>From 2dd72c20e9ff916d0e37c69622527aa9335e7c77 Mon Sep 17 00:00:00 2001 From: Charles Davis Date: Tue, 16 Nov 2010 17:40:14 -0700 Subject: [PATCH] ntdll: Fix exception tests on Mac OS. Reply-To: wine-devel --- dlls/ntdll/process.c | 10 ++++++++++ dlls/ntdll/tests/exception.c | 2 +- 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index b9b81ca..d127e42 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -37,7 +37,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll); +#if defined(__APPLE__) && defined(__i386__) +/* On 32-bit Mac OS when the processor supports no-execute protection, + * only stacks are protected for some reason. All other data is not + * protected. Even if you clear PROT_EXEC with mprotect, the kernel + * will let you execute any code/data in that memory. So, it's point- + * less to enable DEP here. + */ +static ULONG execute_flags = MEM_EXECUTE_OPTION_ENABLE | MEM_EXECUTE_OPTION_PERMANENT; +#else static ULONG execute_flags = MEM_EXECUTE_OPTION_DISABLE; +#endif /* * Process object diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 386c5a6..326cb77 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -678,7 +678,7 @@ static void test_exceptions(void) /* test single stepping over hardware breakpoint */ memset(&ctx, 0, sizeof(ctx)); ctx.Dr0 = (DWORD) code_mem; /* set hw bp on first nop */ - ctx.Dr7 = 3; + ctx.Dr7 = 1; ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS; res = pNtSetContextThread( GetCurrentThread(), &ctx); ok( res == STATUS_SUCCESS, "NtSetContextThread faild with %x\n", res); -- 1.7.4.rc3