Stefan Dösinger : d3d9: Use a proper window class for the query test.

Alexandre Julliard julliard at winehq.org
Mon Feb 7 16:06:35 CST 2011


Module: wine
Branch: master
Commit: eadae86c858fb132191a317ebfaf51b3d7d86226
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=eadae86c858fb132191a317ebfaf51b3d7d86226

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sun Jan 30 20:41:56 2011 +0100

d3d9: Use a proper window class for the query test.

---

 dlls/d3d9/tests/query.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/dlls/d3d9/tests/query.c b/dlls/d3d9/tests/query.c
index d015353..8bcfcf6 100644
--- a/dlls/d3d9/tests/query.c
+++ b/dlls/d3d9/tests/query.c
@@ -255,25 +255,31 @@ START_TEST(query)
     {
         IDirect3D9            *pD3d = NULL;
         HWND                  hwnd = NULL;
+        WNDCLASS wc = {0};
+        wc.lpfnWndProc = DefWindowProc;
+        wc.lpszClassName = "d3d9_test_wc";
+        RegisterClass(&wc);
 
         pD3d = pDirect3DCreate9( D3D_SDK_VERSION );
         if(!pD3d)
         {
             skip("Failed to create Direct3D9 object, not running tests\n");
-            return;
+            goto out;
         }
-        hwnd = CreateWindow( "static", "d3d9_test", WS_OVERLAPPEDWINDOW, 100, 100, 160, 160, NULL, NULL, NULL, NULL );
+        hwnd = CreateWindow( wc.lpszClassName, "d3d9_test",
+                WS_SYSMENU | WS_POPUP, 100, 100, 160, 160, NULL, NULL, NULL, NULL );
         if(!hwnd)
         {
             skip("Failed to create window\n");
-            IDirect3D9_Release(pD3d);
-            return;
+            goto out;
         }
 
         test_query_support(pD3d, hwnd);
         test_occlusion_query_states(pD3d, hwnd);
 
-        DestroyWindow(hwnd);
-        IDirect3D9_Release(pD3d);
+        out:
+        if(pD3d) IDirect3D9_Release(pD3d);
+        if(hwnd) DestroyWindow(hwnd);
+        UnregisterClassA(wc.lpszClassName, GetModuleHandleA(NULL));
     }
 }




More information about the wine-cvs mailing list