Commit ce5fe931 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

ntdll: Allow changes to DEP flags under Wow64.

parent 7527869f
......@@ -73,9 +73,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(process);
static ULONG execute_flags = MEM_EXECUTE_OPTION_DISABLE | (sizeof(void *) > sizeof(int) ?
MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION |
MEM_EXECUTE_OPTION_PERMANENT : 0);
static ULONG execute_flags = MEM_EXECUTE_OPTION_DISABLE;
static UINT process_error_mode;
......@@ -1434,8 +1432,14 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
case ProcessExecuteFlags:
len = sizeof(ULONG);
if (size == len) *(ULONG *)info = execute_flags;
else ret = STATUS_INFO_LENGTH_MISMATCH;
if (size != len)
ret = STATUS_INFO_LENGTH_MISMATCH;
else if (is_win64 && !NtCurrentTeb()->WowTebOffset)
*(ULONG *)info = MEM_EXECUTE_OPTION_DISABLE |
MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION |
MEM_EXECUTE_OPTION_PERMANENT;
else
*(ULONG *)info = execute_flags;
break;
case ProcessPriorityClass:
......@@ -1560,7 +1564,7 @@ NTSTATUS WINAPI NtSetInformationProcess( HANDLE handle, PROCESSINFOCLASS class,
break;
case ProcessExecuteFlags:
if (is_win64 || size != sizeof(ULONG)) return STATUS_INVALID_PARAMETER;
if ((is_win64 && !NtCurrentTeb()->WowTebOffset) || size != sizeof(ULONG)) return STATUS_INVALID_PARAMETER;
if (execute_flags & MEM_EXECUTE_OPTION_PERMANENT) return STATUS_ACCESS_DENIED;
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment