This is needed by x64 chromium sandbox for >= win8. Not doing anything but returning true is enough to make it work, though security won't be perfect.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45643 Signed-off-by: Fabian Maurer dark.shadow4@web.de --- ...api-ms-win-core-processthreads-l1-1-1.spec | 2 +- ...api-ms-win-core-processthreads-l1-1-2.spec | 2 +- dlls/kernel32/kernel32.spec | 1 + dlls/kernel32/process.c | 10 ++++++++++ dlls/kernelbase/kernelbase.spec | 2 +- include/winnt.h | 19 +++++++++++++++++++ 6 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/dlls/api-ms-win-core-processthreads-l1-1-1/api-ms-win-core-processthreads-l1-1-1.spec b/dlls/api-ms-win-core-processthreads-l1-1-1/api-ms-win-core-processthreads-l1-1-1.spec index ebbe55fe68..616fa63909 100644 --- a/dlls/api-ms-win-core-processthreads-l1-1-1/api-ms-win-core-processthreads-l1-1-1.spec +++ b/dlls/api-ms-win-core-processthreads-l1-1-1/api-ms-win-core-processthreads-l1-1-1.spec @@ -44,7 +44,7 @@ @ stdcall ResumeThread(long) kernel32.ResumeThread @ stdcall SetPriorityClass(long long) kernel32.SetPriorityClass @ stdcall SetProcessAffinityUpdateMode(long long) kernel32.SetProcessAffinityUpdateMode -@ stub SetProcessMitigationPolicy +@ stdcall SetProcessMitigationPolicy(long ptr long) kernel32.SetProcessMitigationPolicy @ stdcall SetProcessShutdownParameters(long long) kernel32.SetProcessShutdownParameters @ stdcall SetThreadContext(long ptr) kernel32.SetThreadContext @ stdcall SetThreadIdealProcessorEx(long ptr ptr) kernel32.SetThreadIdealProcessorEx diff --git a/dlls/api-ms-win-core-processthreads-l1-1-2/api-ms-win-core-processthreads-l1-1-2.spec b/dlls/api-ms-win-core-processthreads-l1-1-2/api-ms-win-core-processthreads-l1-1-2.spec index db94c2e5e7..8de6c5b66c 100644 --- a/dlls/api-ms-win-core-processthreads-l1-1-2/api-ms-win-core-processthreads-l1-1-2.spec +++ b/dlls/api-ms-win-core-processthreads-l1-1-2/api-ms-win-core-processthreads-l1-1-2.spec @@ -49,7 +49,7 @@ @ stdcall ResumeThread(long) kernel32.ResumeThread @ stdcall SetPriorityClass(long long) kernel32.SetPriorityClass @ stdcall SetProcessAffinityUpdateMode(long long) kernel32.SetProcessAffinityUpdateMode -@ stub SetProcessMitigationPolicy +@ stdcall SetProcessMitigationPolicy(long ptr long) kernel32.SetProcessMitigationPolicy @ stdcall SetProcessPriorityBoost(long long) kernel32.SetProcessPriorityBoost @ stdcall SetProcessShutdownParameters(long long) kernel32.SetProcessShutdownParameters @ stdcall SetThreadContext(long ptr) kernel32.SetThreadContext diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 9844a744d7..2d5b6df8dd 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1427,6 +1427,7 @@ @ stdcall SetProcessAffinityMask(long long) @ stdcall SetProcessAffinityUpdateMode(long long) @ stdcall SetProcessDEPPolicy(long) +@ stdcall SetProcessMitigationPolicy(long ptr long) # @ stub SetProcessPreferredUILanguages @ stdcall SetProcessPriorityBoost(long long) @ stdcall SetProcessShutdownParameters(long long) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 42dd7cbbc0..a6a067b3cb 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -4536,3 +4536,13 @@ BOOL WINAPI BaseFlushAppcompatCache(void) SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +/********************************************************************** + * SetProcessMitigationPolicy (KERNEL32.@) + */ +BOOL WINAPI SetProcessMitigationPolicy(PROCESS_MITIGATION_POLICY migitation_policy, void *buffer, SIZE_T length) +{ + FIXME("(%d, %p, %lu): stub\n", migitation_policy, buffer, length); + + return TRUE; +} diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index c4a75bc169..885c8eca10 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1456,7 +1456,7 @@ # @ stub SetProcessDefaultCpuSets # @ stub SetProcessGroupAffinity # @ stub SetProcessInformation -# @ stub SetProcessMitigationPolicy +@ stdcall SetProcessMitigationPolicy(long ptr long) kernel32.SetProcessMitigationPolicy # @ stub SetProcessPreferredUILanguages @ stdcall SetProcessPriorityBoost(long long) kernel32.SetProcessPriorityBoost @ stdcall SetProcessShutdownParameters(long long) kernel32.SetProcessShutdownParameters diff --git a/include/winnt.h b/include/winnt.h index 719cf8496f..efa41b698d 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -6288,6 +6288,25 @@ typedef enum _RTL_UMS_SCHEDULER_REASON
typedef void (CALLBACK *PRTL_UMS_SCHEDULER_ENTRY_POINT)(RTL_UMS_SCHEDULER_REASON,ULONG_PTR,PVOID);
+typedef enum _PROCESS_MITIGATION_POLICY { + ProcessDEPPolicy, + ProcessASLRPolicy, + ProcessDynamicCodePolicy, + ProcessStrictHandleCheckPolicy, + ProcessSystemCallDisablePolicy, + ProcessMitigationOptionsMask, + ProcessExtensionPointDisablePolicy, + ProcessControlFlowGuardPolicy, + ProcessSignaturePolicy, + ProcessFontDisablePolicy, + ProcessImageLoadPolicy, + ProcessSystemCallFilterPolicy, + ProcessPayloadRestrictionPolicy, + ProcessChildProcessPolicy, + ProcessSideChannelIsolationPolicy, + MaxProcessMitigationPolicy +} PROCESS_MITIGATION_POLICY, *PPROCESS_MITIGATION_POLICY; + #ifdef __cplusplus } #endif