Author: hbelusca
Date: Sun Jun 15 20:02:26 2014
New Revision: 63601
URL:
http://svn.reactos.org/svn/reactos?rev=63601&view=rev
Log:
[EXPLORER][EXPLORER_NEW]
[TASKMGR]
Set a proper shutdown level (with SetProcessShutdownParameters) so that explorer and
taskmgr are terminated the very last when one shutdowns ReactOS.
See Windows Internals 4th page 286 (section "Shutdown") which gives the values
(that I've cross-checked on Windows 2k3 too).
Modified:
branches/shell-experiments/base/shell/explorer-new/explorer.c
trunk/reactos/base/applications/taskmgr/taskmgr.c
trunk/reactos/base/shell/explorer/explorer.cpp
Modified: branches/shell-experiments/base/shell/explorer-new/explorer.c
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/ex…
==============================================================================
--- branches/shell-experiments/base/shell/explorer-new/explorer.c [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/explorer-new/explorer.c [iso-8859-1] Sun Jun 15
20:02:26 2014
@@ -407,6 +407,12 @@
InitCommonControls();
OleInitialize(NULL);
+ /*
+ * Set our shutdown parameters: we want to shutdown the very last,
+ * but before any TaskMgr instance (which has a shutdown level of 1).
+ */
+ SetProcessShutdownParameters(2, 0);
+
ProcessStartupItems();
if (GetShellWindow() == NULL)
Modified: trunk/reactos/base/applications/taskmgr/taskmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/taskmgr.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/taskmgr.c [iso-8859-1] Sun Jun 15 20:02:26
2014
@@ -172,6 +172,12 @@
return -1;
}
+ /*
+ * Set our shutdown parameters: we want to shutdown the very last,
+ * without displaying any end task dialog if needed.
+ */
+ SetProcessShutdownParameters(1, SHUTDOWN_NORETRY);
+
DialogBoxW(hInst, (LPCWSTR)IDD_TASKMGR_DIALOG, NULL, TaskManagerWndProc);
/* Save our settings to the registry */
Modified: trunk/reactos/base/shell/explorer/explorer.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explor…
==============================================================================
--- trunk/reactos/base/shell/explorer/explorer.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/explorer.cpp [iso-8859-1] Sun Jun 15 20:02:26 2014
@@ -1203,6 +1203,12 @@
"ROS Explorer - command line options", MB_OK);
}
+ /*
+ * Set our shutdown parameters: we want to shutdown the very last,
+ * but before any TaskMgr instance (which has a shutdown level of 1).
+ */
+ SetProcessShutdownParameters(2, 0);
+
Thread* pSSOThread = NULL;
if (startup_desktop) {