Register application for restart, Update ProcessShutdownParameters for Win10
@@ -169,7 +169,11 @@ BOOLEAN PhMainWndInitialization(
// Allow WM_PH_ACTIVATE to pass through UIPI. (wj32)
if (PhGetOwnTokenAttributes().Elevated)
{
+#if (PHNT_VERSION >= PHNT_WIN7)
ChangeWindowMessageFilterEx(PhMainWndHandle, WM_PH_ACTIVATE, MSGFLT_ADD, NULL);
+#elif (PHNT_VERSION >= PHNT_VISTA)
+ ChangeWindowMessageFilter(WM_PH_ACTIVATE, MSGFLT_ADD);
+#endif
}
// Initialize child controls.
@@ -518,8 +522,19 @@ NTSTATUS PhMwpLoadStage1Worker(
PhNfLoadStage2();
+ if (WindowsVersion < WINDOWS_10)
+ {
// Make sure we get closed late in the shutdown process.
- SetProcessShutdownParameters(0x100, 0);
+ SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY);
+ }
+ else
+ {
+ // Same values as taskmgr.exe on Win10 (dmex)
+ SetProcessShutdownParameters(0x1, SHUTDOWN_NORETRY);
+ }
+
+ // Register application for restart (dmex)
+ RegisterApplicationRestart(NULL, 0);
DelayedLoadCompleted = TRUE;
//PostMessage((HWND)Parameter, WM_PH_DELAYED_LOAD_COMPLETED, 0, 0);
