Author: ekohl
Date: Mon Jan 20 21:23:17 2014
New Revision: 61741
URL:
http://svn.reactos.org/svn/reactos?rev=61741&view=rev
Log:
[MSGINA]
Save the password in the gina-context after successful logon and use it to check the
password when unlocking the computer.
Modified:
trunk/reactos/dll/win32/msgina/gui.c
trunk/reactos/dll/win32/msgina/msgina.c
trunk/reactos/dll/win32/msgina/msgina.h
Modified: trunk/reactos/dll/win32/msgina/gui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/gui.c?rev…
==============================================================================
--- trunk/reactos/dll/win32/msgina/gui.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/gui.c [iso-8859-1] Mon Jan 20 21:23:17 2014
@@ -527,6 +527,12 @@
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 @@
{
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;
}
Modified: trunk/reactos/dll/win32/msgina/msgina.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.c?…
==============================================================================
--- trunk/reactos/dll/win32/msgina/msgina.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/msgina.c [iso-8859-1] Mon Jan 20 21:23:17 2014
@@ -817,7 +817,15 @@
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 @@
return;
}
-// if (CheckAutoAdminLogon(pgContext))
if (pgContext->bAutoAdminLogon == TRUE)
{
/* Don't display the window, we want to do an automatic logon */
Modified: trunk/reactos/dll/win32/msgina/msgina.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.h?…
==============================================================================
--- trunk/reactos/dll/win32/msgina/msgina.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/msgina.h [iso-8859-1] Mon Jan 20 21:23:17 2014
@@ -42,6 +42,7 @@
/* Information to be filled during logon */
WCHAR UserName[256];
WCHAR Domain[256];
+ LPWSTR Password;
SYSTEMTIME LogonTime;
HANDLE UserToken;
PLUID pAuthenticationId;