[PATCH 3/5] windows.globalization: Implement IGlobalizationPreferencesStatics::HomeGeographicRegion.
Rémi Bernon
rbernon at codeweavers.com
Wed Mar 24 12:39:39 CDT 2021
On 3/24/21 4:52 PM, Jacek Caban wrote:
> On 24.03.2021 11:32, Rémi Bernon wrote:
>> diff --git a/dlls/windows.globalization/main.c
>> b/dlls/windows.globalization/main.c
>> index 17bb49a1c4e..914fde0eff6 100644
>> --- a/dlls/windows.globalization/main.c
>> +++ b/dlls/windows.globalization/main.c
>> @@ -225,8 +225,20 @@ static HRESULT STDMETHODCALLTYPE
>> globalization_preferences_get_Languages(
>> static HRESULT STDMETHODCALLTYPE
>> globalization_preferences_get_HomeGeographicRegion(
>> IGlobalizationPreferencesStatics*iface, HSTRING* out)
>> {
>> - FIXME("iface %p, out %p stub!\n", iface, out);
>> - return E_NOTIMPL;
>> + WCHAR locale_w[LOCALE_NAME_MAX_LENGTH], *tmp;
>> + const WCHAR *country;
>> +
>> + TRACE("iface %p, out %p.\n", iface, out);
>> +
>> + GetUserDefaultLocaleName(locale_w, LOCALE_NAME_MAX_LENGTH);
>
>
> Shouldn't it use GetUserDefaultGeoName?
>
Ah maybe I didn't know there was a function to get that directly, thanks.
>
>> +
>> + if ((tmp = wcsrchr(locale_w, '_'))) *tmp = 0;
>> + if (!(tmp = wcschr(locale_w, '-')) || (wcslen(tmp) > 3 && !(tmp =
>> wcschr(tmp + 1, '-')))) country = L"US";
>> + else country = tmp + 1;
>
> country is uninitialized in else case.
>
Hm, I'm not sure to see how? It's set to point to the char after the
first '-', or the second '-' if the country code is longer than 2 chars.
In we fail any of these, it defaults to "US".
Do you mean if GetUserDefaultLocaleName fails?
>
> Thanks,
>
> Jacek
>
--
Rémi Bernon <rbernon at codeweavers.com>
More information about the wine-devel
mailing list