mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:03:12 +00:00
[WINLOGON] Improve EWX_* flags to WLX_* actions mapping in WM_LOGONNOTIFY:LN_LOGOFF
CORE-8322 CORE-11550
This commit is contained in:
parent
52e02af86b
commit
2e4cdd4c23
1 changed files with 32 additions and 37 deletions
|
@ -738,7 +738,7 @@ LogoffShutdownThread(
|
||||||
uFlags = EWX_CALLER_WINLOGON | (LSData->Flags & 0x0F);
|
uFlags = EWX_CALLER_WINLOGON | (LSData->Flags & 0x0F);
|
||||||
|
|
||||||
TRACE("In LogoffShutdownThread with uFlags == 0x%x; exit_in_progress == %s\n",
|
TRACE("In LogoffShutdownThread with uFlags == 0x%x; exit_in_progress == %s\n",
|
||||||
uFlags, ExitReactOSInProgress ? "true" : "false");
|
uFlags, ExitReactOSInProgress ? "TRUE" : "FALSE");
|
||||||
|
|
||||||
ExitReactOSInProgress = TRUE;
|
ExitReactOSInProgress = TRUE;
|
||||||
|
|
||||||
|
@ -1599,49 +1599,44 @@ SASWindowProc(
|
||||||
* Our caller (USERSRV) should have added the shutdown flag
|
* Our caller (USERSRV) should have added the shutdown flag
|
||||||
* when setting also poweroff or reboot.
|
* when setting also poweroff or reboot.
|
||||||
*/
|
*/
|
||||||
if (Action & (EWX_POWEROFF | EWX_REBOOT))
|
if ((Action & (EWX_POWEROFF | EWX_REBOOT)) && !(Action & EWX_SHUTDOWN))
|
||||||
{
|
{
|
||||||
if ((Action & EWX_SHUTDOWN) == 0)
|
ERR("Missing EWX_SHUTDOWN flag for poweroff or reboot; action 0x%x\n", Action);
|
||||||
{
|
return STATUS_INVALID_PARAMETER;
|
||||||
ERR("Missing EWX_SHUTDOWN flag for poweroff or reboot; action 0x%x\n", Action);
|
}
|
||||||
return STATUS_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now we can locally remove it for performing checks */
|
// INVESTIGATE: Our HandleLogoff/HandleShutdown may instead
|
||||||
|
// take an EWX_* flags combination to determine what to do
|
||||||
|
// more precisely.
|
||||||
|
/* Map EWX_* flags to WLX_* actions and check for any unhandled flag */
|
||||||
|
if (Action & EWX_POWEROFF)
|
||||||
|
{
|
||||||
|
wlxAction = WLX_SAS_ACTION_SHUTDOWN_POWER_OFF;
|
||||||
|
Action &= ~(EWX_SHUTDOWN | EWX_POWEROFF);
|
||||||
|
}
|
||||||
|
else if (Action & EWX_REBOOT)
|
||||||
|
{
|
||||||
|
wlxAction = WLX_SAS_ACTION_SHUTDOWN_REBOOT;
|
||||||
|
Action &= ~(EWX_SHUTDOWN | EWX_REBOOT);
|
||||||
|
}
|
||||||
|
else if (Action & EWX_SHUTDOWN)
|
||||||
|
{
|
||||||
|
wlxAction = WLX_SAS_ACTION_SHUTDOWN;
|
||||||
Action &= ~EWX_SHUTDOWN;
|
Action &= ~EWX_SHUTDOWN;
|
||||||
}
|
}
|
||||||
|
else // EWX_LOGOFF
|
||||||
/* Check parameters */
|
|
||||||
if (Action & EWX_FORCE)
|
|
||||||
{
|
{
|
||||||
// FIXME!
|
if (Action & EWX_FORCE)
|
||||||
ERR("FIXME: EWX_FORCE present for Winlogon, what to do?\n");
|
wlxAction = WLX_SAS_ACTION_FORCE_LOGOFF;
|
||||||
Action &= ~EWX_FORCE;
|
else
|
||||||
}
|
|
||||||
switch (Action)
|
|
||||||
{
|
|
||||||
case EWX_LOGOFF:
|
|
||||||
wlxAction = WLX_SAS_ACTION_LOGOFF;
|
wlxAction = WLX_SAS_ACTION_LOGOFF;
|
||||||
break;
|
Action &= ~(EWX_LOGOFF | EWX_FORCE);
|
||||||
case EWX_SHUTDOWN:
|
|
||||||
wlxAction = WLX_SAS_ACTION_SHUTDOWN;
|
|
||||||
break;
|
|
||||||
case EWX_REBOOT:
|
|
||||||
wlxAction = WLX_SAS_ACTION_SHUTDOWN_REBOOT;
|
|
||||||
break;
|
|
||||||
case EWX_POWEROFF:
|
|
||||||
wlxAction = WLX_SAS_ACTION_SHUTDOWN_POWER_OFF;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
ERR("Invalid ExitWindows action 0x%x\n", Action);
|
|
||||||
return STATUS_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (Action)
|
||||||
|
ERR("Unhandled EWX_* action flags: 0x%x\n", Action);
|
||||||
|
|
||||||
TRACE("In LN_LOGOFF, exit_in_progress == %s\n",
|
TRACE("In LN_LOGOFF, exit_in_progress == %s\n",
|
||||||
ExitReactOSInProgress ? "true" : "false");
|
ExitReactOSInProgress ? "TRUE" : "FALSE");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In case a parallel shutdown request is done (while we are
|
* In case a parallel shutdown request is done (while we are
|
||||||
|
@ -1666,8 +1661,8 @@ SASWindowProc(
|
||||||
}
|
}
|
||||||
case LN_LOGOFF_CANCELED:
|
case LN_LOGOFF_CANCELED:
|
||||||
{
|
{
|
||||||
ERR("Logoff canceled!!, before: exit_in_progress == %s, after will be false\n",
|
ERR("Logoff canceled! Before: exit_in_progress == %s; After: FALSE\n",
|
||||||
ExitReactOSInProgress ? "true" : "false");
|
ExitReactOSInProgress ? "TRUE" : "FALSE");
|
||||||
|
|
||||||
ExitReactOSInProgress = FALSE;
|
ExitReactOSInProgress = FALSE;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue