mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:52:54 +00:00
[USETUP]
Set the default user locale after registry setup. #CORE-5989 #comment Please retest! svn path=/trunk/; revision=70398
This commit is contained in:
parent
5570ee8746
commit
13fbf3250a
1 changed files with 37 additions and 0 deletions
|
@ -811,6 +811,43 @@ ProcessLocaleRegistry(
|
||||||
if (LanguageId == NULL)
|
if (LanguageId == NULL)
|
||||||
return FALSE;
|
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 */
|
/* Skip first 4 zeroes */
|
||||||
if (wcslen(LanguageId) >= 4)
|
if (wcslen(LanguageId) >= 4)
|
||||||
LanguageId += 4;
|
LanguageId += 4;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue