Bernhard Kölbl : windows.media.speech: Implement ISpeechRecognizer_get_Constraints.
Alexandre Julliard
julliard at winehq.org
Wed Mar 30 15:43:57 CDT 2022
Module: wine
Branch: master
Commit: 1f35e2fe4ff6d42116e72e7e83bcea8e8b0fddf9
URL: https://source.winehq.org/git/wine.git/?a=commit;h=1f35e2fe4ff6d42116e72e7e83bcea8e8b0fddf9
Author: Bernhard Kölbl <besentv at gmail.com>
Date: Wed Mar 30 21:00:38 2022 +0200
windows.media.speech: Implement ISpeechRecognizer_get_Constraints.
Signed-off-by: Bernhard Kölbl <besentv at gmail.com>
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/windows.media.speech/recognizer.c | 6 ++++--
dlls/windows.media.speech/tests/speech.c | 7 +++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/windows.media.speech/recognizer.c b/dlls/windows.media.speech/recognizer.c
index 0894f91b36a..36836f83a98 100644
--- a/dlls/windows.media.speech/recognizer.c
+++ b/dlls/windows.media.speech/recognizer.c
@@ -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 )
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c
index ea160eec9da..8093c4b95b8 100644
--- a/dlls/windows.media.speech/tests/speech.c
+++ b/dlls/windows.media.speech/tests/speech.c
@@ -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);
More information about the wine-cvs
mailing list