[PATCH v2 2/3] kernel32: Make GetUserGeoID() always succeed if geoclass is valid.

João Diogo Ferreira devilj at outlook.pt
Mon Dec 2 15:44:57 CST 2019


Forgot the bug line.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46196
(Partial fix: fixes the crashing, but not the country flag in the UI.)

A segunda-feira, 2 de dezembro de 2019 21:39:52 WET João Diogo Ferreira escreveu:
> When a GeoID for the requested class is not yet set, Windows 10 v1709+
> returns 39070 ("World") as default.
> This means that native Win32 applications can no longer be reliably
> tested against GEOID_NOT_AVAILABLE, leading to bugs when running them
> under Wine.
> 
> While it's true that we're going to set the ID automatically anyway,
> we only set one of the classes depending on the locale.
> This patch makes sure every class returns a good GeoID in all cases.
> 
> Signed-off-by: João Diogo Craveiro Ferreira <devilj at outlook.pt>
> ---
> This is for a single edge case and I don't know if it'll ever happen.
> ---
>  dlls/kernel32/locale.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
> index 7d79cee0c3..52b9a53a80 100644
> --- a/dlls/kernel32/locale.c
> +++ b/dlls/kernel32/locale.c
> @@ -2812,7 +2812,7 @@ static const struct geoinfo_t *get_geoinfo_dataptr(GEOID geoid)
>   */
>  GEOID WINAPI GetUserGeoID(GEOCLASS geoclass)
>  {
> -    GEOID ret = GEOID_NOT_AVAILABLE;
> +    GEOID ret = 39070;
>      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};
> @@ -2833,7 +2833,7 @@ GEOID WINAPI GetUserGeoID(GEOCLASS geoclass)
>          break;
>      default:
>          WARN("Unknown geoclass %d\n", geoclass);
> -        return ret;
> +        return GEOID_NOT_AVAILABLE;
>      }
>  
>      if (!(hkey = create_registry_key())) return ret;
> -- 
> 2.24.0
> 
> 







More information about the wine-devel mailing list