Fix patch 4 (1.23.4)

This commit is contained in:
Vorapol Rinsatitnon
2024-12-24 19:34:49 +07:00
parent 51ae6d6612
commit 289b9e3aad

View File

@@ -1,6 +1,6 @@
From ea796551e74ca73fa170ed296c290d5644fbae56 Mon Sep 17 00:00:00 2001
From 3e1a3a3c96117fd4d655dd85d2e2c807e691104e Mon Sep 17 00:00:00 2001
From: Vorapol Rinsatitnon <vorapol.r@pm.me>
Date: Tue, 24 Dec 2024 19:18:28 +0700
Date: Tue, 24 Dec 2024 19:31:25 +0700
Subject: [PATCH] Add back LoadLibraryA fallback
---
@@ -8,10 +8,10 @@ Subject: [PATCH] Add back LoadLibraryA fallback
src/runtime/os_windows.go | 60 ++++++++++++++++++++++++++++-
src/runtime/syscall_windows.go | 17 +++++++-
src/runtime/syscall_windows_test.go | 23 ++++++++++-
src/syscall/dll_windows.go | 29 +++++++++++++-
src/syscall/dll_windows.go | 28 +++++++++++++-
src/syscall/security_windows.go | 1 +
src/syscall/zsyscall_windows.go | 10 +++++
7 files changed, 137 insertions(+), 7 deletions(-)
7 files changed, 136 insertions(+), 7 deletions(-)
diff --git a/src/runtime/export_windows_test.go b/src/runtime/export_windows_test.go
index 4880e62..8bfff0b 100644
@@ -210,14 +210,11 @@ index 156cf3e..2db5b61 100644
modwinmm = syscall.NewLazyDLL("winmm.dll")
modkernel32 = syscall.NewLazyDLL("kernel32.dll")
diff --git a/src/syscall/dll_windows.go b/src/syscall/dll_windows.go
index 81134cb..bd82b51 100644
index a7873e6..bd82b51 100644
--- a/src/syscall/dll_windows.go
+++ b/src/syscall/dll_windows.go
@@ -42,9 +42,10 @@ func Syscall15(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a
// Deprecated: Use [SyscallN] instead.
func Syscall18(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18 uintptr) (r1, r2 uintptr, err Errno)
+//go:noescape
@@ -45,7 +45,7 @@ func Syscall18(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a
//go:noescape
func SyscallN(trap uintptr, args ...uintptr) (r1, r2 uintptr, err Errno)
func loadlibrary(filename *uint16) (handle uintptr, err Errno)
-func loadsystemlibrary(filename *uint16) (handle uintptr, err Errno)
@@ -225,7 +222,7 @@ index 81134cb..bd82b51 100644
func getprocaddress(handle uintptr, procname *uint8) (proc uintptr, err Errno)
// A DLL implements access to a single DLL.
@@ -53,6 +54,26 @@ type DLL struct {
@@ -54,6 +54,26 @@ type DLL struct {
Handle Handle
}
@@ -252,7 +249,7 @@ index 81134cb..bd82b51 100644
// LoadDLL loads the named DLL file into memory.
//
// If name is not an absolute path and is not a known system DLL used by
@@ -69,7 +90,11 @@ func LoadDLL(name string) (*DLL, error) {
@@ -70,7 +90,11 @@ func LoadDLL(name string) (*DLL, error) {
var h uintptr
var e Errno
if sysdll.IsSystemDLL[name] {