Updated windows.globalization-dll patchset

This commit is contained in:
Alistair Leslie-Hughes 2020-10-14 18:14:26 +11:00
parent fbf364bce9
commit 2d12fd01d7
7 changed files with 672 additions and 482 deletions

View File

@ -270,6 +270,7 @@ patch_enable_all ()
enable_widl_SLTG_Typelib_Support="$1"
enable_widl_winrt_support="$1"
enable_windows_gaming_input_dll="$1"
enable_windows_globalization_dll="$1"
enable_windows_media_speech_dll="$1"
enable_windowscodecs_GIF_Encoder="$1"
enable_windowscodecs_TIFF_Support="$1"
@ -898,6 +899,9 @@ patch_enable ()
windows.gaming.input-dll)
enable_windows_gaming_input_dll="$2"
;;
windows.globalization-dll)
enable_windows_globalization_dll="$2"
;;
windows.media.speech.dll)
enable_windows_media_speech_dll="$2"
;;
@ -1451,6 +1455,13 @@ if test "$enable_wineboot_ProxySettings" -eq 1; then
enable_wineboot_drivers_etc_Stubs=1
fi
if test "$enable_windows_globalization_dll" -eq 1; then
if test "$enable_windows_gaming_input_dll" -gt 1; then
abort "Patchset windows.gaming.input-dll disabled, but windows.globalization-dll depends on that."
fi
enable_windows_gaming_input_dll=1
fi
if test "$enable_windows_gaming_input_dll" -eq 1; then
if test "$enable_windows_media_speech_dll" -gt 1; then
abort "Patchset windows.media.speech.dll disabled, but windows.gaming.input-dll depends on that."
@ -4408,6 +4419,28 @@ if test "$enable_windows_gaming_input_dll" -eq 1; then
patch_apply windows.gaming.input-dll/0009-windows.gaming.input-Fake-IEventHandler_RawGameContr.patch
fi
# Patchset windows.globalization-dll
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * widl-winrt-support, windows.media.speech.dll, windows.gaming.input-dll
# |
# | This patchset fixes the following Wine bugs:
# | * [#49740] windows.globalization: New DLL
# | * [#49998] windows.globalization: New DLL
# |
# | Modified files:
# | * configure.ac, dlls/windows.globalization.dll/Makefile.in, dlls/windows.globalization.dll/windows.globalization.spec,
# | dlls/windows.globalization.dll/windows.globalization_main.c, include/Makefile.in, include/windows.globalization.idl,
# | include/windows.system.userprofile.idl, loader/wine.inf.in
# |
if test "$enable_windows_globalization_dll" -eq 1; then
patch_apply windows.globalization-dll/0001-windows.globalization-Add-stub-dll.patch
patch_apply windows.globalization-dll/0002-windows.globalization-Implement-IGlobalizationPrefer.patch
patch_apply windows.globalization-dll/0003-windows.globalization-Implement-IGlobalizationPrefer.patch
patch_apply windows.globalization-dll/0004-windows.globalization-Implement-IGlobalizationPrefer.patch
patch_apply windows.globalization-dll/0005-windows.globalization-Fake-empty-IGlobalizationPrefe.patch
fi
# Patchset windowscodecs-GIF_Encoder
# |
# | Modified files:

View File

