Add a check to see if surface can be create, it return it can be create,
but still createsurface return invaild param
Modified: trunk/reactos/lib/ddraw/main/surface.c
_____
Modified: trunk/reactos/lib/ddraw/main/surface.c
--- trunk/reactos/lib/ddraw/main/surface.c 2005-08-08 18:59:56 UTC
(rev 17218)
+++ trunk/reactos/lib/ddraw/main/surface.c 2005-08-08 21:29:25 UTC
(rev 17219)
@@ -63,12 +63,26 @@
CreateData.dwSCnt = 1;
CreateData.lplpSList = &pLocal;
- if(This->owner->DriverCallbacks.DdMain.CreateSurface
(&CreateData) != DDHAL_DRIVER_HANDLED)
- return DDERR_INVALIDPARAMS;
+ DDHAL_CANCREATESURFACEDATA CanCreateData;
+ memset(&CanCreateData, 0, sizeof(DD_CANCREATESURFACEDATA));
+ CanCreateData.lpDD = &This->owner->DirectDrawGlobal;
+ CanCreateData.lpDDSurfaceDesc = (DDSURFACEDESC*)pDDSD;
+
+ if (This->owner->DriverCallbacks.DdMain.CanCreateSurface
(&CanCreateData) == DDHAL_DRIVER_NOTHANDLED)
+ return DDERR_INVALIDPARAMS;
+
if(CreateData.ddRVal != DD_OK)
+ return CanCreateData.ddRVal;
+
+
+ if(This->owner->DriverCallbacks.DdMain.CreateSurface
(&CreateData) == DDHAL_DRIVER_NOTHANDLED)
+ return DDERR_INVALIDPARAMS;
+
+ if(CreateData.ddRVal != DD_OK)
return CreateData.ddRVal;
+
OutputDebugString(L"This does not get hit.");
return DD_OK;