Zebediah Figura : quartz/filesource: Check if the media type is acceptable.

Alexandre Julliard julliard at winehq.org
Fri Mar 6 16:38:42 CST 2020


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Mar  5 20:04:35 2020 -0600

quartz/filesource: Check if the media type is acceptable.

PowerPoint 2016 tries to build a graph by autoplugging the file source to the
sample grabber; direct connection should fail here.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/filesource.c       |  3 ++-
 dlls/quartz/tests/filesource.c | 30 +++++-------------------------
 2 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
index c1f7f69d5e..53d9528d26 100644
--- a/dlls/quartz/filesource.c
+++ b/dlls/quartz/filesource.c
@@ -611,7 +611,8 @@ static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(struct strmbase_sourc
 
     TRACE("%p->(%p, %p)\n", This, pReceivePin, pmt);
 
-    /* FIXME: call queryacceptproc */
+    if (This->pin.ops->pin_query_accept(&This->pin, pmt) != S_OK)
+        return VFW_E_TYPE_NOT_ACCEPTED;
 
     This->pin.peer = pReceivePin;
     IPin_AddRef(pReceivePin);
diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c
index 846b92ac60..2040910516 100644
--- a/dlls/quartz/tests/filesource.c
+++ b/dlls/quartz/tests/filesource.c
@@ -1363,12 +1363,7 @@ static void test_connect_pin(void)
 
     req_mt.majortype = MEDIATYPE_Video;
     hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt);
-    todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
-    if (hr == S_OK)
-    {
-        IFilterGraph2_Disconnect(graph, source);
-        IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface);
-    }
+    ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
     req_mt.majortype = MEDIATYPE_Stream;
 
     req_mt.subtype = MEDIASUBTYPE_RGB8;
@@ -1379,12 +1374,7 @@ static void test_connect_pin(void)
     IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface);
     req_mt.subtype = GUID_NULL;
     hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt);
-    todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
-    if (hr == S_OK)
-    {
-        IFilterGraph2_Disconnect(graph, source);
-        IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface);
-    }
+    ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
     req_mt.subtype = MEDIASUBTYPE_Avi;
 
     /* Test connection with wildcards. */
@@ -1445,12 +1435,7 @@ static void test_connect_pin(void)
      * consistent with its being rejected by IPin::QueryAccept(). */
     testsink.reject_avi = TRUE;
     hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, NULL);
-    todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
-    if (hr == S_OK)
-    {
-        IFilterGraph2_Disconnect(graph, source);
-        IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface);
-    }
+    ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
 
     /* But any types we expose are tried. */
     testsink.mt = &mt;
@@ -1459,17 +1444,12 @@ static void test_connect_pin(void)
     mt.subtype = MEDIASUBTYPE_RGB8;
     mt.formattype = FORMAT_None;
     hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, NULL);
-    todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
-    if (hr == S_OK)
-    {
-        IFilterGraph2_Disconnect(graph, source);
-        IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface);
-    }
+    ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
 
     mt.majortype = MEDIATYPE_Stream;
     hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, NULL);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
-    todo_wine ok(compare_media_types(&testsink.pin.pin.mt, &mt), "Media types didn't match.\n");
+    ok(compare_media_types(&testsink.pin.pin.mt, &mt), "Media types didn't match.\n");
     IFilterGraph2_Disconnect(graph, source);
     IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface);
 




More information about the wine-cvs mailing list