winex11.drv: Fix handle leak.
[wine] / dlls / d3d9 / tests / d3d9ex.c
1 /*
2  * Copyright (C) 2008 Stefan Dösinger(for CodeWeavers)
3  * Copyright (C) 2010 Louis Lenders
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  */
19
20 /* This file contains tests specific to IDirect3D9Ex and IDirect3DDevice9Ex, like
21  * how to obtain them. For testing rendering with extended functions use visual.c
22  */
23
24 #define COBJMACROS
25 #include "wine/test.h"
26 #include "winuser.h"
27 #include "wingdi.h"
28 #include <initguid.h>
29 #include <d3d9.h>
30
31 static HMODULE d3d9_handle = 0;
32
33 static BOOL (WINAPI *pEnumDisplaySettingsExA)(LPCSTR, DWORD, DEVMODEA *, DWORD);
34 static LONG (WINAPI *pChangeDisplaySettingsExA)(LPCSTR, LPDEVMODE, HWND, DWORD, LPVOID);
35
36 static IDirect3D9 * (WINAPI *pDirect3DCreate9)(UINT SDKVersion);
37 static HRESULT (WINAPI *pDirect3DCreate9Ex)(UINT SDKVersion, IDirect3D9Ex **d3d9ex);
38
39 static HWND create_window(void)
40 {
41     WNDCLASS wc = {0};
42     HWND ret;
43     wc.lpfnWndProc = DefWindowProc;
44     wc.lpszClassName = "d3d9_test_wc";
45     RegisterClass(&wc);
46
47     ret = CreateWindow("d3d9_test_wc", "d3d9_test",
48                         WS_MAXIMIZE | WS_VISIBLE | WS_CAPTION , 0, 0, 640, 480, 0, 0, 0, 0);
49     return ret;
50 }
51
52 static IDirect3DDevice9Ex *create_device(IDirect3D9Ex *d3d9, HWND device_window, HWND focus_window, BOOL windowed)
53 {
54     D3DPRESENT_PARAMETERS present_parameters = {0};
55     IDirect3DDevice9Ex *device;
56     D3DDISPLAYMODEEX mode, *m;
57
58     present_parameters.Windowed = windowed;
59     present_parameters.hDeviceWindow = device_window;
60     present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
61     present_parameters.BackBufferWidth = 640;
62     present_parameters.BackBufferHeight = 480;
63     present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8;
64     present_parameters.EnableAutoDepthStencil = TRUE;
65     present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8;
66
67     mode.Size = sizeof(mode);
68     mode.Width = 640;
69     mode.Height = 480;
70     mode.RefreshRate = 0;
71     mode.Format = D3DFMT_A8R8G8B8;
72     mode.ScanLineOrdering = 0;
73
74     m = windowed ? NULL : &mode;
75     if (SUCCEEDED(IDirect3D9Ex_CreateDeviceEx(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window,
76             D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, m, &device))) return device;
77
78     present_parameters.AutoDepthStencilFormat = D3DFMT_D16;
79     if (SUCCEEDED(IDirect3D9Ex_CreateDeviceEx(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window,
80             D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, m, &device))) return device;
81
82     if (SUCCEEDED(IDirect3D9Ex_CreateDeviceEx(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window,
83             D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, m, &device))) return device;
84
85     return NULL;
86 }
87
88 static ULONG getref(IUnknown *obj) {
89     IUnknown_AddRef(obj);
90     return IUnknown_Release(obj);
91 }
92
93 static void test_qi_base_to_ex(void)
94 {
95     IDirect3D9 *d3d9 = pDirect3DCreate9(D3D_SDK_VERSION);
96     IDirect3D9Ex *d3d9ex = (void *) 0xdeadbeef;
97     IDirect3DDevice9 *device;
98     IDirect3DDevice9Ex *deviceEx = (void *) 0xdeadbeef;
99     HRESULT hr;
100     HWND window = create_window();
101     D3DPRESENT_PARAMETERS present_parameters;
102
103     if (!d3d9)
104     {
105         skip("Direct3D9 is not available\n");
106         return;
107     }
108
109     hr = IDirect3D9_QueryInterface(d3d9, &IID_IDirect3D9Ex, (void **) &d3d9ex);
110     ok(hr == E_NOINTERFACE,
111        "IDirect3D9::QueryInterface for IID_IDirect3D9Ex returned %08x, expected E_NOINTERFACE\n",
112        hr);
113     ok(d3d9ex == NULL, "QueryInterface returned interface %p, expected NULL\n", d3d9ex);
114     if(d3d9ex) IDirect3D9Ex_Release(d3d9ex);
115
116     memset(&present_parameters, 0, sizeof(present_parameters));
117     present_parameters.Windowed = TRUE;
118     present_parameters.hDeviceWindow = window;
119     present_parameters.SwapEffect = D3DSWAPEFFECT_COPY;
120     present_parameters.BackBufferWidth = 640;
121     present_parameters.BackBufferHeight = 480;
122     present_parameters.EnableAutoDepthStencil = FALSE;
123     present_parameters.AutoDepthStencilFormat = D3DFMT_D16;
124     hr = IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, present_parameters.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device);
125     if(FAILED(hr)) {
126         skip("Failed to create a regular Direct3DDevice9, skipping QI tests\n");
127         goto out;
128     }
129
130     hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9Ex, (void **) &deviceEx);
131     ok(hr == E_NOINTERFACE,
132        "IDirect3D9Device::QueryInterface for IID_IDirect3DDevice9Ex returned %08x, expected E_NOINTERFACE\n",
133        hr);
134     ok(deviceEx == NULL, "QueryInterface returned interface %p, expected NULL\n", deviceEx);
135     if(deviceEx) IDirect3DDevice9Ex_Release(deviceEx);
136
137     IDirect3DDevice9_Release(device);
138
139 out:
140     IDirect3D9_Release(d3d9);
141     DestroyWindow(window);
142 }
143
144 static void test_qi_ex_to_base(void)
145 {
146     IDirect3D9 *d3d9 = (void *) 0xdeadbeef;
147     IDirect3D9Ex *d3d9ex;
148     IDirect3DDevice9 *device;
149     IDirect3DDevice9Ex *deviceEx = (void *) 0xdeadbeef;
150     HRESULT hr;
151     HWND window = create_window();
152     D3DPRESENT_PARAMETERS present_parameters;
153     ULONG ref;
154
155     hr = pDirect3DCreate9Ex(D3D_SDK_VERSION, &d3d9ex);
156     ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "Direct3DCreate9Ex returned %08x\n", hr);
157     if(FAILED(hr)) {
158         skip("Direct3D9Ex is not available\n");
159         goto out;
160     }
161
162     hr = IDirect3D9Ex_QueryInterface(d3d9ex, &IID_IDirect3D9, (void **) &d3d9);
163     ok(hr == D3D_OK,
164        "IDirect3D9Ex::QueryInterface for IID_IDirect3D9 returned %08x, expected D3D_OK\n",
165        hr);
166     ok(d3d9 != NULL && d3d9 != (void *) 0xdeadbeef,
167        "QueryInterface returned interface %p, expected != NULL && != 0xdeadbeef\n", d3d9);
168     ref = getref((IUnknown *) d3d9ex);
169     ok(ref == 2, "IDirect3D9Ex refcount is %d, expected 2\n", ref);
170     ref = getref((IUnknown *) d3d9);
171     ok(ref == 2, "IDirect3D9 refcount is %d, expected 2\n", ref);
172
173     memset(&present_parameters, 0, sizeof(present_parameters));
174     present_parameters.Windowed = TRUE;
175     present_parameters.hDeviceWindow = window;
176     present_parameters.SwapEffect = D3DSWAPEFFECT_COPY;
177     present_parameters.BackBufferWidth = 640;
178     present_parameters.BackBufferHeight = 480;
179     present_parameters.EnableAutoDepthStencil = FALSE;
180     present_parameters.AutoDepthStencilFormat = D3DFMT_D16;
181
182     /* First, try to create a normal device with IDirect3D9Ex::CreateDevice and QI it for IDirect3DDevice9Ex */
183     hr = IDirect3D9Ex_CreateDevice(d3d9ex, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, present_parameters.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device);
184     if(FAILED(hr)) {
185         skip("Failed to create a regular Direct3DDevice9, skipping QI tests\n");
186         goto out;
187     }
188
189     hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9Ex, (void **) &deviceEx);
190     ok(hr == D3D_OK,
191        "IDirect3D9Device::QueryInterface for IID_IDirect3DDevice9Ex returned %08x, expected D3D_OK\n",
192        hr);
193     ok(deviceEx != NULL && deviceEx != (void *) 0xdeadbeef,
194        "QueryInterface returned interface %p, expected != NULL && != 0xdeadbeef\n", deviceEx);
195     ref = getref((IUnknown *) device);
196     ok(ref == 2, "IDirect3DDevice9 refcount is %d, expected 2\n", ref);
197     ref = getref((IUnknown *) deviceEx);
198     ok(ref == 2, "IDirect3DDevice9Ex refcount is %d, expected 2\n", ref);
199     if(deviceEx) IDirect3DDevice9Ex_Release(deviceEx);
200     IDirect3DDevice9_Release(device);
201
202     /* Next, try to create a normal device with IDirect3D9::CreateDevice(non-ex) and QI it */
203     hr = IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, present_parameters.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device);
204     if(FAILED(hr)) {
205         skip("Failed to create a regular Direct3DDevice9, skipping QI tests\n");
206         goto out;
207     }
208
209     hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9Ex, (void **) &deviceEx);
210     ok(hr == D3D_OK,
211        "IDirect3D9Device::QueryInterface for IID_IDirect3DDevice9Ex returned %08x, expected D3D_OK\n",
212        hr);
213     ok(deviceEx != NULL && deviceEx != (void *) 0xdeadbeef,
214        "QueryInterface returned interface %p, expected != NULL && != 0xdeadbeef\n", deviceEx);
215     ref = getref((IUnknown *) device);
216     ok(ref == 2, "IDirect3DDevice9 refcount is %d, expected 2\n", ref);
217     ref = getref((IUnknown *) deviceEx);
218     ok(ref == 2, "IDirect3DDevice9Ex refcount is %d, expected 2\n", ref);
219     if(deviceEx) IDirect3DDevice9Ex_Release(deviceEx);
220     IDirect3DDevice9_Release(device);
221
222     IDirect3D9_Release(d3d9);
223     IDirect3D9Ex_Release(d3d9ex);
224
225 out:
226     DestroyWindow(window);
227 }
228
229 static void test_get_adapter_luid(void)
230 {
231     HWND window = create_window();
232     IDirect3D9Ex *d3d9ex;
233     UINT count;
234     HRESULT hr;
235     LUID luid;
236
237     hr = pDirect3DCreate9Ex(D3D_SDK_VERSION, &d3d9ex);
238     if (FAILED(hr))
239     {
240         skip("Direct3D9Ex is not available.\n");
241         DestroyWindow(window);
242         return;
243     }
244
245     count = IDirect3D9Ex_GetAdapterCount(d3d9ex);
246     if (!count)
247     {
248         skip("No adapters available.\n");
249         IDirect3D9Ex_Release(d3d9ex);
250         DestroyWindow(window);
251         return;
252     }
253
254     hr = IDirect3D9Ex_GetAdapterLUID(d3d9ex, D3DADAPTER_DEFAULT, &luid);
255     ok(SUCCEEDED(hr), "GetAdapterLUID failed, hr %#x.\n", hr);
256     trace("adapter luid: %08x:%08x.\n", luid.HighPart, luid.LowPart);
257
258     IDirect3D9Ex_Release(d3d9ex);
259 }
260
261 static void test_get_adapter_displaymode_ex(void)
262 {
263     HWND window = create_window();
264     IDirect3D9 *d3d9 = (void *) 0xdeadbeef;
265     IDirect3D9Ex *d3d9ex;
266     UINT count;
267     HRESULT hr;
268     D3DDISPLAYMODE mode;
269     D3DDISPLAYMODEEX mode_ex;
270     D3DDISPLAYROTATION rotation;
271     HANDLE hdll;
272     DEVMODEA startmode;
273     LONG retval;
274
275     hr = pDirect3DCreate9Ex(D3D_SDK_VERSION, &d3d9ex);
276     if (FAILED(hr))
277     {
278         skip("Direct3D9Ex is not available (%#x)\n", hr);
279         DestroyWindow(window);
280         return;
281     }
282
283     count = IDirect3D9Ex_GetAdapterCount(d3d9ex);
284     if (!count)
285     {
286         skip("No adapters available.\n");
287         IDirect3D9Ex_Release(d3d9ex);
288         DestroyWindow(window);
289         return;
290     }
291
292     hr = IDirect3D9Ex_QueryInterface(d3d9ex, &IID_IDirect3D9, (void **) &d3d9);
293     ok(hr == D3D_OK,
294        "IDirect3D9Ex::QueryInterface for IID_IDirect3D9 returned %08x, expected D3D_OK\n",
295        hr);
296     ok(d3d9 != NULL && d3d9 != (void *) 0xdeadbeef,
297        "QueryInterface returned interface %p, expected != NULL && != 0xdeadbeef\n", d3d9);
298     /* change displayorientation*/
299     hdll = GetModuleHandleA("user32.dll");
300     pEnumDisplaySettingsExA = (void*)GetProcAddress(hdll, "EnumDisplaySettingsExA");
301     pChangeDisplaySettingsExA = (void*)GetProcAddress(hdll, "ChangeDisplaySettingsExA");
302
303     if (!pEnumDisplaySettingsExA || !pChangeDisplaySettingsExA) goto out;
304
305     memset(&startmode, 0, sizeof(startmode));
306     startmode.dmSize = sizeof(startmode);
307     retval = pEnumDisplaySettingsExA(NULL, ENUM_CURRENT_SETTINGS, &startmode, 0);
308     ok(retval, "Failed to retrieve current display mode, retval %d.\n", retval);
309     if (!retval) goto out;
310
311     startmode.dmFields = DM_DISPLAYORIENTATION | DM_PELSWIDTH | DM_PELSHEIGHT;
312     S2(U1(startmode)).dmDisplayOrientation = DMDO_180;
313     retval = pChangeDisplaySettingsExA(NULL, &startmode, NULL, 0, NULL);
314
315     if(retval == DISP_CHANGE_BADMODE)
316     {
317         trace(" Test skipped: graphics mode is not supported\n");
318         goto out;
319     }
320
321     ok(retval == DISP_CHANGE_SUCCESSFUL,"ChangeDisplaySettingsEx failed with %d\n", retval);
322     /* try retrieve orientation info with EnumDisplaySettingsEx*/
323     startmode.dmFields = 0;
324     S2(U1(startmode)).dmDisplayOrientation = 0;
325     ok(pEnumDisplaySettingsExA(NULL, ENUM_CURRENT_SETTINGS, &startmode, EDS_ROTATEDMODE), "EnumDisplaySettingsEx failed\n");
326
327     /*now that orientation has changed start tests for GetAdapterDisplayModeEx: invalid Size*/
328     memset(&mode_ex, 0, sizeof(mode_ex));
329     hr = IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, D3DADAPTER_DEFAULT, &mode_ex, &rotation);
330     todo_wine ok(hr == D3DERR_INVALIDCALL, "GetAdapterDisplayModeEx returned %#x instead of D3DERR_INVALIDCALL\n", hr);
331
332     mode_ex.Size = sizeof(D3DDISPLAYMODEEX);
333     /* invalid count*/
334     hr = IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, count + 1, &mode_ex, &rotation);
335     todo_wine ok(hr == D3DERR_INVALIDCALL, "GetAdapterDisplayModeEx returned %#x instead of D3DERR_INVALIDCALL\n", hr);
336     /*valid count and valid Size*/
337     hr = IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, D3DADAPTER_DEFAULT, &mode_ex, &rotation);
338     todo_wine ok(SUCCEEDED(hr), "GetAdapterDisplayModeEx failed, hr %#x.\n", hr);
339
340     /* Compare what GetAdapterDisplayMode returns with what GetAdapterDisplayModeEx returns*/
341     hr = IDirect3D9_GetAdapterDisplayMode(d3d9, D3DADAPTER_DEFAULT, &mode);
342     ok(SUCCEEDED(hr), "GetAdapterDisplayMode failed, hr %#x.\n", hr);
343
344     ok(mode_ex.Size == sizeof(D3DDISPLAYMODEEX), "size is %d\n", mode_ex.Size);
345     todo_wine ok(mode_ex.Width == mode.Width, "width is %d instead of %d\n", mode_ex.Width, mode.Width);
346     todo_wine ok(mode_ex.Height == mode.Height, "height is %d instead of %d\n", mode_ex.Height, mode.Height);
347     todo_wine ok(mode_ex.RefreshRate == mode.RefreshRate, "RefreshRate is %d instead of %d\n", mode_ex.RefreshRate, mode.RefreshRate);
348     todo_wine ok(mode_ex.Format == mode.Format, "format is %x instead of %x\n", mode_ex.Format, mode.Format);
349     /* don't know yet how to test for ScanLineOrdering, just testing that it is set to a value by GetAdapterDisplayModeEx*/
350     todo_wine ok(mode_ex.ScanLineOrdering != 0, "ScanLineOrdering returned 0\n");
351     /* check that orientation is returned correctly by GetAdapterDisplayModeEx and EnumDisplaySettingsEx*/
352     todo_wine ok(S2(U1(startmode)).dmDisplayOrientation == DMDO_180 && rotation == D3DDISPLAYROTATION_180, "rotation is %d instead of %d\n", rotation, S2(U1(startmode)).dmDisplayOrientation);
353
354     trace("GetAdapterDisplayModeEx returned Width = %d,Height = %d, RefreshRate = %d, Format = %x, ScanLineOrdering = %x, rotation = %d\n",
355           mode_ex.Width, mode_ex.Height, mode_ex.RefreshRate, mode_ex.Format, mode_ex.ScanLineOrdering, rotation);
356
357     /* test GetAdapterDisplayModeEx with null pointer for D3DDISPLAYROTATION */
358     memset(&mode_ex, 0, sizeof(mode_ex));
359     mode_ex.Size = sizeof(D3DDISPLAYMODEEX);
360
361     hr = IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, D3DADAPTER_DEFAULT, &mode_ex, NULL);
362     todo_wine ok(SUCCEEDED(hr), "GetAdapterDisplayModeEx failed, hr %#x.\n", hr);
363
364     ok(mode_ex.Size == sizeof(D3DDISPLAYMODEEX), "size is %d\n", mode_ex.Size);
365     todo_wine ok(mode_ex.Width == mode.Width, "width is %d instead of %d\n", mode_ex.Width, mode.Width);
366     todo_wine ok(mode_ex.Height == mode.Height, "height is %d instead of %d\n", mode_ex.Height, mode.Height);
367     todo_wine ok(mode_ex.RefreshRate == mode.RefreshRate, "RefreshRate is %d instead of %d\n", mode_ex.RefreshRate, mode.RefreshRate);
368     todo_wine ok(mode_ex.Format == mode.Format, "format is %x instead of %x\n", mode_ex.Format, mode.Format);
369     /* don't know yet how to test for ScanLineOrdering, just testing that it is set to a value by GetAdapterDisplayModeEx*/
370     todo_wine ok(mode_ex.ScanLineOrdering != 0, "ScanLineOrdering returned 0\n");
371
372     /* return to the default mode */
373     pChangeDisplaySettingsExA(NULL, NULL, NULL, 0, NULL);
374 out:
375     IDirect3D9_Release(d3d9);
376     IDirect3D9Ex_Release(d3d9ex);
377 }
378
379 static void test_texture_sysmem_create(void)
380 {
381     IDirect3DDevice9Ex *device;
382     IDirect3DTexture9 *texture;
383     D3DLOCKED_RECT locked_rect;
384     IDirect3D9Ex *d3d9;
385     UINT refcount;
386     HWND window;
387     HRESULT hr;
388     void *mem;
389
390     if (FAILED(hr = pDirect3DCreate9Ex(D3D_SDK_VERSION, &d3d9)))
391     {
392         skip("Failed to create IDirect3D9Ex object (hr %#x), skipping tests.\n", hr);
393         return;
394     }
395
396     window = create_window();
397     device = create_device(d3d9, window, window, TRUE);
398     if (!device)
399     {
400         skip("Failed to create a D3D device, skipping tests.\n");
401         goto done;
402     }
403
404     mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 128 * 128 * 4);
405     hr = IDirect3DDevice9Ex_CreateTexture(device, 128, 128, 0, 0, D3DFMT_A8R8G8B8,
406             D3DPOOL_SYSTEMMEM, &texture, &mem);
407     ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
408     hr = IDirect3DDevice9Ex_CreateTexture(device, 128, 128, 1, 0, D3DFMT_A8R8G8B8,
409             D3DPOOL_SYSTEMMEM, &texture, &mem);
410     ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr);
411     hr = IDirect3DTexture9_LockRect(texture, 0, &locked_rect, NULL, 0);
412     ok(SUCCEEDED(hr), "Failed to lock texture, hr %#x.\n", hr);
413     ok(locked_rect.Pitch == 128 * 4, "Got unexpected pitch %d.\n", locked_rect.Pitch);
414     ok(locked_rect.pBits == mem, "Got unexpected pBits %p, expected %p.\n", locked_rect.pBits, mem);
415     hr = IDirect3DTexture9_UnlockRect(texture, 0);
416     ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x.\n", hr);
417     IDirect3DTexture9_Release(texture);
418     HeapFree(GetProcessHeap(), 0, mem);
419
420     refcount = IDirect3DDevice9Ex_Release(device);
421     ok(!refcount, "Device has %u references left.\n", refcount);
422
423 done:
424     DestroyWindow(window);
425     if (d3d9)
426         IDirect3D9Ex_Release(d3d9);
427 }
428
429 START_TEST(d3d9ex)
430 {
431     d3d9_handle = LoadLibraryA("d3d9.dll");
432     if (!d3d9_handle)
433     {
434         skip("Could not load d3d9.dll\n");
435         return;
436     }
437     pDirect3DCreate9 = (void *)GetProcAddress(d3d9_handle, "Direct3DCreate9");
438     ok(pDirect3DCreate9 != NULL, "Failed to get address of Direct3DCreate9\n");
439     if(!pDirect3DCreate9) {
440         return;
441     }
442
443     pDirect3DCreate9Ex = (void *)GetProcAddress(d3d9_handle, "Direct3DCreate9Ex");
444     if (!pDirect3DCreate9Ex) {
445         win_skip("Failed to get address of Direct3DCreate9Ex\n");
446         return;
447     }
448
449     test_qi_base_to_ex();
450     test_qi_ex_to_base();
451     test_get_adapter_luid();
452     test_get_adapter_displaymode_ex();
453     test_texture_sysmem_create();
454 }