From: Stefan Dösinger Subject: [PATCH 3/5] d3d9/tests: Add style and size tests for D3DCREATE_NOWINDOWCHANGES. Message-Id: <1413472043-13114-3-git-send-email-stefan@codeweavers.com> Date: Thu, 16 Oct 2014 17:07:21 +0200 This flag is supported on Windows XP too. Windows draws to the entire screen if the device window size does not match the screen size, but the user can "click through" the d3d rendering and e.g. open the start menu. If such a click leads to focus loss the device changes the display mode, but does not minimize the device window. The focus loss tests will need D3DCREATE_NOWINDOWCHANGES as well, hence the additional field in struct device_desc. It'll also allow migrating test_fpu_setup and test_swvp_buffer to create_device. --- dlls/d3d9/tests/d3d9ex.c | 98 +++++++++++++++---------- dlls/d3d9/tests/device.c | 185 +++++++++++++++++++++++++++++------------------ 2 files changed, 176 insertions(+), 107 deletions(-) diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 11fe091..34b967a 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -37,6 +37,7 @@ struct device_desc unsigned int width; unsigned int height; BOOL windowed; + DWORD behavior_flags; }; static HWND create_window(void) @@ -75,6 +76,7 @@ static IDirect3DDevice9Ex *create_device(HWND focus_window, const struct device_ IDirect3DDevice9Ex *device; D3DDISPLAYMODEEX mode, *m; IDirect3D9Ex *d3d9; + DWORD behavior_flags = D3DCREATE_HARDWARE_VERTEXPROCESSING; if (FAILED(pDirect3DCreate9Ex(D3D_SDK_VERSION, &d3d9))) return NULL; @@ -94,6 +96,7 @@ static IDirect3DDevice9Ex *create_device(HWND focus_window, const struct device_ present_parameters.BackBufferHeight = desc->height; present_parameters.hDeviceWindow = desc->device_window; present_parameters.Windowed = desc->windowed; + behavior_flags = desc->behavior_flags; } mode.Size = sizeof(mode); @@ -105,14 +108,18 @@ static IDirect3DDevice9Ex *create_device(HWND focus_window, const struct device_ m = present_parameters.Windowed ? NULL : &mode; if (SUCCEEDED(IDirect3D9Ex_CreateDeviceEx(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, - D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, m, &device))) goto done; + behavior_flags, &present_parameters, m, &device))) + goto done; present_parameters.AutoDepthStencilFormat = D3DFMT_D16; if (SUCCEEDED(IDirect3D9Ex_CreateDeviceEx(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, - D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, m, &device))) goto done; + behavior_flags, &present_parameters, m, &device))) + goto done; - if (SUCCEEDED(IDirect3D9Ex_CreateDeviceEx(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, - D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, m, &device))) goto done; + if ((!desc || !desc->behavior_flags) && SUCCEEDED(IDirect3D9Ex_CreateDeviceEx(d3d9, + D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, D3DCREATE_SOFTWARE_VERTEXPROCESSING, + &present_parameters, m, &device))) + goto done; device = NULL; @@ -1230,6 +1237,7 @@ static void test_lost_device(void) desc.width = 640; desc.height = 480; desc.windowed = FALSE; + desc.behavior_flags = 0; if (!(device = create_device(window, &desc))) { skip("Failed to create a D3D device, skipping tests.\n"); @@ -1831,6 +1839,7 @@ static void test_wndproc(void) device_desc.width = startup_mode.dmPelsWidth; device_desc.height = startup_mode.dmPelsHeight; device_desc.windowed = FALSE; + device_desc.behavior_flags = 0; if (!(device = create_device(focus_window, &device_desc))) { skip("Failed to create a D3D device, skipping tests.\n"); @@ -1971,6 +1980,7 @@ static void test_wndproc_windowed(void) device_desc.width = 640; device_desc.height = 480; device_desc.windowed = TRUE; + device_desc.behavior_flags = 0; if (!(device = create_device(focus_window, &device_desc))) { skip("Failed to create a D3D device, skipping tests.\n"); @@ -2110,7 +2120,7 @@ done: static void test_window_style(void) { - RECT focus_rect, fullscreen_rect, r; + RECT focus_rect, device_rect, fullscreen_rect, r, r2; LONG device_style, device_exstyle; LONG focus_style, focus_exstyle; struct device_desc device_desc; @@ -2118,20 +2128,27 @@ static void test_window_style(void) IDirect3DDevice9Ex *device; HRESULT hr; ULONG ref; - static const LONG test_style_flags[] = + static const struct { - 0, - WS_VISIBLE + LONG style_flags; + DWORD behavior_flags; + } + tests[] = + { + {0, D3DCREATE_SOFTWARE_VERTEXPROCESSING}, + {WS_VISIBLE, D3DCREATE_SOFTWARE_VERTEXPROCESSING}, + {0, D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_NOWINDOWCHANGES}, + {WS_VISIBLE, D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_NOWINDOWCHANGES}, }; unsigned int i; SetRect(&fullscreen_rect, 0, 0, startup_mode.dmPelsWidth, startup_mode.dmPelsHeight); - for (i = 0; i < sizeof(test_style_flags) / sizeof(*test_style_flags); ++i) + for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) { - focus_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | test_style_flags[i], + focus_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | tests[i].style_flags, 0, 0, startup_mode.dmPelsWidth / 2, startup_mode.dmPelsHeight / 2, 0, 0, 0, 0); - device_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | test_style_flags[i], + device_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | tests[i].style_flags, 0, 0, startup_mode.dmPelsWidth / 2, startup_mode.dmPelsHeight / 2, 0, 0, 0, 0); device_style = GetWindowLongA(device_window, GWL_STYLE); @@ -2140,11 +2157,13 @@ static void test_window_style(void) focus_exstyle = GetWindowLongA(focus_window, GWL_EXSTYLE); GetWindowRect(focus_window, &focus_rect); + GetWindowRect(device_window, &device_rect); device_desc.device_window = device_window; device_desc.width = startup_mode.dmPelsWidth; device_desc.height = startup_mode.dmPelsHeight; device_desc.windowed = FALSE; + device_desc.behavior_flags = tests[i].behavior_flags; if (!(device = create_device(focus_window, &device_desc))) { skip("Failed to create a D3D device, skipping tests.\n"); @@ -2154,50 +2173,55 @@ static void test_window_style(void) } style = GetWindowLongA(device_window, GWL_STYLE); - todo_wine ok(style == device_style, "Expected device window style %#x, got %#x.\n", - device_style, style); + todo_wine ok(style == device_style, "Expected device window style %#x, got %#x, i=%u.\n", + device_style, style, i); style = GetWindowLongA(device_window, GWL_EXSTYLE); - todo_wine ok(style == device_exstyle, "Expected device window extended style %#x, got %#x.\n", - device_exstyle, style); + todo_wine ok(style == device_exstyle, "Expected device window extended style %#x, got %#x, i=%u.\n", + device_exstyle, style, i); style = GetWindowLongA(focus_window, GWL_STYLE); - ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", - focus_style, style); + ok(style == focus_style, "Expected focus window style %#x, got %#x, i=%u.\n", + focus_style, style, i); style = GetWindowLongA(focus_window, GWL_EXSTYLE); - ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", - focus_exstyle, style); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x, i=%u.\n", + focus_exstyle, style, i); GetWindowRect(device_window, &r); - ok(EqualRect(&r, &fullscreen_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", - fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, - r.left, r.top, r.right, r.bottom); - GetClientRect(device_window, &r); - todo_wine ok(!EqualRect(&r, &fullscreen_rect), "Client rect and window rect are equal.\n"); + if (tests[i].behavior_flags & D3DCREATE_NOWINDOWCHANGES) + todo_wine ok(EqualRect(&r, &device_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}, i=%u.\n", + device_rect.left, device_rect.top, device_rect.right, device_rect.bottom, + r.left, r.top, r.right, r.bottom, i); + else + ok(EqualRect(&r, &fullscreen_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}, i=%u.\n", + fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, + r.left, r.top, r.right, r.bottom, i); + GetClientRect(device_window, &r2); + todo_wine ok(!EqualRect(&r, &r2), "Client rect and window rect are equal, i=%u.\n", i); GetWindowRect(focus_window, &r); - ok(EqualRect(&r, &focus_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", + ok(EqualRect(&r, &focus_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}, i=%u.\n", focus_rect.left, focus_rect.top, focus_rect.right, focus_rect.bottom, - r.left, r.top, r.right, r.bottom); + r.left, r.top, r.right, r.bottom, i); hr = reset_device(device, device_window, TRUE); ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); style = GetWindowLongA(device_window, GWL_STYLE); - if (test_style_flags[i] & WS_VISIBLE) - ok(style == device_style, "Expected device window style %#x, got %#x.\n", - device_style, style); + if (tests[i].style_flags & WS_VISIBLE) + ok(style == device_style, "Expected device window style %#x, got %#x, i=%u.\n", + device_style, style, i); else - todo_wine ok(style == device_style, "Expected device window style %#x, got %#x.\n", - device_style, style); + todo_wine ok(style == device_style, "Expected device window style %#x, got %#x, i=%u.\n", + device_style, style, i); style = GetWindowLongA(device_window, GWL_EXSTYLE); - todo_wine ok(style == device_exstyle, "Expected device window extended style %#x, got %#x.\n", - device_exstyle, style); + todo_wine ok(style == device_exstyle, "Expected device window extended style %#x, got %#x, i=%u.\n", + device_exstyle, style, i); style = GetWindowLongA(focus_window, GWL_STYLE); - ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", - focus_style, style); + ok(style == focus_style, "Expected focus window style %#x, got %#x, i=%u.\n", + focus_style, style, i); style = GetWindowLongA(focus_window, GWL_EXSTYLE); - ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", - focus_exstyle, style); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x, i=%u.\n", + focus_exstyle, style, i); ref = IDirect3DDevice9Ex_Release(device); ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 7559d28..74bacc7 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -37,6 +37,7 @@ struct device_desc unsigned int width; unsigned int height; BOOL windowed; + DWORD behavior_flags; }; #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) @@ -129,6 +130,7 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window, cons { D3DPRESENT_PARAMETERS present_parameters = {0}; IDirect3DDevice9 *device; + DWORD behavior_flags = D3DCREATE_HARDWARE_VERTEXPROCESSING; present_parameters.BackBufferWidth = 640; present_parameters.BackBufferHeight = 480; @@ -145,17 +147,24 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window, cons present_parameters.BackBufferHeight = desc->height; present_parameters.hDeviceWindow = desc->device_window; present_parameters.Windowed = desc->windowed; + behavior_flags = desc->behavior_flags; } if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, - D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device))) return device; + behavior_flags, &present_parameters, &device))) + return device; present_parameters.AutoDepthStencilFormat = D3DFMT_D16; if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, - D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device))) return device; + behavior_flags, &present_parameters, &device))) + return device; + + if (desc && desc->behavior_flags) + return NULL; if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, - D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device))) return device; + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device))) + return device; return NULL; } @@ -2972,6 +2981,7 @@ static void test_scissor_size(void) device_desc.width = scts[i].backx; device_desc.height = scts[i].backy; device_desc.windowed = scts[i].window; + device_desc.behavior_flags = 0; if (!(device_ptr = create_device(d3d9_ptr, hwnd, &device_desc))) { skip("Failed to create a 3D device, skipping test.\n"); @@ -3206,6 +3216,7 @@ static void test_wndproc(void) device_desc.width = screen_width; device_desc.height = screen_height; device_desc.windowed = FALSE; + device_desc.behavior_flags = 0; if (!(device = create_device(d3d9, focus_window, &device_desc))) { skip("Failed to create a D3D device, skipping tests.\n"); @@ -3634,7 +3645,7 @@ done: static void test_window_style(void) { - RECT focus_rect, fullscreen_rect, r; + RECT focus_rect, device_rect, fullscreen_rect, r, r2; LONG device_style, device_exstyle; LONG focus_style, focus_exstyle; struct device_desc device_desc; @@ -3643,86 +3654,116 @@ static void test_window_style(void) IDirect3D9 *d3d9; HRESULT hr; ULONG ref; + static const struct + { + DWORD behavior_flags; + LONG style, exstyle; + } + tests[] = + { + {D3DCREATE_SOFTWARE_VERTEXPROCESSING, WS_VISIBLE, WS_EX_TOPMOST}, + {D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_NOWINDOWCHANGES, 0}, + }; + unsigned int i; - focus_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW, - 0, 0, screen_width / 2, screen_height / 2, 0, 0, 0, 0); - device_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW, - 0, 0, screen_width / 2, screen_height / 2, 0, 0, 0, 0); d3d9 = Direct3DCreate9(D3D_SDK_VERSION); ok(!!d3d9, "Failed to create a D3D object.\n"); - - device_style = GetWindowLongA(device_window, GWL_STYLE); - device_exstyle = GetWindowLongA(device_window, GWL_EXSTYLE); - focus_style = GetWindowLongA(focus_window, GWL_STYLE); - focus_exstyle = GetWindowLongA(focus_window, GWL_EXSTYLE); - SetRect(&fullscreen_rect, 0, 0, screen_width, screen_height); - GetWindowRect(focus_window, &focus_rect); - device_desc.device_window = device_window; - device_desc.width = screen_width; - device_desc.height = screen_height; - device_desc.windowed = FALSE; - if (!(device = create_device(d3d9, focus_window, &device_desc))) + for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) { - skip("Failed to create a D3D device, skipping tests.\n"); - goto done; - } + focus_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, screen_width / 2, screen_height / 2, 0, 0, 0, 0); + device_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, screen_width / 2, screen_height / 2, 0, 0, 0, 0); - style = GetWindowLongA(device_window, GWL_STYLE); - expected_style = device_style | WS_VISIBLE; - todo_wine ok(style == expected_style, "Expected device window style %#x, got %#x.\n", - expected_style, style); - style = GetWindowLongA(device_window, GWL_EXSTYLE); - expected_style = device_exstyle | WS_EX_TOPMOST; - todo_wine ok(style == expected_style, "Expected device window extended style %#x, got %#x.\n", - expected_style, style); + device_style = GetWindowLongA(device_window, GWL_STYLE); + device_exstyle = GetWindowLongA(device_window, GWL_EXSTYLE); + focus_style = GetWindowLongA(focus_window, GWL_STYLE); + focus_exstyle = GetWindowLongA(focus_window, GWL_EXSTYLE); - style = GetWindowLongA(focus_window, GWL_STYLE); - ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", - focus_style, style); - style = GetWindowLongA(focus_window, GWL_EXSTYLE); - ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", - focus_exstyle, style); + GetWindowRect(focus_window, &focus_rect); + GetWindowRect(device_window, &device_rect); - GetWindowRect(device_window, &r); - ok(EqualRect(&r, &fullscreen_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", - fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, - r.left, r.top, r.right, r.bottom); - GetClientRect(device_window, &r); - todo_wine ok(!EqualRect(&r, &fullscreen_rect), "Client rect and window rect are equal.\n"); - GetWindowRect(focus_window, &r); - ok(EqualRect(&r, &focus_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", - focus_rect.left, focus_rect.top, focus_rect.right, focus_rect.bottom, - r.left, r.top, r.right, r.bottom); + device_desc.device_window = device_window; + device_desc.width = screen_width; + device_desc.height = screen_height; + device_desc.windowed = FALSE; + device_desc.behavior_flags = tests[i].behavior_flags; + if (!(device = create_device(d3d9, focus_window, &device_desc))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + DestroyWindow(device_window); + DestroyWindow(focus_window); + break; + } - hr = reset_device(device, device_window, TRUE); - ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + style = GetWindowLongA(device_window, GWL_STYLE); + expected_style = device_style | tests[i].style; + todo_wine ok(style == expected_style, "Expected device window style %#x, got %#x, i=%u.\n", + expected_style, style, i); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | tests[i].exstyle; + todo_wine ok(style == expected_style, "Expected device window extended style %#x, got %#x, i=%u.\n", + expected_style, style, i); + + style = GetWindowLongA(focus_window, GWL_STYLE); + ok(style == focus_style, "Expected focus window style %#x, got %#x, i=%u.\n", + focus_style, style, i); + style = GetWindowLongA(focus_window, GWL_EXSTYLE); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x, i=%u.\n", + focus_exstyle, style, i); + + GetWindowRect(device_window, &r); + if (tests[i].behavior_flags & D3DCREATE_NOWINDOWCHANGES) + todo_wine ok(EqualRect(&r, &device_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}, i=%u.\n", + device_rect.left, device_rect.top, device_rect.right, device_rect.bottom, + r.left, r.top, r.right, r.bottom, i); + else + ok(EqualRect(&r, &fullscreen_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}, i=%u.\n", + fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, + r.left, r.top, r.right, r.bottom, i); + GetClientRect(device_window, &r2); + todo_wine ok(!EqualRect(&r, &r2), "Client rect and window rect are equal.\n"); + GetWindowRect(focus_window, &r); + ok(EqualRect(&r, &focus_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}, i=%u.\n", + focus_rect.left, focus_rect.top, focus_rect.right, focus_rect.bottom, + r.left, r.top, r.right, r.bottom, i); + + hr = reset_device(device, device_window, TRUE); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + expected_style = device_style | tests[i].style; + if (tests[i].behavior_flags & D3DCREATE_NOWINDOWCHANGES) + todo_wine ok(style == expected_style, "Expected device window style %#x, got %#x, i=%u.\n", + expected_style, style, i); + else + ok(style == expected_style, "Expected device window style %#x, got %#x, i=%u.\n", + expected_style, style, i); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | tests[i].exstyle; + if (tests[i].behavior_flags & D3DCREATE_NOWINDOWCHANGES) + todo_wine ok(style == expected_style, "Expected device window extended style %#x, got %#x, i=%u.\n", + expected_style, style, i); + else + ok(style == expected_style, "Expected device window extended style %#x, got %#x, i=%u.\n", + expected_style, style, i); - style = GetWindowLongA(device_window, GWL_STYLE); - expected_style = device_style | WS_VISIBLE; - ok(style == expected_style, "Expected device window style %#x, got %#x.\n", - expected_style, style); - style = GetWindowLongA(device_window, GWL_EXSTYLE); - expected_style = device_exstyle | WS_EX_TOPMOST; - ok(style == expected_style, "Expected device window extended style %#x, got %#x.\n", - expected_style, style); - - style = GetWindowLongA(focus_window, GWL_STYLE); - ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", - focus_style, style); - style = GetWindowLongA(focus_window, GWL_EXSTYLE); - ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", - focus_exstyle, style); + style = GetWindowLongA(focus_window, GWL_STYLE); + ok(style == focus_style, "Expected focus window style %#x, got %#x, i=%u.\n", + focus_style, style, i); + style = GetWindowLongA(focus_window, GWL_EXSTYLE); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x, i=%u.\n", + focus_exstyle, style, i); - ref = IDirect3DDevice9_Release(device); - ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); + ref = IDirect3DDevice9_Release(device); + ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); -done: + DestroyWindow(device_window); + DestroyWindow(focus_window); + } IDirect3D9_Release(d3d9); - - DestroyWindow(device_window); - DestroyWindow(focus_window); } static const POINT *expect_pos; @@ -3869,6 +3910,7 @@ static void test_mode_change(void) device_desc.width = screen_width; device_desc.height = screen_height; device_desc.windowed = FALSE; + device_desc.behavior_flags = 0; if (!(device = create_device(d3d9, focus_window, &device_desc))) { skip("Failed to create a D3D device, skipping tests.\n"); @@ -3967,6 +4009,7 @@ static void test_device_window_reset(void) device_desc.width = screen_width; device_desc.height = screen_height; device_desc.windowed = FALSE; + device_desc.behavior_flags = 0; if (!(device = create_device(d3d9, focus_window, &device_desc))) { skip("Failed to create a D3D device, skipping tests.\n"); @@ -4570,6 +4613,7 @@ static void test_occlusion_query_states(void) device_desc.width = screen_width; device_desc.height = screen_height; device_desc.windowed = FALSE; + device_desc.behavior_flags = 0; if (!(device = create_device(d3d9, window, &device_desc))) { skip("Failed to create a D3D device, skipping tests.\n"); @@ -9161,6 +9205,7 @@ static void test_lost_device(void) device_desc.width = screen_width; device_desc.height = screen_height; device_desc.windowed = FALSE; + device_desc.behavior_flags = 0; if (!(device = create_device(d3d, window, &device_desc))) { skip("Failed to create a D3D device, skipping tests.\n"); -- 2.0.4