Module: wine Branch: master Commit: dd083a6195df6b1b8a98940a76e6d2c7ae99b414 URL: https://gitlab.winehq.org/wine/wine/-/commit/dd083a6195df6b1b8a98940a76e6d2c...
Author: Shaun Ren shaun.ren@linux.com Date: Fri Feb 16 19:52:33 2024 -0500
sapi: Implement ISpeechVoice::GetTypeInfo.
---
dlls/sapi/dispatch.c | 1 + dlls/sapi/sapi_private.h | 1 + dlls/sapi/tests/tts.c | 13 +++++++++++++ dlls/sapi/tts.c | 8 ++++---- 4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/dlls/sapi/dispatch.c b/dlls/sapi/dispatch.c index 731ae9ae48f..c1f0e842788 100644 --- a/dlls/sapi/dispatch.c +++ b/dlls/sapi/dispatch.c @@ -36,6 +36,7 @@ static REFIID tid_id[] = { &IID_ISpeechObjectToken, &IID_ISpeechObjectTokens, + &IID_ISpeechVoice, };
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret) diff --git a/dlls/sapi/sapi_private.h b/dlls/sapi/sapi_private.h index 55e1460ad38..219436f88c1 100644 --- a/dlls/sapi/sapi_private.h +++ b/dlls/sapi/sapi_private.h @@ -57,6 +57,7 @@ enum type_id { ISpeechObjectToken_tid, ISpeechObjectTokens_tid, + ISpeechVoice_tid, last_tid };
diff --git a/dlls/sapi/tests/tts.c b/dlls/sapi/tests/tts.c index 8f18934fce3..111d0a0bc6c 100644 --- a/dlls/sapi/tests/tts.c +++ b/dlls/sapi/tests/tts.c @@ -436,6 +436,8 @@ static void test_spvoice(void) LONG count; BSTR req = NULL, opt = NULL; UINT info_count; + ITypeInfo *typeinfo; + TYPEATTR *typeattr; HRESULT hr;
if (waveOutGetNumDevs() == 0) { @@ -719,6 +721,17 @@ static void test_spvoice(void) ok(hr == S_OK, "got %#lx.\n", hr); ok(info_count == 1, "got %u.\n", info_count);
+ typeinfo = NULL; + typeattr = NULL; + hr = ISpeechVoice_GetTypeInfo(speech_voice, 0, 0, &typeinfo); + ok(hr == S_OK, "got %#lx.\n", hr); + hr = ITypeInfo_GetTypeAttr(typeinfo, &typeattr); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(typeattr->typekind == TKIND_DISPATCH, "got %u.\n", typeattr->typekind); + ok(IsEqualGUID(&typeattr->guid, &IID_ISpeechVoice), "got %s.\n", wine_dbgstr_guid(&typeattr->guid)); + ITypeInfo_ReleaseTypeAttr(typeinfo, typeattr); + ITypeInfo_Release(typeinfo); + ISpeechVoice_Release(speech_voice);
done: diff --git a/dlls/sapi/tts.c b/dlls/sapi/tts.c index 2493a2804f2..8e597252b31 100644 --- a/dlls/sapi/tts.c +++ b/dlls/sapi/tts.c @@ -186,12 +186,12 @@ static HRESULT WINAPI speech_voice_GetTypeInfoCount(ISpeechVoice *iface, UINT *c return S_OK; }
-static HRESULT WINAPI speech_voice_GetTypeInfo(ISpeechVoice *iface, UINT info, LCID lcid, +static HRESULT WINAPI speech_voice_GetTypeInfo(ISpeechVoice *iface, UINT index, LCID lcid, ITypeInfo **type_info) { - FIXME("(%p, %u, %lu, %p): stub.\n", iface, info, lcid, type_info); - - return E_NOTIMPL; + TRACE("(%p, %u, %#lx, %p).\n", iface, index, lcid, type_info); + if (index != 0) return DISP_E_BADINDEX; + return get_typeinfo(ISpeechVoice_tid, type_info); }
static HRESULT WINAPI speech_voice_GetIDsOfNames(ISpeechVoice *iface, REFIID riid, LPOLESTR *names,