[PATCH v4 6/7] kernel32: Autoinitialize geographic values when launching any program.
We ask Wine for the country code of the current locale and then set it with SetUserGeoName(). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46196 Signed-off-by: João Diogo Craveiro Ferreira <devilj(a)outlook.pt> --- Supersedes: 172358 V4: Removed opt-out mechanism. --- dlls/kernel32/kernel_main.c | 3 +++ dlls/kernel32/kernel_private.h | 1 + dlls/kernel32/locale.c | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/dlls/kernel32/kernel_main.c b/dlls/kernel32/kernel_main.c index dfa66f0295..206972c210 100644 --- a/dlls/kernel32/kernel_main.c +++ b/dlls/kernel32/kernel_main.c @@ -88,6 +88,9 @@ static BOOL process_attach( HMODULE module ) /* Setup registry locale information */ LOCALE_InitRegistry(); + /* Setup registry geographic information */ + LOCALE_InitGeo(); + /* Setup registry timezone information */ TIMEZONE_InitRegistry(); diff --git a/dlls/kernel32/kernel_private.h b/dlls/kernel32/kernel_private.h index af85bee84d..6b93add056 100644 --- a/dlls/kernel32/kernel_private.h +++ b/dlls/kernel32/kernel_private.h @@ -76,6 +76,7 @@ extern void COMPUTERNAME_Init(void) DECLSPEC_HIDDEN; /* locale.c */ extern void LOCALE_Init(void) DECLSPEC_HIDDEN; extern void LOCALE_InitRegistry(void) DECLSPEC_HIDDEN; +extern void LOCALE_InitGeo(void) DECLSPEC_HIDDEN; /* time.c */ extern void TIMEZONE_InitRegistry(void) DECLSPEC_HIDDEN; diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 7d481a2a48..4d5a0880ad 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -846,6 +846,22 @@ void LOCALE_InitRegistry(void) NtClose( hkey ); } +/* Initialize the geographic information in the registry. */ +void LOCALE_InitGeo(void) +{ + WCHAR name[4]; + static WCHAR fallback[] = {'0','0','1',0}; /* World */ + int result; + + TRACE("Initializing geographic data...\n"); + if ((result = GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_SISO3166CTRYNAME, + name, ARRAY_SIZE(name)))) + result = SetUserGeoName(name); + + if (!result) + SetUserGeoName(fallback); + TRACE("Finished initializing geographic data.\n"); +} #ifdef __APPLE__ /*********************************************************************** -- 2.23.0
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58790 Your paranoid android. === debian10 (64 bit WoW report) === kernel32: debugger: Timeout
participants (2)
-
João Diogo Ferreira -
Marvin