X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fdll%2Fwin32%2Fmsgina%2Fmsgina.c;h=fbd9ef5e99ff4f101fa11939392b6226bba8cb73;hp=c45dbbcd832638b308e8fcc863afa229e30af286;hb=e7e1ec28e508c28fdbb336902e2536ac85ae693f;hpb=f0ecb9c0cb57c3e219d6ec7ee6e376ded9f3207e diff --git a/reactos/dll/win32/msgina/msgina.c b/reactos/dll/win32/msgina/msgina.c index c45dbbcd832..fbd9ef5e99f 100644 --- a/reactos/dll/win32/msgina/msgina.c +++ b/reactos/dll/win32/msgina/msgina.c @@ -572,6 +572,47 @@ cleanup: 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 @@ WlxDisplaySASNotice( return; } - if (DoAutoLogon(pgContext)) + if (CheckAutoAdminLogon(pgContext)) { /* Don't display the window, we want to do an automatic logon */ pgContext->AutoLogonState = AUTOLOGON_ONCE;