diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2025-09-29 21:45:56 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2025-09-29 21:45:56 +0200 |
| commit | 24762f09de2aa8cada3f3c63afa313e06ebf47c8 (patch) | |
| tree | 260b236dbdaa4b21ab55f2ce54003446630dcea5 /vendor/golang.org/x/sys/windows/dll_windows.go | |
| parent | 6f4c551a522b94e80ace5657d2b8cdfc267d8ae2 (diff) | |
| download | gofu-24762f09de2aa8cada3f3c63afa313e06ebf47c8.tar.gz | |
replace deprecated dependencies with their successors
Diffstat (limited to 'vendor/golang.org/x/sys/windows/dll_windows.go')
| -rw-r--r-- | vendor/golang.org/x/sys/windows/dll_windows.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/vendor/golang.org/x/sys/windows/dll_windows.go b/vendor/golang.org/x/sys/windows/dll_windows.go index 115341f..3ca814f 100644 --- a/vendor/golang.org/x/sys/windows/dll_windows.go +++ b/vendor/golang.org/x/sys/windows/dll_windows.go @@ -43,8 +43,8 @@ type DLL struct { // LoadDLL loads DLL file into memory. // // Warning: using LoadDLL without an absolute path name is subject to -// DLL preloading attacks. To safely load a system DLL, use LazyDLL -// with System set to true, or use LoadLibraryEx directly. +// DLL preloading attacks. To safely load a system DLL, use [NewLazySystemDLL], +// or use [LoadLibraryEx] directly. func LoadDLL(name string) (dll *DLL, err error) { namep, err := UTF16PtrFromString(name) if err != nil { @@ -65,7 +65,7 @@ func LoadDLL(name string) (dll *DLL, err error) { return d, nil } -// MustLoadDLL is like LoadDLL but panics if load operation failes. +// MustLoadDLL is like LoadDLL but panics if load operation fails. func MustLoadDLL(name string) *DLL { d, e := LoadDLL(name) if e != nil { @@ -271,6 +271,9 @@ func (d *LazyDLL) NewProc(name string) *LazyProc { } // NewLazyDLL creates new LazyDLL associated with DLL file. +// +// Warning: using NewLazyDLL without an absolute path name is subject to +// DLL preloading attacks. To safely load a system DLL, use [NewLazySystemDLL]. func NewLazyDLL(name string) *LazyDLL { return &LazyDLL{Name: name} } @@ -410,7 +413,3 @@ func loadLibraryEx(name string, system bool) (*DLL, error) { } return &DLL{Name: name, Handle: h}, nil } - -type errString string - -func (s errString) Error() string { return string(s) } |
