kernelbase: Update GeoID when locale has changed.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46196 Signed-off-by: João Diogo Craveiro Ferreira <devilj@outlook.pt> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a31dec5fa9
commit
7b1b0ce506
|
@ -239,7 +239,8 @@ void init_locale(void)
|
||||||
USHORT *ansi_ptr, *oem_ptr, *casemap_ptr;
|
USHORT *ansi_ptr, *oem_ptr, *casemap_ptr;
|
||||||
LCID lcid = GetUserDefaultLCID();
|
LCID lcid = GetUserDefaultLCID();
|
||||||
WCHAR bufferW[80];
|
WCHAR bufferW[80];
|
||||||
DWORD count, i;
|
GEOID geoid = GEOID_NOT_AVAILABLE;
|
||||||
|
DWORD count, dispos, i;
|
||||||
SIZE_T size;
|
SIZE_T size;
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
|
|
||||||
|
@ -268,6 +269,17 @@ void init_locale(void)
|
||||||
RegCreateKeyExW( HKEY_CURRENT_USER, L"Control Panel\\International",
|
RegCreateKeyExW( HKEY_CURRENT_USER, L"Control Panel\\International",
|
||||||
0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &intl_key, NULL );
|
0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &intl_key, NULL );
|
||||||
|
|
||||||
|
if (!RegCreateKeyExW( intl_key, L"Geo", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, &dispos ))
|
||||||
|
{
|
||||||
|
if (dispos == REG_CREATED_NEW_KEY)
|
||||||
|
{
|
||||||
|
GetLocaleInfoW( LOCALE_USER_DEFAULT, LOCALE_IGEOID | LOCALE_RETURN_NUMBER,
|
||||||
|
(WCHAR *)&geoid, sizeof(geoid) / sizeof(WCHAR) );
|
||||||
|
SetUserGeoID( geoid );
|
||||||
|
}
|
||||||
|
RegCloseKey( hkey );
|
||||||
|
}
|
||||||
|
|
||||||
/* Update registry contents if the user locale has changed.
|
/* Update registry contents if the user locale has changed.
|
||||||
* This simulates the action of the Windows control panel. */
|
* This simulates the action of the Windows control panel. */
|
||||||
|
|
||||||
|
@ -290,6 +302,13 @@ void init_locale(void)
|
||||||
(BYTE *)bufferW, (lstrlenW(bufferW) + 1) * sizeof(WCHAR) );
|
(BYTE *)bufferW, (lstrlenW(bufferW) + 1) * sizeof(WCHAR) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (geoid == GEOID_NOT_AVAILABLE)
|
||||||
|
{
|
||||||
|
GetLocaleInfoW( LOCALE_USER_DEFAULT, LOCALE_IGEOID | LOCALE_RETURN_NUMBER,
|
||||||
|
(WCHAR *)&geoid, sizeof(geoid) / sizeof(WCHAR) );
|
||||||
|
SetUserGeoID( geoid );
|
||||||
|
}
|
||||||
|
|
||||||
if (!RegCreateKeyExW( nls_key, L"Codepage",
|
if (!RegCreateKeyExW( nls_key, L"Codepage",
|
||||||
0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL ))
|
0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL ))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue