diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index 2a09390d747..3179d9c85c3 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -389,6 +389,28 @@ NTSTATUS WINAPI NtSetInformationProcess( SERVER_END_REQ; } break; + + case ProcessExecuteFlags: + if (ProcessInformationLength != sizeof(ULONG)) + return STATUS_INVALID_PARAMETER; + else + { + BOOL enable; + switch (*(ULONG *)ProcessInformation & (MEM_EXECUTE_OPTION_ENABLE|MEM_EXECUTE_OPTION_DISABLE)) + { + case MEM_EXECUTE_OPTION_ENABLE: + enable = FALSE; + break; + case MEM_EXECUTE_OPTION_DISABLE: + enable = TRUE; + break; + default: + return STATUS_INVALID_PARAMETER; + } + VIRTUAL_SetForceExec( enable ); + } + break; + default: FIXME("(%p,0x%08x,%p,0x%08x) stub\n", ProcessHandle,ProcessInformationClass,ProcessInformation, diff --git a/include/winternl.h b/include/winternl.h index 2dc1fc2ba95..71169fa236d 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -665,9 +665,14 @@ typedef enum _PROCESSINFOCLASS { ProcessDebugObjectHandle = 30, ProcessDebugFlags = 31, ProcessHandleTracing = 32, + ProcessExecuteFlags = 34, MaxProcessInfoClass } PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS; +#define MEM_EXECUTE_OPTION_DISABLE 0x01 +#define MEM_EXECUTE_OPTION_ENABLE 0x02 +#define MEM_EXECUTE_OPTION_PERMANENT 0x08 + typedef enum _SECTION_INHERIT { ViewShare = 1, ViewUnmap = 2