Save the password in the gina-context after successful logon and use it to check the password when unlocking the computer.

svn path=/trunk/; revision=61741
This commit is contained in:
Eric Kohl 2014-01-20 21:23:17 +00:00
parent d74e783572
commit c3cdc1abae
3 changed files with 22 additions and 7 deletions

View file

@ -527,6 +527,12 @@ LoggedOutWindowProc(
if (GetTextboxText(hwndDlg, IDC_PASSWORD, &Password) &&
DoLoginTasks(pgContext, UserName, NULL, Password))
{
pgContext->Password = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
(wcslen(Password) + 1) * sizeof(WCHAR));
if (pgContext->Password != NULL)
wcscpy(pgContext->Password, Password);
result = WLX_SAS_ACTION_LOGON;
}
HeapFree(GetProcessHeap(), 0, UserName);
@ -648,22 +654,23 @@ UnlockWindowProc(
{
case IDOK:
{
#if 0
LPWSTR UserName = NULL, Password = NULL;
INT result = WLX_SAS_ACTION_NONE;
if (GetTextboxText(hwndDlg, IDC_USERNAME, &UserName) && *UserName == '\0')
break;
if (GetTextboxText(hwndDlg, IDC_PASSWORD, &Password) &&
DoLoginTasks(pgContext, UserName, NULL, Password))
if (GetTextboxText(hwndDlg, IDC_PASSWORD, &Password))
{
result = WLX_SAS_ACTION_LOGON;
if (UserName != NULL && Password != NULL &&
wcscmp(UserName, pgContext->UserName) == 0 &&
wcscmp(Password, pgContext->Password) == 0)
{
result = WLX_SAS_ACTION_UNLOCK_WKSTA;
}
}
HeapFree(GetProcessHeap(), 0, UserName);
HeapFree(GetProcessHeap(), 0, Password);
EndDialog(hwndDlg, result);
#endif
EndDialog(hwndDlg, WLX_SAS_ACTION_UNLOCK_WKSTA);
return TRUE;
}

View file

@ -817,7 +817,15 @@ DoAutoLogon(
result = DoLoginTasks(pgContext, UserName, DomainName, Password);
if (result == TRUE)
{
pgContext->Password = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
(wcslen(Password) + 1) * sizeof(WCHAR));
if (pgContext->Password != NULL)
wcscpy(pgContext->Password, Password);
NotifyBootConfigStatus(TRUE);
}
}
cleanup:
@ -852,7 +860,6 @@ WlxDisplaySASNotice(
return;
}
// if (CheckAutoAdminLogon(pgContext))
if (pgContext->bAutoAdminLogon == TRUE)
{
/* Don't display the window, we want to do an automatic logon */

View file

@ -42,6 +42,7 @@ typedef struct
/* Information to be filled during logon */
WCHAR UserName[256];
WCHAR Domain[256];
LPWSTR Password;
SYSTEMTIME LogonTime;
HANDLE UserToken;
PLUID pAuthenticationId;