Mostly to test that when doing mode restoration, all display outputs get restored to their display settings in the registry, not just one output gets restored.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/d3d9/tests/device.c | 385 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 373 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 0f0de5e3382..d7b71152b03 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -159,6 +159,14 @@ static BOOL adapter_is_warp(const D3DADAPTER_IDENTIFIER9 *identifier) return !strcmp(identifier->Driver, "d3d10warp.dll"); }
+static BOOL equal_mode_rect(const DEVMODEW *mode1, const DEVMODEW *mode2) +{ + return mode1->dmPosition.x == mode2->dmPosition.x + && mode1->dmPosition.y == mode2->dmPosition.y + && mode1->dmPelsWidth == mode2->dmPelsWidth + && mode1->dmPelsHeight == mode2->dmPelsHeight; +} + /* Free original_modes after finished using it */ static BOOL save_display_modes(DEVMODEW **original_modes, unsigned int *display_count) { @@ -5267,21 +5275,34 @@ done:
static void test_mode_change(void) { + DEVMODEW old_devmode, devmode, devmode2, *original_modes = NULL; + struct device_desc device_desc, device_desc2; + WCHAR second_monitor_name[CCHDEVICENAME]; + IDirect3DDevice9 *device, *device2; + unsigned int display_count = 0; RECT d3d_rect, focus_rect, r; - struct device_desc device_desc; IDirect3DSurface9 *backbuffer; - IDirect3DDevice9 *device; + MONITORINFOEXW monitor_info; + HMONITOR second_monitor; D3DSURFACE_DESC desc; IDirect3D9 *d3d9; - DEVMODEW devmode; ULONG refcount; UINT adapter_mode_count, i; HRESULT hr; - DWORD ret; + BOOL ret; LONG change_ret; D3DDISPLAYMODE d3ddm; DWORD d3d_width = 0, d3d_height = 0, user32_width = 0, user32_height = 0;
+ memset(&devmode, 0, sizeof(devmode)); + devmode.dmSize = sizeof(devmode); + ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(equal_mode_rect(&devmode, ®istry_mode), "Got a different mode.\n"); + ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(equal_mode_rect(&devmode, ®istry_mode), "Got a different mode.\n"); + d3d9 = Direct3DCreate9(D3D_SDK_VERSION); ok(!!d3d9, "Failed to create a D3D object.\n");
@@ -5334,6 +5355,9 @@ static void test_mode_change(void) return; }
+ ret = save_display_modes(&original_modes, &display_count); + ok(ret, "Failed to save original display modes.\n"); + memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(devmode); devmode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; @@ -5358,8 +5382,6 @@ static void test_mode_change(void) if (!(device = create_device(d3d9, focus_window, &device_desc))) { skip("Failed to create a D3D device, skipping tests.\n"); - change_ret = ChangeDisplaySettingsW(NULL, CDS_FULLSCREEN); - ok(change_ret == DISP_CHANGE_SUCCESSFUL, "Failed to change display mode, ret %#x.\n", change_ret); goto done; }
@@ -5411,8 +5433,13 @@ static void test_mode_change(void) device_desc.width = registry_mode.dmPelsWidth; device_desc.height = registry_mode.dmPelsHeight; device_desc.flags = CREATE_DEVICE_FULLSCREEN; - ok(!!(device = create_device(d3d9, focus_window, &device_desc)), "Failed to create a D3D device.\n"); + if (!(device = create_device(d3d9, focus_window, &device_desc))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + }
+ devmode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; devmode.dmPelsWidth = user32_width; devmode.dmPelsHeight = user32_height; change_ret = ChangeDisplaySettingsW(&devmode, CDS_FULLSCREEN); @@ -5421,17 +5448,351 @@ static void test_mode_change(void) refcount = IDirect3DDevice9_Release(device); ok(!refcount, "Device has %u references left.\n", refcount);
- ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); + memset(&devmode2, 0, sizeof(devmode2)); + devmode2.dmSize = sizeof(devmode2); + ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2); ok(ret, "Failed to get display mode.\n"); - ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth - && devmode.dmPelsHeight == registry_mode.dmPelsHeight, - "Expected resolution %ux%u, got %ux%u.\n", - registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, devmode.dmPelsWidth, devmode.dmPelsHeight); + ok(devmode2.dmPelsWidth == registry_mode.dmPelsWidth + && devmode2.dmPelsHeight == registry_mode.dmPelsHeight, + "Expected resolution %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, + registry_mode.dmPelsHeight, devmode2.dmPelsWidth, devmode2.dmPelsHeight); + ret = restore_display_modes(original_modes, display_count); + ok(ret, "Failed to restore display modes.\n"); + + /* Test that no mode restorations if no mode changes happened */ + change_ret = ChangeDisplaySettingsW(&devmode, CDS_UPDATEREGISTRY | CDS_NORESET); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %d.\n", change_ret); + + device_desc.adapter_ordinal = D3DADAPTER_DEFAULT; + device_desc.device_window = device_window; + device_desc.width = d3d_width; + device_desc.height = d3d_height; + device_desc.flags = 0; + device = create_device(d3d9, device_window, &device_desc); + ok(!!device, "Failed to create a D3D device.\n"); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + + ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(equal_mode_rect(&devmode2, ®istry_mode), "Got a different mode.\n"); + ret = restore_display_modes(original_modes, display_count); + ok(ret, "Failed to restore display modes.\n"); + + /* Test that mode restorations use display settings in the registry with a fullscreen device */ + change_ret = ChangeDisplaySettingsW(&devmode, CDS_UPDATEREGISTRY | CDS_NORESET); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %d.\n", change_ret); + + device_desc.adapter_ordinal = D3DADAPTER_DEFAULT; + device_desc.device_window = device_window; + device_desc.width = registry_mode.dmPelsWidth; + device_desc.height = registry_mode.dmPelsHeight; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + if (!(device = create_device(d3d9, device_window, &device_desc))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + + ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + todo_wine ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n"); + ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n"); + ret = restore_display_modes(original_modes, display_count); + ok(ret, "Failed to restore display modes.\n"); + + /* Test that mode restorations use display settings in the registry with a fullscreen device + * having the same display mode and then reset to a different mode */ + change_ret = ChangeDisplaySettingsW(&devmode, CDS_UPDATEREGISTRY | CDS_NORESET); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsW failed with %d.\n", change_ret); + + device_desc.adapter_ordinal = D3DADAPTER_DEFAULT; + device_desc.device_window = device_window; + device_desc.width = registry_mode.dmPelsWidth; + device_desc.height = registry_mode.dmPelsHeight; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + if (!(device = create_device(d3d9, device_window, &device_desc))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + device_desc.width = d3d_width; + device_desc.height = d3d_height; + hr = reset_device(device, &device_desc); + ok(hr == D3D_OK, "Failed to reset device, hr %#x.\n", hr); + ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(devmode2.dmPelsWidth == d3d_width && devmode2.dmPelsHeight == d3d_height, + "Expected resolution %ux%u, got %ux%u.\n", d3d_width, d3d_height, + devmode2.dmPelsWidth, devmode2.dmPelsHeight); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + + ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + todo_wine ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n"); + ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n"); + ret = restore_display_modes(original_modes, display_count); + ok(ret, "Failed to restore display modes.\n"); + + if (IDirect3D9_GetAdapterCount(d3d9) < 2) + { + skip("Following tests require two adapters.\n"); + goto done; + } + + second_monitor = IDirect3D9_GetAdapterMonitor(d3d9, 1); + monitor_info.cbSize = sizeof(monitor_info); + ret = GetMonitorInfoW(second_monitor, (MONITORINFO *)&monitor_info); + ok(ret, "GetMonitorInfoW failed, error %#x.\n", GetLastError()); + lstrcpyW(second_monitor_name, monitor_info.szDevice); + + memset(&old_devmode, 0, sizeof(old_devmode)); + old_devmode.dmSize = sizeof(old_devmode); + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &old_devmode); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + + i = 0; + d3d_width = 0; + d3d_height = 0; + user32_width = 0; + user32_height = 0; + while (EnumDisplaySettingsW(second_monitor_name, i++, &devmode)) + { + if (devmode.dmPelsWidth == old_devmode.dmPelsWidth + && devmode.dmPelsHeight == old_devmode.dmPelsHeight) + continue; + + if (!d3d_width && !d3d_height) + { + d3d_width = devmode.dmPelsWidth; + d3d_height = devmode.dmPelsHeight; + continue; + } + + if (devmode.dmPelsWidth == d3d_width && devmode.dmPelsHeight == d3d_height) + continue; + + user32_width = devmode.dmPelsWidth; + user32_height = devmode.dmPelsHeight; + break; + } + if (!user32_width || !user32_height) + { + skip("Failed to find three different display modes for the second monitor.\n"); + goto done; + } + + /* Test that mode restorations also happen for non-primary monitors on device resets */ + device_desc.adapter_ordinal = D3DADAPTER_DEFAULT; + device_desc.device_window = device_window; + device_desc.width = registry_mode.dmPelsWidth; + device_desc.height = registry_mode.dmPelsHeight; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + if (!(device = create_device(d3d9, device_window, &device_desc))) + { + skip("Failed to create a D3D device.\n"); + goto done; + } + + change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, CDS_RESET, NULL); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + if (devmode2.dmPelsWidth == old_devmode.dmPelsWidth + && devmode2.dmPelsHeight == old_devmode.dmPelsHeight) + { + skip("Failed to change display settings of the second monitor.\n"); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + goto done; + } + + device_desc.flags = 0; + hr = reset_device(device, &device_desc); + ok(hr == D3D_OK, "Failed to reset device, hr %#x.\n", hr); + + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); + hr = IDirect3D9_GetAdapterDisplayMode(d3d9, 1, &d3ddm); + ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr); + todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth, "Expected width %u, got %u.\n", + old_devmode.dmPelsWidth, d3ddm.Width); + todo_wine ok(d3ddm.Height == old_devmode.dmPelsHeight, "Expected height %u, got %u.\n", + old_devmode.dmPelsHeight, d3ddm.Height); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + ret = restore_display_modes(original_modes, display_count); + ok(ret, "Failed to restore display modes.\n"); + + /* Test that mode restorations happen for non-primary monitors on device releases */ + device_desc.adapter_ordinal = D3DADAPTER_DEFAULT; + device_desc.device_window = device_window; + device_desc.width = registry_mode.dmPelsWidth; + device_desc.height = registry_mode.dmPelsHeight; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + if (!(device = create_device(d3d9, device_window, &device_desc))) + { + skip("Failed to create a D3D device.\n"); + goto done; + } + + change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, CDS_RESET, NULL); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); + hr = IDirect3D9_GetAdapterDisplayMode(d3d9, 1, &d3ddm); + ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr); + todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth, "Expected width %u, got %u.\n", + old_devmode.dmPelsWidth, d3ddm.Width); + todo_wine ok(d3ddm.Height == old_devmode.dmPelsHeight, "Expected height %u, got %u.\n", + old_devmode.dmPelsHeight, d3ddm.Height); + ret = restore_display_modes(original_modes, display_count); + ok(ret, "Failed to restore display modes.\n"); + + /* Test that mode restorations for non-primary monitors use display settings in the registry */ + if (!(device = create_device(d3d9, device_window, &device_desc))) + { + skip("Failed to create a D3D device.\n"); + goto done; + } + + change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, + CDS_UPDATEREGISTRY | CDS_NORESET, NULL); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + todo_wine ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight, + "Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight, + devmode2.dmPelsWidth, devmode2.dmPelsHeight); + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight, + "Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight, + devmode2.dmPelsWidth, devmode2.dmPelsHeight); + hr = IDirect3D9_GetAdapterDisplayMode(d3d9, 1, &d3ddm); + ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr); + todo_wine ok(d3ddm.Width == devmode.dmPelsWidth && d3ddm.Height == devmode.dmPelsHeight, + "Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight, + d3ddm.Width, d3ddm.Height); + ret = restore_display_modes(original_modes, display_count); + ok(ret, "Failed to restore display modes.\n"); + + /* Test mode restorations when there are two fullscreen devices and one of them got reset */ + if (!(device = create_device(d3d9, focus_window, &device_desc))) + { + skip("Failed to create a D3D device.\n"); + goto done; + } + + device_desc2.adapter_ordinal = 1; + device_desc2.device_window = device_window; + device_desc2.width = d3d_width; + device_desc2.height = d3d_height; + device_desc2.flags = CREATE_DEVICE_FULLSCREEN; + if (!(device2 = create_device(d3d9, focus_window, &device_desc2))) + { + skip("Failed to create a D3D device.\n"); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + goto done; + } + + change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, CDS_RESET, NULL); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + + device_desc.flags = 0; + hr = reset_device(device, &device_desc); + ok(hr == D3D_OK, "Failed to reset device, hr %#x.\n", hr); + + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); + hr = IDirect3D9_GetAdapterDisplayMode(d3d9, 1, &d3ddm); + ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr); + todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth && d3ddm.Height == old_devmode.dmPelsHeight, + "Expected resolution %ux%u, got %ux%u.\n", old_devmode.dmPelsWidth, + old_devmode.dmPelsHeight, d3ddm.Width, d3ddm.Height); + + refcount = IDirect3DDevice9_Release(device2); + ok(!refcount, "Device has %u references left.\n", refcount); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + ret = restore_display_modes(original_modes, display_count); + ok(ret, "Failed to restore display modes.\n"); + + /* Test mode restoration when there are two fullscreen devices and one of them got released */ + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + if (!(device = create_device(d3d9, focus_window, &device_desc))) + { + skip("Failed to create a D3D device.\n"); + goto done; + } + + if (!(device2 = create_device(d3d9, focus_window, &device_desc2))) + { + skip("Failed to create a D3D device.\n"); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + goto done; + } + + change_ret = ChangeDisplaySettingsExW(second_monitor_name, &devmode, NULL, CDS_RESET, NULL); + ok(change_ret == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW failed with %d.\n", change_ret); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); + ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2); + ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError()); + ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n"); + hr = IDirect3D9_GetAdapterDisplayMode(d3d9, 1, &d3ddm); + ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr); + todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth && d3ddm.Height == old_devmode.dmPelsHeight, + "Expected resolution %ux%u, got %ux%u.\n", old_devmode.dmPelsWidth, + old_devmode.dmPelsHeight, d3ddm.Width, d3ddm.Height); + + refcount = IDirect3DDevice9_Release(device2); + ok(!refcount, "Device has %u references left.\n", refcount);
done: DestroyWindow(device_window); DestroyWindow(focus_window); IDirect3D9_Release(d3d9); + ret = restore_display_modes(original_modes, display_count); + ok(ret, "Failed to restore display modes.\n"); + heap_free(original_modes); }
static void test_device_window_reset(void)