From 9d59c4b21a35cc172a58ab7e8fffe40ad70fe6d7 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 5 Apr 2024 07:56:29 +1100 Subject: [PATCH] Updated ntdll-WRITECOPY patchset This extra patch allows Battle.net once again. --- ...ct-return-value-in-VirtualProtect-fo.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 patches/ntdll-WRITECOPY/0010-kernelbase-Correct-return-value-in-VirtualProtect-fo.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 new file mode 100644 index 00000000..6126e4fb --- /dev/null +++ b/patches/ntdll-WRITECOPY/0010-kernelbase-Correct-return-value-in-VirtualProtect-fo.patch @@ -0,0 +1,28 @@ +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 +