sapi: Implement ISpeechVoice::Invoke.

This commit is contained in:
Shaun Ren 2024-02-17 00:36:26 -05:00 committed by Alexandre Julliard
parent 9d044669f3
commit c72f0ec0f0
2 changed files with 34 additions and 2 deletions

View file

@ -440,6 +440,8 @@ static void test_spvoice(void)
ITypeInfo *typeinfo;
TYPEATTR *typeattr;
DISPID dispid;
DISPPARAMS params;
VARIANT args[2], ret;
HRESULT hr;
if (waveOutGetNumDevs() == 0) {
@ -739,6 +741,29 @@ static void test_spvoice(void)
ok(hr == S_OK, "got %#lx.\n", hr);
ok(dispid == DISPID_SVGetVoices, "got %#lx.\n", dispid);
memset(&params, 0, sizeof(params));
params.cArgs = 2;
params.cNamedArgs = 0;
params.rgvarg = args;
VariantInit(&args[0]);
VariantInit(&args[1]);
V_VT(&args[0]) = VT_BSTR;
V_VT(&args[1]) = VT_BSTR;
V_BSTR(&args[0]) = opt;
V_BSTR(&args[1]) = req;
VariantInit(&ret);
hr = ISpeechVoice_Invoke(speech_voice, dispid, &IID_NULL, 0, DISPATCH_METHOD, &params, &ret, NULL, NULL);
ok(hr == S_OK, "got %#lx.\n", hr);
ok(V_VT(&ret) == VT_DISPATCH, "got %#x.\n", V_VT(&ret));
hr = IDispatch_QueryInterface(V_DISPATCH(&ret), &IID_ISpeechObjectTokens, (void **)&speech_tokens);
ok(hr == S_OK, "got %#lx.\n", hr);
count = -1;
hr = ISpeechObjectTokens_get_Count(speech_tokens, &count);
ok(hr == S_OK, "got %#lx.\n", hr);
ok(count == 1, "got %ld.\n", count);
ISpeechObjectTokens_Release(speech_tokens);
VariantClear(&ret);
ISpeechVoice_Release(speech_voice);
done:

View file

@ -213,10 +213,17 @@ static HRESULT WINAPI speech_voice_Invoke(ISpeechVoice *iface, DISPID dispid, RE
WORD flags, DISPPARAMS *params, VARIANT *result,
EXCEPINFO *excepinfo, UINT *argerr)
{
FIXME("(%p, %ld, %s, %#lx, %#x, %p, %p, %p, %p): stub.\n", iface, dispid, debugstr_guid(riid),
ITypeInfo *typeinfo;
HRESULT hr;
TRACE("(%p, %ld, %s, %#lx, %#x, %p, %p, %p, %p).\n", iface, dispid, debugstr_guid(riid),
lcid, flags, params, result, excepinfo, argerr);
return E_NOTIMPL;
if (FAILED(hr = get_typeinfo(ISpeechVoice_tid, &typeinfo)))
return hr;
hr = ITypeInfo_Invoke(typeinfo, iface, dispid, flags, params, result, excepinfo, argerr);
ITypeInfo_Release(typeinfo);
return hr;
}
static HRESULT WINAPI speech_voice_get_Status(ISpeechVoice *iface, ISpeechVoiceStatus **status)