[PATCH] kernel32: Always return a good GeoID from GetUserGeoID() if arguments are sane.

João Diogo Ferreira devilj at outlook.pt
Thu Oct 24 09:22:23 CDT 2019


PARTIALLY FIXES BUG #46196: Prevents the game from crashing,
but the country flag is still wrong without manual configuration by the user.
https://bugs.winehq.org/show_bug.cgi?id=46196

This behaviour is 100% identical to Windows 10 v1903 (probably since v1709
but I didn't check that far).

39070 is the neutral "World" GeoID.

Signed-off-by: João Diogo Craveiro Ferreira <devilj at outlook.pt>
---
 dlls/kernel32/locale.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index c690aa8d5e..ce13db3369 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -3648,7 +3648,7 @@ BOOL WINAPI InvalidateNLSCache(void)
  */
 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};
     WCHAR bufferW[40], *end;
@@ -3671,8 +3671,11 @@ GEOID WINAPI GetUserGeoID( GEOCLASS GeoClass )
         }
         break;
     case GEOCLASS_REGION:
-        FIXME("GEOCLASS_REGION not handled yet\n");
+        FIXME("GEOCLASS_REGION not handled yet, returning default: 39070\n");
         break;
+    default:
+        WARN("Unrecognized geoclass %d\n", GeoClass);
+        ret = GEOID_NOT_AVAILABLE;
     }
 
     NtClose(hkey);
-- 
2.23.0



More information about the wine-devel mailing list