[PATCH 0/4] MR2754: quartz: Check whether the pin is connected in some video window methods.
From: Zebediah Figura <zfigura(a)codeweavers.com> --- dlls/quartz/tests/videorenderer.c | 2 ++ dlls/quartz/tests/vmr7.c | 2 ++ dlls/quartz/tests/vmr9.c | 2 ++ dlls/quartz/window.c | 5 ++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index fccb32d06d0..29a6d51be7c 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -2807,6 +2807,8 @@ static void test_basic_video(void) ok(hr == E_POINTER, "Got hr %#lx.\n", hr); hr = IBasicVideo_GetVideoSize(video, NULL, &height); ok(hr == E_POINTER, "Got hr %#lx.\n", hr); + hr = IBasicVideo_GetVideoSize(video, &width, &height); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); hr = IBasicVideo_GetVideoPaletteEntries(video, 0, 1, NULL, &l); ok(hr == E_POINTER, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 0e5aa89265a..1f1b99a178c 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -2824,6 +2824,8 @@ static void test_basic_video(void) ok(hr == E_POINTER, "Got hr %#lx.\n", hr); hr = IBasicVideo_GetVideoSize(video, NULL, &height); ok(hr == E_POINTER, "Got hr %#lx.\n", hr); + hr = IBasicVideo_GetVideoSize(video, &width, &height); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); hr = IBasicVideo_GetVideoPaletteEntries(video, 0, 1, NULL, &l); ok(hr == E_POINTER, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 1d3fa207e18..d93802485ac 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -3860,6 +3860,8 @@ static void test_basic_video(void) ok(hr == E_POINTER, "Got hr %#lx.\n", hr); hr = IBasicVideo_GetVideoSize(video, NULL, &height); ok(hr == E_POINTER, "Got hr %#lx.\n", hr); + hr = IBasicVideo_GetVideoSize(video, &width, &height); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); hr = IBasicVideo_GetVideoPaletteEntries(video, 0, 1, NULL, &l); ok(hr == E_POINTER, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index 2064be7e320..1fdbd5f9428 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -1138,13 +1138,16 @@ static HRESULT WINAPI basic_video_SetDefaultDestinationPosition(IBasicVideo *ifa static HRESULT WINAPI basic_video_GetVideoSize(IBasicVideo *iface, LONG *width, LONG *height) { struct video_window *window = impl_from_IBasicVideo(iface); - const BITMAPINFOHEADER *bitmap_header = get_bitmap_header(window); + const BITMAPINFOHEADER *bitmap_header; TRACE("window %p, width %p, height %p.\n", window, width, height); if (!width || !height) return E_POINTER; + if (!window->pPin->peer) + return VFW_E_NOT_CONNECTED; + bitmap_header = get_bitmap_header(window); *width = bitmap_header->biWidth; *height = bitmap_header->biHeight; return S_OK; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2754
From: Zebediah Figura <zfigura(a)codeweavers.com> Ferro CCTV calls this. --- dlls/quartz/tests/videorenderer.c | 5 +++++ dlls/quartz/tests/vmr7.c | 5 +++++ dlls/quartz/tests/vmr9.c | 5 +++++ dlls/quartz/window.c | 3 +++ 4 files changed, 18 insertions(+) diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 29a6d51be7c..903f173386b 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -2379,6 +2379,11 @@ static void test_video_window(void) hr = IVideoWindow_get_Caption(window, &caption); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + caption = SysAllocString(L"foo"); + hr = IVideoWindow_put_Caption(window, caption); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + SysFreeString(caption); + hr = IVideoWindow_get_WindowStyle(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 1f1b99a178c..5019d1b610c 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -2378,6 +2378,11 @@ static void test_video_window(void) hr = IVideoWindow_get_Caption(window, &caption); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + caption = SysAllocString(L"foo"); + hr = IVideoWindow_put_Caption(window, caption); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + SysFreeString(caption); + hr = IVideoWindow_get_WindowStyle(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index d93802485ac..838ba812299 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -2604,6 +2604,11 @@ static void test_video_window(void) hr = IVideoWindow_get_Caption(window, &caption); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + caption = SysAllocString(L"foo"); + hr = IVideoWindow_put_Caption(window, caption); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + SysFreeString(caption); + hr = IVideoWindow_get_WindowStyle(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index 1fdbd5f9428..3f8d862fccd 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -194,6 +194,9 @@ HRESULT WINAPI BaseControlWindowImpl_put_Caption(IVideoWindow *iface, BSTR capti TRACE("window %p, caption %s.\n", window, debugstr_w(caption)); + if (!window->pPin->peer) + return VFW_E_NOT_CONNECTED; + if (!SetWindowTextW(window->hwnd, caption)) return E_FAIL; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2754
From: Zebediah Figura <zfigura(a)codeweavers.com> 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 | 2 ++ 4 files changed, 11 insertions(+) diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 903f173386b..f386d0e3edf 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -2387,6 +2387,9 @@ static void test_video_window(void) hr = IVideoWindow_get_WindowStyle(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_put_WindowStyle(window, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_get_AutoShow(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 5019d1b610c..7240e51b1d9 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -2386,6 +2386,9 @@ static void test_video_window(void) hr = IVideoWindow_get_WindowStyle(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_put_WindowStyle(window, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_get_AutoShow(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 838ba812299..8249857ff60 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -2612,6 +2612,9 @@ static void test_video_window(void) hr = IVideoWindow_get_WindowStyle(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_put_WindowStyle(window, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_get_AutoShow(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index 3f8d862fccd..f7242ecff58 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -231,6 +231,8 @@ HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG s if (style & (WS_DISABLED|WS_HSCROLL|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL)) return E_INVALIDARG; + if (!window->pPin->peer) + return VFW_E_NOT_CONNECTED; SetWindowLongW(window->hwnd, GWL_STYLE, style); SetWindowPos(window->hwnd, 0, 0, 0, 0, 0, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2754
From: Zebediah Figura <zfigura(a)codeweavers.com> 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 f386d0e3edf..7771c467a13 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -2393,6 +2393,9 @@ static void test_video_window(void) hr = IVideoWindow_get_AutoShow(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_put_AutoShow(window, OAFALSE); + 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 7240e51b1d9..cbab6eb077d 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -2392,6 +2392,9 @@ static void test_video_window(void) hr = IVideoWindow_get_AutoShow(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_put_AutoShow(window, OAFALSE); + 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 8249857ff60..9c5ec2129a3 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -2618,6 +2618,9 @@ static void test_video_window(void) hr = IVideoWindow_get_AutoShow(window, &l); todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + hr = IVideoWindow_put_AutoShow(window, OAFALSE); + 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 f7242ecff58..617d45b74e0 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -273,11 +273,14 @@ HRESULT WINAPI BaseControlWindowImpl_get_WindowStyleEx(IVideoWindow *iface, LONG HRESULT WINAPI BaseControlWindowImpl_put_AutoShow(IVideoWindow *iface, LONG AutoShow) { - struct video_window *This = impl_from_IVideoWindow(iface); + struct video_window *window = impl_from_IVideoWindow(iface); + + TRACE("window %p, AutoShow %ld.\n", window, AutoShow); - TRACE("window %p, AutoShow %ld.\n", This, AutoShow); + if (!window->pPin->peer) + return VFW_E_NOT_CONNECTED; - This->AutoShow = AutoShow; + window->AutoShow = AutoShow; return S_OK; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2754
participants (2)
-
Zebediah Figura -
Zebediah Figura (@zfigura)