[WINLOGON] Close all dialog boxes on SAS
[reactos.git] / base / system / winlogon / wlx.c
index 03f7326..44983e7 100644 (file)
@@ -106,24 +106,22 @@ GetDialogListEntry(HWND hwndDlg)
 
 
 HWND
-GetTopDialogWindow(VOID)
+CloseAllDialogWindows(VOID)
 {
     PDIALOG_LIST_ENTRY Current;
     PLIST_ENTRY ListEntry;
 
     ListEntry = DialogListHead.Flink;
-    if (ListEntry != &DialogListHead)
+    while (ListEntry != &DialogListHead)
     {
         Current = CONTAINING_RECORD(ListEntry,
                                     DIALOG_LIST_ENTRY,
                                     Entry);
 
-        TRACE("Found entry: %p window %p\n", Current, Current->hWnd);
-        return Current->hWnd;
-    }
+        PostMessage(Current->hWnd, WLX_WM_SAS, 0, 0);
 
-    TRACE("Found no window\n");
-    return NULL;
+        ListEntry = ListEntry->Flink;
+    }
 }
 
 
@@ -850,7 +848,7 @@ LoadGina(
     }
     else
     {
-        TRACE("About to negociate with Gina %S. Winlogon uses version %x\n",
+        TRACE("About to negotiate with Gina %S. Winlogon uses version %x\n",
             GinaDll, WLX_CURRENT_VERSION);
         if (!Functions->WlxNegotiate(WLX_CURRENT_VERSION, DllVersion))
             goto cleanup;
@@ -1235,7 +1233,7 @@ CreateWindowStationAndDesktops(
     Session->InteractiveWindowStation = CreateWindowStationW(
         Session->InteractiveWindowStationName,
         0,
-        GENERIC_ALL,
+        MAXIMUM_ALLOWED,
         &DefaultSecurity);
     if (!Session->InteractiveWindowStation)
     {
@@ -1256,7 +1254,7 @@ CreateWindowStationAndDesktops(
         NULL,
         NULL,
         0, /* FIXME: Add DF_ALLOWOTHERACCOUNTHOOK flag? */
-        GENERIC_ALL,
+        MAXIMUM_ALLOWED,
         &UserDesktopSecurity);
     if (!Session->ApplicationDesktop)
     {
@@ -1272,7 +1270,7 @@ CreateWindowStationAndDesktops(
         NULL,
         NULL,
         0,
-        GENERIC_ALL,
+        MAXIMUM_ALLOWED,
         &DefaultSecurity);
     if (!Session->WinlogonDesktop)
     {
@@ -1288,7 +1286,7 @@ CreateWindowStationAndDesktops(
         NULL,
         NULL,
         0,
-        GENERIC_ALL,
+        MAXIMUM_ALLOWED,
         &DefaultSecurity);
     if(!Session->ScreenSaverDesktop)
     {