mirror of
https://github.com/golang/sys.git
synced 2026-02-08 19:56:04 +03:00
windows: document panics in LazyProc
Some of LazyProc's methods will panic if the procedure cannot be found. This patch documents that fact. Change-Id: If446a61e001ae04eaba0ff08b512df4def8a00b7 Reviewed-on: https://go-review.googlesource.com/73450 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
This commit is contained in:
committed by
Alex Brainman
parent
9e4fff1f4d
commit
5d0dd06d1c
@@ -289,6 +289,7 @@ func (p *LazyProc) mustFind() {
|
||||
|
||||
// Addr returns the address of the procedure represented by p.
|
||||
// The return value can be passed to Syscall to run the procedure.
|
||||
// It will panic if the procedure cannot be found.
|
||||
func (p *LazyProc) Addr() uintptr {
|
||||
p.mustFind()
|
||||
return p.proc.Addr()
|
||||
@@ -297,7 +298,7 @@ func (p *LazyProc) Addr() uintptr {
|
||||
//go:uintptrescapes
|
||||
|
||||
// Call executes procedure p with arguments a. It will panic, if more then 15 arguments
|
||||
// are supplied.
|
||||
// are supplied. It will also panic if the procedure cannot be found.
|
||||
//
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user