Update patch 4

This commit is contained in:
Vorapol Rinsatitnon
2024-11-09 18:59:13 +11:00
parent a50237a54f
commit 998d564602

View File

@@ -1,6 +1,6 @@
From 4945989aba36baee4cdc72e61bdc4484c81d9ea0 Mon Sep 17 00:00:00 2001
From ed249cf4dbfe31b9cea185100b74c38e5c6e3bd9 Mon Sep 17 00:00:00 2001
From: Vorapol Rinsatitnon <vorapol.r@pm.me>
Date: Fri, 27 Sep 2024 04:05:44 +1000
Date: Sat, 9 Nov 2024 18:54:55 +1100
Subject: [PATCH] Add back LoadLibraryA fallback
---
@@ -14,7 +14,7 @@ Subject: [PATCH] Add back LoadLibraryA fallback
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
index 4880e62a55..8bfff0bc93 100644
--- a/src/runtime/export_windows_test.go
+++ b/src/runtime/export_windows_test.go
@@ -36,3 +36,7 @@ func NewContextStub() *ContextStub {
@@ -26,7 +26,7 @@ index 4880e62..8bfff0b 100644
+ return useLoadLibraryEx, _LoadLibraryExW != nil, _AddDllDirectory != nil
+}
diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go
index 0273580..c76df9d 100644
index 02735802d4..c76df9da22 100644
--- a/src/runtime/os_windows.go
+++ b/src/runtime/os_windows.go
@@ -41,6 +41,7 @@ const (
@@ -139,7 +139,7 @@ index 0273580..c76df9d 100644
// osRelaxMinNS indicates that sysmon shouldn't osRelax if the next
diff --git a/src/runtime/syscall_windows.go b/src/runtime/syscall_windows.go
index 69d720a..973fd9c 100644
index 85b1b8c902..eb808feea5 100644
--- a/src/runtime/syscall_windows.go
+++ b/src/runtime/syscall_windows.go
@@ -413,10 +413,23 @@ func callbackWrap(a *callbackArgs) {
@@ -169,7 +169,7 @@ index 69d720a..973fd9c 100644
err = 0
}
diff --git a/src/runtime/syscall_windows_test.go b/src/runtime/syscall_windows_test.go
index 6a056c8..2c91cd9 100644
index 156cf3eb8e..2db5b61a9b 100644
--- a/src/runtime/syscall_windows_test.go
+++ b/src/runtime/syscall_windows_test.go
@@ -1166,7 +1166,10 @@ uintptr_t cfunc(void) {
@@ -184,8 +184,8 @@ index 6a056c8..2c91cd9 100644
}
}
@@ -1212,6 +1215,24 @@ func TestBigStackCallbackSyscall(t *testing.T) {
}
@@ -1219,6 +1222,24 @@ func TestSyscallStackUsage(t *testing.T) {
syscall.Syscall18(procSetEvent.Addr(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
}
+// wantLoadLibraryEx reports whether we expect LoadLibraryEx to work for tests.
@@ -210,7 +210,7 @@ index 6a056c8..2c91cd9 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..b3554d3 100644
index 81134cb0bd..b3554d349b 100644
--- a/src/syscall/dll_windows.go
+++ b/src/syscall/dll_windows.go
@@ -44,7 +44,7 @@ func Syscall18(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a
@@ -263,7 +263,7 @@ index 81134cb..b3554d3 100644
h, e = loadlibrary(namep)
}
diff --git a/src/syscall/security_windows.go b/src/syscall/security_windows.go
index 4e988c4..45b1908 100644
index 4e988c418a..45b1908b71 100644
--- a/src/syscall/security_windows.go
+++ b/src/syscall/security_windows.go
@@ -290,6 +290,7 @@ type Tokenprimarygroup struct {
@@ -275,7 +275,7 @@ index 4e988c4..45b1908 100644
// An access token contains the security information for a logon session.
// The system creates an access token when a user logs on, and every
diff --git a/src/syscall/zsyscall_windows.go b/src/syscall/zsyscall_windows.go
index d8d8594..28369e3 100644
index d8d8594a55..28369e3b91 100644
--- a/src/syscall/zsyscall_windows.go
+++ b/src/syscall/zsyscall_windows.go
@@ -128,6 +128,7 @@ var (