@ -1,27 +1,27 @@
From 636675e36ad598d6f7bab7d9444f89b1f15e3573 Mon Sep 17 00:00:00 2001
From 22add75334045f50a22d3c14f4a7d9c3ed708742 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 28 Aug 2020 15:59:50 +0200
Subject: [PATCH] windows.globalization: Add stub dll.
Subject: [PATCH 1/5] windows.globalization: Add stub dll.
---
configure.ac | 1 +
dlls/windows.globalization.dll/Makefile.in | 5 +
.../windows.globalization.spec | 3 +
.../windows.globalization_main.c | 585 ++++++++++++++++++
.../windows.globalization_main.c | 141 ++++++++++++++++++
include/Makefile.in | 1 +
include/windows.globalization.idl | 27 +
include/windows.globalization.idl | 27 ++++
loader/wine.inf.in | 1 +
7 files changed, 623 insertions(+)
7 files changed, 179 insertions(+)
create mode 100644 dlls/windows.globalization.dll/Makefile.in
create mode 100644 dlls/windows.globalization.dll/windows.globalization.spec
create mode 100644 dlls/windows.globalization.dll/windows.globalization_main.c
create mode 100644 include/windows.globalization.idl
diff --git a/configure.ac b/configure.ac
index 57b39ea7daa..110f50d762a 100644
index 3e717d5191f..187bd614387 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3895,6 +3895,7 @@ WINE_CONFIG_MAKEFILE(dlls/win87em.dll16,enable_win16)
@@ -3823,6 +3823,7 @@ WINE_CONFIG_MAKEFILE(dlls/win87em.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/winaspi.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/windebug.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/windows.gaming.input.dll)
@ -31,12 +31,12 @@ index 57b39ea7daa..110f50d762a 100644
WINE_CONFIG_MAKEFILE(dlls/windowscodecs/tests)
diff --git a/dlls/windows.globalization.dll/Makefile.in b/dlls/windows.globalization.dll/Makefile.in
new file mode 100644
index 00000000000..7ddd97aef52
index 00000000000..25dc1cac3e6
--- /dev/null
+++ b/dlls/windows.globalization.dll/Makefile.in
@@ -0,0 +1,5 @@
+MODULE = windows.globalization.dll
+IMPORTS = combase uuid
+IMPORTS = combase
+EXTRADLLFLAGS = -mno-cygwin
+C_SRCS = \
+ windows.globalization_main.c
@ -51,10 +51,10 @@ index 00000000000..721493229c2
+3 stdcall -private DllGetClassObject(ptr ptr ptr)
diff --git a/dlls/windows.globalization.dll/windows.globalization_main.c b/dlls/windows.globalization.dll/windows.globalization_main.c
new file mode 100644
index 00000000000..f29079d6a5e
index 00000000000..840ce08c0c5
--- /dev/null
+++ b/dlls/windows.globalization.dll/windows.globalization_main.c
@@ -0,0 +1,585 @@
@@ -0,0 +1,141 @@
+#include <stdarg.h>
+
+#define COBJMACROS
@ -62,14 +62,16 @@ index 00000000000..f29079d6a5e
+#include "winbase.h"
+#include "winstring.h"
+#include "wine/debug.h"
+#include "activation.h"
+#include "objbase.h"
+#include "initguid.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(locale);
+#include "initguid.h"
+#include "activation.h"
+
+#include "windows.foundation.h"
+#include "windows.globalization.h"
+#include "windows.system.userprofile.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(locale);
+
+static const char *debugstr_hstring(HSTRING hstr)
+{
@ -80,307 +82,9 @@ index 00000000000..f29079d6a5e
+ return wine_dbgstr_wn(str, len);
+}
+
+DEFINE_GUID(IID_IGlobalizationPreferencesStatics,0x01bf4326,0xed37,0x4e96,0xb0,0xe9,0xc1,0x34,0x0d,0x1e,0xa1,0x58);
+DEFINE_GUID(IID_IVectorView,0xbbe1fa4c,0xb0e3,0x4583,0xba,0xef,0x1f,0x1b,0x2e,0x48,0x3e,0x56);
+/*DEFINE_GUID(IID_IAgileObject,0x94ea2b94,0xe9cc,0x49e0,0xc0,0xff,0xee,0x64,0xca,0x8f,0x5b,0x90);*/
+DEFINE_GUID(IID_IInspectable,0xaf86e2e0,0xb12d,0x4c6a,0x9c,0x5a,0xd7,0xaa,0x65,0x10,0x1e,0x90);
+
+typedef struct IVectorView IVectorView;
+
+typedef struct IVectorViewVtbl
+{
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IVectorView *This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IVectorView *This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IVectorView *This);
+
+ /*** IInspectable methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetIids)(
+ IVectorView *This,
+ ULONG *iidCount,
+ IID **iids);
+
+ HRESULT (STDMETHODCALLTYPE *GetRuntimeClassName)(
+ IVectorView *This,
+ HSTRING *className);
+
+ HRESULT (STDMETHODCALLTYPE *GetTrustLevel)(
+ IVectorView *This,
+ TrustLevel *trustLevel);
+
+ /*** IVectorView<T> methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetAt)(
+ IVectorView *This,
+ ULONG index,
+ /* T */ void **out_value);
+
+ HRESULT (STDMETHODCALLTYPE *get_Size)(
+ IVectorView *This,
+ ULONG *out_value);
+
+ HRESULT (STDMETHODCALLTYPE *IndexOf)(
+ IVectorView *This,
+ /* T */ void *value,
+ ULONG *index,
+ BOOLEAN *out_value);
+
+ HRESULT (STDMETHODCALLTYPE *GetMany)(
+ IVectorView *This,
+ ULONG start_index,
+ /* T[] */ void **items,
+ UINT *out_value);
+} IVectorViewVtbl;
+
+struct IVectorView
+{
+ CONST_VTBL IVectorViewVtbl* lpVtbl;
+};
+
+struct hstring_vector
+{
+ IVectorView IVectorView_iface;
+ LONG ref;
+
+ ULONG count;
+ HSTRING values[0];
+};
+
+static inline struct hstring_vector *impl_from_IVectorView(IVectorView *iface)
+{
+ return CONTAINING_RECORD(iface, struct hstring_vector, IVectorView_iface);
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_QueryInterface(
+ IVectorView *iface, REFIID iid, void **out)
+{
+ struct hstring_vector *This = impl_from_IVectorView(iface);
+
+ FIXME("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
+
+ if (!out) return E_INVALIDARG;
+
+ *out = NULL;
+ if (!IsEqualIID(&IID_IUnknown, iid) && !IsEqualIID(&IID_IInspectable, iid) && !IsEqualIID(&IID_IVectorView, iid))
+ {
+ FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
+ return E_NOINTERFACE;
+ }
+
+ *out = &This->IVectorView_iface;
+ IUnknown_AddRef((IUnknown *)*out);
+ return S_OK;
+}
+
+static ULONG STDMETHODCALLTYPE hstring_vector_AddRef(
+ IVectorView *iface)
+{
+ struct hstring_vector *This = impl_from_IVectorView(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+ FIXME("iface %p -> ref %u.\n", iface, ref);
+ return ref;
+}
+
+static ULONG STDMETHODCALLTYPE hstring_vector_Release(
+ IVectorView *iface)
+{
+ struct hstring_vector *This = impl_from_IVectorView(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+ FIXME("iface %p -> ref %u.\n", iface, ref);
+ if (ref == 0)
+ {
+ while (This->count--) WindowsDeleteString(This->values[This->count]);
+ HeapFree(GetProcessHeap(), 0, This);
+ }
+ return ref;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_GetIids(
+ IVectorView *iface, ULONG *iid_count, IID **iids)
+{
+ FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_GetRuntimeClassName(
+ IVectorView *iface, HSTRING *class_name)
+{
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_GetTrustLevel(
+ IVectorView *iface, TrustLevel *trust_level)
+{
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_GetAt(
+ IVectorView *iface, ULONG index, void **value)
+{
+ struct hstring_vector *This = impl_from_IVectorView(iface);
+
+ FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value);
+
+ if (index >= This->count) return E_BOUNDS;
+ return WindowsDuplicateString(This->values[index], (HSTRING *)value);
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_get_Size(
+ IVectorView *iface, ULONG *value)
+{
+ struct hstring_vector *This = impl_from_IVectorView(iface);
+
+ FIXME("iface %p, value %p stub!\n", iface, value);
+
+ *value = This->count;
+ return S_OK;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_IndexOf(
+ IVectorView *iface, void *element, ULONG *index, BOOLEAN *value)
+{
+ FIXME("iface %p, element %p, index %p, value %p stub!\n", iface, element, index, value);
+ *value = FALSE;
+ return S_OK;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_GetMany(
+ IVectorView *iface, ULONG start_index, void **items, UINT *count)
+{
+ struct hstring_vector *This = impl_from_IVectorView(iface);
+ HRESULT hr;
+ ULONG i;
+
+ FIXME("iface %p, start_index %#x, items %p, count %p stub!\n", iface, start_index, items, count);
+
+ for (i = start_index; i < This->count; ++i)
+ if (FAILED(hr = WindowsDuplicateString(This->values[i], (HSTRING *)(items + i - start_index))))
+ return hr;
+ *count = This->count - start_index;
+
+ return S_OK;
+}
+
+static const struct IVectorViewVtbl hstring_vector_vtbl =
+{
+ hstring_vector_QueryInterface,
+ hstring_vector_AddRef,
+ hstring_vector_Release,
+ /* IInspectable methods */
+ hstring_vector_GetIids,
+ hstring_vector_GetRuntimeClassName,
+ hstring_vector_GetTrustLevel,
+ /*** IVectorView<T> methods ***/
+ hstring_vector_GetAt,
+ hstring_vector_get_Size,
+ hstring_vector_IndexOf,
+ hstring_vector_GetMany,
+};
+
+static HRESULT hstring_vector_create(HSTRING *values, SIZE_T count, IVectorView **out)
+{
+ struct hstring_vector *This;
+
+ if (!(This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This) + count * sizeof(HSTRING)))) return E_OUTOFMEMORY;
+ This->ref = 1;
+
+ This->IVectorView_iface.lpVtbl = &hstring_vector_vtbl;
+ This->count = count;
+ memcpy(This->values, values, count * sizeof(HSTRING));
+
+ *out = &This->IVectorView_iface;
+ return S_OK;
+}
+
+typedef enum DayOfWeek
+{
+ DayOfWeek_Sunday = 0,
+ DayOfWeek_Monday = 1,
+ DayOfWeek_Tuesday = 2,
+ DayOfWeek_Wednesday = 3,
+ DayOfWeek_Thursday = 4,
+ DayOfWeek_Friday = 5,
+ DayOfWeek_Saturday = 6
+} DayOfWeek;
+
+typedef struct IGlobalizationPreferencesStatics IGlobalizationPreferencesStatics;
+
+typedef struct IGlobalizationPreferencesStaticsVtbl
+{
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IGlobalizationPreferencesStatics *This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IGlobalizationPreferencesStatics *This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IGlobalizationPreferencesStatics *This);
+
+ /*** IInspectable methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetIids)(
+ IGlobalizationPreferencesStatics *This,
+ ULONG *iidCount,
+ IID **iids);
+
+ HRESULT (STDMETHODCALLTYPE *GetRuntimeClassName)(
+ IGlobalizationPreferencesStatics *This,
+ HSTRING *className);
+
+ HRESULT (STDMETHODCALLTYPE *GetTrustLevel)(
+ IGlobalizationPreferencesStatics *This,
+ TrustLevel *trustLevel);
+
+ /*** IGlobalizationPreferencesStatics methods ***/
+
+ HRESULT (STDMETHODCALLTYPE *get_Calendars)(
+ IGlobalizationPreferencesStatics *This,
+ /* Windows.Foundation.Collections.IVectorView<HSTRING>** */
+ void **value);
+ HRESULT (STDMETHODCALLTYPE *get_Clocks)(
+ IGlobalizationPreferencesStatics *This,
+ /* Windows.Foundation.Collections.IVectorView<HSTRING>** */
+ void **value);
+ HRESULT (STDMETHODCALLTYPE *get_Currencies)(
+ IGlobalizationPreferencesStatics *This,
+ /* Windows.Foundation.Collections.IVectorView<HSTRING>** */
+ void **value);
+ HRESULT (STDMETHODCALLTYPE *get_Languages)(
+ IGlobalizationPreferencesStatics *This,
+ /* Windows.Foundation.Collections.IVectorView<HSTRING>** */
+ void **value);
+ HRESULT (STDMETHODCALLTYPE *get_HomeGeographicRegion)(
+ IGlobalizationPreferencesStatics *This,
+ HSTRING* value);
+ HRESULT (STDMETHODCALLTYPE *get_WeekStartsOn)(
+ IGlobalizationPreferencesStatics *This,
+ /* Windows.Globalization.DayOfWeek* */
+ DayOfWeek *value);
+
+ END_INTERFACE
+} IGlobalizationPreferencesStaticsVtbl;
+
+struct IGlobalizationPreferencesStatics
+{
+ CONST_VTBL IGlobalizationPreferencesStaticsVtbl* lpVtbl;
+};
+
+struct windows_globalization
+{
+ IActivationFactory IActivationFactory_iface;
+ IGlobalizationPreferencesStatics IGlobalizationPreferencesStatics_iface;
+ LONG ref;
+};
+
@ -389,170 +93,23 @@ index 00000000000..f29079d6a5e
+ return CONTAINING_RECORD(iface, struct windows_globalization, IActivationFactory_iface);
+}
+
+static inline struct windows_globalization *impl_from_IGlobalizationPreferencesStatics(IGlobalizationPreferencesStatics *iface)
+{
+ return CONTAINING_RECORD(iface, struct windows_globalization, IGlobalizationPreferencesStatics_iface);
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_QueryInterface(
+ IGlobalizationPreferencesStatics *iface, REFIID iid, void **object)
+{
+ FIXME("iface %p, iid %s, object %p stub!\n", iface, debugstr_guid(iid), object);
+
+ if (IsEqualGUID(iid, &IID_IAgileObject))
+ {
+ IUnknown_AddRef(iface);
+ *object = iface;
+ return S_OK;
+ }
+
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
+ *object = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG STDMETHODCALLTYPE globalization_preferences_AddRef(
+ IGlobalizationPreferencesStatics *iface)
+{
+ struct windows_globalization *impl = impl_from_IGlobalizationPreferencesStatics(iface);
+ ULONG ref = InterlockedIncrement(&impl->ref);
+ FIXME("iface %p -> ref %u.\n", iface, ref);
+ return ref;
+}
+
+static ULONG STDMETHODCALLTYPE globalization_preferences_Release(
+ IGlobalizationPreferencesStatics *iface)
+{
+ struct windows_globalization *impl = impl_from_IGlobalizationPreferencesStatics(iface);
+ ULONG ref = InterlockedDecrement(&impl->ref);
+ FIXME("iface %p -> ref %u.\n", iface, ref);
+ return ref;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_GetIids(
+ IGlobalizationPreferencesStatics *iface, ULONG *iid_count, IID **iids)
+{
+ FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_GetRuntimeClassName(
+ IGlobalizationPreferencesStatics *iface, HSTRING *class_name)
+{
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_GetTrustLevel(
+ IGlobalizationPreferencesStatics *iface, TrustLevel *trust_level)
+{
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Calendars(IGlobalizationPreferencesStatics *iface,
+ void** value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return hstring_vector_create(NULL, 0, (IVectorView **)value);
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Clocks(IGlobalizationPreferencesStatics *iface,
+ void** value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return hstring_vector_create(NULL, 0, (IVectorView **)value);
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Currencies(IGlobalizationPreferencesStatics *iface,
+ void** value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return hstring_vector_create(NULL, 0, (IVectorView **)value);
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Languages(IGlobalizationPreferencesStatics *iface,
+ void** value)
+{
+ HSTRING hstring;
+ UINT32 length;
+ WCHAR locale_w[LOCALE_NAME_MAX_LENGTH], *tmp;
+
+ FIXME("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, '-')))) *tmp = 0;
+ length = wcslen(locale_w);
+
+ FIXME("returning language %s\n", debugstr_w(locale_w));
+
+ WindowsCreateString(locale_w, length, &hstring);
+ return hstring_vector_create(&hstring, 1, (IVectorView **)value);
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_HomeGeographicRegion(IGlobalizationPreferencesStatics *iface,
+ HSTRING* value)
+{
+ UINT32 length;
+ WCHAR locale_w[LOCALE_NAME_MAX_LENGTH], *tmp;
+ const WCHAR *country;
+
+ FIXME("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);
+
+ FIXME("returning country %s\n", debugstr_w(country));
+
+ return WindowsCreateString(country, length, value);
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_WeekStartsOn(IGlobalizationPreferencesStatics *iface,
+ DayOfWeek* value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return E_NOTIMPL;
+}
+
+static const struct IGlobalizationPreferencesStaticsVtbl globalization_preferences_vtbl =
+{
+ globalization_preferences_QueryInterface,
+ globalization_preferences_AddRef,
+ globalization_preferences_Release,
+ /* IInspectable methods */
+ globalization_preferences_GetIids,
+ globalization_preferences_GetRuntimeClassName,
+ globalization_preferences_GetTrustLevel,
+ /* IGlobalizationPreferencesStatics methods */
+ globalization_preferences_get_Calendars,
+ globalization_preferences_get_Clocks,
+ globalization_preferences_get_Currencies,
+ globalization_preferences_get_Languages,
+ globalization_preferences_get_HomeGeographicRegion,
+ globalization_preferences_get_WeekStartsOn,
+};
+
+static HRESULT STDMETHODCALLTYPE windows_globalization_QueryInterface(
+ IActivationFactory *iface, REFIID iid, void **object)
+ IActivationFactory *iface, REFIID iid, void **out)
+{
+ struct windows_globalization *impl = impl_from_IActivationFactory(iface);
+ FIXME("iface %p, iid %s, object %p stub!\n", iface, debugstr_guid(iid), object);
+ TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
+
+ if (IsEqualGUID(iid, &IID_IGlobalizationPreferencesStatics))
+ if (IsEqualGUID(iid, &IID_IUnknown) ||
+ IsEqualGUID(iid, &IID_IInspectable) ||
+ IsEqualGUID(iid, &IID_IActivationFactory))
+ {
+ IUnknown_AddRef(iface);
+ *object = &impl->IGlobalizationPreferencesStatics_iface;
+ *out = &impl->IActivationFactory_iface;
+ return S_OK;
+ }
+
+ FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
+ *object = NULL;
+ *out = NULL;
+ return E_NOINTERFACE;
+}
+
@ -561,7 +118,7 @@ index 00000000000..f29079d6a5e
+{
+ struct windows_globalization *impl = impl_from_IActivationFactory(iface);
+ ULONG ref = InterlockedIncrement(&impl->ref);
+ FIXME("iface %p -> ref %u.\n", iface, ref);
+ TRACE("iface %p, ref %u.\n", iface, ref);
+ return ref;
+}
+
@ -570,7 +127,7 @@ index 00000000000..f29079d6a5e
+{
+ struct windows_globalization *impl = impl_from_IActivationFactory(iface);
+ ULONG ref = InterlockedDecrement(&impl->ref);
+ FIXME("iface %p -> ref %u.\n", iface, ref);
+ TRACE("iface %p, ref %u.\n", iface, ref);
+ return ref;
+}
+
@ -618,7 +175,6 @@ index 00000000000..f29079d6a5e
+static struct windows_globalization windows_globalization =
+{
+ {&activation_factory_vtbl},
+ {&globalization_preferences_vtbl},
+ 0
+};
+
@ -627,31 +183,31 @@ index 00000000000..f29079d6a5e
+ return S_FALSE;
+}
+
+HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, LPVOID *object)
+HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out)
+{
+ FIXME("clsid %s, riid %s, object %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), object);
+ FIXME("clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out);
+ return CLASS_E_CLASSNOTAVAILABLE;
+}
+
+HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory)
+{
+ FIXME("classid %s, factory %p.\n", debugstr_hstring(classid), factory);
+ TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory);
+ *factory = &windows_globalization.IActivationFactory_iface;
+ IUnknown_AddRef(*factory);
+ return S_OK;
+}
diff --git a/include/Makefile.in b/include/Makefile.in
index 89e952600a0..d32b0a225c1 100644
index e26eafb7f6a..74eeff2d830 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -741,6 +741,7 @@ SOURCES = \
windef.h \
windns.h \
@@ -738,6 +738,7 @@ SOURCES = \
windows.foundation.idl \
windows.gaming.input.idl \
windows.gaming.input.forcefeedback.idl \
+ windows.globalization.idl \
windows.media.speechsynthesis.idl \
windows.system.idl \
windows.h \
windowsx.h \
wine/debug.h \
diff --git a/include/windows.globalization.idl b/include/windows.globalization.idl
new file mode 100644
index 00000000000..c3f80999af5
@ -686,10 +242,10 @@ index 00000000000..c3f80999af5
+namespace Windows {
+}
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 879c1038a95..164d9f3df61 100644
index ab18ab97e4c..0c20b5b1098 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -732,6 +732,7 @@ HKLM,%MciExtStr%,"wvx",,"MPEGVideo"
@@ -716,6 +716,7 @@ HKLM,%MciExtStr%,"wvx",,"MPEGVideo"
HKLM,Software\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.Input.Gamepad,"DllPath",2,"Windows.Gaming.Input.dll"
HKLM,Software\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.Input.RawGameController,"DllPath",2,"Windows.Gaming.Input.dll"
HKLM,Software\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Media.SpeechSynthesis.SpeechSynthesizer,"DllPath",2,"Windows.Media.Speech.dll"

View File

@ -0,0 +1,307 @@
From a5fb434c28607cd124e463eed2b4ef6c4e856983 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 18:11:35 +0200
Subject: [PATCH 2/5] windows.globalization: Implement
IGlobalizationPreferencesStatics stubs.
---
dlls/windows.globalization.dll/Makefile.in | 2 +-
.../windows.globalization_main.c | 133 ++++++++++++++++++
include/Makefile.in | 1 +
include/windows.globalization.idl | 20 ++-
include/windows.system.userprofile.idl | 56 ++++++++
5 files changed, 210 insertions(+), 2 deletions(-)
create mode 100644 include/windows.system.userprofile.idl
diff --git a/dlls/windows.globalization.dll/Makefile.in b/dlls/windows.globalization.dll/Makefile.in
index 25dc1cac3e6..7ddd97aef52 100644
--- a/dlls/windows.globalization.dll/Makefile.in
+++ b/dlls/windows.globalization.dll/Makefile.in
@@ -1,5 +1,5 @@
MODULE = windows.globalization.dll
-IMPORTS = combase
+IMPORTS = combase uuid
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
windows.globalization_main.c
diff --git a/dlls/windows.globalization.dll/windows.globalization_main.c b/dlls/windows.globalization.dll/windows.globalization_main.c
index 840ce08c0c5..97afc941219 100644
--- a/dlls/windows.globalization.dll/windows.globalization_main.c
+++ b/dlls/windows.globalization.dll/windows.globalization_main.c
@@ -10,6 +10,9 @@
#include "initguid.h"
#include "activation.h"
+#define WIDL_USING_IVECTORVIEW_1_HSTRING
+#define WIDL_USING_WINDOWS_GLOBALIZATION_DAYOFWEEK
+#define WIDL_USING_WINDOWS_SYSTEM_USERPROFILE_IGLOBALIZATIONPREFERENCESSTATICS
#include "windows.foundation.h"
#include "windows.globalization.h"
#include "windows.system.userprofile.h"
@@ -28,6 +31,7 @@ static const char *debugstr_hstring(HSTRING hstr)
struct windows_globalization
{
IActivationFactory IActivationFactory_iface;
+ IGlobalizationPreferencesStatics IGlobalizationPreferencesStatics_iface;
LONG ref;
};
@@ -36,6 +40,127 @@ static inline struct windows_globalization *impl_from_IActivationFactory(IActiva
return CONTAINING_RECORD(iface, struct windows_globalization, IActivationFactory_iface);
}
+static inline struct windows_globalization *impl_from_IGlobalizationPreferencesStatics(IGlobalizationPreferencesStatics *iface)
+{
+ return CONTAINING_RECORD(iface, struct windows_globalization, IGlobalizationPreferencesStatics_iface);
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_QueryInterface(
+ IGlobalizationPreferencesStatics *iface, REFIID iid, void **object)
+{
+ FIXME("iface %p, iid %s, object %p stub!\n", iface, debugstr_guid(iid), object);
+
+ if (IsEqualGUID(iid, &IID_IAgileObject))
+ {
+ IUnknown_AddRef(iface);
+ *object = iface;
+ return S_OK;
+ }
+
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
+ *object = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG STDMETHODCALLTYPE globalization_preferences_AddRef(
+ IGlobalizationPreferencesStatics *iface)
+{
+ struct windows_globalization *impl = impl_from_IGlobalizationPreferencesStatics(iface);
+ ULONG ref = InterlockedIncrement(&impl->ref);
+ FIXME("iface %p -> ref %u.\n", iface, ref);
+ return ref;
+}
+
+static ULONG STDMETHODCALLTYPE globalization_preferences_Release(
+ IGlobalizationPreferencesStatics *iface)
+{
+ struct windows_globalization *impl = impl_from_IGlobalizationPreferencesStatics(iface);
+ ULONG ref = InterlockedDecrement(&impl->ref);
+ FIXME("iface %p -> ref %u.\n", iface, ref);
+ return ref;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_GetIids(
+ IGlobalizationPreferencesStatics *iface, ULONG *iid_count, IID **iids)
+{
+ FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_GetRuntimeClassName(
+ IGlobalizationPreferencesStatics *iface, HSTRING *class_name)
+{
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_GetTrustLevel(
+ IGlobalizationPreferencesStatics *iface, TrustLevel *trust_level)
+{
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Calendars(IGlobalizationPreferencesStatics *iface,
+ IVectorView_HSTRING **value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Clocks(IGlobalizationPreferencesStatics *iface,
+ IVectorView_HSTRING **value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Currencies(IGlobalizationPreferencesStatics *iface,
+ IVectorView_HSTRING **value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Languages(IGlobalizationPreferencesStatics *iface,
+ IVectorView_HSTRING **value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_HomeGeographicRegion(IGlobalizationPreferencesStatics *iface,
+ HSTRING* value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE globalization_preferences_get_WeekStartsOn(IGlobalizationPreferencesStatics *iface,
+ enum DayOfWeek* value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return E_NOTIMPL;
+}
+
+static const struct IGlobalizationPreferencesStaticsVtbl globalization_preferences_vtbl =
+{
+ globalization_preferences_QueryInterface,
+ globalization_preferences_AddRef,
+ globalization_preferences_Release,
+ /* IInspectable methods */
+ globalization_preferences_GetIids,
+ globalization_preferences_GetRuntimeClassName,
+ globalization_preferences_GetTrustLevel,
+ /* IGlobalizationPreferencesStatics methods */
+ globalization_preferences_get_Calendars,
+ globalization_preferences_get_Clocks,
+ globalization_preferences_get_Currencies,
+ globalization_preferences_get_Languages,
+ globalization_preferences_get_HomeGeographicRegion,
+ globalization_preferences_get_WeekStartsOn,
+};
+
static HRESULT STDMETHODCALLTYPE windows_globalization_QueryInterface(
IActivationFactory *iface, REFIID iid, void **out)
{
@@ -51,6 +176,13 @@ static HRESULT STDMETHODCALLTYPE windows_globalization_QueryInterface(
return S_OK;
}
+ if (IsEqualGUID(iid, &IID_IGlobalizationPreferencesStatics))
+ {
+ IUnknown_AddRef(iface);
+ *out = &impl->IGlobalizationPreferencesStatics_iface;
+ return S_OK;
+ }
+
FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
*out = NULL;
return E_NOINTERFACE;
@@ -118,6 +250,7 @@ static const struct IActivationFactoryVtbl activation_factory_vtbl =
static struct windows_globalization windows_globalization =
{
{&activation_factory_vtbl},
+ {&globalization_preferences_vtbl},
0
};
diff --git a/include/Makefile.in b/include/Makefile.in
index 74eeff2d830..258813f7f15 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -739,6 +739,7 @@ SOURCES = \
windows.gaming.input.idl \
windows.gaming.input.forcefeedback.idl \
windows.globalization.idl \
+ windows.system.userprofile.idl \
windows.media.speechsynthesis.idl \
windows.system.idl \
windows.h \
diff --git a/include/windows.globalization.idl b/include/windows.globalization.idl
index c3f80999af5..ac76455b847 100644
--- a/include/windows.globalization.idl
+++ b/include/windows.globalization.idl
@@ -20,8 +20,26 @@
#pragma winrt ns_prefix
#endif
-import "inspectable.idl";
import "windows.foundation.idl";
namespace Windows {
+ namespace Globalization {
+ typedef enum DayOfWeek DayOfWeek;
+ }
+}
+
+namespace Windows {
+ namespace Globalization {
+ [contract(Windows.Foundation.UniversalApiContract, 1.0)]
+ enum DayOfWeek
+ {
+ Sunday = 0,
+ Monday = 1,
+ Tuesday = 2,
+ Wednesday = 3,
+ Thursday = 4,
+ Friday = 5,
+ Saturday = 6
+ };
+ }
}
diff --git a/include/windows.system.userprofile.idl b/include/windows.system.userprofile.idl
new file mode 100644
index 00000000000..e2676f9dd89
--- /dev/null
+++ b/include/windows.system.userprofile.idl
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2020 Rémi Bernon for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef __WIDL__
+#pragma winrt ns_prefix
+#endif
+
+import "windows.foundation.idl";
+import "windows.globalization.idl";
+
+namespace Windows {
+ namespace System {
+ namespace UserProfile {
+ interface IGlobalizationPreferencesStatics;
+ runtimeclass GlobalizationPreferences;
+ }
+ }
+}
+
+namespace Windows {
+ namespace System {
+ namespace UserProfile {
+
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ exclusiveto(Windows.System.UserProfile.GlobalizationPreferences),
+ uuid(01bf4326-ed37-4e96-b0e9-c1340d1ea158)
+ ]
+ interface IGlobalizationPreferencesStatics : IInspectable
+ {
+ [propget] HRESULT Calendars([out, retval] Windows.Foundation.Collections.IVectorView<HSTRING>** value);
+ [propget] HRESULT Clocks([out, retval] Windows.Foundation.Collections.IVectorView<HSTRING>** value);
+ [propget] HRESULT Currencies([out, retval] Windows.Foundation.Collections.IVectorView<HSTRING>** value);
+ [propget] HRESULT Languages([out, retval] Windows.Foundation.Collections.IVectorView<HSTRING>** value);
+ [propget] HRESULT HomeGeographicRegion([out, retval] HSTRING* value);
+ [propget] HRESULT WeekStartsOn([out, retval] Windows.Globalization.DayOfWeek* value);
+ }
+
+ }
+ }
+}
--
2.28.0

View File

@ -0,0 +1,43 @@
From 26dc75ab2eb7ac9f8c21da1d0f2be70fe2430460 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 18:19:17 +0200
Subject: [PATCH 3/5] windows.globalization: Implement
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
index 97afc941219..6d17317677e 100644
--- a/dlls/windows.globalization.dll/windows.globalization_main.c
+++ b/dlls/windows.globalization.dll/windows.globalization_main.c
@@ -132,8 +132,22 @@ static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Languages(IGlobal
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,
--
2.28.0

View File

@ -0,0 +1,209 @@
From 0eaa05ab9ae489154aefe7241b3189bb57d0af40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 18:20:27 +0200
Subject: [PATCH 4/5] windows.globalization: Implement
IGlobalizationPreferencesStatics::Languages semi-stub.
Returning system default language in a 1-element HSTRING vector.
---
.../windows.globalization_main.c | 177 +++++++++++++++++-
1 file changed, 175 insertions(+), 2 deletions(-)
diff --git a/dlls/windows.globalization.dll/windows.globalization_main.c b/dlls/windows.globalization.dll/windows.globalization_main.c
index 6d17317677e..16bcb9344dd 100644
--- a/dlls/windows.globalization.dll/windows.globalization_main.c
+++ b/dlls/windows.globalization.dll/windows.globalization_main.c
@@ -28,6 +28,165 @@ static const char *debugstr_hstring(HSTRING hstr)
return wine_dbgstr_wn(str, len);
}
+struct hstring_vector
+{
+ IVectorView_HSTRING IVectorView_HSTRING_iface;
+ LONG ref;
+
+ ULONG count;
+ HSTRING values[0];
+};
+
+static inline struct hstring_vector *impl_from_IVectorView_HSTRING(IVectorView_HSTRING *iface)
+{
+ return CONTAINING_RECORD(iface, struct hstring_vector, IVectorView_HSTRING_iface);
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_QueryInterface(
+ IVectorView_HSTRING *iface, REFIID iid, void **out)
+{
+ struct hstring_vector *This = impl_from_IVectorView_HSTRING(iface);
+
+ FIXME("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
+
+ if (!out) return E_INVALIDARG;
+
+ *out = NULL;
+ if (!IsEqualIID(&IID_IUnknown, iid) &&
+ !IsEqualIID(&IID_IInspectable, iid) &&
+ !IsEqualIID(&IID_IVectorView_HSTRING, iid))
+ {
+ FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
+ return E_NOINTERFACE;
+ }
+
+ *out = &This->IVectorView_HSTRING_iface;
+ IUnknown_AddRef((IUnknown *)*out);
+ return S_OK;
+}
+
+static ULONG STDMETHODCALLTYPE hstring_vector_AddRef(
+ IVectorView_HSTRING *iface)
+{
+ struct hstring_vector *This = impl_from_IVectorView_HSTRING(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+ FIXME("iface %p -> ref %u.\n", iface, ref);
+ return ref;
+}
+
+static ULONG STDMETHODCALLTYPE hstring_vector_Release(
+ IVectorView_HSTRING *iface)
+{
+ struct hstring_vector *This = impl_from_IVectorView_HSTRING(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+ FIXME("iface %p -> ref %u.\n", iface, ref);
+ if (ref == 0)
+ {
+ while (This->count--) WindowsDeleteString(This->values[This->count]);
+ HeapFree(GetProcessHeap(), 0, This);
+ }
+ return ref;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_GetIids(
+ IVectorView_HSTRING *iface, ULONG *iid_count, IID **iids)
+{
+ FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_GetRuntimeClassName(
+ IVectorView_HSTRING *iface, HSTRING *class_name)
+{
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_GetTrustLevel(
+ IVectorView_HSTRING *iface, TrustLevel *trust_level)
+{
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_GetAt(
+ IVectorView_HSTRING *iface, ULONG index, HSTRING *value)
+{
+ struct hstring_vector *This = impl_from_IVectorView_HSTRING(iface);
+
+ FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value);
+
+ if (index >= This->count) return E_BOUNDS;
+ return WindowsDuplicateString(This->values[index], value);
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_get_Size(
+ IVectorView_HSTRING *iface, ULONG *value)
+{
+ struct hstring_vector *This = impl_from_IVectorView_HSTRING(iface);
+
+ FIXME("iface %p, value %p stub!\n", iface, value);
+
+ *value = This->count;
+ return S_OK;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_IndexOf(
+ IVectorView_HSTRING *iface, HSTRING element, ULONG *index, BOOLEAN *value)
+{
+ FIXME("iface %p, element %p, index %p, value %p stub!\n", iface, element, index, value);
+ *value = FALSE;
+ return S_OK;
+}
+
+static HRESULT STDMETHODCALLTYPE hstring_vector_GetMany(
+ IVectorView_HSTRING *iface, ULONG start_index, HSTRING *items, UINT *count)
+{
+ struct hstring_vector *This = impl_from_IVectorView_HSTRING(iface);
+ HRESULT hr;
+ ULONG i;
+
+ FIXME("iface %p, start_index %#x, items %p, count %p stub!\n", iface, start_index, items, count);
+
+ for (i = start_index; i < This->count; ++i)
+ if (FAILED(hr = WindowsDuplicateString(This->values[i], items + i - start_index)))
+ return hr;
+ *count = This->count - start_index;
+
+ return S_OK;
+}
+
+static const struct IVectorView_HSTRINGVtbl hstring_vector_vtbl =
+{
+ hstring_vector_QueryInterface,
+ hstring_vector_AddRef,
+ hstring_vector_Release,
+ /* IInspectable methods */
+ hstring_vector_GetIids,
+ hstring_vector_GetRuntimeClassName,
+ hstring_vector_GetTrustLevel,
+ /* IVectorView<HSTRING> methods */
+ hstring_vector_GetAt,
+ hstring_vector_get_Size,
+ hstring_vector_IndexOf,
+ hstring_vector_GetMany,
+};
+
+static HRESULT hstring_vector_create(HSTRING *values, SIZE_T count, IVectorView_HSTRING **out)
+{
+ struct hstring_vector *This;
+
+ if (!(This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This) + count * sizeof(HSTRING)))) return E_OUTOFMEMORY;
+ This->ref = 1;
+
+ This->IVectorView_HSTRING_iface.lpVtbl = &hstring_vector_vtbl;
+ This->count = count;
+ memcpy(This->values, values, count * sizeof(HSTRING));
+
+ *out = &This->IVectorView_HSTRING_iface;
+ return S_OK;
+}
+
struct windows_globalization
{
IActivationFactory IActivationFactory_iface;
@@ -125,8 +284,22 @@ static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Currencies(IGloba
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Languages(IGlobalizationPreferencesStatics *iface,
IVectorView_HSTRING **value)
{
- FIXME("iface %p, value %p stub!\n", iface, value);
- return E_NOTIMPL;
+ HSTRING hstring;
+ UINT32 length;
+ WCHAR locale_w[LOCALE_NAME_MAX_LENGTH], *tmp;
+
+ FIXME("iface %p, value %p semi-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, '-')))) *tmp = 0;
+ length = wcslen(locale_w);
+
+ FIXME("returning language %s\n", debugstr_w(locale_w));
+
+ WindowsCreateString(locale_w, length, &hstring);
+ return hstring_vector_create(&hstring, 1, value);
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_HomeGeographicRegion(IGlobalizationPreferencesStatics *iface,
--
2.28.0

View File

@ -0,0 +1,42 @@
From 91eee8c901692177e62e86e7ac9e705de2b01c7a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 18:11:35 +0200
Subject: [PATCH 5/5] windows.globalization: Fake empty
IGlobalizationPreferencesStatics properties.
---
dlls/windows.globalization.dll/windows.globalization_main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/windows.globalization.dll/windows.globalization_main.c b/dlls/windows.globalization.dll/windows.globalization_main.c
index 16bcb9344dd..c5da98cc22f 100644
--- a/dlls/windows.globalization.dll/windows.globalization_main.c
+++ b/dlls/windows.globalization.dll/windows.globalization_main.c
@@ -264,21 +264,21 @@ static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Calendars(IGlobal
IVectorView_HSTRING **value)
{
FIXME("iface %p, value %p stub!\n", iface, value);
- return E_NOTIMPL;
+ return hstring_vector_create(NULL, 0, value);
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Clocks(IGlobalizationPreferencesStatics *iface,
IVectorView_HSTRING **value)
{
FIXME("iface %p, value %p stub!\n", iface, value);
- return E_NOTIMPL;
+ return hstring_vector_create(NULL, 0, value);
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Currencies(IGlobalizationPreferencesStatics *iface,
IVectorView_HSTRING **value)
{
FIXME("iface %p, value %p stub!\n", iface, value);
- return E_NOTIMPL;
+ return hstring_vector_create(NULL, 0, value);
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Languages(IGlobalizationPreferencesStatics *iface,
--
2.28.0

View File

@ -1,3 +1,3 @@
Fixes: [49740] windows.globalization: New DLL
Depends: windows.media.speech.dll
Disabled: True
Fixes: [49998] windows.globalization: New DLL
Depends: windows.gaming.input-dll