2021-02-26 20:46:07 -08:00
|
|
|
From 4508defd1c20893e534824ea07821912745175a8 Mon Sep 17 00:00:00 2001
|
2020-10-14 00:14:26 -07:00
|
|
|
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
|
|
|
Date: Tue, 13 Oct 2020 18:19:17 +0200
|
2021-02-26 20:46:07 -08:00
|
|
|
Subject: [PATCH] windows.globalization: Implement
|
2020-10-14 00:14:26 -07:00
|
|
|
IGlobalizationPreferencesStatics::HomeGeographicRegion semi-stub.
|
|
|
|
|
|
|
|
Returning the system default country.
|
|
|
|
---
|
|
|
|
.../windows.globalization_main.c | 18 ++++++++++++++++--
|
|
|
|
1 file changed, 16 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/dlls/windows.globalization.dll/windows.globalization_main.c b/dlls/windows.globalization.dll/windows.globalization_main.c
|
2021-02-26 20:46:07 -08:00
|
|
|
index 5bb0b46866d..83e269bead6 100644
|
2020-10-14 00:14:26 -07:00
|
|
|
--- a/dlls/windows.globalization.dll/windows.globalization_main.c
|
|
|
|
+++ b/dlls/windows.globalization.dll/windows.globalization_main.c
|
2021-02-26 20:46:07 -08:00
|
|
|
@@ -133,8 +133,22 @@ static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Languages(IGlobal
|
2020-10-14 00:14:26 -07:00
|
|
|
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_HomeGeographicRegion(IGlobalizationPreferencesStatics *iface,
|
|
|
|
HSTRING* value)
|
|
|
|
{
|
|
|
|
- FIXME("iface %p, value %p stub!\n", iface, value);
|
|
|
|
- return E_NOTIMPL;
|
|
|
|
+ UINT32 length;
|
|
|
|
+ WCHAR locale_w[LOCALE_NAME_MAX_LENGTH], *tmp;
|
|
|
|
+ const WCHAR *country;
|
|
|
|
+
|
|
|
|
+ TRACE("iface %p, value %p stub!\n", iface, value);
|
|
|
|
+
|
|
|
|
+ GetSystemDefaultLocaleName(locale_w, LOCALE_NAME_MAX_LENGTH);
|
|
|
|
+
|
|
|
|
+ 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;
|
|
|
|
+ length = wcslen(country);
|
|
|
|
+
|
|
|
|
+ TRACE("returning country %s\n", debugstr_w(country));
|
|
|
|
+
|
|
|
|
+ return WindowsCreateString(country, length, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_WeekStartsOn(IGlobalizationPreferencesStatics *iface,
|
|
|
|
--
|
2021-02-26 20:46:07 -08:00
|
|
|
2.20.1
|
2020-10-14 00:14:26 -07:00
|
|
|
|