Set the default user locale after registry setup.
#CORE-5989 #comment Please retest!

svn path=/trunk/; revision=70398
This commit is contained in:
Eric Kohl 2015-12-18 21:36:16 +00:00
parent 5570ee8746
commit 13fbf3250a

View file

@ -811,6 +811,43 @@ ProcessLocaleRegistry(
if (LanguageId == NULL)
return FALSE;
DPRINT("LanguageId: %S\n", LanguageId);
/* Open the default users locale key */
RtlInitUnicodeString(&KeyName,
L"\\Registry\\User\\.DEFAULT\\Control Panel\\International");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtOpenKey(&KeyHandle,
KEY_SET_VALUE,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
return FALSE;
}
/* Set default user locale */
RtlInitUnicodeString(&ValueName,
L"Locale");
Status = NtSetValueKey(KeyHandle,
&ValueName,
0,
REG_SZ,
(PVOID)LanguageId,
(wcslen(LanguageId) + 1) * sizeof(WCHAR));
NtClose(KeyHandle);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
return FALSE;
}
/* Skip first 4 zeroes */
if (wcslen(LanguageId) >= 4)
LanguageId += 4;