windows.media.speech: Implement ISpeechRecognizer_get_Constraints.

Signed-off-by: Bernhard Kölbl <besentv@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Bernhard Kölbl 2022-03-30 21:00:38 +02:00 committed by Alexandre Julliard
parent 3366fecc3c
commit 1f35e2fe4f
2 changed files with 11 additions and 2 deletions

View File

@ -324,8 +324,10 @@ static HRESULT WINAPI recognizer_GetTrustLevel( ISpeechRecognizer *iface, TrustL
static HRESULT WINAPI recognizer_get_Constraints( ISpeechRecognizer *iface, IVector_ISpeechRecognitionConstraint **vector )
{
FIXME("iface %p, operation %p stub!\n", iface, vector);
return E_NOTIMPL;
struct recognizer *impl = impl_from_ISpeechRecognizer(iface);
TRACE("iface %p, operation %p.\n", iface, vector);
IVector_ISpeechRecognitionConstraint_AddRef((*vector = impl->constraints));
return S_OK;
}
static HRESULT WINAPI recognizer_get_CurrentLanguage( ISpeechRecognizer *iface, ILanguage **language )

View File

@ -729,6 +729,7 @@ static void test_VoiceInformation(void)
static void test_SpeechRecognizer(void)
{
static const WCHAR *speech_recognition_name = L"Windows.Media.SpeechRecognition.SpeechRecognizer";
IVector_ISpeechRecognitionConstraint *constraints = NULL;
ISpeechContinuousRecognitionSession *session = NULL;
ISpeechRecognizerFactory *sr_factory = NULL;
ISpeechRecognizerStatics *sr_statics = NULL;
@ -841,6 +842,12 @@ static void test_SpeechRecognizer(void)
hr = ISpeechContinuousRecognitionSession_remove_ResultGenerated(session, token);
ok(hr == S_OK, "ISpeechContinuousRecognitionSession_remove_ResultGenerated failed, hr %#lx.\n", hr);
hr = ISpeechRecognizer_get_Constraints(recognizer, &constraints);
ok(hr == S_OK, "ISpeechContinuousRecognitionSession_get_Constraints failed, hr %#lx.\n", hr);
ref = IVector_ISpeechRecognitionConstraint_Release(constraints);
ok(ref == 1, "Got unexpected ref %lu.\n", ref);
ref = ISpeechContinuousRecognitionSession_Release(session);
ok(ref == 1, "Got unexpected ref %lu.\n", ref);