In Windows 10, with the changes introduced in v1709, this function now always returns a good GeoID if the provided geoclass is valid. If that class didn't have a GeoID set yet, it now returns 39070, which is the ID for the very neutral "World" region.
This behaviour matches Windows 10 v1709-v1909 and also prevents at least one game from crashing.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46196 (partial fix: game no longer crashes.)
Signed-off-by: João Diogo Craveiro Ferreira devilj@outlook.pt --- Supersedes: 172517 V5: (no changes.) --- dlls/kernel32/locale.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 8c7099e99e..7a6d05c968 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -4097,10 +4097,14 @@ static inline const struct geoinfo_t *get_geoinfoptr_by_name(const WCHAR *name) * RETURNS * SUCCESS: The ID of the specified geographic class. * FAILURE: GEOID_NOT_AVAILABLE. + * + * NOTES + * This function only fails if the specified geoclass is invalid; + * otherwise, a valid GeoID will always be returned. */ GEOID WINAPI GetUserGeoID(GEOCLASS geoclass) { - GEOID ret = GEOID_NOT_AVAILABLE; + GEOID ret = 39070; /* World */ static const WCHAR geoW[] = {'G','e','o',0}; static const WCHAR nationW[] = {'N','a','t','i','o','n',0}; static const WCHAR regionW[] = {'R','e','g','i','o','n',0}; @@ -4124,7 +4128,7 @@ GEOID WINAPI GetUserGeoID(GEOCLASS geoclass) else { WARN("Unknown geoclass %d\n", geoclass); - return ret; + return GEOID_NOT_AVAILABLE; }
if (!(hkey = create_registry_key())) return ret;
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=59516
Your paranoid android.
=== debian10 (32 bit WoW report) ===
kernel32: comm.c:919: Test failed: OutQueue should not be empty debugger.c:320: Test failed: GetThreadContext failed: 5
=== debian10 (64 bit WoW report) ===
kernel32: debugger: Timeout