From c901884ac0af17eeeac309269693d959cfb45e0b Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Thu, 22 Aug 2024 19:20:23 -0500 Subject: [PATCH] ntdll-WRITECOPY: Remove patch 0010. This is a hack specifically meant for upstream Wine; it was never meant to apply to Wine-Staging. This very patch set is supposed to be a more complete and holistic hack/implementation of the same logic. This hack only works for CEF, and breaks the existing tests that are fixed by the rest of ntdll-WRITECOPY. --- ...ct-return-value-in-VirtualProtect-fo.patch | 28 ----------------- ...e-NULL-old_prot-parameter-in-Virtual.patch | 30 ------------------- 2 files changed, 58 deletions(-) delete mode 100644 patches/ntdll-WRITECOPY/0010-kernelbase-Correct-return-value-in-VirtualProtect-fo.patch delete mode 100644 patches/ntdll-WRITECOPY/0011-kernelbase-Handle-NULL-old_prot-parameter-in-Virtual.patch diff --git a/patches/ntdll-WRITECOPY/0010-kernelbase-Correct-return-value-in-VirtualProtect-fo.patch b/patches/ntdll-WRITECOPY/0010-kernelbase-Correct-return-value-in-VirtualProtect-fo.patch deleted file mode 100644 index 6126e4fb..00000000 --- a/patches/ntdll-WRITECOPY/0010-kernelbase-Correct-return-value-in-VirtualProtect-fo.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 321e3228c6c28256bfb209efdc372b61f9c8535f Mon Sep 17 00:00:00 2001 -From: Fabian Maurer -Date: Thu, 21 Dec 2023 20:09:23 +0100 -Subject: [PATCH] kernelbase: Correct return value in VirtualProtect for - PAGE_WRITECOPY - ---- - dlls/kernelbase/memory.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c -index 4f4bba9a13b..de42395b33b 100644 ---- a/dlls/kernelbase/memory.c -+++ b/dlls/kernelbase/memory.c -@@ -481,7 +481,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH VirtualLock( void *addr, SIZE_T size ) - */ - BOOL WINAPI DECLSPEC_HOTPATCH VirtualProtect( void *addr, SIZE_T size, DWORD new_prot, DWORD *old_prot ) - { -- return VirtualProtectEx( GetCurrentProcess(), addr, size, new_prot, old_prot ); -+ BOOL ret = VirtualProtectEx( GetCurrentProcess(), addr, size, new_prot, old_prot ); -+ if (*old_prot == PAGE_WRITECOPY) *old_prot = PAGE_READWRITE; -+ return ret; - } - - --- -2.43.0 - diff --git a/patches/ntdll-WRITECOPY/0011-kernelbase-Handle-NULL-old_prot-parameter-in-Virtual.patch b/patches/ntdll-WRITECOPY/0011-kernelbase-Handle-NULL-old_prot-parameter-in-Virtual.patch deleted file mode 100644 index e8f0e300..00000000 --- a/patches/ntdll-WRITECOPY/0011-kernelbase-Handle-NULL-old_prot-parameter-in-Virtual.patch +++ /dev/null @@ -1,30 +0,0 @@ -From d455916aec7649a816deb36c303341a6c7732a97 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Aida=20Jonikien=C4=97?= -Date: Fri, 26 Jul 2024 20:33:57 +0300 -Subject: [PATCH] kernelbase: Handle NULL old_prot parameter in - VirtualProtect(). - -This fixes a segfault when launching any game with the EA Desktop application. - -Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56694 -Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56711 ---- - dlls/kernelbase/memory.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c -index 2b0e674bb9b..d1408cf4c0e 100644 ---- a/dlls/kernelbase/memory.c -+++ b/dlls/kernelbase/memory.c -@@ -548,7 +548,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH VirtualLock( void *addr, SIZE_T size ) - BOOL WINAPI DECLSPEC_HOTPATCH VirtualProtect( void *addr, SIZE_T size, DWORD new_prot, DWORD *old_prot ) - { - BOOL ret = VirtualProtectEx( GetCurrentProcess(), addr, size, new_prot, old_prot ); -- if (*old_prot == PAGE_WRITECOPY) *old_prot = PAGE_READWRITE; -+ if (old_prot && *old_prot == PAGE_WRITECOPY) *old_prot = PAGE_READWRITE; - return ret; - } - --- -2.43.0 -