Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c
Modified: trunk/reactos/lib/ddraw/main/ddraw_main.c
Modified: trunk/reactos/lib/ddraw/main/surface_main.c
--- trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-10-31 00:53:00 UTC (rev 18907)
+++ trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-10-31 01:22:19 UTC (rev 18908)
@@ -13,7 +13,8 @@
HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rDest,
LPDIRECTDRAWSURFACE7 src, LPRECT rSrc, DWORD dwFlags, LPDDBLTFX lpbltfx)
{
- IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
+
+ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
IDirectDrawSurfaceImpl* That = (IDirectDrawSurfaceImpl*)src;
if (!(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT))
--- trunk/reactos/lib/ddraw/main/ddraw_main.c 2005-10-31 00:53:00 UTC (rev 18907)
+++ trunk/reactos/lib/ddraw/main/ddraw_main.c 2005-10-31 01:22:19 UTC (rev 18908)
@@ -38,7 +38,8 @@
// ... then overwrite with hal
if((ret = Hel_DirectDraw_Initialize (iface)) != DD_OK)
return ret;
-
+
+
return DD_OK;
}
@@ -165,22 +166,30 @@
return DDERR_UNSUPPORTED;
// the nasty com stuff
+ IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+
IDirectDrawSurfaceImpl* That;
That = (IDirectDrawSurfaceImpl*)HeapAlloc(GetProcessHeap(), 0, sizeof(IDirectDrawSurfaceImpl));
-
+
if (That == NULL)
return E_OUTOFMEMORY;
ZeroMemory(That, sizeof(IDirectDrawSurfaceImpl));
-
+
That->lpVtbl = &DirectDrawSurface7_Vtable;
That->lpVtbl_v3 = &DDRAW_IDDS3_Thunk_VTable;
-
+
+ This->DirectDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
+ sizeof(DDRAWI_DDRAWSURFACE_INT));
+
+ That->owner = (IDirectDrawImpl *)This;
+
That->owner->DirectDrawGlobal.dsList->dwIntRefCnt =1;
/* we alwasy set to use the DirectDrawSurface7_Vtable as internel */
That->owner->DirectDrawGlobal.dsList->lpVtbl = (PVOID) &DirectDrawSurface7_Vtable;
+
*ppSurf = (LPDIRECTDRAWSURFACE7)That;
--- trunk/reactos/lib/ddraw/main/surface_main.c 2005-10-31 00:53:00 UTC (rev 18907)
+++ trunk/reactos/lib/ddraw/main/surface_main.c 2005-10-31 01:22:19 UTC (rev 18908)
@@ -14,17 +14,14 @@
HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAW pDD, LPDDSURFACEDESC2 pDDSD)
{
IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
-
- if (This->owner)
- return DDERR_ALREADYINITIALIZED;
-
+
if(sizeof(DDSURFACEDESC2) != pDDSD->dwSize)
return DDERR_UNSUPPORTED;
if(!(pDDSD->dwFlags & DDSD_CAPS))
return DDERR_INVALIDPARAMS;
- This->owner = (IDirectDrawImpl*)pDD;
+ This->owner = (IDirectDrawImpl*)pDD;
if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CANCREATESURFACE)
{