Paul Vriens : ddraw/tests: Let tests run again on win9x.

Alexandre Julliard julliard at winehq.org
Wed Sep 3 07:43:38 CDT 2008


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

Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date:   Tue Sep  2 18:07:49 2008 +0200

ddraw/tests: Let tests run again on win9x.

---

 dlls/ddraw/tests/overlay.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/dlls/ddraw/tests/overlay.c b/dlls/ddraw/tests/overlay.c
index 8d38f98..10f66b4 100644
--- a/dlls/ddraw/tests/overlay.c
+++ b/dlls/ddraw/tests/overlay.c
@@ -24,6 +24,8 @@
 #include "ddraw.h"
 #include "unknwn.h"
 
+static HRESULT (WINAPI *pDirectDrawCreateEx)(LPGUID,LPVOID*,REFIID,LPUNKNOWN);
+
 static IDirectDraw7 *ddraw = NULL;
 static IDirectDrawSurface7 *primary = NULL;
 
@@ -51,8 +53,15 @@ static BOOL CreateDirectDraw(void)
     HRESULT hr;
     DDSURFACEDESC2 ddsd;
     IDirectDrawSurface7 *overlay = NULL;
+    HMODULE hmod = GetModuleHandleA("ddraw.dll");
+
+    pDirectDrawCreateEx = (void*)GetProcAddress(hmod, "DirectDrawCreateEx");
+    if (!pDirectDrawCreateEx) {
+        win_skip("DirectDrawCreateEx is not available\n");
+        return FALSE;
+    }
 
-    hr = DirectDrawCreateEx(NULL, (void**)&ddraw, &IID_IDirectDraw7, NULL);
+    hr = pDirectDrawCreateEx(NULL, (void**)&ddraw, &IID_IDirectDraw7, NULL);
     ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreateEx returned: %x\n", hr);
     if (!ddraw) {
         trace("DirectDrawCreateEx() failed with an error %x\n", hr);




More information about the wine-cvs mailing list