Skip to content

Commit 77bfc12

Browse files
committed
[WINLOGON] Move logoff flags handling code to HandleLogoff
1 parent 18c3f39 commit 77bfc12

File tree

1 file changed

+10
-7
lines changed
  • base/system/winlogon

1 file changed

+10
-7
lines changed

base/system/winlogon/sas.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,8 @@ DestroyLogoffSecurityAttributes(
786786
static
787787
NTSTATUS
788788
HandleLogoff(
789-
IN OUT PWLSESSION Session,
790-
IN UINT Flags)
789+
_Inout_ PWLSESSION Session,
790+
_In_ DWORD wlxAction)
791791
{
792792
PLOGOFF_SHUTDOWN_DATA LSData;
793793
PSECURITY_ATTRIBUTES psa;
@@ -802,7 +802,13 @@ HandleLogoff(
802802
ERR("Failed to allocate mem for thread data\n");
803803
return STATUS_NO_MEMORY;
804804
}
805-
LSData->Flags = Flags;
805+
806+
LSData->Flags = EWX_LOGOFF;
807+
if (wlxAction == WLX_SAS_ACTION_FORCE_LOGOFF)
808+
{
809+
LSData->Flags |= EWX_FORCE;
810+
}
811+
806812
LSData->Session = Session;
807813

808814
Status = CreateLogoffSecurityAttributes(&psa);
@@ -1065,12 +1071,9 @@ DoGenericAction(
10651071
case WLX_SAS_ACTION_SHUTDOWN_REBOOT: /* 0x0b */
10661072
if (Session->LogonState != STATE_LOGGED_OFF)
10671073
{
1068-
UINT LogOffFlags = EWX_LOGOFF;
1069-
if (wlxAction == WLX_SAS_ACTION_FORCE_LOGOFF)
1070-
LogOffFlags |= EWX_FORCE;
10711074
if (!Session->Gina.Functions.WlxIsLogoffOk(Session->Gina.Context))
10721075
break;
1073-
if (!NT_SUCCESS(HandleLogoff(Session, LogOffFlags)))
1076+
if (!NT_SUCCESS(HandleLogoff(Session, wlxAction)))
10741077
{
10751078
RemoveStatusMessage(Session);
10761079
break;

0 commit comments

Comments
 (0)