From c30626505b2782decc1370f9f60b82ebfd9f7c8f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 1 Apr 2022 16:00:46 +0200 Subject: [PATCH] kernelbase: Check the locale name instead of the LCID to detect changes. Signed-off-by: Alexandre Julliard --- dlls/kernelbase/locale.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 4f0957ceff6..6bfa9604806 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -1543,6 +1543,7 @@ void init_locale( HMODULE module ) void *sort_ptr; WCHAR bufferW[LOCALE_NAME_MAX_LENGTH]; DYNAMIC_TIME_ZONE_INFORMATION timezone; + const WCHAR *user_locale_name; DWORD count; SIZE_T size; HKEY hkey; @@ -1621,13 +1622,15 @@ void init_locale( HMODULE module ) /* Update registry contents if the user locale has changed. * This simulates the action of the Windows control panel. */ + user_locale_name = locale_strings + user_locale->sname + 1; count = sizeof(bufferW); - if (!RegQueryValueExW( intl_key, L"Locale", NULL, NULL, (BYTE *)bufferW, &count )) + if (!RegQueryValueExW( intl_key, L"LocaleName", NULL, NULL, (BYTE *)bufferW, &count )) { - if (wcstoul( bufferW, NULL, 16 ) == user_lcid) return; /* already set correctly */ - TRACE( "updating registry, locale changed %s -> %08lx\n", debugstr_w(bufferW), user_lcid ); + if (!wcscmp( bufferW, user_locale_name )) return; /* unchanged */ + TRACE( "updating registry, locale changed %s -> %s\n", + debugstr_w(bufferW), debugstr_w(user_locale_name) ); } - else TRACE( "updating registry, locale changed none -> %08lx\n", user_lcid ); + else TRACE( "updating registry, locale changed none -> %s\n", debugstr_w(user_locale_name) ); update_locale_registry();