Skip to content

Commit 27e91d8

Browse files
committed
windows: NewLazyDLL, LoadDLL: update docs to point to NewLazySystemDLL
Point users to the NewLazySystemDLL utility that was added in CL 21592.
1 parent a7f19e9 commit 27e91d8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

windows/dll_windows.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ type DLL struct {
4343
// LoadDLL loads DLL file into memory.
4444
//
4545
// Warning: using LoadDLL without an absolute path name is subject to
46-
// DLL preloading attacks. To safely load a system DLL, use LazyDLL
47-
// with System set to true, or use LoadLibraryEx directly.
46+
// DLL preloading attacks. To safely load a system DLL, use [NewLazySystemDLL],
47+
// [LazyDLL] with System set to true, or use [LoadLibraryEx] directly.
4848
func LoadDLL(name string) (dll *DLL, err error) {
4949
namep, err := UTF16PtrFromString(name)
5050
if err != nil {
@@ -271,6 +271,9 @@ func (d *LazyDLL) NewProc(name string) *LazyProc {
271271
}
272272

273273
// NewLazyDLL creates new LazyDLL associated with DLL file.
274+
//
275+
// Warning: using NewLazyDLL without an absolute path name is subject to
276+
// DLL preloading attacks. To safely load a system DLL, use [NewLazySystemDLL].
274277
func NewLazyDLL(name string) *LazyDLL {
275278
return &LazyDLL{Name: name}
276279
}

0 commit comments

Comments
 (0)