Author: ekohl Date: Sat Jan 11 20:47:41 2014 New Revision: 61587
URL: http://svn.reactos.org/svn/reactos?rev=61587&view=rev Log: [MSGINA] - WlxDisplaySASNotice: Do not try an auto admin logon here. Check for auto admin logon instead and let WlxLoggedOutSAS do the logon stuff.
[WINLOGON] - Avoid posting two SAS notification messages when winlogon is started up.
Modified: trunk/reactos/base/system/winlogon/sas.c trunk/reactos/dll/win32/msgina/msgina.c
Modified: trunk/reactos/base/system/winlogon/sas.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/sas.c?... ============================================================================== --- trunk/reactos/base/system/winlogon/sas.c [iso-8859-1] (original) +++ trunk/reactos/base/system/winlogon/sas.c [iso-8859-1] Sat Jan 11 20:47:41 2014 @@ -845,7 +845,10 @@ 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_OFF) + { + Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context); + } break; case WLX_SAS_ACTION_LOCK_WKSTA: /* 0x03 */ if (Session->Gina.Functions.WlxIsLockOk(Session->Gina.Context)) @@ -919,7 +922,7 @@ case WLX_SAS_TYPE_TIMEOUT: /* 0x00 */ { Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context); - break; + return; } default: {
Modified: trunk/reactos/dll/win32/msgina/msgina.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.c?r... ============================================================================== --- trunk/reactos/dll/win32/msgina/msgina.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msgina/msgina.c [iso-8859-1] Sat Jan 11 20:47:41 2014 @@ -572,6 +572,47 @@ return FALSE; }
+ +static +BOOL +CheckAutoAdminLogon( + IN PGINA_CONTEXT pgContext) +{ + HKEY WinLogonKey = NULL; + LPWSTR AutoLogon = NULL; + BOOL result = FALSE; + LONG rc; + + if (pgContext->AutoLogonState == AUTOLOGON_DISABLED) + return FALSE; + + rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon", + 0, + KEY_QUERY_VALUE, + &WinLogonKey); + if (rc != ERROR_SUCCESS) + goto cleanup; + + rc = ReadRegSzKey(WinLogonKey, + L"AutoAdminLogon", + &AutoLogon); + + if (rc != ERROR_SUCCESS) + goto cleanup; + + if (wcscmp(AutoLogon, L"1") == 0) + result = TRUE; + +cleanup: + if (WinLogonKey != NULL) + RegCloseKey(WinLogonKey); + HeapFree(GetProcessHeap(), 0, AutoLogon); + + return result; +} + + static BOOL DoAutoLogon( IN PGINA_CONTEXT pgContext) @@ -685,7 +726,7 @@ return; }
- if (DoAutoLogon(pgContext)) + if (CheckAutoAdminLogon(pgContext)) { /* Don't display the window, we want to do an automatic logon */ pgContext->AutoLogonState = AUTOLOGON_ONCE;