Skip to content

Commit

Permalink
sapi: Implement ISpeechVoice::GetTypeInfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunren authored and julliard committed Feb 20, 2024
1 parent 5808735 commit dd083a6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions dlls/sapi/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ static REFIID tid_id[] =
{
&IID_ISpeechObjectToken,
&IID_ISpeechObjectTokens,
&IID_ISpeechVoice,
};

HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
Expand Down
1 change: 1 addition & 0 deletions dlls/sapi/sapi_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ enum type_id
{
ISpeechObjectToken_tid,
ISpeechObjectTokens_tid,
ISpeechVoice_tid,
last_tid
};

Expand Down
13 changes: 13 additions & 0 deletions dlls/sapi/tests/tts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions dlls/sapi/tts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit dd083a6

Please sign in to comment.