Module: wine Branch: master Commit: 9d044669f3a50fa154cbe4d1d804dee319dbbf09 URL: https://gitlab.winehq.org/wine/wine/-/commit/9d044669f3a50fa154cbe4d1d804dee...
Author: Shaun Ren shaun.ren@linux.com Date: Fri Feb 16 20:04:41 2024 -0500
sapi: Implement ISpeechVoice::GetIDsOfNames.
---
dlls/sapi/tests/tts.c | 7 +++++++ dlls/sapi/tts.c | 13 ++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/dlls/sapi/tests/tts.c b/dlls/sapi/tests/tts.c index 111d0a0bc6c..7566bd5c5cb 100644 --- a/dlls/sapi/tests/tts.c +++ b/dlls/sapi/tests/tts.c @@ -418,6 +418,7 @@ static void test_spvoice(void) { static const WCHAR test_token_id[] = L"HKEY_LOCAL_MACHINE\Software\Microsoft\Speech\Voices\Tokens\WinetestVoice"; static const WCHAR test_text[] = L"Hello! This is a test sentence."; + static const WCHAR *get_voices = L"GetVoices";
ISpVoice *voice; IUnknown *dummy; @@ -438,6 +439,7 @@ static void test_spvoice(void) UINT info_count; ITypeInfo *typeinfo; TYPEATTR *typeattr; + DISPID dispid; HRESULT hr;
if (waveOutGetNumDevs() == 0) { @@ -732,6 +734,11 @@ static void test_spvoice(void) ITypeInfo_ReleaseTypeAttr(typeinfo, typeattr); ITypeInfo_Release(typeinfo);
+ dispid = 0xdeadbeef; + hr = ISpeechVoice_GetIDsOfNames(speech_voice, &IID_NULL, (WCHAR **)&get_voices, 1, 0x409, &dispid); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(dispid == DISPID_SVGetVoices, "got %#lx.\n", dispid); + ISpeechVoice_Release(speech_voice);
done: diff --git a/dlls/sapi/tts.c b/dlls/sapi/tts.c index 8e597252b31..d08b0c5de22 100644 --- a/dlls/sapi/tts.c +++ b/dlls/sapi/tts.c @@ -195,11 +195,18 @@ static HRESULT WINAPI speech_voice_GetTypeInfo(ISpeechVoice *iface, UINT index, }
static HRESULT WINAPI speech_voice_GetIDsOfNames(ISpeechVoice *iface, REFIID riid, LPOLESTR *names, - UINT count, LCID lcid, DISPID *dispid) + UINT count, LCID lcid, DISPID *dispids) { - FIXME("(%p, %s, %p, %u, %lu, %p): stub.\n", iface, debugstr_guid(riid), names, count, lcid, dispid); + ITypeInfo *typeinfo; + HRESULT hr;
- return E_NOTIMPL; + TRACE("(%p, %s, %p, %u, %#lx, %p).\n", iface, debugstr_guid(riid), names, count, lcid, dispids); + + if (FAILED(hr = get_typeinfo(ISpeechVoice_tid, &typeinfo))) + return hr; + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, dispids); + ITypeInfo_Release(typeinfo); + return hr; }
static HRESULT WINAPI speech_voice_Invoke(ISpeechVoice *iface, DISPID dispid, REFIID riid, LCID lcid,