From 298ffd8f804038cdfcb255f8661eff311655fb51 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 3 May 2023 13:19:35 -0500 Subject: [PATCH] quartz: Check whether the pin is connected in IVideoWindow::SetWindowPosition(). 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 | 3 +++ 4 files changed, 12 insertions(+) diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index edc4d40f19d..ea54ec87a8e 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -2405,6 +2405,9 @@ static void test_video_window(void) hr = IVideoWindow_put_Visible(window, OATRUE); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_SetWindowPosition(window, 100, 200, 300, 400); + 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 7282458dc33..c30fefbd3ab 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -2404,6 +2404,9 @@ static void test_video_window(void) hr = IVideoWindow_put_Visible(window, OATRUE); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_SetWindowPosition(window, 100, 200, 300, 400); + 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 c201d316bab..9d88afb295d 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -2630,6 +2630,9 @@ static void test_video_window(void) hr = IVideoWindow_put_Visible(window, OATRUE); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_SetWindowPosition(window, 100, 200, 300, 400); + 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 130194bcc29..4a9c4aed8f7 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -598,6 +598,9 @@ HRESULT WINAPI BaseControlWindowImpl_SetWindowPosition(IVideoWindow *iface, TRACE("window %p, left %ld, top %ld, width %ld, height %ld.\n", window, left, top, width, height); + if (!window->pPin->peer) + return VFW_E_NOT_CONNECTED; + if (!SetWindowPos(window->hwnd, NULL, left, top, width, height, SWP_NOACTIVATE | SWP_NOZORDER)) return E_FAIL; return S_OK; -- 2.11.4.GIT