mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
Check if CanCreateSurface is implemented by the driver before calling it.
svn path=/trunk/; revision=18872
This commit is contained in:
parent
0a695e7538
commit
c709116fa0
1 changed files with 14 additions and 10 deletions
|
@ -26,17 +26,20 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC
|
|||
|
||||
This->owner = (IDirectDrawImpl*)pDD;
|
||||
|
||||
/* can the driver create the surface */
|
||||
DDHAL_CANCREATESURFACEDATA CanCreateData;
|
||||
memset(&CanCreateData, 0, sizeof(DDHAL_CANCREATESURFACEDATA));
|
||||
CanCreateData.lpDD = &This->owner->DirectDrawGlobal;
|
||||
CanCreateData.lpDDSurfaceDesc = (DDSURFACEDESC*)pDDSD;
|
||||
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));
|
||||
CanCreateData.lpDD = &This->owner->DirectDrawGlobal;
|
||||
CanCreateData.lpDDSurfaceDesc = (DDSURFACEDESC*)pDDSD;
|
||||
|
||||
if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CanCreateSurface(&CanCreateData) == DDHAL_DRIVER_NOTHANDLED)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CanCreateSurface(&CanCreateData) == DDHAL_DRIVER_NOTHANDLED)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
if(CanCreateData.ddRVal != DD_OK)
|
||||
return CanCreateData.ddRVal;
|
||||
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue