]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: refer to Proc.Call documentation for LazyProc.Call on Windows
authorMatt Layher <mdlayher@gmail.com>
Fri, 7 Jun 2019 17:07:32 +0000 (13:07 -0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 7 Jun 2019 17:22:53 +0000 (17:22 +0000)
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: Brad Fitzpatrick <bradfitz@golang.org>
src/syscall/dll_windows.go

index 34925f74a44595f29739f258f7d188d4d7ae62fb..75bc372c3de03f50940b29a3b9d6c8e17dd75c06 100644 (file)
@@ -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...)