Sebastian Lackner : ntdll: reset_write_watches shouldn' t remove enforced exec permissions.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Oct 13 11:18:10 CDT 2014
Module: wine
Branch: master
Commit: e16996bb3d5d5f12d2a5524bb86a2503d61d44ee
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e16996bb3d5d5f12d2a5524bb86a2503d61d44ee
Author: Sebastian Lackner <sebastian at fds-team.de>
Date: Wed Oct 8 21:28:25 2014 +0200
ntdll: reset_write_watches shouldn't remove enforced exec permissions.
---
dlls/kernel32/tests/virtual.c | 6 +-----
dlls/ntdll/virtual.c | 4 ++--
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c
index 2d2554b..4627c5a 100644
--- a/dlls/kernel32/tests/virtual.c
+++ b/dlls/kernel32/tests/virtual.c
@@ -2112,11 +2112,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
ret = send_message_excpt( hWnd, WM_USER, 0, 0 );
ok( ret == 42, "call returned wrong result, expected 42, got %d\n", ret );
ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls );
- if (dep_flags & MEM_EXECUTE_OPTION_DISABLE)
- ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls );
- else
- todo_wine
- ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls );
+ ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls );
/* Now a bit more complicated, the page containing the code is protected with
* PAGE_GUARD memory protection. */
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 3c9a4b5..d2bb152 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -693,12 +693,12 @@ static void reset_write_watches( struct file_view *view, void *base, SIZE_T size
p[i] |= VPROT_WRITEWATCH;
prot = VIRTUAL_GetUnixProt( p[i] );
if (prot == unix_prot) continue;
- mprotect( addr, count << page_shift, unix_prot );
+ mprotect_exec( addr, count << page_shift, unix_prot, view->protect );
addr += count << page_shift;
unix_prot = prot;
count = 0;
}
- if (count) mprotect( addr, count << page_shift, unix_prot );
+ if (count) mprotect_exec( addr, count << page_shift, unix_prot, view->protect );
}
More information about the wine-cvs
mailing list