[PATCH v2] quartz: Return correct error in IBasicAudio put_Volume

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Wed Aug 22 23:58:31 CDT 2018


Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=45366

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/quartz/filtergraph.c       |  2 ++
 dlls/quartz/tests/filtergraph.c | 22 +++++++++++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 0113674..210eb3e 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -3140,6 +3140,8 @@ static HRESULT WINAPI BasicAudio_put_Volume(IBasicAudio *iface, LONG lVolume)
 
     if (hr == S_OK)
         hr = IBasicAudio_put_Volume(pBasicAudio, lVolume);
+    else
+        hr = E_NOTIMPL;
 
     LeaveCriticalSection(&This->cs);
 
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index 85079d9..d73cde7 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -67,6 +67,20 @@ static WCHAR *load_resource(const WCHAR *name)
     return pathW;
 }
 
+static void test_basic_audio(IFilterGraph2 *graph, HRESULT expected)
+{
+    IBasicAudio* basic;
+    HRESULT hr;
+
+    hr = IFilterGraph2_QueryInterface(graph, &IID_IBasicAudio, (void **)&basic);
+    ok(hr==S_OK, "Cannot get IBasicAudio interface returned: %x\n", hr);
+
+    hr = IBasicAudio_put_Volume(basic, 0);
+    ok(hr==expected, "expected %x got %x\n", expected, hr);
+
+    IBasicAudio_Release(basic);
+}
+
 static IFilterGraph2 *create_graph(void)
 {
     IFilterGraph2 *ret;
@@ -540,7 +554,7 @@ static HRESULT test_graph_builder_connect(WCHAR *filename)
     return hr;
 }
 
-static void test_render_run(const WCHAR *file)
+static void test_render_run(const WCHAR *file, HRESULT expected )
 {
     IFilterGraph2 *graph;
     HANDLE h;
@@ -576,6 +590,7 @@ todo_wine
     {
         ok(hr == S_OK || hr == VFW_S_AUDIO_NOT_RENDERED, "RenderFile failed: %x\n", hr);
         rungraph(graph);
+        test_basic_audio(graph, expected);
 
         refs = IFilterGraph2_Release(graph);
         ok(!refs, "Graph has %u references\n", refs);
@@ -620,6 +635,7 @@ static void test_render_with_multithread(void)
     thread = CreateThread(NULL, 0, call_RenderFile_multithread, graph, 0, NULL);
 
     ok(WaitForSingleObject(thread, 1000) == WAIT_OBJECT_0, "wait failed\n");
+
     IFilterGraph2_Release(graph);
     CloseHandle(thread);
     CoUninitialize();
@@ -2291,8 +2307,8 @@ START_TEST(filtergraph)
 {
     CoInitializeEx(NULL, COINIT_MULTITHREADED);
 
-    test_render_run(avifile);
-    test_render_run(mpegfile);
+    test_render_run(avifile, E_NOTIMPL);
+    test_render_run(mpegfile, S_OK);
     test_graph_builder();
     test_render_filter_priority();
     test_aggregate_filter_graph();
-- 
1.9.1




More information about the wine-devel mailing list