Update to go1.25.0
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
From 8dea0c5555bd5f397aa11a4e052bbec0d71e6495 Mon Sep 17 00:00:00 2001
|
||||
From f406141ab7c4861f2738d73ea5b77733ad0aab37 Mon Sep 17 00:00:00 2001
|
||||
From: Vorapol Rinsatitnon <vorapol.r@pm.me>
|
||||
Date: Fri, 14 Feb 2025 10:39:55 +0700
|
||||
Date: Wed, 13 Aug 2025 21:41:22 +0700
|
||||
Subject: [PATCH] Switch ProcessPrng back to RtlGenRandom
|
||||
|
||||
---
|
||||
@@ -47,10 +47,10 @@ index 1ca16ca..7d5cea8 100644
|
||||
// - On wasip1/wasm, Reader uses random_get.
|
||||
//
|
||||
diff --git a/src/internal/syscall/windows/syscall_windows.go b/src/internal/syscall/windows/syscall_windows.go
|
||||
index c848f92..715d072 100644
|
||||
index 905cabc..94d280b 100644
|
||||
--- a/src/internal/syscall/windows/syscall_windows.go
|
||||
+++ b/src/internal/syscall/windows/syscall_windows.go
|
||||
@@ -416,7 +416,7 @@ func ErrorLoadingGetTempPath2() error {
|
||||
@@ -419,7 +419,7 @@ func ErrorLoadingGetTempPath2() error {
|
||||
//sys DestroyEnvironmentBlock(block *uint16) (err error) = userenv.DestroyEnvironmentBlock
|
||||
//sys CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle syscall.Handle, err error) = kernel32.CreateEventW
|
||||
|
||||
@@ -60,7 +60,7 @@ index c848f92..715d072 100644
|
||||
type FILE_ID_BOTH_DIR_INFO struct {
|
||||
NextEntryOffset uint32
|
||||
diff --git a/src/internal/syscall/windows/zsyscall_windows.go b/src/internal/syscall/windows/zsyscall_windows.go
|
||||
index 6a6ea7b..9a096cf 100644
|
||||
index 90cf0b9..87d0b9e 100644
|
||||
--- a/src/internal/syscall/windows/zsyscall_windows.go
|
||||
+++ b/src/internal/syscall/windows/zsyscall_windows.go
|
||||
@@ -38,7 +38,6 @@ func errnoErr(e syscall.Errno) error {
|
||||
@@ -79,8 +79,8 @@ index 6a6ea7b..9a096cf 100644
|
||||
+ procSystemFunction036 = modadvapi32.NewProc("SystemFunction036")
|
||||
procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
|
||||
procCreateEventW = modkernel32.NewProc("CreateEventW")
|
||||
procGetACP = modkernel32.NewProc("GetACP")
|
||||
@@ -236,12 +235,12 @@ func SetTokenInformation(tokenHandle syscall.Token, tokenInformationClass uint32
|
||||
procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort")
|
||||
@@ -242,12 +241,12 @@ func SetTokenInformation(tokenHandle syscall.Token, tokenInformationClass uint32
|
||||
return
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ index 6a6ea7b..9a096cf 100644
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go
|
||||
index 7183e79..fd65e34 100644
|
||||
index 04752f2..a6d3211 100644
|
||||
--- a/src/runtime/os_windows.go
|
||||
+++ b/src/runtime/os_windows.go
|
||||
@@ -128,8 +128,15 @@ var (
|
||||
@@ -127,8 +127,15 @@ var (
|
||||
_WriteFile,
|
||||
_ stdFunction
|
||||
|
||||
@@ -117,7 +117,7 @@ index 7183e79..fd65e34 100644
|
||||
|
||||
// Load ntdll.dll manually during startup, otherwise Mingw
|
||||
// links wrong printf function to cgo executable (see issue
|
||||
@@ -147,10 +154,11 @@ var (
|
||||
@@ -146,10 +153,11 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -133,7 +133,7 @@ index 7183e79..fd65e34 100644
|
||||
)
|
||||
|
||||
// Function to be called by windows CreateThread
|
||||
@@ -264,11 +272,11 @@ func windows_QueryPerformanceFrequency() int64 {
|
||||
@@ -263,11 +271,11 @@ func windows_QueryPerformanceFrequency() int64 {
|
||||
}
|
||||
|
||||
func loadOptionalSyscalls() {
|
||||
@@ -149,7 +149,7 @@ index 7183e79..fd65e34 100644
|
||||
|
||||
n32 := windowsLoadSystemLib(ntdlldll[:])
|
||||
if n32 == 0 {
|
||||
@@ -501,7 +509,7 @@ func osinit() {
|
||||
@@ -500,7 +508,7 @@ func osinit() {
|
||||
//go:nosplit
|
||||
func readRandom(r []byte) int {
|
||||
n := 0
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
From 017970028ebf60ec44fd1b528b691a47f09ea3a6 Mon Sep 17 00:00:00 2001
|
||||
From 4c18dbd71ffab945d87cbd5fa86a0027dd6248f1 Mon Sep 17 00:00:00 2001
|
||||
From: Vorapol Rinsatitnon <vorapol.r@pm.me>
|
||||
Date: Fri, 14 Feb 2025 12:13:28 +0700
|
||||
Date: Wed, 13 Aug 2025 21:47:16 +0700
|
||||
Subject: [PATCH] Add Windows 7 console and process handle workaround
|
||||
|
||||
---
|
||||
src/os/exec_windows.go | 11 ++++++++++
|
||||
src/os/exec_windows.go | 10 +++++++++
|
||||
src/syscall/exec_windows.go | 38 ++++++++++++++++++++++++++++++++-
|
||||
src/syscall/types_windows.go | 10 +++++++++
|
||||
src/syscall/zsyscall_windows.go | 7 ++++++
|
||||
4 files changed, 65 insertions(+), 1 deletion(-)
|
||||
4 files changed, 64 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/os/exec_windows.go b/src/os/exec_windows.go
|
||||
index ab2dae1..f5e3a4f 100644
|
||||
index 68c7064..6a44a7d 100644
|
||||
--- a/src/os/exec_windows.go
|
||||
+++ b/src/os/exec_windows.go
|
||||
@@ -44,6 +44,17 @@ func (p *Process) wait() (ps *ProcessState, err error) {
|
||||
if e != nil {
|
||||
@@ -45,6 +45,16 @@ func (p *Process) wait() (ps *ProcessState, err error) {
|
||||
return nil, NewSyscallError("GetProcessTimes", e)
|
||||
}
|
||||
+
|
||||
|
||||
+ // NOTE(brainman): It seems that sometimes process is not dead
|
||||
+ // when WaitForSingleObject returns. But we do not know any
|
||||
+ // other way to wait for it. Sleeping for a while seems to do
|
||||
@@ -29,11 +28,11 @@ index ab2dae1..f5e3a4f 100644
|
||||
+ defer time.Sleep(5 * time.Millisecond)
|
||||
+ }
|
||||
+
|
||||
defer p.Release()
|
||||
return &ProcessState{p.Pid, syscall.WaitStatus{ExitCode: ec}, &u}, nil
|
||||
}
|
||||
// For compatibility we use statusReleased here rather
|
||||
// than statusDone.
|
||||
p.doRelease(statusReleased)
|
||||
diff --git a/src/syscall/exec_windows.go b/src/syscall/exec_windows.go
|
||||
index 1220de4..b4b846d 100644
|
||||
index 3ba2fbe..77c0d44 100644
|
||||
--- a/src/syscall/exec_windows.go
|
||||
+++ b/src/syscall/exec_windows.go
|
||||
@@ -254,6 +254,16 @@ type SysProcAttr struct {
|
||||
@@ -103,10 +102,10 @@ index 1220de4..b4b846d 100644
|
||||
// to treat the entire list as empty, so remove NULL handles.
|
||||
j := 0
|
||||
diff --git a/src/syscall/types_windows.go b/src/syscall/types_windows.go
|
||||
index fa34053..f08ebe0 100644
|
||||
index 92fa796..c9749ba 100644
|
||||
--- a/src/syscall/types_windows.go
|
||||
+++ b/src/syscall/types_windows.go
|
||||
@@ -1173,3 +1173,13 @@ const (
|
||||
@@ -1183,3 +1183,13 @@ const (
|
||||
)
|
||||
|
||||
const UNIX_PATH_MAX = 108 // defined in afunix.h
|
||||
@@ -121,7 +120,7 @@ index fa34053..f08ebe0 100644
|
||||
+ csdVersion [128]uint16
|
||||
+}
|
||||
diff --git a/src/syscall/zsyscall_windows.go b/src/syscall/zsyscall_windows.go
|
||||
index 85c66de..e58a384 100644
|
||||
index ef00c0b..065977e 100644
|
||||
--- a/src/syscall/zsyscall_windows.go
|
||||
+++ b/src/syscall/zsyscall_windows.go
|
||||
@@ -43,6 +43,7 @@ var (
|
||||
@@ -132,7 +131,7 @@ index 85c66de..e58a384 100644
|
||||
modsecur32 = NewLazyDLL(sysdll.Add("secur32.dll"))
|
||||
modshell32 = NewLazyDLL(sysdll.Add("shell32.dll"))
|
||||
moduserenv = NewLazyDLL(sysdll.Add("userenv.dll"))
|
||||
@@ -170,6 +171,7 @@ var (
|
||||
@@ -171,6 +172,7 @@ var (
|
||||
procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation")
|
||||
procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo")
|
||||
procGetUserNameExW = modsecur32.NewProc("GetUserNameExW")
|
||||
@@ -140,7 +139,7 @@ index 85c66de..e58a384 100644
|
||||
procTranslateNameW = modsecur32.NewProc("TranslateNameW")
|
||||
procCommandLineToArgvW = modshell32.NewProc("CommandLineToArgvW")
|
||||
procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW")
|
||||
@@ -1237,6 +1239,11 @@ func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err er
|
||||
@@ -1247,6 +1249,11 @@ func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err er
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user