Check if CanCreateSurface is implemented by the driver before calling it.

svn path=/trunk/; revision=18872
This commit is contained in:
Maarten Bosma 2005-10-30 08:46:46 +00:00
parent 0a695e7538
commit c709116fa0

View file

@ -26,6 +26,8 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC
This->owner = (IDirectDrawImpl*)pDD;
if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CANCREATESURFACE)
{
/* can the driver create the surface */
DDHAL_CANCREATESURFACEDATA CanCreateData;
memset(&CanCreateData, 0, sizeof(DDHAL_CANCREATESURFACEDATA));
@ -37,6 +39,7 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC
if(CanCreateData.ddRVal != DD_OK)
return CanCreateData.ddRVal;
}
/* down here we got a crach */
@ -81,6 +84,7 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC
CreateData.lplpSList = pLocal;
/* this is the call we were waiting for */
MessageBox(0,0,0,0);
if(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED)
return DDERR_INVALIDPARAMS;