[MSGINA] Add the IgnoreShiftOverride feature again

This commit is contained in:
Eric Kohl 2018-05-22 11:06:38 +02:00
parent 0d308f4b6e
commit 665926d38b
2 changed files with 23 additions and 7 deletions

View 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)

View 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;