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

@ -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