[PATCH v3 5/5] quartz/vmr9: Implement IOverlay::GetWindowHandle().

Zebediah Figura z.figura12 at gmail.com
Fri Oct 4 10:02:49 CDT 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/quartz/tests/vmr7.c | 26 ++++++++++++++++++++++++++
 dlls/quartz/tests/vmr9.c | 26 ++++++++++++++++++++++++++
 dlls/quartz/vmr9.c       |  8 ++++++--
 3 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c
index 0228e0c249f..0d72689078f 100644
--- a/dlls/quartz/tests/vmr7.c
+++ b/dlls/quartz/tests/vmr7.c
@@ -1097,6 +1097,31 @@ static void test_connect_pin(void)
     ok(!ref, "Got outstanding refcount %d.\n", ref);
 }
 
+static void test_overlay(void)
+{
+    IBaseFilter *filter = create_vmr7(0);
+    IOverlay *overlay;
+    HRESULT hr;
+    ULONG ref;
+    IPin *pin;
+    HWND hwnd;
+
+    IBaseFilter_FindPin(filter, L"VMR Input0", &pin);
+
+    hr = IPin_QueryInterface(pin, &IID_IOverlay, (void **)&overlay);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+    hwnd = (HWND)0xdeadbeef;
+    hr = IOverlay_GetWindowHandle(overlay, &hwnd);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    todo_wine ok(hwnd && hwnd != (HWND)0xdeadbeef, "Got invalid window %p.\n", hwnd);
+
+    IOverlay_Release(overlay);
+    IPin_Release(pin);
+    ref = IBaseFilter_Release(filter);
+    ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
 START_TEST(vmr7)
 {
     CoInitialize(NULL);
@@ -1111,6 +1136,7 @@ START_TEST(vmr7)
     test_enum_media_types();
     test_unconnected_filter_state();
     test_connect_pin();
+    test_overlay();
 
     CoUninitialize();
 }
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c
index d3001727d4d..928484ccb6a 100644
--- a/dlls/quartz/tests/vmr9.c
+++ b/dlls/quartz/tests/vmr9.c
@@ -1096,6 +1096,31 @@ static void test_connect_pin(void)
     ok(!ref, "Got outstanding refcount %d.\n", ref);
 }
 
+static void test_overlay(void)
+{
+    IBaseFilter *filter = create_vmr9(0);
+    IOverlay *overlay;
+    HRESULT hr;
+    ULONG ref;
+    IPin *pin;
+    HWND hwnd;
+
+    IBaseFilter_FindPin(filter, L"VMR Input0", &pin);
+
+    hr = IPin_QueryInterface(pin, &IID_IOverlay, (void **)&overlay);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+    hwnd = (HWND)0xdeadbeef;
+    hr = IOverlay_GetWindowHandle(overlay, &hwnd);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    todo_wine ok(hwnd && hwnd != (HWND)0xdeadbeef, "Got invalid window %p.\n", hwnd);
+
+    IOverlay_Release(overlay);
+    IPin_Release(pin);
+    ref = IBaseFilter_Release(filter);
+    ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
 START_TEST(vmr9)
 {
     IBaseFilter *filter;
@@ -1121,6 +1146,7 @@ START_TEST(vmr9)
     test_enum_media_types();
     test_unconnected_filter_state();
     test_connect_pin();
+    test_overlay();
 
     CoUninitialize();
 }
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index 5a1d248ddeb..600e75945a8 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -2183,8 +2183,12 @@ static HRESULT WINAPI overlay_SetColorKey(IOverlay *iface, COLORKEY *key)
 
 static HRESULT WINAPI overlay_GetWindowHandle(IOverlay *iface, HWND *window)
 {
-    FIXME("iface %p, window %p, stub!\n", iface, window);
-    return E_NOTIMPL;
+    struct quartz_vmr *filter = impl_from_IOverlay(iface);
+
+    TRACE("filter %p, window %p.\n", filter, window);
+
+    *window = filter->baseControlWindow.baseWindow.hWnd;
+    return S_OK;
 }
 
 static HRESULT WINAPI overlay_GetClipList(IOverlay *iface, RECT *source, RECT *dest, RGNDATA **region)
-- 
2.23.0




More information about the wine-devel mailing list