Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrorNotFound = errors.New("not found") ErrorUnmarshalFailed = errors.New("unmarshal failed") )
Functions ¶
Types ¶
type DLL ¶
A DLL implements access to a single DLL.
func LoadDLL ¶
LoadDLL loads the named DLL file into memory.
If name is not an absolute path and is not a known system DLL used by Go, Windows will search for the named DLL in many locations, causing potential DLL preloading attacks.
Use LazyDLL in golang.org/x/sys/windows for a secure way to load system DLLs.
func MustLoadDLL ¶
MustLoadDLL is like LoadDLL but panics if load operation fails.
func (*DLL) FindProc ¶
FindProc searches DLL d for procedure named name and returns *Proc if found. It returns an error if search fails.
func (*DLL) MustFindProc ¶
MustFindProc is like FindProc but panics if search fails.
type FunctionPointer ¶
type LazyDLL ¶
A LazyDLL implements access to a single DLL. It will delay the load of the DLL until the first call to its Handle method or to one of its LazyProc's Addr method.
LazyDLL is subject to the same DLL preloading attacks as documented on LoadDLL.
Use LazyDLL in golang.org/x/sys/windows for a secure way to load system DLLs.
func NewLazyDLL ¶
NewLazyDLL creates new LazyDLL associated with DLL file.
func NewLazySystemDLL ¶
NewLazySystemDLL is like NewLazyDLL, but will only search Windows System directory for the DLL if name is a base name (like "advapi32.dll").
type LazyProc ¶
type LazyProc struct {
Name string
// contains filtered or unexported fields
}
A LazyProc implements access to a procedure inside a LazyDLL. It delays the lookup until the Addr, Call, or Find method is called.
func (*LazyProc) Addr ¶
Addr returns the address of the procedure represented by p. The return value can be passed to Syscall to run the procedure.
type Proc ¶
A Proc implements access to a procedure inside a DLL.
func (*Proc) Addr ¶
Addr returns the address of the procedure represented by p. The return value can be passed to Syscall to run the procedure.
func (*Proc) Call ¶
Call executes procedure p with arguments a.
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 always has type syscall.Errno.
On amd64, Call can pass and return floating-point values. To pass an argument x with C type "float", use uintptr(math.Float32bits(x)). To pass an argument with C type "double", use uintptr(math.Float64bits(x)). Floating-point return values are returned in r2. The return value for C type "float" is math.Float32frombits(uint32(r2)). For C type "double", it is math.Float64frombits(uint64(r2)).