Skip to content

Commit d4ac05d

Browse files
thaJeztahgopherbot
authored andcommittedDec 26, 2024·
windows: update NewLazyDLL, LoadDLL docs to point to NewLazySystemDLL
Point users to the NewLazySystemDLL utility that was added in CL 21592. Change-Id: I5fddd927fe6628f06a6266b225949c4227fb79f1 GitHub-Last-Rev: 1fe36ed GitHub-Pull-Request: #240 Reviewed-on: https://go-review.googlesource.com/c/sys/+/638715 Reviewed-by: Jorropo <jorropo.pgm@gmail.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
1 parent 680bd24 commit d4ac05d

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+
// 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)
Please sign in to comment.