Rebase against 87f41e6b408dd01055ff6a378b90d089d61ec370.

This commit is contained in:
Alistair Leslie-Hughes
2020-09-03 08:40:02 +10:00
parent 6c6ef5bfa4
commit 285e594688
5 changed files with 39 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
From cf0cdffd0ddaeb7f72f447554247d257608ff53e Mon Sep 17 00:00:00 2001
From 683ec6017757a1f2cdd33feec608aad6a9022322 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 4 Oct 2014 03:22:09 +0200
Subject: [PATCH] ntdll: Properly handle PAGE_WRITECOPY protection. (try 5)
@@ -9,10 +9,10 @@ For now, only enable it when a special environment variable is set.
1 file changed, 39 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index d4a8d4d38d5b..f0ec65d12704 100644
index 54c6b732d0f..cd0e343c46b 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -500,6 +500,21 @@ int CDECL mmap_enum_reserved_areas( int (CDECL *enum_func)(void *base, SIZE_T si
@@ -363,6 +363,21 @@ static int mmap_enum_reserved_areas( int (CDECL *enum_func)(void *base, SIZE_T s
return ret;
}
@@ -32,9 +32,9 @@ index d4a8d4d38d5b..f0ec65d12704 100644
+ return enabled;
+}
/***********************************************************************
* free_ranges_lower_bound
@@ -801,8 +816,19 @@ static int get_unix_prot( BYTE vprot )
static void reserve_area( void *addr, void *end )
{
@@ -803,8 +818,19 @@ static int get_unix_prot( BYTE vprot )
{
if (vprot & VPROT_READ) prot |= PROT_READ;
if (vprot & VPROT_WRITE) prot |= PROT_WRITE | PROT_READ;
@@ -55,7 +55,7 @@ index d4a8d4d38d5b..f0ec65d12704 100644
if (vprot & VPROT_WRITEWATCH) prot &= ~PROT_WRITE;
}
if (!prot) prot = PROT_NONE;
@@ -1548,7 +1574,7 @@ static void update_write_watches( void *base, size_t size, size_t accessed_size
@@ -1550,7 +1576,7 @@ static void update_write_watches( void *base, size_t size, size_t accessed_size
{
TRACE( "updating watch %p-%p-%p\n", base, (char *)base + accessed_size, (char *)base + size );
/* clear write watch flag on accessed pages */
@@ -64,7 +64,7 @@ index d4a8d4d38d5b..f0ec65d12704 100644
/* restore page protections on the entire range */
mprotect_range( base, size, 0, 0 );
}
@@ -2900,12 +2926,13 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack )
@@ -2904,12 +2930,13 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack )
set_page_vprot_bits( page, page_size, 0, VPROT_WRITEWATCH );
mprotect_range( page, page_size, 0, 0 );
}
@@ -82,7 +82,7 @@ index d4a8d4d38d5b..f0ec65d12704 100644
}
pthread_mutex_unlock( &virtual_mutex );
return ret;
@@ -2982,11 +3009,16 @@ static NTSTATUS check_write_access( void *base, size_t size, BOOL *has_write_wat
@@ -2986,11 +3013,16 @@ static NTSTATUS check_write_access( void *base, size_t size, BOOL *has_write_wat
{
BYTE vprot = get_page_vprot( addr + i );
if (vprot & VPROT_WRITEWATCH) *has_write_watch = TRUE;
@@ -101,5 +101,5 @@ index d4a8d4d38d5b..f0ec65d12704 100644
}
--
2.20.1
2.28.0