more stuff for ddraw.dll not tested yet.
Modified: trunk/reactos/lib/ddraw/Makefile
Modified: trunk/reactos/lib/ddraw/ddraw.c
Added: trunk/reactos/lib/ddraw/rosddraw.h

Modified: trunk/reactos/lib/ddraw/Makefile
--- trunk/reactos/lib/ddraw/Makefile	2005-03-17 19:35:16 UTC (rev 14164)
+++ trunk/reactos/lib/ddraw/Makefile	2005-03-17 20:15:44 UTC (rev 14165)
@@ -12,7 +12,7 @@
 # require os code to explicitly request A/W version of structs/functions
 TARGET_CFLAGS += -D_DISABLE_TIDENTS -Wall -Werror 
 
-TARGET_SDKLIBS = ntdll.a gdi32.a dxguid.a ole32.a user32.a 
+TARGET_SDKLIBS = ntdll.a gdi32.a dxguid.a ole32.a user32.a d3d8thk.a
 
 
 TARGET_OBJECTS = \

Modified: trunk/reactos/lib/ddraw/ddraw.c
--- trunk/reactos/lib/ddraw/ddraw.c	2005-03-17 19:35:16 UTC (rev 14164)
+++ trunk/reactos/lib/ddraw/ddraw.c	2005-03-17 20:15:44 UTC (rev 14165)
@@ -10,27 +10,18 @@
  */
 
 #include <windows.h>
-//#include <ddraw.h>
+#include "ddraw.h"
+#include "rosddraw.h"
 
- #define DD_OK 0
  
-HRESULT STDCALL DirectDrawCreate(
-  GUID FAR* lpGUID, 
-  DWORD FAR* lplpDD, 
-  IUnknown FAR* pUnkOuter
-)
-{	
-    return DD_OK;
+HRESULT WINAPI DirectDrawCreate(LPGUID lpGUID, LPVOID* lplpDD, LPUNKNOWN pUnkOuter) 
+{    	
+   return DDRAW_Create(lpGUID, (LPVOID*) lplpDD, pUnkOuter, &IID_IDirectDraw, FALSE);
 }
 
-HRESULT STDCALL DirectDrawCreateEx(
-  GUID FAR* lpGUID, 
-  DWORD FAR* lplpDD, 
-  DWORD Unknown3,
-  IUnknown FAR* pUnkOuter
-)
+HRESULT WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID* lplpDD, REFIID iid, LPUNKNOWN pUnkOuter)
 {
-    return DD_OK;
+    return DDRAW_Create(lpGUID, lplpDD, pUnkOuter, iid, TRUE);
 }
 
 HRESULT WINAPI DirectDrawEnumerateA(
@@ -77,6 +68,29 @@
     return DD_OK;
 }
 
+HRESULT DDRAW_Create(
+	LPGUID lpGUID, LPVOID *lplpDD, LPUNKNOWN pUnkOuter, REFIID iid, BOOL ex) 
+{  		      
+	HDC desktop;
+	
+    /* BOOL ex == TRUE it is DirectDrawCreateEx call here. */
+	
+	/* TODO: 
+	   check the GUID are right 
+	   add scanner that DirectDrawCreate / DirectDrawCreateEx select right driver.
+	   now we will assume it is the current display driver 
+	*/
+
+	if (pUnkOuter != NULL) return DDERR_INVALIDPARAMS;
+	
+	desktop = GetWindowDC(GetDesktopWindow());
+
+	lplpDD = OsThunkDdCreateDirectDrawObject(desktop);   
+	if (lplpDD == NULL) return DDERR_NODIRECTDRAWHW;
+	 	
+	return DD_OK;
+}
+
 BOOL WINAPI DllMain(HINSTANCE hInstance,DWORD fwdReason, LPVOID lpvReserved)
 {
     switch(fwdReason)

Added: trunk/reactos/lib/ddraw/rosddraw.h
--- trunk/reactos/lib/ddraw/rosddraw.h	2005-03-17 19:35:16 UTC (rev 14164)
+++ trunk/reactos/lib/ddraw/rosddraw.h	2005-03-17 20:15:44 UTC (rev 14165)
@@ -0,0 +1,15 @@
+/* 
+ *
+ * COPYRIGHT:            See COPYING in the top level directory
+ * PROJECT:              ReactOS kernel
+ * FILE:                 lib/ddraw/ddraw.c
+ * PURPOSE:              ddraw lib
+ * PROGRAMMER:           Magnus Olsen
+ * UPDATE HISTORY:
+ */
+
+
+ HANDLE STDCALL OsThunkDdCreateDirectDrawObject(HDC hdc);
+
+
+HRESULT DDRAW_Create(LPGUID lpGUID, LPVOID *lplpDD, LPUNKNOWN pUnkOuter, REFIID iid, BOOL ex);