]> Cypherpunks repositories - gostls13.git/commitdiff
internal/syscall/windows/registry: append .dll when loading kernel32
authorqmuntal <quimmuntal@gmail.com>
Wed, 6 Mar 2024 13:43:13 +0000 (14:43 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Wed, 6 Mar 2024 19:19:00 +0000 (19:19 +0000)
Win32 LoadLibrary supports loading a DLL omitting the .dll extension,
but it is better to be explicit and include the extension. This is
consistent with all other uses of LoadLibrary in the Go standard
library.

Change-Id: I7349d0a27db5f8ab59061434f37d10918e43b869
Reviewed-on: https://go-review.googlesource.com/c/go/+/569535
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/internal/syscall/windows/registry/registry_test.go

index afe7a5d1c3ffa44591dd9c722389153c835ec4c3..12eae54a8f381496e0713f1f323edad59cc3e85e 100644 (file)
@@ -647,9 +647,9 @@ type DynamicTimezoneinformation struct {
 }
 
 var (
-       kernel32DLL = syscall.NewLazyDLL("kernel32")
+       modkernel32 = syscall.NewLazyDLL("kernel32.dll")
 
-       procGetDynamicTimeZoneInformation = kernel32DLL.NewProc("GetDynamicTimeZoneInformation")
+       procGetDynamicTimeZoneInformation = modkernel32.NewProc("GetDynamicTimeZoneInformation")
 )
 
 func GetDynamicTimeZoneInformation(dtzi *DynamicTimezoneinformation) (rc uint32, err error) {