https://bugs.winehq.org/show_bug.cgi?id=54585
Bug ID: 54585 Summary: kernel32:locale - test_geo_name() fails on Windows 11 Product: Wine Version: unspecified Hardware: x86-64 OS: Windows Status: NEW Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com
kernel32:locale - test_geo_name() fails on Windows 11:
locale.c:8076: Test failed: Got unexpected name L"US". locale.c:8095: Test failed: Got unexpected ret 3, GetLastError() 3735928559. locale.c:8096: Test failed: Got unexpected name L"US". locale.c:8103: Test failed: Got unexpected name L"QQ". locale.c:8123: Test failed: Got unexpected ret 3, GetLastError() 3735928559. locale.c:8125: Test failed: Got unexpected name L"AR". locale.c:8145: Test failed: Got unexpected ret 3, GetLastError() 3735928559. locale.c:8146: Test failed: Got unexpected name L"XX". locale.c:8153: Test failed: Got unexpected name L"XX".
See https://test.winehq.org/data/patterns.html#kernel32:locale
It looks like the first failing test attempts to prove one can set the GeoName to invalid values by setting the registry directly (whereas one would get an error if attempting the same through SetUserGeoName()). But on Windows 11 that loophole does not work.
The "AR" failing test appears to be when we set the GeoName to a numeric code, 150, and expect to get that code back from GetUserDefaultGeoName(), but instead get the actual name, AR.
These two failures seem to indicate that Windows 11 looks up the (registry) GeoName in its database (see EnumSystemGeoNames()) so as to always return an actual name instead of a numeric code. And if that lookup fails it falls back to "US", or something based off of one of the current locales (system, thread or whatever).