[PATCH v2 0/4] MR10275: windows.media.speech: Some smaller changes
-- v2: windows.media.speech: Set pointer to NULL. windows.media.speech: Make sure voice provider is initialized before returning default voice. windows.media.speech/tests: Skip some voice tests on Windows 8. windows.media.speech/tests: Change a value check. https://gitlab.winehq.org/wine/wine/-/merge_requests/10275
From: Bernhard Kölbl <bkoelbl@codeweavers.com> --- dlls/windows.media.speech/tests/speech.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 0146f635b2a..63410d6a50c 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -1492,7 +1492,7 @@ static void test_SpeechRecognizer(void) compilation_result = (void *)0xdeadbeef; hr = IAsyncOperation_SpeechRecognitionCompilationResult_GetResults(operation, &compilation_result); todo_wine ok(hr == E_UNEXPECTED, "Got unexpected hr %#lx.\n", hr); - todo_wine ok(compilation_result == NULL, "Got %p.\n", compilation_result); + todo_wine ok(compilation_result == (void *)0xdeadbeef, "Got %p.\n", compilation_result); if (compilation_result && compilation_result != (void *)0xdeadbeef) ISpeechRecognitionCompilationResult_Release(compilation_result); hr = IAsyncOperation_SpeechRecognitionCompilationResult_QueryInterface(operation, &IID_IAsyncInfo, (void **)&info); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10275
From: Bernhard Kölbl <bkoelbl@codeweavers.com> --- dlls/windows.media.speech/tests/speech.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 63410d6a50c..fbd2873330c 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -861,7 +861,7 @@ static void test_SpeechSynthesizer(void) IClosable *closable; struct async_inspectable_handler async_inspectable_handler; HMODULE hdll; - HSTRING str, str2, default_voice_id; + HSTRING str, str2, default_voice_id = NULL; UINT64 value; HRESULT hr; UINT32 size, idx; @@ -936,7 +936,10 @@ static void test_SpeechSynthesizer(void) IAgileObject_Release(tmp_agile_object); hr = IInstalledVoicesStatic_get_AllVoices(voices_static, &voices); - ok(hr == S_OK, "IInstalledVoicesStatic_get_AllVoices failed, hr %#lx\n", hr); + ok(hr == S_OK || broken(hr == COR_E_FILENOTFOUND) /* Broken on Win 8 + 8.1 */, "IInstalledVoicesStatic_get_AllVoices failed, hr %#lx\n", hr); + + if (FAILED(hr)) + goto skip_voices; hr = IVectorView_VoiceInformation_QueryInterface(voices, &IID_IInspectable, (void **)&tmp_inspectable); ok(hr == S_OK, "IVectorView_VoiceInformation_QueryInterface voices failed, hr %#lx\n", hr); @@ -1012,6 +1015,7 @@ static void test_SpeechSynthesizer(void) ref = IVectorView_VoiceInformation_Release(voices); ok(!ref, "Got unexpected ref %lu.\n", ref); +skip_voices: IInstalledVoicesStatic_Release(voices_static); IAgileObject_Release(agile_object); IInspectable_Release(inspectable); @@ -1033,8 +1037,11 @@ static void test_SpeechSynthesizer(void) hr = IVoiceInformation_get_Id(voice, &str); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - hr = WindowsCompareStringOrdinal(str, default_voice_id, &cmp); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + if (default_voice_id) + { + hr = WindowsCompareStringOrdinal(str, default_voice_id, &cmp); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + } hr = WindowsDeleteString(str); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10275
From: Bernhard Kölbl <bkoelbl@codeweavers.com> --- dlls/windows.media.speech/synthesizer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c index bbe6181c1d4..0209d7a0dcd 100644 --- a/dlls/windows.media.speech/synthesizer.c +++ b/dlls/windows.media.speech/synthesizer.c @@ -1801,12 +1801,16 @@ static HRESULT WINAPI installed_voices_static_get_DefaultVoice( IInstalledVoices EnterCriticalSection(&allvoices_cs); + if (FAILED(hr = static_installed_voices_init())) + goto end; + if (SUCCEEDED(hr = IVectorView_VoiceInformation_GetAt(&all_voices.IVectorView_VoiceInformation_iface, 0, &static_voice))) { hr = voice_information_clone(static_voice, value); IVoiceInformation_Release(static_voice); } +end: LeaveCriticalSection(&allvoices_cs); return hr; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10275
From: Bernhard Kölbl <bkoelbl@codeweavers.com> --- dlls/windows.media.speech/synthesizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c index 0209d7a0dcd..587463c0444 100644 --- a/dlls/windows.media.speech/synthesizer.c +++ b/dlls/windows.media.speech/synthesizer.c @@ -304,7 +304,7 @@ static ULONG WINAPI vector_view_voice_information_Release( IVectorView_VoiceInfo for (i = 0; i < impl->provider.num_voices; ++i) { IVoiceInformation_Release(impl->provider.voices[i]); - impl->provider.voices[i] = 0; + impl->provider.voices[i] = NULL; } impl->provider.num_voices = 0; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10275
v2: - Return lazy loading and invoke it when getting the default voice. - Split of setting a pointer to null in a separate commit. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10275#note_131840
participants (1)
-
Bernhard Kölbl