Paul Vriens : d3d9: Don't treat missing d3d9.dll as a failure.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Dec 15 04:35:09 CST 2005


Module: wine
Branch: refs/heads/master
Commit: 27462d1d40306b9ba10d9e353890cd101d16adfa
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=27462d1d40306b9ba10d9e353890cd101d16adfa

Author: Paul Vriens <Paul.Vriens at xs4all.nl>
Date:   Thu Dec 15 10:25:06 2005 +0100

d3d9: Don't treat missing d3d9.dll as a failure.

---

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

diff --git a/dlls/d3d9/tests/vertexdeclaration.c b/dlls/d3d9/tests/vertexdeclaration.c
index eb88240..5118b55 100644
--- a/dlls/d3d9/tests/vertexdeclaration.c
+++ b/dlls/d3d9/tests/vertexdeclaration.c
@@ -20,19 +20,16 @@
 #include <d3d9.h>
 #include "wine/test.h"
 
+static HMODULE d3d9_handle = 0;
+
 static IDirect3DDevice9 *init_d3d9(void)
 {
     IDirect3D9 * (__stdcall * d3d9_create)(UINT SDKVersion) = 0;
-    HMODULE d3d9_handle = 0;
     IDirect3D9 *d3d9_ptr = 0;
     IDirect3DDevice9 *device_ptr = 0;
     D3DPRESENT_PARAMETERS present_parameters;
     HRESULT hres;
 
-    d3d9_handle = LoadLibrary("d3d9");
-    ok(d3d9_handle != NULL, "Failed to load d3d9.\n");
-    if (!d3d9_handle) return NULL;
-
     d3d9_create = (void *)GetProcAddress(d3d9_handle, "Direct3DCreate9");
     ok(d3d9_create != NULL, "Failed to get address of Direct3DCreate9\n");
     if (!d3d9_create) return NULL;
@@ -93,7 +90,16 @@ static void test_get_set_vertex_declarat
 
 START_TEST(vertexdeclaration)
 {
-    IDirect3DDevice9 *device_ptr = init_d3d9();
+    IDirect3DDevice9 *device_ptr;
+
+    d3d9_handle = LoadLibraryA("d3d9.dll");
+    if (!d3d9_handle)
+    {
+        trace("Could not load d3d9.dll, skipping tests\n");
+        return;
+    }
+
+    device_ptr = init_d3d9();
     if (!device_ptr) return;
     
     test_get_set_vertex_declaration(device_ptr);




More information about the wine-cvs mailing list