[WINLOGON]
[reactos.git] / reactos / base / system / winlogon / sas.c
index 3646d44..4fc901b 100644 (file)
@@ -845,7 +845,14 @@ DoGenericAction(
                 Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
             break;
         case WLX_SAS_ACTION_NONE: /* 0x02 */
-            Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
+            if (Session->LogonState == STATE_LOGGED_ON_SAS)
+            {
+                Session->LogonState = STATE_LOGGED_ON;
+            }
+            else if (Session->LogonState == STATE_LOGGED_OFF)
+            {
+                Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
+            }
             break;
         case WLX_SAS_ACTION_LOCK_WKSTA: /* 0x03 */
             if (Session->Gina.Functions.WlxIsLockOk(Session->Gina.Context))
@@ -888,6 +895,7 @@ DoGenericAction(
             break;
         case WLX_SAS_ACTION_TASKLIST: /* 0x07 */
             SwitchDesktop(WLSession->ApplicationDesktop);
+            Session->LogonState = STATE_LOGGED_ON;
             StartTaskManager(Session);
             break;
         case WLX_SAS_ACTION_UNLOCK_WKSTA: /* 0x08 */
@@ -907,8 +915,16 @@ DispatchSAS(
 {
     DWORD wlxAction = WLX_SAS_ACTION_NONE;
 
+    /* Ignore SAS if we are already in an SAS state */
+    if (Session->LogonState == STATE_LOGGED_OFF_SAS ||
+        Session->LogonState == STATE_LOGGED_ON_SAS)
+        return;
+
     if (Session->LogonState == STATE_LOGGED_ON)
+    {
+        Session->LogonState = STATE_LOGGED_ON_SAS;
         wlxAction = (DWORD)Session->Gina.Functions.WlxLoggedOnSAS(Session->Gina.Context, dwSasType, NULL);
+    }
     else if (Session->LogonState == STATE_LOCKED)
         wlxAction = (DWORD)Session->Gina.Functions.WlxWkstaLockedSAS(Session->Gina.Context, dwSasType);
     else
@@ -919,7 +935,7 @@ DispatchSAS(
             case WLX_SAS_TYPE_TIMEOUT: /* 0x00 */
             {
                 Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
-                break;
+                return;
             }
             default:
             {