Commit ff23e5a9 authored by Stefan Leichter's avatar Stefan Leichter Committed by Alexandre Julliard

Make ddraw tests loadable on NT4.

parent 9b3b7caf
...@@ -40,12 +40,25 @@ static LPDIRECT3D7 lpD3D = NULL; ...@@ -40,12 +40,25 @@ static LPDIRECT3D7 lpD3D = NULL;
static LPDIRECTDRAWSURFACE7 lpDDS = NULL; static LPDIRECTDRAWSURFACE7 lpDDS = NULL;
static LPDIRECT3DDEVICE7 lpD3DDevice = NULL; static LPDIRECT3DDEVICE7 lpD3DDevice = NULL;
static HRESULT (WINAPI *pDirectDrawCreateEx)(LPGUID,LPVOID*,REFIID,LPUNKNOWN);
static void init_function_pointers(void)
{
HMODULE hmod = GetModuleHandleA("ddraw.dll");
if(hmod)
{
pDirectDrawCreateEx = (void*)GetProcAddress(hmod, "DirectDrawCreateEx");
}
}
static void CreateDirect3D() static void CreateDirect3D()
{ {
HRESULT rc; HRESULT rc;
DDSURFACEDESC2 ddsd; DDSURFACEDESC2 ddsd;
rc = DirectDrawCreateEx(NULL, (void**)&lpDD, rc = pDirectDrawCreateEx(NULL, (void**)&lpDD,
&IID_IDirectDraw7, NULL); &IID_IDirectDraw7, NULL);
ok(rc==DD_OK, "DirectDrawCreateEx returned: %lx\n", rc); ok(rc==DD_OK, "DirectDrawCreateEx returned: %lx\n", rc);
...@@ -190,6 +203,12 @@ static void LightTest() ...@@ -190,6 +203,12 @@ static void LightTest()
START_TEST(d3d) START_TEST(d3d)
{ {
init_function_pointers();
if(!pDirectDrawCreateEx) {
trace("function DirectDrawCreateEx not available, skipping tests\n");
return;
}
CreateDirect3D(); CreateDirect3D();
LightTest(); LightTest();
ReleaseDirect3D(); ReleaseDirect3D();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment