Bernhard Kölbl : windows.media.speech: Implement ISpeechRecognitionConstraint isEnabled.

Alexandre Julliard julliard at winehq.org
Wed Mar 16 16:48:23 CDT 2022


Module: wine
Branch: master
Commit: be725a5e0db5999c031a1b391e8d57b4d93615b5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=be725a5e0db5999c031a1b391e8d57b4d93615b5

Author: Bernhard Kölbl <besentv at gmail.com>
Date:   Wed Mar 16 17:31:00 2022 +0100

windows.media.speech: Implement ISpeechRecognitionConstraint isEnabled.

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/listconstraint.c | 14 ++++++++++----
 dlls/windows.media.speech/tests/speech.c   |  8 ++++----
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/dlls/windows.media.speech/listconstraint.c b/dlls/windows.media.speech/listconstraint.c
index 33fe9d4ae51..d641902f4bc 100644
--- a/dlls/windows.media.speech/listconstraint.c
+++ b/dlls/windows.media.speech/listconstraint.c
@@ -34,6 +34,8 @@ struct list_constraint
     ISpeechRecognitionListConstraint ISpeechRecognitionListConstraint_iface;
     ISpeechRecognitionConstraint ISpeechRecognitionConstraint_iface;
     LONG ref;
+
+    BOOLEAN enabled;
 };
 
 /*
@@ -142,14 +144,18 @@ DEFINE_IINSPECTABLE(constraint, ISpeechRecognitionConstraint, struct list_constr
 
 static HRESULT WINAPI constraint_get_IsEnabled( ISpeechRecognitionConstraint *iface, BOOLEAN *value )
 {
-    FIXME("iface %p, value %p stub!\n", iface, value);
-    return E_NOTIMPL;
+    struct list_constraint *impl = impl_from_ISpeechRecognitionConstraint(iface);
+    TRACE("iface %p, value %p.\n", iface, value);
+    *value = impl->enabled;
+    return S_OK;
 }
 
 static HRESULT WINAPI constraint_put_IsEnabled( ISpeechRecognitionConstraint *iface, BOOLEAN value )
 {
-    FIXME("iface %p, value %u stub!\n", iface, value);
-    return E_NOTIMPL;
+    struct list_constraint *impl = impl_from_ISpeechRecognitionConstraint(iface);
+    TRACE("iface %p, value %u.\n", iface, value);
+    impl->enabled = value;
+    return S_OK;
 }
 
 static HRESULT WINAPI constraint_get_Tag( ISpeechRecognitionConstraint *iface, HSTRING *value )
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c
index a88b8aae3d2..66869a164d2 100644
--- a/dlls/windows.media.speech/tests/speech.c
+++ b/dlls/windows.media.speech/tests/speech.c
@@ -797,13 +797,13 @@ static void test_SpeechRecognitionListConstraint(void)
     hr = WindowsDeleteString(tag_out);
     todo_wine ok(hr == S_OK, "WindowsDeleteString failed, hr %#lx.\n", hr);
 
+skip_tests:
     hr = ISpeechRecognitionConstraint_put_IsEnabled(constraint, TRUE);
-    todo_wine ok(hr == S_OK, "ISpeechRecognitionConstraint_put_IsEnabled failed, hr %#lx.\n", hr);
+    ok(hr == S_OK, "ISpeechRecognitionConstraint_put_IsEnabled failed, hr %#lx.\n", hr);
     hr = ISpeechRecognitionConstraint_get_IsEnabled(constraint, &enabled);
-    todo_wine ok(hr == S_OK, "ISpeechRecognitionConstraint_get_IsEnabled failed, hr %#lx.\n", hr);
-    todo_wine ok(enabled, "ListConstraint didn't get enabled.\n");
+    ok(hr == S_OK, "ISpeechRecognitionConstraint_get_IsEnabled failed, hr %#lx.\n", hr);
+    ok(enabled, "ListConstraint didn't get enabled.\n");
 
-skip_tests:
     ref = ISpeechRecognitionConstraint_Release(constraint);
     ok(ref == 1, "Got unexpected ref %lu.\n", ref);
 




More information about the wine-cvs mailing list