wine-staging/patches/windows.media.speech.dll/0003-windows.media.speech-Implement-IInstalledVoicesStati.patch
2020-10-14 18:00:35 +11:00

168 lines
6.3 KiB
Diff

From 66203027d2c82fd502e1ff30213bc4ba09f73d5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 17:02:57 +0200
Subject: [PATCH 3/4] windows.media.speech: Implement
IInstalledVoicesStatic::AllVoices stub.
---
.../windows.media.speech_main.c | 114 +++++++++++++++++-
1 file changed, 113 insertions(+), 1 deletion(-)
diff --git a/dlls/windows.media.speech.dll/windows.media.speech_main.c b/dlls/windows.media.speech.dll/windows.media.speech_main.c
index cb686ccc0b5..1f9c2bdc0b9 100644
--- a/dlls/windows.media.speech.dll/windows.media.speech_main.c
+++ b/dlls/windows.media.speech.dll/windows.media.speech_main.c
@@ -13,6 +13,7 @@
#define WIDL_USING_IVECTORVIEW_1_WINDOWS_MEDIA_SPEECHSYNTHESIS_VOICEINFORMATION
#define WIDL_USING_WINDOWS_MEDIA_SPEECHSYNTHESIS_IINSTALLEDVOICESSTATIC
#define WIDL_USING_WINDOWS_MEDIA_SPEECHSYNTHESIS_IVOICEINFORMATION
+#define WIDL_USING_WINDOWS_MEDIA_SPEECHSYNTHESIS_VOICEINFORMATION
#include "windows.foundation.h"
#include "windows.media.speechsynthesis.h"
@@ -31,6 +32,7 @@ struct windows_media_speech
{
IActivationFactory IActivationFactory_iface;
IInstalledVoicesStatic IInstalledVoicesStatic_iface;
+ IVectorView_VoiceInformation IVectorView_VoiceInformation_iface;
LONG ref;
};
@@ -44,6 +46,113 @@ static inline struct windows_media_speech *impl_from_IInstalledVoicesStatic(IIns
return CONTAINING_RECORD(iface, struct windows_media_speech, IInstalledVoicesStatic_iface);
}
+static inline struct windows_media_speech *impl_from_IVectorView_VoiceInformation(IVectorView_VoiceInformation *iface)
+{
+ return CONTAINING_RECORD(iface, struct windows_media_speech, IVectorView_VoiceInformation_iface);
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_voice_information_QueryInterface(
+ IVectorView_VoiceInformation *iface, REFIID iid, void **out)
+{
+ TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
+
+ if (IsEqualGUID(iid, &IID_IUnknown) ||
+ IsEqualGUID(iid, &IID_IInspectable) ||
+ IsEqualGUID(iid, &IID_IVectorView_VoiceInformation))
+ {
+ IUnknown_AddRef(iface);
+ *out = iface;
+ return S_OK;
+ }
+
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
+ *out = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG STDMETHODCALLTYPE vector_view_voice_information_AddRef(
+ IVectorView_VoiceInformation *iface)
+{
+ struct windows_media_speech *impl = impl_from_IVectorView_VoiceInformation(iface);
+ ULONG ref = InterlockedIncrement(&impl->ref);
+ TRACE("iface %p, ref %u.\n", iface, ref);
+ return ref;
+}
+
+static ULONG STDMETHODCALLTYPE vector_view_voice_information_Release(
+ IVectorView_VoiceInformation *iface)
+{
+ struct windows_media_speech *impl = impl_from_IVectorView_VoiceInformation(iface);
+ ULONG ref = InterlockedDecrement(&impl->ref);
+ TRACE("iface %p, ref %u.\n", iface, ref);
+ return ref;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_voice_information_GetIids(
+ IVectorView_VoiceInformation *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 vector_view_voice_information_GetRuntimeClassName(
+ IVectorView_VoiceInformation *iface, HSTRING *class_name)
+{
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_voice_information_GetTrustLevel(
+ IVectorView_VoiceInformation *iface, TrustLevel *trust_level)
+{
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_voice_information_GetAt(
+ IVectorView_VoiceInformation *iface, ULONG index, IVoiceInformation **value)
+{
+ FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_voice_information_get_Size(
+ IVectorView_VoiceInformation *iface, ULONG *value)
+{
+ FIXME("iface %p, value %p stub!\n", iface, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_voice_information_IndexOf(
+ IVectorView_VoiceInformation *iface, IVoiceInformation *element, ULONG *index, BOOLEAN *value)
+{
+ FIXME("iface %p, element %p, index %p, value %p stub!\n", iface, element, index, value);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE vector_view_voice_information_GetMany(
+ IVectorView_VoiceInformation *iface, ULONG start_index, IVoiceInformation **items, UINT *value)
+{
+ FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value);
+ return E_NOTIMPL;
+}
+
+static const struct IVectorView_VoiceInformationVtbl vector_view_voice_information_vtbl =
+{
+ vector_view_voice_information_QueryInterface,
+ vector_view_voice_information_AddRef,
+ vector_view_voice_information_Release,
+ /* IInspectable methods */
+ vector_view_voice_information_GetIids,
+ vector_view_voice_information_GetRuntimeClassName,
+ vector_view_voice_information_GetTrustLevel,
+ /* IVectorView<VoiceInformation> methods */
+ vector_view_voice_information_GetAt,
+ vector_view_voice_information_get_Size,
+ vector_view_voice_information_IndexOf,
+ vector_view_voice_information_GetMany,
+};
+
static HRESULT STDMETHODCALLTYPE installed_voices_static_QueryInterface(
IInstalledVoicesStatic *iface, REFIID iid, void **out)
{
@@ -106,8 +215,10 @@ static HRESULT STDMETHODCALLTYPE installed_voices_static_GetTrustLevel(
static HRESULT STDMETHODCALLTYPE installed_voices_static_get_AllVoices(
IInstalledVoicesStatic *iface, IVectorView_VoiceInformation **value)
{
+ struct windows_media_speech *impl = impl_from_IInstalledVoicesStatic(iface);
FIXME("iface %p, value %p stub!\n", iface, value);
- return E_NOTIMPL;
+ *value = &impl->IVectorView_VoiceInformation_iface;
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE installed_voices_static_get_DefaultVoice(
@@ -221,6 +332,7 @@ static struct windows_media_speech windows_media_speech =
{
{&activation_factory_vtbl},
{&installed_voices_static_vtbl},
+ {&vector_view_voice_information_vtbl},
0
};
--
2.28.0