Author: ekohl
Date: Fri Dec 18 21:36:16 2015
New Revision: 70398
URL:
http://svn.reactos.org/svn/reactos?rev=70398&view=rev
Log:
[USETUP]
Set the default user locale after registry setup.
#CORE-5989 #comment Please retest!
Modified:
trunk/reactos/base/setup/usetup/settings.c
Modified: trunk/reactos/base/setup/usetup/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/settings…
==============================================================================
--- trunk/reactos/base/setup/usetup/settings.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/settings.c [iso-8859-1] Fri Dec 18 21:36:16 2015
@@ -811,6 +811,43 @@
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;