Commit e0dd9271 authored by Matt Layher's avatar Matt Layher Committed by Brad Fitzpatrick

syscall: refer to Proc.Call documentation for LazyProc.Call on Windows

The documentation comment was duplicated for each of these methods, and
the LazyProc.Call documentation incorrectly mentioned that Call accepts
only 15 arguments, but it actually accepts 18 now.

To prevent further documentation drift, refer the reader to the
documentation for Proc.Call instead of duplicating it for LazyProc.Call.

In addition, note that LazyProc's Addr, Call, and Find methods each
trigger a procedure lookup.

Change-Id: I6756cf7601fba79d1414ff5a5d6eef900aa590e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/181199
Run-TryBot: Matt Layher <mdlayher@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 5587e05e
......@@ -270,7 +270,7 @@ func NewLazyDLL(name string) *LazyDLL {
}
// A LazyProc implements access to a procedure inside a LazyDLL.
// It delays the lookup until the Addr method is called.
// It delays the lookup until the Addr, Call, or Find method is called.
type LazyProc struct {
mu sync.Mutex
Name string
......@@ -321,13 +321,8 @@ func (p *LazyProc) Addr() uintptr {
//go:uintptrescapes
// Call executes procedure p with arguments a. It will panic, if more than 15 arguments
// are supplied.
//
// The returned error is always non-nil, constructed from the result of GetLastError.
// Callers must inspect the primary return value to decide whether an error occurred
// (according to the semantics of the specific function being called) before consulting
// the error. The error will be guaranteed to contain syscall.Errno.
// Call executes procedure p with arguments a. See the documentation of
// Proc.Call for more information.
func (p *LazyProc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) {
p.mustFind()
return p.proc.Call(a...)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment