summaryrefslogtreecommitdiffstats
path: root/system/wine-staging/writecopy.patch
blob: d067dccd9207b0f267ddbd665c0e70303337b69e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@@ -, +, @@ 
---
 dlls/kernelbase/memory.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--- a/dlls/kernelbase/memory.c	
+++ a/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;
 }
 
 
--