Skip to content

Commit c29e4eb

Browse files
committed
[WINLOGON] Move WlxShutdown() GINA notification in HandleShutdown() (reactos#8329)
- Both 3rd-party modules and GINA shutdown notifications should be called just when shutdown is being started. Addendum to commit d3b9c68 (r66252) CORE-8322 - Factor the two `DisplayStatusMessage()` calls for shutdown vs. reboot.
1 parent 27e147a commit c29e4eb

File tree

1 file changed

+14
-9
lines changed
  • base/system/winlogon

1 file changed

+14
-9
lines changed

base/system/winlogon/sas.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,22 +1151,30 @@ HandleShutdown(
11511151
IN DWORD wlxAction)
11521152
{
11531153
NTSTATUS Status;
1154+
UINT uMsgId;
11541155
BOOLEAN Old;
11551156

1156-
// SwitchDesktop(Session->WinlogonDesktop);
1157-
1158-
/* If the system is rebooting, show the appropriate string */
1157+
/* Display the appropriate shutdown or reboot message */
11591158
if (wlxAction == WLX_SAS_ACTION_SHUTDOWN_REBOOT)
1160-
DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_REACTOSISRESTARTING);
1159+
uMsgId = IDS_REACTOSISRESTARTING;
11611160
else
1162-
DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_REACTOSISSHUTTINGDOWN);
1161+
uMsgId = IDS_REACTOSISSHUTTINGDOWN;
1162+
1163+
// SwitchDesktop(Session->WinlogonDesktop);
1164+
DisplayStatusMessage(Session, Session->WinlogonDesktop, uMsgId);
1165+
1166+
/* Invoke Shutdown notifications and notify GINA */
1167+
CallNotificationDlls(Session, ShutdownHandler);
1168+
Session->Gina.Functions.WlxShutdown(Session->Gina.Context, wlxAction);
11631169

11641170
/* Run the shutdown thread. *IGNORE* all failures as we want to force shutting down! */
11651171
Status = RunLogoffShutdownThread(Session, NULL, wlxAction);
11661172
if (!NT_SUCCESS(Status))
11671173
ERR("Failed to start the Shutdown thread, Status 0x%08lx\n", Status);
11681174

1169-
CallNotificationDlls(Session, ShutdownHandler);
1175+
/* Show again the shutdown message */
1176+
// SwitchDesktop(Session->WinlogonDesktop); // Re-enable if you notice the desktop may have switched to something else.
1177+
DisplayStatusMessage(Session, Session->WinlogonDesktop, uMsgId);
11701178

11711179
/* Destroy SAS window */
11721180
UninitializeSAS(Session);
@@ -1271,9 +1279,6 @@ DoGenericAction(
12711279
}
12721280
if (WLX_SHUTTINGDOWN(wlxAction))
12731281
{
1274-
// FIXME: WlxShutdown should be done from inside HandleShutdown,
1275-
// after having displayed "ReactOS is shutting down" message.
1276-
Session->Gina.Functions.WlxShutdown(Session->Gina.Context, wlxAction);
12771282
if (!NT_SUCCESS(HandleShutdown(Session, wlxAction)))
12781283
{
12791284
RemoveStatusMessage(Session);

0 commit comments

Comments
 (0)