From e0dd927123df2bbaf7af91f50e68710cfc220dfa Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Fri, 7 Jun 2019 13:07:32 -0400 Subject: [PATCH] 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 Reviewed-by: Brad Fitzpatrick --- src/syscall/dll_windows.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/syscall/dll_windows.go b/src/syscall/dll_windows.go index 34925f74a4..75bc372c3d 100644 --- a/src/syscall/dll_windows.go +++ b/src/syscall/dll_windows.go @@ -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...) -- 2.48.1