1
0
mirror of https://github.com/golang/go synced 2024-11-27 02:21:17 -07:00

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: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Matt Layher 2019-06-07 13:07:32 -04:00 committed by Brad Fitzpatrick
parent 5587e05eac
commit e0dd927123

View 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...)