- 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
This commit is contained in:
Eric Kohl 2013-02-17 01:06:24 +00:00
parent ebaac9c9e5
commit c7e70b81fa
4 changed files with 40 additions and 6 deletions

View file

@ -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),

View file

@ -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

View file

@ -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;

View file

@ -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;