From 4d4b5a9a2f713c32d3ffac82026a254ec1afeb8b Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Sun, 28 Feb 1999 19:49:42 +0000 Subject: [PATCH] - added function DirectDrawEnumerateEx - added (or corrected) check for the return value of the enumeration functions --- graphics/ddraw.c | 55 +++++++++++++++++++++++++++++++++++++++++----- relay32/ddraw.spec | 34 ++++++++++++++-------------- 2 files changed, 68 insertions(+), 21 deletions(-) diff --git a/graphics/ddraw.c b/graphics/ddraw.c index a5b8dd927a6..75051d5e7bf 100644 --- a/graphics/ddraw.c +++ b/graphics/ddraw.c @@ -129,14 +129,59 @@ DDRAW_DGA_Available(void) HRESULT WINAPI DirectDrawEnumerateA(LPDDENUMCALLBACKA ddenumproc,LPVOID data) { + TRACE(ddraw, "(%p,%p)\n", ddenumproc, data); + if (DDRAW_DGA_Available()) { TRACE(ddraw, "Enumerating DGA interface\n"); - ddenumproc(&DGA_DirectDraw_GUID,"WINE with XFree86 DGA","display",data); + if (!ddenumproc(&DGA_DirectDraw_GUID,"WINE with XFree86 DGA","display",data)) + return DD_OK; } + TRACE(ddraw, "Enumerating Xlib interface\n"); - ddenumproc(&XLIB_DirectDraw_GUID,"WINE with Xlib","display",data); + if (!ddenumproc(&XLIB_DirectDraw_GUID,"WINE with Xlib","display",data)) + return DD_OK; + TRACE(ddraw, "Enumerating Default interface\n"); - ddenumproc(NULL,"WINE (default)","display",data); + if (!ddenumproc(NULL,"WINE (default)","display",data)) + return DD_OK; + + return DD_OK; +} + +HRESULT WINAPI +DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA ddenumproc,LPVOID data, DWORD dwFlags) { + TRACE(ddraw, "(%p,%p, %08lx)\n", ddenumproc, data, dwFlags); + + if (TRACE_ON(ddraw)) { + DUMP(" Flags : "); + if (dwFlags & DDENUM_ATTACHEDSECONDARYDEVICES) + DUMP("DDENUM_ATTACHEDSECONDARYDEVICES "); + if (dwFlags & DDENUM_DETACHEDSECONDARYDEVICES) + DUMP("DDENUM_DETACHEDSECONDARYDEVICES "); + if (dwFlags & DDENUM_NONDISPLAYDEVICES) + DUMP("DDENUM_NONDISPLAYDEVICES "); + DUMP("\n"); + } + + if (dwFlags & DDENUM_NONDISPLAYDEVICES) { + /* For the moment, Wine does not support any 3D only accelerators */ + return DD_OK; + } + + if (DDRAW_DGA_Available()) { + TRACE(ddraw, "Enumerating DGA interface\n"); + if (!ddenumproc(&DGA_DirectDraw_GUID,"WINE with XFree86 DGA","display",data, NULL)) + return DD_OK; + } + + TRACE(ddraw, "Enumerating Xlib interface\n"); + if (!ddenumproc(&XLIB_DirectDraw_GUID,"WINE with Xlib","display",data, NULL)) + return DD_OK; + + TRACE(ddraw, "Enumerating Default interface\n"); + if (!ddenumproc(NULL,"WINE (default)","display",data, NULL)) + return DD_OK; + return DD_OK; } @@ -1983,7 +2028,7 @@ static HRESULT WINAPI IDirect3D_EnumDevices(LPDIRECT3D this, FIXME(ddraw,"(%p)->(%p,%p),stub!\n",this,cb,context); /* Call functions defined in d3ddevices.c */ - if (d3d_OpenGL_dx3(cb, context)) + if (!d3d_OpenGL_dx3(cb, context)) return DD_OK; return DD_OK; @@ -2080,7 +2125,7 @@ static HRESULT WINAPI IDirect3D2_EnumDevices( FIXME(ddraw,"(%p)->(%p,%p),stub!\n",this,cb,context); /* Call functions defined in d3ddevices.c */ - if (d3d_OpenGL(cb, context)) + if (!d3d_OpenGL(cb, context)) return DD_OK; return DD_OK; diff --git a/relay32/ddraw.spec b/relay32/ddraw.spec index 98682806997..063fc1c4909 100644 --- a/relay32/ddraw.spec +++ b/relay32/ddraw.spec @@ -10,19 +10,21 @@ type win32 7 stdcall DirectDrawCreateClipper(long ptr ptr) DirectDrawCreateClipper 8 stdcall DirectDrawEnumerateA(ptr ptr) DirectDrawEnumerateA 9 stub DirectDrawEnumerateW - 10 stub DllCanUnloadNow - 11 stub DllGetClassObject - 12 stub GetNextMipMap - 13 stub GetSurfaceFromDC - 14 stub HeapVidMemAllocAligned - 15 stub InternalLock - 16 stub InternalUnlock - 17 stub LateAllocateSurfaceMem - 18 stub VidMemAlloc - 19 stub VidMemAmountFree - 20 stub VidMemFini - 21 stub VidMemFree - 22 stub VidMemInit - 23 stub VidMemLargestFree - 24 stub thk1632_ThunkData32 - 25 stub thk3216_ThunkData32 + 10 stdcall DirectDrawEnumerateExA(ptr ptr long) DirectDrawEnumerateExA + 11 stub DirectDrawEnumerateExW + 12 stub DllCanUnloadNow + 13 stub DllGetClassObject + 14 stub GetNextMipMap + 15 stub GetSurfaceFromDC + 16 stub HeapVidMemAllocAligned + 17 stub InternalLock + 18 stub InternalUnlock + 19 stub LateAllocateSurfaceMem + 20 stub VidMemAlloc + 21 stub VidMemAmountFree + 22 stub VidMemFini + 23 stub VidMemFree + 24 stub VidMemInit + 25 stub VidMemLargestFree + 26 stub thk1632_ThunkData32 + 27 stub thk3216_ThunkData32