mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 20:22:05 +00:00
[WINLOGON] Correctly reset LogonState in case logon or shutdown fails (#8133)
CORE-18351 CORE-18237 CORE-17137 CORE-16567 CORE-15360 CORE-5071 CORE-3804 Reset `LogonState` back to `STATE_LOGGED_OFF` before invoking `WlxDisplaySASNotice()` when: - in `STATE_LOGGED_OFF_SAS` state, `HandleLogon()` failed; - or when an attempted shutdown operation failed. This fixes the resulting inconsistent `LogonState` that happened if any of these operations failed due to legitimate reasons. For example, a corrupted user profile that caused the login attempt to abort, or, an ongoing shutdown attempt being aborted as well. One of the user-visible effects of this inconsistency, was the inability to access the familiar Logged-Out SAS dialog by pressing Ctrl-Alt-Del at the invite (SAS notice) dialog, because the `LogonState` was incorrectly left into the `STATE_LOGGED_OFF_SAS` state, instead of being reset to `STATE_LOGGED_OFF`. ---- Typical scenario: The "Administrator" user, who is auto-logged-in by default after the installation, gets a corrupted ntuser.dat profile registry hive if the 2nd-stage installation is aborted at the end by force-restarting ReactOS. After reboot, ReactOS tries to log into the account, but fails, and goes back to the Ctrl-Alt-Del invite dialog. Before this fix, the user couldn't go into the Logged-Out SAS dialog to enter new login credentials and attempt login to another account. This is now fixed.
This commit is contained in:
parent
545f9cebb2
commit
82a57e41e1
1 changed files with 3 additions and 0 deletions
|
@ -1071,6 +1071,7 @@ DoGenericAction(
|
||||||
{
|
{
|
||||||
if (!HandleLogon(Session))
|
if (!HandleLogon(Session))
|
||||||
{
|
{
|
||||||
|
Session->LogonState = STATE_LOGGED_OFF;
|
||||||
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
|
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
|
||||||
CallNotificationDlls(Session, LogonHandler);
|
CallNotificationDlls(Session, LogonHandler);
|
||||||
}
|
}
|
||||||
|
@ -1132,12 +1133,14 @@ DoGenericAction(
|
||||||
if (!NT_SUCCESS(HandleShutdown(Session, wlxAction)))
|
if (!NT_SUCCESS(HandleShutdown(Session, wlxAction)))
|
||||||
{
|
{
|
||||||
RemoveStatusMessage(Session);
|
RemoveStatusMessage(Session);
|
||||||
|
Session->LogonState = STATE_LOGGED_OFF;
|
||||||
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
|
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RemoveStatusMessage(Session);
|
RemoveStatusMessage(Session);
|
||||||
|
Session->LogonState = STATE_LOGGED_OFF;
|
||||||
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
|
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue