https://git.reactos.org/?p=reactos.git;a=commitdiff;h=77bfc12e0f2a5f59573dae13e1de5d0bc2320799

commit 77bfc12e0f2a5f59573dae13e1de5d0bc2320799
Author:     Thamatip Chitpong <thamatip.chitp...@reactos.org>
AuthorDate: Tue Dec 3 23:55:11 2024 +0700
Commit:     Thamatip Chitpong <thamatip.chitp...@reactos.org>
CommitDate: Mon Dec 9 09:52:57 2024 +0700

    [WINLOGON] Move logoff flags handling code to HandleLogoff
---
 base/system/winlogon/sas.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/base/system/winlogon/sas.c b/base/system/winlogon/sas.c
index c9675ba314d..0bb363fd87f 100644
--- a/base/system/winlogon/sas.c
+++ b/base/system/winlogon/sas.c
@@ -786,8 +786,8 @@ DestroyLogoffSecurityAttributes(
 static
 NTSTATUS
 HandleLogoff(
-    IN OUT PWLSESSION Session,
-    IN UINT Flags)
+    _Inout_ PWLSESSION Session,
+    _In_ DWORD wlxAction)
 {
     PLOGOFF_SHUTDOWN_DATA LSData;
     PSECURITY_ATTRIBUTES psa;
@@ -802,7 +802,13 @@ HandleLogoff(
         ERR("Failed to allocate mem for thread data\n");
         return STATUS_NO_MEMORY;
     }
-    LSData->Flags = Flags;
+
+    LSData->Flags = EWX_LOGOFF;
+    if (wlxAction == WLX_SAS_ACTION_FORCE_LOGOFF)
+    {
+        LSData->Flags |= EWX_FORCE;
+    }
+
     LSData->Session = Session;
 
     Status = CreateLogoffSecurityAttributes(&psa);
@@ -1065,12 +1071,9 @@ DoGenericAction(
         case WLX_SAS_ACTION_SHUTDOWN_REBOOT: /* 0x0b */
             if (Session->LogonState != STATE_LOGGED_OFF)
             {
-                UINT LogOffFlags = EWX_LOGOFF;
-                if (wlxAction == WLX_SAS_ACTION_FORCE_LOGOFF)
-                    LogOffFlags |= EWX_FORCE;
                 if 
(!Session->Gina.Functions.WlxIsLogoffOk(Session->Gina.Context))
                     break;
-                if (!NT_SUCCESS(HandleLogoff(Session, LogOffFlags)))
+                if (!NT_SUCCESS(HandleLogoff(Session, wlxAction)))
                 {
                     RemoveStatusMessage(Session);
                     break;

Reply via email to