Skip to content

Commit

Permalink
windows: update NewLazyDLL, LoadDLL docs to point to NewLazySystemDLL
Browse files Browse the repository at this point in the history
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 <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
Auto-Submit: Jorropo <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
thaJeztah authored and gopherbot committed Dec 26, 2024
1 parent 680bd24 commit d4ac05d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions windows/dll_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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}
}
Expand Down

0 comments on commit d4ac05d

Please sign in to comment.