[PATCH 3/5] windows.media.speech: Implement ISpeechRecognizer2_get_ContinuousRecognitionSession.

Bernhard Kölbl besentv at gmail.com
Wed Mar 16 11:31:02 CDT 2022


Signed-off-by: Bernhard Kölbl <besentv at gmail.com>
---
 dlls/windows.media.speech/recognizer.c   | 6 ++++--
 dlls/windows.media.speech/tests/speech.c | 9 +++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dlls/windows.media.speech/recognizer.c b/dlls/windows.media.speech/recognizer.c
index 8819a46d5ba..47c6e62f417 100644
--- a/dlls/windows.media.speech/recognizer.c
+++ b/dlls/windows.media.speech/recognizer.c
@@ -443,8 +443,10 @@ DEFINE_IINSPECTABLE(recognizer2, ISpeechRecognizer2, struct recognizer, ISpeechR
 static HRESULT WINAPI recognizer2_get_ContinuousRecognitionSession( ISpeechRecognizer2 *iface,
                                                                     ISpeechContinuousRecognitionSession **session )
 {
-    FIXME("iface %p, session %p stub!\n", iface, session);
-    return E_NOTIMPL;
+    struct recognizer *impl = impl_from_ISpeechRecognizer2(iface);
+    TRACE("iface %p, session %p.\n", iface, session);
+    ISpeechContinuousRecognitionSession_QueryInterface(impl->session, &IID_ISpeechContinuousRecognitionSession, (void **)session);
+    return S_OK;
 }
 
 static HRESULT WINAPI recognizer2_get_State( ISpeechRecognizer2 *iface, SpeechRecognizerState *state )
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c
index 66869a164d2..e22ab35928e 100644
--- a/dlls/windows.media.speech/tests/speech.c
+++ b/dlls/windows.media.speech/tests/speech.c
@@ -569,6 +569,7 @@ static void test_VoiceInformation(void)
 static void test_SpeechRecognizer(void)
 {
     static const WCHAR *speech_recognition_name = L"Windows.Media.SpeechRecognition.SpeechRecognizer";
+    ISpeechContinuousRecognitionSession *session = NULL;
     ISpeechRecognizerFactory *sr_factory = NULL;
     ISpeechRecognizerStatics *sr_statics = NULL;
     ISpeechRecognizerStatics2 *sr_statics2 = NULL;
@@ -648,6 +649,14 @@ static void test_SpeechRecognizer(void)
         hr = IInspectable_QueryInterface(inspectable, &IID_ISpeechRecognizer2, (void **)&recognizer2);
         ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
+        hr = ISpeechRecognizer2_get_ContinuousRecognitionSession(recognizer2, &session);
+        ok(hr == S_OK, "ISpeechRecognizer2_get_ContinuousRecognitionSession failed, hr %#lx.\n", hr);
+        check_refcount(session, 2);
+        check_refcount(inspectable, 3);
+
+        ref = ISpeechContinuousRecognitionSession_Release(session);
+        ok(ref == 1, "Got unexpected ref %lu.\n", ref);
+
         hr = IInspectable_QueryInterface(inspectable, &IID_IClosable, (void **)&closable);
         ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
-- 
2.35.1




More information about the wine-devel mailing list