ddraw: implement DirectDrawEnumerateExW

Erik Inge Bolsø knan-wine at anduin.net
Mon Oct 5 17:42:19 CDT 2009


---
fixes bug 20184

 dlls/ddraw/ddraw.spec |    2 +-
 dlls/ddraw/main.c     |   26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/dlls/ddraw/ddraw.spec b/dlls/ddraw/ddraw.spec
index 0cd1d0f..c315c9c 100644
--- a/dlls/ddraw/ddraw.spec
+++ b/dlls/ddraw/ddraw.spec
@@ -8,7 +8,7 @@
 @ stdcall DirectDrawCreateEx(ptr ptr ptr ptr)
 @ stdcall DirectDrawEnumerateA(ptr ptr)
 @ stdcall DirectDrawEnumerateExA(ptr ptr long)
-@ stub DirectDrawEnumerateExW
+@ stdcall DirectDrawEnumerateExW(ptr ptr long)
 @ stub DirectDrawEnumerateW
 @ stdcall -private DllCanUnloadNow()
 @ stdcall -private DllGetClassObject(ptr ptr ptr)
diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c
index b7eed02..1d6489d 100644
--- a/dlls/ddraw/main.c
+++ b/dlls/ddraw/main.c
@@ -444,6 +444,32 @@ DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA Callback,
  * The Flag member is not supported right now.
  *
  ***********************************************************************/
+HRESULT WINAPI
+DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW Callback,
+                       LPVOID Context,
+                       DWORD Flags)
+{
+    BOOL stop = FALSE;
+    TRACE("Enumerating default DirectDraw HAL interface\n");
+
+    /* We only have one driver by now */
+    __TRY
+    {
+        static WCHAR driver_desc[15] = { 'D', 'i', 'r', 'e', 'c', 't',
+          'D', 'r', 'a', 'w', ' ', 'H', 'A', 'L', 0 },
+        driver_name[8] = { 'd', 'i', 's', 'p', 'l', 'a', 'y', 0 };
+
+        stop = !Callback(NULL, driver_desc, driver_name, Context, 0);
+    }
+    __EXCEPT_PAGE_FAULT
+    {
+        return E_INVALIDARG;
+    }
+    __ENDTRY;
+
+    TRACE("End of enumeration\n");
+    return DD_OK;
+}
 
 /***********************************************************************
  * Classfactory implementation.
-- 
1.6.0.4



More information about the wine-patches mailing list