Bernhard Kölbl : windows.media.speech: Return IAsyncOperation from synthesizer_SynthesizeSsmlToStreamAsync.
Module: wine Branch: master Commit: f184c777b4f59e6b8174a17d780a53f5eb7ed003 URL: https://source.winehq.org/git/wine.git/?a=commit;h=f184c777b4f59e6b8174a17d7... Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Tue Jun 7 21:55:55 2022 +0200 windows.media.speech: Return IAsyncOperation from synthesizer_SynthesizeSsmlToStreamAsync. Based on a patch by Connor McAdams <cmcadams(a)codeweavers.com> Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> --- dlls/windows.media.speech/synthesizer.c | 8 +++++++- dlls/windows.media.speech/tests/speech.c | 16 +++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c index 3a77fc62234..7e1d19cb4c1 100644 --- a/dlls/windows.media.speech/synthesizer.c +++ b/dlls/windows.media.speech/synthesizer.c @@ -254,11 +254,17 @@ static HRESULT WINAPI synthesizer_SynthesizeTextToStreamAsync( ISpeechSynthesize text_to_stream_operation, (IAsyncOperation_IInspectable **)operation); } +static HRESULT CALLBACK ssml_to_stream_operation( IInspectable *invoker, IInspectable **result ) +{ + return S_OK; +} + static HRESULT WINAPI synthesizer_SynthesizeSsmlToStreamAsync( ISpeechSynthesizer *iface, HSTRING ssml, IAsyncOperation_SpeechSynthesisStream **operation ) { FIXME("iface %p, text %p, operation %p stub.\n", iface, ssml, operation); - return E_NOTIMPL; + return async_operation_inspectable_create(&IID_IAsyncOperation_SpeechSynthesisStream, NULL, + ssml_to_stream_operation, (IAsyncOperation_IInspectable **)operation); } static HRESULT WINAPI synthesizer_put_Voice( ISpeechSynthesizer *iface, IVoiceInformation *value ) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index c9898b2cc03..bea3c5104b1 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -971,8 +971,7 @@ static void test_SpeechSynthesizer(void) ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr); hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str2, &operation_ss_stream); - todo_wine ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); - if(FAILED(hr)) goto skip_ss_stream; + ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); await_async_inspectable((IAsyncOperation_IInspectable *)operation_ss_stream, &async_inspectable_handler, @@ -998,28 +997,27 @@ static void test_SpeechSynthesizer(void) operation_ss_stream = (void *)0xdeadbeef; hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, NULL, &operation_ss_stream); /* Broken on Win 8 + 8.1 */ - todo_wine ok(hr == S_OK || broken(hr == E_INVALIDARG), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); + ok(hr == S_OK || broken(hr == E_INVALIDARG), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); if (hr == S_OK) { - todo_wine ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream); + ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream); IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream); } - else todo_wine ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream); + else ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream); operation_ss_stream = (void *)0xdeadbeef; hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str, &operation_ss_stream); /* Broken on Win 8 + 8.1 */ - todo_wine ok(hr == S_OK || broken(hr == SPERR_WINRT_INCORRECT_FORMAT), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); + ok(hr == S_OK || broken(hr == SPERR_WINRT_INCORRECT_FORMAT), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); if (hr == S_OK) { - todo_wine ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream); + ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream); IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream); } - else todo_wine ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream); + else ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream); -skip_ss_stream: WindowsDeleteString(str2); WindowsDeleteString(str);
participants (1)
-
Alexandre Julliard