From 6e8d4508048941015e62c42372a584d9e0dd4931 Mon Sep 17 00:00:00 2001 From: Shaun Ren Date: Sun, 11 Feb 2024 00:29:46 -0500 Subject: [PATCH] sapi: Implement ISpeechObjectTokens::Invoke. --- dlls/sapi/dispatch.c | 1 + dlls/sapi/sapi_private.h | 1 + dlls/sapi/tests/token.c | 11 ++++++++++- dlls/sapi/token.c | 14 ++++++++++++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/sapi/dispatch.c b/dlls/sapi/dispatch.c index df0c6c9bf9c..731ae9ae48f 100644 --- a/dlls/sapi/dispatch.c +++ b/dlls/sapi/dispatch.c @@ -35,6 +35,7 @@ static ITypeInfo *typeinfos[last_tid]; static REFIID tid_id[] = { &IID_ISpeechObjectToken, + &IID_ISpeechObjectTokens, }; HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret) diff --git a/dlls/sapi/sapi_private.h b/dlls/sapi/sapi_private.h index 9a3c92cc4dc..55e1460ad38 100644 --- a/dlls/sapi/sapi_private.h +++ b/dlls/sapi/sapi_private.h @@ -56,6 +56,7 @@ HRESULT token_create( IUnknown *outer, REFIID iid, void **obj ); enum type_id { ISpeechObjectToken_tid, + ISpeechObjectTokens_tid, last_tid }; diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index 89cbb5150a4..6d2c40ea154 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -256,7 +256,8 @@ static void test_token_enum(void) ISpObjectToken *out_tokens[5]; WCHAR token_id[MAX_PATH]; ULONG count; - VARIANT vars[3]; + VARIANT vars[3], ret; + DISPPARAMS params; int i; hr = CoCreateInstance( &CLSID_SpObjectTokenEnum, NULL, CLSCTX_INPROC_SERVER, @@ -402,6 +403,14 @@ static void test_token_enum(void) IEnumVARIANT_Release( enumvar ); + memset( ¶ms, 0, sizeof(params) ); + VariantInit( &ret ); + hr = ISpeechObjectTokens_Invoke( speech_tokens, DISPID_SOTsCount, &IID_NULL, 0, + DISPATCH_PROPERTYGET, ¶ms, &ret, NULL, NULL ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( V_VT( &ret ) == VT_I4, "got %#x\n", V_VT( &ret ) ); + ok( V_I4( &ret ) == 3, "got %ld\n", V_I4( &ret ) ); + ISpeechObjectTokens_Release( speech_tokens ); ISpObjectTokenEnumBuilder_Release( token_enum ); diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c index b7f78fe98bd..ad8163c9567 100644 --- a/dlls/sapi/token.c +++ b/dlls/sapi/token.c @@ -1339,8 +1339,18 @@ static HRESULT WINAPI speech_tokens_Invoke( ISpeechObjectTokens *iface, EXCEPINFO *excepinfo, UINT *argerr ) { - FIXME( "stub\n" ); - return E_NOTIMPL; + ITypeInfo *ti; + HRESULT hr; + + TRACE( "(%p)->(%ld %s %#lx %#x %p %p %p %p)\n", iface, dispid, + debugstr_guid( iid ), lcid, flags, params, result, excepinfo, argerr ); + + if (FAILED(hr = get_typeinfo( ISpeechObjectTokens_tid, &ti ))) + return hr; + hr = ITypeInfo_Invoke( ti, iface, dispid, flags, params, result, excepinfo, argerr ); + ITypeInfo_Release( ti ); + + return hr; } static HRESULT WINAPI speech_tokens_get_Count( ISpeechObjectTokens *iface,