From 23ca7fe89470961d168f35df2b8fc04c5efbd037 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 14 Oct 2020 17:56:21 +1100 Subject: [PATCH] Updated windows.media.speech.dll patchset --- patches/patchinstall.sh | 3 + ...01-windows.media.speech-Add-stub-dll.patch | 374 ++---------------- ...eech-Implement-IInstalledVoicesStati.patch | 156 ++++++++ ...eech-Implement-IInstalledVoicesStati.patch | 167 ++++++++ ...eech-Fake-empty-IInstalledVoicesStat.patch | 53 +++ 5 files changed, 415 insertions(+), 338 deletions(-) create mode 100644 patches/windows.media.speech.dll/0002-windows.media.speech-Implement-IInstalledVoicesStati.patch create mode 100644 patches/windows.media.speech.dll/0003-windows.media.speech-Implement-IInstalledVoicesStati.patch create mode 100644 patches/windows.media.speech.dll/0004-windows.media.speech-Fake-empty-IInstalledVoicesStat.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index d5a7adfd..25924f24 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -4386,6 +4386,9 @@ fi # | if test "$enable_windows_media_speech_dll" -eq 1; then patch_apply windows.media.speech.dll/0001-windows.media.speech-Add-stub-dll.patch + patch_apply windows.media.speech.dll/0002-windows.media.speech-Implement-IInstalledVoicesStati.patch + patch_apply windows.media.speech.dll/0003-windows.media.speech-Implement-IInstalledVoicesStati.patch + patch_apply windows.media.speech.dll/0004-windows.media.speech-Fake-empty-IInstalledVoicesStat.patch fi # Patchset windowscodecs-GIF_Encoder diff --git a/patches/windows.media.speech.dll/0001-windows.media.speech-Add-stub-dll.patch b/patches/windows.media.speech.dll/0001-windows.media.speech-Add-stub-dll.patch index d4054ef5..b209cb75 100644 --- a/patches/windows.media.speech.dll/0001-windows.media.speech-Add-stub-dll.patch +++ b/patches/windows.media.speech.dll/0001-windows.media.speech-Add-stub-dll.patch @@ -1,39 +1,39 @@ -From 7805fb3c793fbc3c84df32915107df1b1fcb1c93 Mon Sep 17 00:00:00 2001 +From b38b826ee230339be27e83e42822a69afe13259f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 25 Aug 2020 19:07:58 +0200 -Subject: [PATCH] windows.media.speech: Add stub dll. +Subject: [PATCH 1/4] windows.media.speech: Add stub dll. --- configure.ac | 1 + dlls/windows.media.speech.dll/Makefile.in | 5 + .../windows.media.speech.spec | 3 + - .../windows.media.speech_main.c | 442 ++++++++++++++++++ + .../windows.media.speech_main.c | 140 ++++++++++++++++++ loader/wine.inf.in | 1 + - 5 files changed, 452 insertions(+) + 5 files changed, 150 insertions(+) create mode 100644 dlls/windows.media.speech.dll/Makefile.in create mode 100644 dlls/windows.media.speech.dll/windows.media.speech.spec create mode 100644 dlls/windows.media.speech.dll/windows.media.speech_main.c diff --git a/configure.ac b/configure.ac -index ffe287aeb80..bc8c7123c8b 100644 +index a57697a0ddf..a8649a2e40b 100644 --- a/configure.ac +++ b/configure.ac -@@ -3894,6 +3894,7 @@ WINE_CONFIG_MAKEFILE(dlls/win87em.dll16,enable_win16) +@@ -3822,6 +3822,7 @@ WINE_CONFIG_MAKEFILE(dlls/win32s16.dll16,enable_win16) + 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) +WINE_CONFIG_MAKEFILE(dlls/windows.media.speech.dll) WINE_CONFIG_MAKEFILE(dlls/windowscodecs) WINE_CONFIG_MAKEFILE(dlls/windowscodecs/tests) WINE_CONFIG_MAKEFILE(dlls/windowscodecsext) diff --git a/dlls/windows.media.speech.dll/Makefile.in b/dlls/windows.media.speech.dll/Makefile.in new file mode 100644 -index 00000000000..aed947cc441 +index 00000000000..e1f4b3402bd --- /dev/null +++ b/dlls/windows.media.speech.dll/Makefile.in @@ -0,0 +1,5 @@ +MODULE = windows.media.speech.dll -+IMPORTS = combase ++IMPORTS = combase uuid +EXTRADLLFLAGS = -mno-cygwin +C_SRCS = \ + windows.media.speech_main.c @@ -48,10 +48,10 @@ index 00000000000..721493229c2 +3 stdcall -private DllGetClassObject(ptr ptr ptr) diff --git a/dlls/windows.media.speech.dll/windows.media.speech_main.c b/dlls/windows.media.speech.dll/windows.media.speech_main.c new file mode 100644 -index 00000000000..63c4a71eea0 +index 00000000000..c7c14deef78 --- /dev/null +++ b/dlls/windows.media.speech.dll/windows.media.speech_main.c -@@ -0,0 +1,442 @@ +@@ -0,0 +1,140 @@ +#include + +#define COBJMACROS @@ -59,15 +59,16 @@ index 00000000000..63c4a71eea0 +#include "winbase.h" +#include "winstring.h" +#include "wine/debug.h" -+#include "activation.h" +#include "objbase.h" ++ +#include "initguid.h" ++#include "activation.h" ++ ++#include "windows.foundation.h" ++#include "windows.media.speechsynthesis.h" + +WINE_DEFAULT_DEBUG_CHANNEL(speech); + -+DEFINE_GUID(IID_IInstalledVoicesStatic,0x7d526ecc,0x7533,0x4c3f,0x85,0xbe,0x88,0x8c,0x2b,0xae,0xeb,0xdc); -+DEFINE_GUID(IID_IAgileObject,0x94ea2b94,0xe9cc,0x49e0,0xc0,0xff,0xee,0x64,0xca,0x8f,0x5b,0x90); -+ +static const char *debugstr_hstring(HSTRING hstr) +{ + const WCHAR *str; @@ -77,120 +78,10 @@ index 00000000000..63c4a71eea0 + return wine_dbgstr_wn(str, len); +} + -+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 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; -+}; -+ -+typedef struct IInstalledVoicesStatic IInstalledVoicesStatic; -+ -+typedef struct IInstalledVoicesStaticVtbl -+{ -+ BEGIN_INTERFACE -+ -+ /*** IUnknown methods ***/ -+ HRESULT (STDMETHODCALLTYPE *QueryInterface)( -+ IInstalledVoicesStatic *This, -+ REFIID riid, -+ void **ppvObject); -+ -+ ULONG (STDMETHODCALLTYPE *AddRef)( -+ IInstalledVoicesStatic *This); -+ -+ ULONG (STDMETHODCALLTYPE *Release)( -+ IInstalledVoicesStatic *This); -+ -+ /*** IInspectable methods ***/ -+ HRESULT (STDMETHODCALLTYPE *GetIids)( -+ IInstalledVoicesStatic *This, -+ ULONG *iidCount, -+ IID **iids); -+ -+ HRESULT (STDMETHODCALLTYPE *GetRuntimeClassName)( -+ IInstalledVoicesStatic *This, -+ HSTRING *className); -+ -+ HRESULT (STDMETHODCALLTYPE *GetTrustLevel)( -+ IInstalledVoicesStatic *This, -+ TrustLevel *trustLevel); -+ -+ /*** IInstalledVoicesStatic methods ***/ -+ HRESULT (STDMETHODCALLTYPE *get_AllVoices)( -+ IInstalledVoicesStatic *This, -+ /* Windows.Foundation.Collections.IVectorView** */ -+ void **value); -+ HRESULT (STDMETHODCALLTYPE *get_DefaultVoice)( -+ IInstalledVoicesStatic *This, -+ /* Windows.Media.SpeechSynthesis.VoiceInformation** */ -+ void **value); -+ -+ END_INTERFACE -+} IInstalledVoicesStaticVtbl; -+ -+struct IInstalledVoicesStatic -+{ -+ CONST_VTBL IInstalledVoicesStaticVtbl* lpVtbl; -+}; -+ +struct windows_media_speech +{ + IActivationFactory IActivationFactory_iface; -+ IInstalledVoicesStatic IInstalledVoicesStatic_iface; -+ IVectorView IVectorView_iface; -+ LONG refcount; ++ LONG ref; +}; + +static inline struct windows_media_speech *impl_from_IActivationFactory(IActivationFactory *iface) @@ -198,214 +89,23 @@ index 00000000000..63c4a71eea0 + return CONTAINING_RECORD(iface, struct windows_media_speech, IActivationFactory_iface); +} + -+static inline struct windows_media_speech *impl_from_IInstalledVoicesStatic(IInstalledVoicesStatic *iface) -+{ -+ return CONTAINING_RECORD(iface, struct windows_media_speech, IInstalledVoicesStatic_iface); -+} -+ -+static inline struct windows_media_speech *impl_from_IVectorView(IVectorView *iface) -+{ -+ return CONTAINING_RECORD(iface, struct windows_media_speech, IVectorView_iface); -+} -+ -+static HRESULT STDMETHODCALLTYPE vector_view_QueryInterface( -+ IVectorView *iface, REFIID iid, void **object) -+{ -+ TRACE("iface %p, iid %s, object %p stub!\n", iface, debugstr_guid(iid), object); -+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); -+ *object = NULL; -+ return E_NOINTERFACE; -+} -+ -+static ULONG STDMETHODCALLTYPE vector_view_AddRef( -+ IVectorView *iface) -+{ -+ struct windows_media_speech *impl = impl_from_IVectorView(iface); -+ ULONG rc = InterlockedIncrement(&impl->refcount); -+ TRACE("%p increasing refcount to %u.\n", impl, rc); -+ return rc; -+} -+ -+static ULONG STDMETHODCALLTYPE vector_view_Release( -+ IVectorView *iface) -+{ -+ struct windows_media_speech *impl = impl_from_IVectorView(iface); -+ ULONG rc = InterlockedDecrement(&impl->refcount); -+ TRACE("%p decreasing refcount to %u.\n", impl, rc); -+ return rc; -+} -+ -+static HRESULT STDMETHODCALLTYPE vector_view_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 vector_view_GetRuntimeClassName( -+ IVectorView *iface, HSTRING *class_name) -+{ -+ FIXME("iface %p, class_name %p stub!\n", iface, class_name); -+ return E_NOTIMPL; -+} -+ -+static HRESULT STDMETHODCALLTYPE vector_view_GetTrustLevel( -+ IVectorView *iface, TrustLevel *trust_level) -+{ -+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); -+ return E_NOTIMPL; -+} -+ -+static HRESULT STDMETHODCALLTYPE vector_view_GetAt( -+ IVectorView *iface, ULONG index, void *out_value) -+{ -+ FIXME("iface %p, index %#x, out_value %p stub!\n", iface, index, out_value); -+ return S_OK; -+} -+ -+static HRESULT STDMETHODCALLTYPE vector_view_get_Size( -+ IVectorView *iface, ULONG *out_value) -+{ -+ FIXME("iface %p, out_value %p stub!\n", iface, out_value); -+ *out_value = 0; -+ return S_OK; -+} -+ -+static HRESULT STDMETHODCALLTYPE vector_view_IndexOf( -+ IVectorView *iface, void *value, ULONG *index, BOOLEAN *out_value) -+{ -+ FIXME("iface %p, value %p, index %p, out_value %p stub!\n", iface, value, index, out_value); -+ *out_value = FALSE; -+ return S_OK; -+} -+ -+static HRESULT STDMETHODCALLTYPE vector_view_GetMany( -+ IVectorView *iface, ULONG start_index, void **items, UINT *out_value) -+{ -+ FIXME("iface %p, start_index %#x, items %p, out_value %p stub!\n", iface, start_index, items, out_value); -+ *out_value = 0; -+ return S_OK; -+} -+ -+static const struct IVectorViewVtbl vector_view_vtbl = -+{ -+ vector_view_QueryInterface, -+ vector_view_AddRef, -+ vector_view_Release, -+ /* IInspectable methods */ -+ vector_view_GetIids, -+ vector_view_GetRuntimeClassName, -+ vector_view_GetTrustLevel, -+ /*** IVectorView methods ***/ -+ vector_view_GetAt, -+ vector_view_get_Size, -+ vector_view_IndexOf, -+ vector_view_GetMany, -+}; -+ -+static HRESULT STDMETHODCALLTYPE installed_voices_static_QueryInterface( -+ IInstalledVoicesStatic *iface, REFIID iid, void **object) -+{ -+ TRACE("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 installed_voices_static_AddRef( -+ IInstalledVoicesStatic *iface) -+{ -+ struct windows_media_speech *impl = impl_from_IInstalledVoicesStatic(iface); -+ ULONG rc = InterlockedIncrement(&impl->refcount); -+ TRACE("%p increasing refcount to %u.\n", impl, rc); -+ return rc; -+} -+ -+static ULONG STDMETHODCALLTYPE installed_voices_static_Release( -+ IInstalledVoicesStatic *iface) -+{ -+ struct windows_media_speech *impl = impl_from_IInstalledVoicesStatic(iface); -+ ULONG rc = InterlockedDecrement(&impl->refcount); -+ TRACE("%p decreasing refcount to %u.\n", impl, rc); -+ return rc; -+} -+ -+static HRESULT STDMETHODCALLTYPE installed_voices_static_GetIids( -+ IInstalledVoicesStatic *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 installed_voices_static_GetRuntimeClassName( -+ IInstalledVoicesStatic *iface, HSTRING *class_name) -+{ -+ FIXME("iface %p, class_name %p stub!\n", iface, class_name); -+ return E_NOTIMPL; -+} -+ -+static HRESULT STDMETHODCALLTYPE installed_voices_static_GetTrustLevel( -+ IInstalledVoicesStatic *iface, TrustLevel *trust_level) -+{ -+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); -+ return E_NOTIMPL; -+} -+ -+static HRESULT STDMETHODCALLTYPE installed_voices_static_get_AllVoices( -+ IInstalledVoicesStatic *iface, void **value) -+{ -+ struct windows_media_speech *impl = impl_from_IInstalledVoicesStatic(iface); -+ FIXME("iface %p, value %p stub!\n", iface, value); -+ *value = &impl->IVectorView_iface; -+ return S_OK; -+} -+ -+static HRESULT STDMETHODCALLTYPE installed_voices_static_get_DefaultVoice( -+ IInstalledVoicesStatic *iface, void **value) -+{ -+ struct windows_media_speech *impl = impl_from_IInstalledVoicesStatic(iface); -+ FIXME("iface %p, value %p stub!\n", iface, value); -+ *value = &impl->IVectorView_iface; -+ return S_OK; -+} -+ -+static const struct IInstalledVoicesStaticVtbl installed_voices_static_vtbl = -+{ -+ installed_voices_static_QueryInterface, -+ installed_voices_static_AddRef, -+ installed_voices_static_Release, -+ /* IInspectable methods */ -+ installed_voices_static_GetIids, -+ installed_voices_static_GetRuntimeClassName, -+ installed_voices_static_GetTrustLevel, -+ /* IInstalledVoicesStatic methods */ -+ installed_voices_static_get_AllVoices, -+ installed_voices_static_get_DefaultVoice, -+}; -+ +static HRESULT STDMETHODCALLTYPE windows_media_speech_QueryInterface( -+ IActivationFactory *iface, REFIID iid, void **object) ++ IActivationFactory *iface, REFIID iid, void **out) +{ + struct windows_media_speech *impl = impl_from_IActivationFactory(iface); -+ TRACE("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_IInstalledVoicesStatic)) ++ if (IsEqualGUID(iid, &IID_IUnknown) || ++ IsEqualGUID(iid, &IID_IInspectable) || ++ IsEqualGUID(iid, &IID_IActivationFactory)) + { + IUnknown_AddRef(iface); -+ *object = &impl->IInstalledVoicesStatic_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; +} + @@ -413,18 +113,18 @@ index 00000000000..63c4a71eea0 + IActivationFactory *iface) +{ + struct windows_media_speech *impl = impl_from_IActivationFactory(iface); -+ ULONG rc = InterlockedIncrement(&impl->refcount); -+ TRACE("%p increasing refcount to %u.\n", impl, rc); -+ return rc; ++ ULONG ref = InterlockedIncrement(&impl->ref); ++ TRACE("iface %p, ref %u.\n", iface, ref); ++ return ref; +} + +static ULONG STDMETHODCALLTYPE windows_media_speech_Release( + IActivationFactory *iface) +{ + struct windows_media_speech *impl = impl_from_IActivationFactory(iface); -+ ULONG rc = InterlockedDecrement(&impl->refcount); -+ TRACE("%p decreasing refcount to %u.\n", impl, rc); -+ return rc; ++ ULONG ref = InterlockedDecrement(&impl->ref); ++ TRACE("iface %p, ref %u.\n", iface, ref); ++ return ref; +} + +static HRESULT STDMETHODCALLTYPE windows_media_speech_GetIids( @@ -471,8 +171,6 @@ index 00000000000..63c4a71eea0 +static struct windows_media_speech windows_media_speech = +{ + {&activation_factory_vtbl}, -+ {&installed_voices_static_vtbl}, -+ {&vector_view_vtbl}, + 0 +}; + @@ -481,9 +179,9 @@ index 00000000000..63c4a71eea0 + 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; +} + @@ -495,13 +193,13 @@ index 00000000000..63c4a71eea0 + return S_OK; +} diff --git a/loader/wine.inf.in b/loader/wine.inf.in -index 73d96debd6a..879c1038a95 100644 +index ff9a221feaa..157b146a857 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in -@@ -731,6 +731,7 @@ HKLM,%MciExtStr%,"wvx",,"MPEGVideo" +@@ -713,6 +713,7 @@ HKLM,%MciExtStr%,"wmx",,"MPEGVideo" + HKLM,%MciExtStr%,"wvx",,"MPEGVideo" + [Misc] - 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" HKLM,Software\Borland\Database Engine\Settings\SYSTEM\INIT,SHAREDMEMLOCATION,,9000 HKLM,Software\Clients\Mail,,2,"Native Mail Client" diff --git a/patches/windows.media.speech.dll/0002-windows.media.speech-Implement-IInstalledVoicesStati.patch b/patches/windows.media.speech.dll/0002-windows.media.speech-Implement-IInstalledVoicesStati.patch new file mode 100644 index 00000000..fe08087c --- /dev/null +++ b/patches/windows.media.speech.dll/0002-windows.media.speech-Implement-IInstalledVoicesStati.patch @@ -0,0 +1,156 @@ +From 7a0957631d225f7eee1bf4c6409f72eab76b3f92 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Bernon?= +Date: Fri, 9 Oct 2020 13:53:55 +0200 +Subject: [PATCH 2/4] windows.media.speech: Implement IInstalledVoicesStatic + stub. + +--- + .../windows.media.speech_main.c | 104 ++++++++++++++++++ + 1 file changed, 104 insertions(+) + +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 c7c14deef78..cb686ccc0b5 100644 +--- a/dlls/windows.media.speech.dll/windows.media.speech_main.c ++++ b/dlls/windows.media.speech.dll/windows.media.speech_main.c +@@ -10,6 +10,9 @@ + #include "initguid.h" + #include "activation.h" + ++#define WIDL_USING_IVECTORVIEW_1_WINDOWS_MEDIA_SPEECHSYNTHESIS_VOICEINFORMATION ++#define WIDL_USING_WINDOWS_MEDIA_SPEECHSYNTHESIS_IINSTALLEDVOICESSTATIC ++#define WIDL_USING_WINDOWS_MEDIA_SPEECHSYNTHESIS_IVOICEINFORMATION + #include "windows.foundation.h" + #include "windows.media.speechsynthesis.h" + +@@ -27,6 +30,7 @@ static const char *debugstr_hstring(HSTRING hstr) + struct windows_media_speech + { + IActivationFactory IActivationFactory_iface; ++ IInstalledVoicesStatic IInstalledVoicesStatic_iface; + LONG ref; + }; + +@@ -35,6 +39,98 @@ static inline struct windows_media_speech *impl_from_IActivationFactory(IActivat + return CONTAINING_RECORD(iface, struct windows_media_speech, IActivationFactory_iface); + } + ++static inline struct windows_media_speech *impl_from_IInstalledVoicesStatic(IInstalledVoicesStatic *iface) ++{ ++ return CONTAINING_RECORD(iface, struct windows_media_speech, IInstalledVoicesStatic_iface); ++} ++ ++static HRESULT STDMETHODCALLTYPE installed_voices_static_QueryInterface( ++ IInstalledVoicesStatic *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_IAgileObject) || ++ IsEqualGUID(iid, &IID_IInspectable) || ++ IsEqualGUID(iid, &IID_IInstalledVoicesStatic)) ++ { ++ 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 installed_voices_static_AddRef( ++ IInstalledVoicesStatic *iface) ++{ ++ struct windows_media_speech *impl = impl_from_IInstalledVoicesStatic(iface); ++ ULONG ref = InterlockedIncrement(&impl->ref); ++ TRACE("iface %p, ref %u.\n", iface, ref); ++ return ref; ++} ++ ++static ULONG STDMETHODCALLTYPE installed_voices_static_Release( ++ IInstalledVoicesStatic *iface) ++{ ++ struct windows_media_speech *impl = impl_from_IInstalledVoicesStatic(iface); ++ ULONG ref = InterlockedDecrement(&impl->ref); ++ TRACE("iface %p, ref %u.\n", iface, ref); ++ return ref; ++} ++ ++static HRESULT STDMETHODCALLTYPE installed_voices_static_GetIids( ++ IInstalledVoicesStatic *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 installed_voices_static_GetRuntimeClassName( ++ IInstalledVoicesStatic *iface, HSTRING *class_name) ++{ ++ FIXME("iface %p, class_name %p stub!\n", iface, class_name); ++ return E_NOTIMPL; ++} ++ ++static HRESULT STDMETHODCALLTYPE installed_voices_static_GetTrustLevel( ++ IInstalledVoicesStatic *iface, TrustLevel *trust_level) ++{ ++ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); ++ return E_NOTIMPL; ++} ++ ++static HRESULT STDMETHODCALLTYPE installed_voices_static_get_AllVoices( ++ IInstalledVoicesStatic *iface, IVectorView_VoiceInformation **value) ++{ ++ FIXME("iface %p, value %p stub!\n", iface, value); ++ return E_NOTIMPL; ++} ++ ++static HRESULT STDMETHODCALLTYPE installed_voices_static_get_DefaultVoice( ++ IInstalledVoicesStatic *iface, IVoiceInformation **value) ++{ ++ FIXME("iface %p, value %p stub!\n", iface, value); ++ return E_NOTIMPL; ++} ++ ++static const struct IInstalledVoicesStaticVtbl installed_voices_static_vtbl = ++{ ++ installed_voices_static_QueryInterface, ++ installed_voices_static_AddRef, ++ installed_voices_static_Release, ++ /* IInspectable methods */ ++ installed_voices_static_GetIids, ++ installed_voices_static_GetRuntimeClassName, ++ installed_voices_static_GetTrustLevel, ++ /* IInstalledVoicesStatic methods */ ++ installed_voices_static_get_AllVoices, ++ installed_voices_static_get_DefaultVoice, ++}; ++ + static HRESULT STDMETHODCALLTYPE windows_media_speech_QueryInterface( + IActivationFactory *iface, REFIID iid, void **out) + { +@@ -50,6 +146,13 @@ static HRESULT STDMETHODCALLTYPE windows_media_speech_QueryInterface( + return S_OK; + } + ++ if (IsEqualGUID(iid, &IID_IInstalledVoicesStatic)) ++ { ++ IUnknown_AddRef(iface); ++ *out = &impl->IInstalledVoicesStatic_iface; ++ return S_OK; ++ } ++ + FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +@@ -117,6 +220,7 @@ static const struct IActivationFactoryVtbl activation_factory_vtbl = + static struct windows_media_speech windows_media_speech = + { + {&activation_factory_vtbl}, ++ {&installed_voices_static_vtbl}, + 0 + }; + +-- +2.28.0 + diff --git a/patches/windows.media.speech.dll/0003-windows.media.speech-Implement-IInstalledVoicesStati.patch b/patches/windows.media.speech.dll/0003-windows.media.speech-Implement-IInstalledVoicesStati.patch new file mode 100644 index 00000000..637f87d5 --- /dev/null +++ b/patches/windows.media.speech.dll/0003-windows.media.speech-Implement-IInstalledVoicesStati.patch @@ -0,0 +1,167 @@ +From 66203027d2c82fd502e1ff30213bc4ba09f73d5b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Bernon?= +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 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 + diff --git a/patches/windows.media.speech.dll/0004-windows.media.speech-Fake-empty-IInstalledVoicesStat.patch b/patches/windows.media.speech.dll/0004-windows.media.speech-Fake-empty-IInstalledVoicesStat.patch new file mode 100644 index 00000000..c4faac3b --- /dev/null +++ b/patches/windows.media.speech.dll/0004-windows.media.speech-Fake-empty-IInstalledVoicesStat.patch @@ -0,0 +1,53 @@ +From 619f2108b20c843ca1ba75d18fb7cbc50c80bd5e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Bernon?= +Date: Fri, 9 Oct 2020 14:06:33 +0200 +Subject: [PATCH 4/4] windows.media.speech: Fake empty + IInstalledVoicesStatic::AllVoices vector. + +--- + .../windows.media.speech_main.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +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 1f9c2bdc0b9..5fe2e60ec42 100644 +--- a/dlls/windows.media.speech.dll/windows.media.speech_main.c ++++ b/dlls/windows.media.speech.dll/windows.media.speech_main.c +@@ -113,28 +113,31 @@ 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; ++ return S_OK; + } + + 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; ++ *value = 0; ++ return S_OK; + } + + 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; ++ *value = FALSE; ++ return S_OK; + } + + 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; ++ *value = 0; ++ return S_OK; + } + + static const struct IVectorView_VoiceInformationVtbl vector_view_voice_information_vtbl = +-- +2.28.0 +