[PATCH 2/4] d3d9/tests: Avoid mode changes in d3d9ex' test_lost_device.

Stefan Dösinger stefan at codeweavers.com
Tue Oct 14 16:17:02 CDT 2014


---
 dlls/d3d9/tests/d3d9ex.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c
index 03b693c..96fe8fb 100644
--- a/dlls/d3d9/tests/d3d9ex.c
+++ b/dlls/d3d9/tests/d3d9ex.c
@@ -27,6 +27,7 @@
 #include <d3d9.h>
 
 static HMODULE d3d9_handle = 0;
+static DEVMODEW startup_mode;
 
 static HRESULT (WINAPI *pDirect3DCreate9Ex)(UINT SDKVersion, IDirect3D9Ex **d3d9ex);
 
@@ -1208,8 +1209,8 @@ static void test_lost_device(void)
     window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
             0, 0, 640, 480, NULL, NULL, NULL, NULL);
     desc.device_window = window;
-    desc.width = 640;
-    desc.height = 480;
+    desc.width = startup_mode.dmPelsWidth;
+    desc.height = startup_mode.dmPelsHeight;
     desc.windowed = FALSE;
     if (!(device = create_device(window, &desc)))
     {
@@ -1353,6 +1354,11 @@ START_TEST(d3d9ex)
         return;
     }
 
+    memset(&startup_mode, 0, sizeof(startup_mode));
+    startup_mode.dmSize = sizeof(startup_mode);
+    ok(EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &startup_mode),
+            "Failed to get display mode.\n");
+
     test_qi_base_to_ex();
     test_qi_ex_to_base();
     test_swapchain_get_displaymode_ex();
-- 
2.0.4




More information about the wine-patches mailing list