[SYSSETUP] WriteUserLocale(): Fix Locale[] length and value (#8090)

'Locale' format is "0000nnnn".

CORE-15848
This commit is contained in:
Serge Gautherie
2025-06-08 16:05:22 +02:00
committed by GitHub
parent 6128c20937
commit 076f08cb3e
+2 -2
View File
@@ -1455,11 +1455,11 @@ WriteUserLocale(VOID)
{
HKEY hKey;
LCID lcid;
WCHAR Locale[12];
WCHAR Locale[9] = L"0000";
lcid = GetSystemDefaultLCID();
if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, Locale, ARRAYSIZE(Locale)) != 0)
if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, &Locale[4], _countof(Locale) - 4) != 0)
{
if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Control Panel\\International",
0, NULL, REG_OPTION_NON_VOLATILE,