[3/3] d3d9/tests: Test if IDirect3DSwapChain9Ex is available without IDirect3D9Ex

Michael Müller michael at fds-team.de
Fri Aug 30 10:09:24 CDT 2013


---
 dlls/d3d9/tests/d3d9ex.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)


-------------- next part --------------
From 700b8853334120a4fe3a827460b4a3cd0e8b50c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael at fds-team.de>
Date: Fri, 30 Aug 2013 15:38:37 +0200
Subject: d3d9/tests: Test if IDirect3DSwapChain9Ex is available without
 IDirect3D9Ex

---
 dlls/d3d9/tests/d3d9ex.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c
index 2deef76..138de14 100644
--- a/dlls/d3d9/tests/d3d9ex.c
+++ b/dlls/d3d9/tests/d3d9ex.c
@@ -120,6 +120,8 @@ static void test_qi_base_to_ex(void)
     IDirect3D9Ex *d3d9ex = (void *) 0xdeadbeef;
     IDirect3DDevice9 *device;
     IDirect3DDevice9Ex *deviceEx = (void *) 0xdeadbeef;
+    IDirect3DSwapChain9 *swapchain = NULL;
+    IDirect3DSwapChain9Ex *swapchainEx = (void *) 0xdeadbeef;
     HRESULT hr;
     HWND window = create_window();
     D3DPRESENT_PARAMETERS present_parameters;
@@ -158,6 +160,20 @@ static void test_qi_base_to_ex(void)
     ok(deviceEx == NULL, "QueryInterface returned interface %p, expected NULL\n", deviceEx);
     if(deviceEx) IDirect3DDevice9Ex_Release(deviceEx);
 
+    /* Get the implicit swapchain */
+    hr = IDirect3DDevice9_GetSwapChain(device, 0, &swapchain);
+    ok(SUCCEEDED(hr), "Failed to get the implicit swapchain (%08x)\n", hr);
+    if (SUCCEEDED(hr))
+    {
+        hr = IDirect3DSwapChain9_QueryInterface(swapchain, &IID_IDirect3DSwapChain9Ex, (void **) &swapchainEx);
+        ok(hr == E_NOINTERFACE,
+           "IDirect3DSwapChain9::QueryInterface for IID_IDirect3DSwapChain9Ex returned %08x, expected E_NOINTERFACE\n",
+           hr);
+        ok(swapchainEx == NULL, "QueryInterface returned interface %p, expected NULL\n", swapchainEx);
+        if(swapchainEx) IDirect3DSwapChain9Ex_Release(swapchainEx);
+    }
+    if(swapchain) IDirect3DSwapChain9_Release(swapchain);
+
     IDirect3DDevice9_Release(device);
 
 out:
-- 
1.7.9.5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3744 bytes
Desc: S/MIME Kryptografische Unterschrift
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130830/83122914/attachment.bin>


More information about the wine-patches mailing list