[MSGINA] Add the IgnoreShiftOverride feature again
authorEric Kohl <eric.kohl@reactos.org>
Tue, 22 May 2018 09:06:38 +0000 (11:06 +0200)
committerEric Kohl <eric.kohl@reactos.org>
Tue, 22 May 2018 09:06:38 +0000 (11:06 +0200)
dll/win32/msgina/msgina.c
dll/win32/msgina/msgina.h

index 8772df7..6cb3bc5 100644 (file)
@@ -170,6 +170,7 @@ GetRegistrySettings(PGINA_CONTEXT pgContext)
     LPWSTR lpAutoAdminLogon = NULL;
     LPWSTR lpDontDisplayLastUserName = NULL;
     LPWSTR lpShutdownWithoutLogon = NULL;
+    LPWSTR lpIgnoreShiftOverride = NULL;
     DWORD dwDisableCAD = 0;
     DWORD dwSize;
     LONG rc;
@@ -226,6 +227,15 @@ GetRegistrySettings(PGINA_CONTEXT pgContext)
             pgContext->bDontDisplayLastUserName = TRUE;
     }
 
+    rc = ReadRegSzValue(hKey,
+                        L"IgnoreShiftOverride",
+                        &lpIgnoreShiftOverride);
+    if (rc == ERROR_SUCCESS)
+    {
+        if (wcscmp(lpIgnoreShiftOverride, L"1") == 0)
+            pgContext->bIgnoreShiftOverride = TRUE;
+    }
+
     dwSize = sizeof(pgContext->UserName);
     rc = RegQueryValueExW(hKey,
                           L"DefaultUserName",
@@ -250,6 +260,9 @@ GetRegistrySettings(PGINA_CONTEXT pgContext)
                           (LPBYTE)&pgContext->Password,
                           &dwSize);
 
+    if (lpIgnoreShiftOverride != NULL)
+        HeapFree(GetProcessHeap(), 0, lpIgnoreShiftOverride);
+
     if (lpShutdownWithoutLogon != NULL)
         HeapFree(GetProcessHeap(), 0, lpShutdownWithoutLogon);
 
@@ -893,9 +906,15 @@ WlxDisplaySASNotice(
 
     if (pgContext->bAutoAdminLogon)
     {
-        /* Don't display the window, we want to do an automatic logon */
-        pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL);
-        return;
+        if (pgContext->bIgnoreShiftOverride ||
+            (GetKeyState(VK_SHIFT) >= 0))
+        {
+            /* Don't display the window, we want to do an automatic logon */
+            pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL);
+            return;
+        }
+
+        pgContext->bAutoAdminLogon = FALSE;
     }
 
     if (pgContext->bDisableCAD)
index 38c975e..2243cb8 100644 (file)
@@ -28,10 +28,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msgina);
 
 #include "resource.h"
 
-/* Values for GINA_CONTEXT.AutoLogonState */
-#define AUTOLOGON_CHECK_REGISTRY 1
-#define AUTOLOGON_ONCE           2
-#define AUTOLOGON_DISABLED       3
 
 typedef struct
 {
@@ -46,6 +42,7 @@ typedef struct
     BOOL bAutoAdminLogon;
     BOOL bDontDisplayLastUserName;
     BOOL bShutdownWithoutLogon;
+    BOOL bIgnoreShiftOverride;
 
     ULONG nShutdownAction;