Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46196 Signed-off-by: João Diogo Craveiro Ferreira devilj@outlook.pt --- V8: Use a fallback in case we don't get the right nation ID. Supersedes: 173826 --- dlls/kernel32/kernel_main.c | 3 +++ dlls/kernel32/kernel_private.h | 1 + dlls/kernel32/locale.c | 12 ++++++++++++ 3 files changed, 16 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 cd6c63efa3..e9f5f51029 100644 --- a/dlls/kernel32/kernel_private.h +++ b/dlls/kernel32/kernel_private.h @@ -75,6 +75,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 0f91728e84..208c792e39 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -845,6 +845,18 @@ void LOCALE_InitRegistry(void) NtClose( hkey ); }
+/* Initialize the geographic information in the registry. */ +void LOCALE_InitGeo(void) +{ + GEOID id = GEOID_NOT_AVAILABLE; + static const GEOID fallback = 244; /* United States */ + + GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_IGEOID|LOCALE_RETURN_NUMBER, + (WCHAR *)&id, sizeof(id) / sizeof(WCHAR)); + + if (!SetUserGeoID(id) || GetUserGeoID(GEOCLASS_NATION) == GEOID_NOT_AVAILABLE) + SetUserGeoID(fallback); +}
#ifdef __APPLE__ /***********************************************************************
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=60414
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: debugger.c:320: Test failed: GetThreadContext failed: 5 loader.c:3909: Test failed: kernel32.dll:2: wrong OptionalHeader.DataDirectory[i].Size 1b7ca8 / 1b78b8
=== debian10 (32 bit Chinese:China report) ===
kernel32: comm.c:919: Test failed: OutQueue should not be empty debugger.c:320: Test failed: GetThreadContext failed: 5 loader.c:3909: Test failed: kernel32.dll:2: wrong OptionalHeader.DataDirectory[i].Size 1b7ca8 / 1b78b8
=== debian10 (32 bit WoW report) ===
kernel32: loader.c:3909: Test failed: kernel32.dll:2: wrong OptionalHeader.DataDirectory[i].Size 1b7ca8 / 1b78b8
=== debian10 (64 bit WoW report) ===
kernel32: debugger: Timeout loader.c:3909: Test failed: kernel32.dll:2: wrong OptionalHeader.DataDirectory[i].Size 1b7ca8 / 1b78b8