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, this will return 39070, which is the ID for the very neutral "World" region.
This behaviour also helps prevent bugs with at least one app.
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 --- V3: Actually do what's advertised. Supersedes: 171984 --- dlls/kernel32/locale.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index abb3ecd773..f061b893e1 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -4090,10 +4090,23 @@ static inline const struct geoinfo_t *get_geoinfoptr_by_name(const WCHAR *name)
/****************************************************************************** * GetUserGeoID (KERNEL32.@) + * + * Retrieves the ID of the user's geographic nation or region. + * + * PARAMS + * GeoClass [I] One of GEOCLASS_NATION or GEOCLASS_REGION (SYSGEOCLASS enum from "winnls.h"). + * + * RETURNS + * SUCCESS: The ID of the specified geographic class. + * FAILURE: GEOID_NOT_AVAILABLE. + * + * NOTES + * This function only fails if the geoclass specified is invalid; + * otherwise, a valid GeoID is always returned. */ GEOID WINAPI GetUserGeoID(GEOCLASS geoclass) { - GEOID ret = GEOID_NOT_AVAILABLE; + GEOID ret = 39070; /* World */ static const WCHAR nationW[] = {'N','a','t','i','o','n',0}; static const WCHAR regionW[] = {'R','e','g','i','o','n',0}; WCHAR bufferW[40], *end; @@ -4116,7 +4129,7 @@ GEOID WINAPI GetUserGeoID(GEOCLASS geoclass) else { WARN("Unknown geoclass %d\n", geoclass); - return ret; + return GEOID_NOT_AVAILABLE; }
if (!(hkey = create_geo_regkey())) 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=58785
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/kernel32/locale.c:3994 error: patch failed: dlls/kernel32/locale.c:4141 error: patch failed: dlls/kernel32/locale.c:4090 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/kernel32/locale.c:3994 error: patch failed: dlls/kernel32/locale.c:4141 error: patch failed: dlls/kernel32/locale.c:4090 Task: Patch failed to apply
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=58788
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/kernel32/locale.c:4090 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/kernel32/locale.c:4090 Task: Patch failed to apply