Jelajahi Sumber

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>
Kieran Colford 8 tahun lalu
induk
melakukan
5d0dd06d1c
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      windows/dll_windows.go

+ 2 - 1
windows/dll_windows.go

@@ -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