From 0d694c94940e1cacffd73d9734cf17a38f829001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Mon, 13 Aug 2007 14:54:14 +0000 Subject: [PATCH] Check username/password when unlocking the workstation Fix typo svn path=/trunk/; revision=28318 --- reactos/dll/win32/msgina/msgina.c | 12 ++++++------ reactos/dll/win32/msgina/msgina.h | 2 +- reactos/dll/win32/msgina/tui.c | 11 ++++++++++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/reactos/dll/win32/msgina/msgina.c b/reactos/dll/win32/msgina/msgina.c index 15712f3aadf..2f5dbbf846c 100644 --- a/reactos/dll/win32/msgina/msgina.c +++ b/reactos/dll/win32/msgina/msgina.c @@ -450,10 +450,10 @@ DoLoginTasks( goto cleanup; } *pgContext->pAuthenticationId = Stats.AuthenticationId; - pgContext->pNprNotifyInfo->pszUserName = DuplicationString(UserName); - pgContext->pNprNotifyInfo->pszDomain = DuplicationString(Domain); - pgContext->pNprNotifyInfo->pszPassword = DuplicationString(Password); - pgContext->pNprNotifyInfo->pszOldPassword = NULL; + pgContext->pMprNotifyInfo->pszUserName = DuplicationString(UserName); + pgContext->pMprNotifyInfo->pszDomain = DuplicationString(Domain); + pgContext->pMprNotifyInfo->pszPassword = DuplicationString(Password); + pgContext->pMprNotifyInfo->pszOldPassword = NULL; *pgContext->pdwOptions = 0; *pgContext->pProfile = pProfile; return TRUE; @@ -600,7 +600,7 @@ WlxLoggedOutSAS( IN OUT PSID pLogonSid, OUT PDWORD pdwOptions, OUT PHANDLE phToken, - OUT PWLX_MPR_NOTIFY_INFO pNprNotifyInfo, + OUT PWLX_MPR_NOTIFY_INFO pMprNotifyInfo, OUT PVOID *pProfile) { PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; @@ -613,7 +613,7 @@ WlxLoggedOutSAS( pgContext->pAuthenticationId = pAuthenticationId; pgContext->pdwOptions = pdwOptions; - pgContext->pNprNotifyInfo = pNprNotifyInfo; + pgContext->pMprNotifyInfo = pMprNotifyInfo; pgContext->pProfile = pProfile; if (0 == GetSystemMetrics(SM_REMOTESESSION) && diff --git a/reactos/dll/win32/msgina/msgina.h b/reactos/dll/win32/msgina/msgina.h index f94c7ed066b..19a2d2a4e90 100644 --- a/reactos/dll/win32/msgina/msgina.h +++ b/reactos/dll/win32/msgina/msgina.h @@ -25,7 +25,7 @@ typedef struct HANDLE UserToken; PLUID pAuthenticationId; PDWORD pdwOptions; - PWLX_MPR_NOTIFY_INFO pNprNotifyInfo; + PWLX_MPR_NOTIFY_INFO pMprNotifyInfo; PVOID *pProfile; /* Current logo to display */ diff --git a/reactos/dll/win32/msgina/tui.c b/reactos/dll/win32/msgina/tui.c index 64c594c6306..e66b57575ee 100644 --- a/reactos/dll/win32/msgina/tui.c +++ b/reactos/dll/win32/msgina/tui.c @@ -221,6 +221,7 @@ static INT TUILockedSAS( IN OUT PGINA_CONTEXT pgContext) { + HANDLE hToken; WCHAR UserName[256]; WCHAR Password[256]; @@ -237,7 +238,15 @@ TUILockedSAS( if (!ReadString(IDS_ASKFORPASSWORD, Password, 256, FALSE)) return WLX_SAS_ACTION_NONE; - FIXME("FIXME: Check user/password\n"); + if (!LogonUserW(UserName, NULL, Password, + LOGON32_LOGON_UNLOCK, + LOGON32_PROVIDER_DEFAULT, + &hToken)) + { + TRACE("LogonUserW() failed\n"); + return WLX_SAS_ACTION_NONE; + } + CloseHandle(hToken); return WLX_SAS_ACTION_UNLOCK_WKSTA; }