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: 1fe36ed335f040797ae2c778188e40c29604f135
GitHub-Pull-Request: golang/sys#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>
diff --git a/windows/dll_windows.go b/windows/dll_windows.go
index 04eb457..3ca814f 100644
--- a/windows/dll_windows.go
+++ b/windows/dll_windows.go
@@ -43,8 +43,8 @@
// 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 {
@@ -271,6 +271,9 @@
}
// 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}
}