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 --- Supersedes: 171984 --- dlls/kernel32/locale.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index abb3ecd773..e9d46949d1 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -4090,6 +4090,19 @@ 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) { @@ -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;
I lost a change here during a rebase and the patch just wasn't doing what it said on the tin. Fixed in v3.
My apologies, once again.
(I will not rebase late at night.) (I will not rebase late at night.) (I will not rebase late at night.) (I will not...)
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=58697
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
kernel32: change.c:320: Test failed: should be ready comm.c:919: Test failed: OutQueue should not be empty
=== debian10 (32 bit WoW report) ===
kernel32: debugger: Timeout
=== debian10 (64 bit WoW report) ===
kernel32: debugger: Timeout