Zebediah Figura : quartz: Check whether the pin is connected in IVideoWindow::put_MessageDrain().
Module: wine Branch: master Commit: e4ec04bf26abe1e56a36ac32574614d0997da3db URL: https://gitlab.winehq.org/wine/wine/-/commit/e4ec04bf26abe1e56a36ac32574614d... Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed May 3 13:13:08 2023 -0500 quartz: Check whether the pin is connected in IVideoWindow::put_MessageDrain(). Ferro CCTV calls this. --- dlls/quartz/tests/videorenderer.c | 3 +++ dlls/quartz/tests/vmr7.c | 3 +++ dlls/quartz/tests/vmr9.c | 3 +++ dlls/quartz/window.c | 9 ++++++--- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 4b8bd4e7c2c..76088534924 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -2399,6 +2399,9 @@ static void test_video_window(void) hr = IVideoWindow_put_Owner(window, (OAHWND)our_hwnd); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_put_MessageDrain(window, (OAHWND)our_hwnd); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + testfilter_init(&source); IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, NULL); IFilterGraph2_AddFilter(graph, filter, NULL); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 73e7ff5ffe9..04bf7c1ba1b 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -2398,6 +2398,9 @@ static void test_video_window(void) hr = IVideoWindow_put_Owner(window, (OAHWND)our_hwnd); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_put_MessageDrain(window, (OAHWND)our_hwnd); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + testfilter_init(&source); IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, NULL); IFilterGraph2_AddFilter(graph, filter, NULL); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 27117db9f02..299b0de22d5 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -2624,6 +2624,9 @@ static void test_video_window(void) hr = IVideoWindow_put_Owner(window, (OAHWND)our_hwnd); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_put_MessageDrain(window, (OAHWND)our_hwnd); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + testfilter_init(&source); IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, NULL); IFilterGraph2_AddFilter(graph, filter, NULL); diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index f09dd5aea56..1b6d2664a10 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -511,11 +511,14 @@ HRESULT WINAPI BaseControlWindowImpl_get_Owner(IVideoWindow *iface, OAHWND *Owne HRESULT WINAPI BaseControlWindowImpl_put_MessageDrain(IVideoWindow *iface, OAHWND Drain) { - struct video_window *This = impl_from_IVideoWindow(iface); + struct video_window *window = impl_from_IVideoWindow(iface); + + TRACE("window %p, drain %#Ix.\n", window, Drain); - TRACE("window %p, drain %#Ix.\n", This, Drain); + if (!window->pPin->peer) + return VFW_E_NOT_CONNECTED; - This->hwndDrain = (HWND)Drain; + window->hwndDrain = (HWND)Drain; return S_OK; }
participants (1)
-
Alexandre Julliard