diff --git a/reactos/dll/directx/ddraw/ddraw.rbuild b/reactos/dll/directx/ddraw/ddraw.rbuild
index 0b6d606fb76..e6c0ef3a63b 100644
--- a/reactos/dll/directx/ddraw/ddraw.rbuild
+++ b/reactos/dll/directx/ddraw/ddraw.rbuild
@@ -8,6 +8,7 @@
ntdll
kernel32
+ user32
gdi32
d3d8thk
dxguid
diff --git a/reactos/dll/directx/ddraw/main.c b/reactos/dll/directx/ddraw/main.c
index 62f80ead22e..7d0cbb8e412 100644
--- a/reactos/dll/directx/ddraw/main.c
+++ b/reactos/dll/directx/ddraw/main.c
@@ -12,8 +12,6 @@
#include "rosdraw.h"
-#undef DirectDrawCreate
-
CRITICAL_SECTION ddcs;
// This function is exported by the dll
diff --git a/reactos/dll/directx/ddraw/startup.c b/reactos/dll/directx/ddraw/startup.c
index 26ca6fda3b0..897f21bdfa0 100644
--- a/reactos/dll/directx/ddraw/startup.c
+++ b/reactos/dll/directx/ddraw/startup.c
@@ -11,6 +11,7 @@
#include
#include "rosdraw.h"
#include "d3dhal.h"
+#include "ddrawgdi.h"
DDRAWI_DIRECTDRAW_GBL ddgbl;
DDRAWI_DDRAWSURFACE_GBL ddSurfGbl;
@@ -170,6 +171,116 @@ StartDirectDraw(LPDIRECTDRAW* iface, LPGUID lpGuid)
/* Fixme the mix betwin hel and hal */
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwSize = sizeof(This->lpLcl->lpDDCB->cbDDCallbacks);
+
+ if (This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_CANCREATESURFACE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_CANCREATESURFACE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.CanCreateSurface = This->lpLcl->lpDDCB->HALDD.CanCreateSurface;
+ }
+ else if (This->lpLcl->lpDDCB->HELDD.dwFlags & DDHAL_CB32_CANCREATESURFACE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_CANCREATESURFACE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.CanCreateSurface = This->lpLcl->lpDDCB->HELDD.CanCreateSurface;
+ }
+ if (This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_CREATESURFACE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_CREATESURFACE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.CreateSurface = This->lpLcl->lpDDCB->HALDD.CreateSurface;
+ }
+ else if (This->lpLcl->lpDDCB->HELDD.dwFlags & DDHAL_CB32_CREATESURFACE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_CREATESURFACE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.CreateSurface = This->lpLcl->lpDDCB->HELDD.CreateSurface;
+ }
+ if (This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_CREATEPALETTE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_CREATEPALETTE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.CreatePalette = This->lpLcl->lpDDCB->HALDD.CreatePalette;
+ }
+ else if (This->lpLcl->lpDDCB->HELDD.dwFlags & DDHAL_CB32_CREATEPALETTE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_CREATEPALETTE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.CreatePalette = This->lpLcl->lpDDCB->HELDD.CreatePalette;
+ }
+ if (This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_DESTROYDRIVER)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_DESTROYDRIVER;
+ This->lpLcl->lpDDCB->cbDDCallbacks.DestroyDriver = This->lpLcl->lpDDCB->HALDD.DestroyDriver;
+ }
+ else if (This->lpLcl->lpDDCB->HELDD.dwFlags & DDHAL_CB32_DESTROYDRIVER)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_DESTROYDRIVER;
+ This->lpLcl->lpDDCB->cbDDCallbacks.DestroyDriver = This->lpLcl->lpDDCB->HELDD.DestroyDriver;
+ }
+ if (This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_FLIPTOGDISURFACE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.FlipToGDISurface = This->lpLcl->lpDDCB->HALDD.FlipToGDISurface;
+ }
+ else if (This->lpLcl->lpDDCB->HELDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_FLIPTOGDISURFACE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.FlipToGDISurface = This->lpLcl->lpDDCB->HELDD.FlipToGDISurface;
+ }
+ if (This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_GETSCANLINE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_GETSCANLINE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.GetScanLine = This->lpLcl->lpDDCB->HALDD.GetScanLine;
+ }
+ else if (This->lpLcl->lpDDCB->HELDD.dwFlags & DDHAL_CB32_GETSCANLINE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_GETSCANLINE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.GetScanLine = This->lpLcl->lpDDCB->HELDD.GetScanLine;
+ }
+ if (This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_SETCOLORKEY)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_SETCOLORKEY;
+ This->lpLcl->lpDDCB->cbDDCallbacks.SetColorKey = This->lpLcl->lpDDCB->HALDD.SetColorKey;
+ }
+ else if (This->lpLcl->lpDDCB->HELDD.dwFlags & DDHAL_CB32_SETCOLORKEY)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_SETCOLORKEY;
+ This->lpLcl->lpDDCB->cbDDCallbacks.SetColorKey = This->lpLcl->lpDDCB->HELDD.SetColorKey;
+ }
+ if (This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_SETEXCLUSIVEMODE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.SetExclusiveMode = This->lpLcl->lpDDCB->HALDD.SetExclusiveMode;
+ }
+ else if (This->lpLcl->lpDDCB->HELDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_SETEXCLUSIVEMODE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.SetExclusiveMode = This->lpLcl->lpDDCB->HELDD.SetExclusiveMode;
+ }
+ if (This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_SETMODE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_SETMODE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.SetMode = This->lpLcl->lpDDCB->HALDD.SetMode;
+ }
+ else if (This->lpLcl->lpDDCB->HELDD.dwFlags & DDHAL_CB32_SETMODE)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_SETMODE;
+ This->lpLcl->lpDDCB->cbDDCallbacks.SetMode = This->lpLcl->lpDDCB->HELDD.SetMode;
+ }
+ if (This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_WAITFORVERTICALBLANK;
+ This->lpLcl->lpDDCB->cbDDCallbacks.WaitForVerticalBlank = This->lpLcl->lpDDCB->HALDD.WaitForVerticalBlank;
+ }
+ else if (This->lpLcl->lpDDCB->HELDD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)
+ {
+ This->lpLcl->lpDDCB->cbDDCallbacks.dwFlags = DDHAL_CB32_WAITFORVERTICALBLANK;
+ This->lpLcl->lpDDCB->cbDDCallbacks.WaitForVerticalBlank = This->lpLcl->lpDDCB->HELDD.WaitForVerticalBlank;
+ }
+
+
+
+
+
+
+
+
/* Fill some basic info for Surface */