Module: wine Branch: master Commit: bf461e64072277391e166dc2a5d88ee63a36add2 URL: https://gitlab.winehq.org/wine/wine/-/commit/bf461e64072277391e166dc2a5d88ee...
Author: Zebediah Figura zfigura@codeweavers.com Date: Wed May 3 13:02:19 2023 -0500
quartz: Check whether the pin is connected in IVideoWindow::put_Caption().
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;