From c7e70b81fae6835ad00166f1c31f75d65529ce51 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 17 Feb 2013 01:06:24 +0000 Subject: [PATCH] [MSGINA] - Fix a typo in the german lock dialog. - Store the user name and domain in the gina context and use them in the lock dialog. - Initialize the LOGONSERVER environment variable. svn path=/trunk/; revision=58326 --- reactos/dll/win32/msgina/gui.c | 23 ++++++++++++++++++++--- reactos/dll/win32/msgina/lang/de-DE.rc | 2 +- reactos/dll/win32/msgina/msgina.c | 19 +++++++++++++++++-- reactos/dll/win32/msgina/msgina.h | 2 ++ 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/reactos/dll/win32/msgina/gui.c b/reactos/dll/win32/msgina/gui.c index dc93a5ad481..82a07925852 100644 --- a/reactos/dll/win32/msgina/gui.c +++ b/reactos/dll/win32/msgina/gui.c @@ -414,6 +414,24 @@ GUILockedSAS( } +static VOID +OnInitLockedDlg(HWND hwnd, + PGINA_CONTEXT pgContext, + UINT id) +{ + WCHAR Buffer1[256]; + WCHAR Buffer2[256]; + WCHAR Buffer3[512]; + + LoadStringW(pgContext->hDllInstance, IDS_LOCKMSG, Buffer1, 256); + + wsprintfW(Buffer2, L"%s\\%s", pgContext->Domain, pgContext->UserName); + wsprintfW(Buffer3, Buffer1, Buffer2); + + SetWindowTextW(GetDlgItem(hwnd, id), Buffer3); +} + + static INT_PTR CALLBACK LockedWindowProc( IN HWND hwndDlg, @@ -433,6 +451,7 @@ LockedWindowProc( SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pgContext); pgContext->hBitmap = LoadImage(hDllInstance, MAKEINTRESOURCE(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); + OnInitLockedDlg(hwndDlg, pgContext, IDC_LOCKMSG); return TRUE; } case WM_PAINT: @@ -462,11 +481,9 @@ static VOID GUIDisplayLockedNotice( IN OUT PGINA_CONTEXT pgContext) { - int result; - TRACE("GUIdisplayLockedNotice()\n"); - result = pgContext->pWlxFuncs->WlxDialogBoxParam( + pgContext->pWlxFuncs->WlxDialogBoxParam( pgContext->hWlx, pgContext->hDllInstance, MAKEINTRESOURCEW(IDD_LOCKED_DLG), diff --git a/reactos/dll/win32/msgina/lang/de-DE.rc b/reactos/dll/win32/msgina/lang/de-DE.rc index 197dfa2f0aa..ed6d2eace15 100644 --- a/reactos/dll/win32/msgina/lang/de-DE.rc +++ b/reactos/dll/win32/msgina/lang/de-DE.rc @@ -54,7 +54,7 @@ FONT 8,"MS Shell Dlg",400,0,1 BEGIN CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,54 ICON IDI_LOCKICON,-1,7,59,20,20 - LTEXT "Dieser Computer wird verwndet und ist gesperrt.",IDC_STATIC,37,61,231,8 + LTEXT "Dieser Computer wird verwendet und ist gesperrt.",IDC_STATIC,37,61,231,8 LTEXT "Message",IDC_LOCKMSG,37,75,231,26 LTEXT "Drücken Sie Strg+Alt+Entf um den Computer zu entsperren.",IDC_STATIC,37,106,231,8 END diff --git a/reactos/dll/win32/msgina/msgina.c b/reactos/dll/win32/msgina/msgina.c index 53cd4dfeaac..e392271a20e 100644 --- a/reactos/dll/win32/msgina/msgina.c +++ b/reactos/dll/win32/msgina/msgina.c @@ -416,6 +416,7 @@ DoLoginTasks( TOKEN_STATISTICS Stats; PWLX_PROFILE_V2_0 pProfile = NULL; DWORD cbStats, cbSize; + DWORD dwLength; BOOL bResult; if (!LogonUserW(UserName, Domain, Password, @@ -427,6 +428,18 @@ DoLoginTasks( goto cleanup; } + /* Store user and domain in the context */ + wcscpy(pgContext->UserName, UserName); + if (Domain == NULL || wcslen(Domain) == 0) + { + dwLength = 256; + GetComputerNameW(pgContext->Domain, &dwLength); + } + else + { + wcscpy(pgContext->Domain, Domain); + } + /* Get profile path */ cbSize = 0; bResult = GetProfilesDirectoryW(NULL, &cbSize); @@ -456,13 +469,15 @@ DoLoginTasks( pProfile->dwType = WLX_PROFILE_TYPE_V2_0; pProfile->pszProfile = ProfilePath; - lpEnvironment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 32 * sizeof(WCHAR)); + lpEnvironment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + (wcslen(pgContext->Domain)+ 14) * sizeof(WCHAR)); if (!lpEnvironment) { WARN("HeapAlloc() failed\n"); goto cleanup; } - wcscpy(lpEnvironment, L"LOGONSERVER=\\\\Test"); + + wsprintfW(lpEnvironment, L"LOGONSERVER=\\\\%s", pgContext->Domain); pProfile->pszEnvironment = lpEnvironment; diff --git a/reactos/dll/win32/msgina/msgina.h b/reactos/dll/win32/msgina/msgina.h index 775a1b362cb..b4fe73b0775 100644 --- a/reactos/dll/win32/msgina/msgina.h +++ b/reactos/dll/win32/msgina/msgina.h @@ -29,6 +29,8 @@ typedef struct DWORD AutoLogonState; /* Informations to be filled during logon */ + WCHAR UserName[256]; + WCHAR Domain[256]; HANDLE UserToken; PLUID pAuthenticationId; PDWORD pdwOptions;