https://git.reactos.org/?p=reactos.git;a=commitdiff;h=665926d38bbf7e188111b3a9b2f8abe9b735002f

commit 665926d38bbf7e188111b3a9b2f8abe9b735002f
Author:     Eric Kohl <eric.k...@reactos.org>
AuthorDate: Tue May 22 11:06:38 2018 +0200
Commit:     Eric Kohl <eric.k...@reactos.org>
CommitDate: Tue May 22 11:06:38 2018 +0200

    [MSGINA] Add the IgnoreShiftOverride feature again
---
 dll/win32/msgina/msgina.c | 25 ++++++++++++++++++++++---
 dll/win32/msgina/msgina.h |  5 +----
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/dll/win32/msgina/msgina.c b/dll/win32/msgina/msgina.c
index 8772df7dc1..6cb3bc5324 100644
--- a/dll/win32/msgina/msgina.c
+++ b/dll/win32/msgina/msgina.c
@@ -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)
diff --git a/dll/win32/msgina/msgina.h b/dll/win32/msgina/msgina.h
index 38c975eb89..2243cb8222 100644
--- a/dll/win32/msgina/msgina.h
+++ b/dll/win32/msgina/msgina.h
@@ -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;
 

Reply via email to