mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +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;
|
This->owner = (IDirectDrawImpl*)pDD;
|
||||||
|
|
||||||
/* can the driver create the surface */
|
if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CANCREATESURFACE)
|
||||||
DDHAL_CANCREATESURFACEDATA CanCreateData;
|
{
|
||||||
memset(&CanCreateData, 0, sizeof(DDHAL_CANCREATESURFACEDATA));
|
/* can the driver create the surface */
|
||||||
CanCreateData.lpDD = &This->owner->DirectDrawGlobal;
|
DDHAL_CANCREATESURFACEDATA CanCreateData;
|
||||||
CanCreateData.lpDDSurfaceDesc = (DDSURFACEDESC*)pDDSD;
|
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)
|
if(CanCreateData.ddRVal != DD_OK)
|
||||||
return DDERR_INVALIDPARAMS;
|
return CanCreateData.ddRVal;
|
||||||
|
}
|
||||||
if(CanCreateData.ddRVal != DD_OK)
|
|
||||||
return CanCreateData.ddRVal;
|
|
||||||
|
|
||||||
/* down here we got a crach */
|
/* down here we got a crach */
|
||||||
|
|
||||||
|
@ -81,6 +84,7 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC
|
||||||
CreateData.lplpSList = pLocal;
|
CreateData.lplpSList = pLocal;
|
||||||
|
|
||||||
/* this is the call we were waiting for */
|
/* this is the call we were waiting for */
|
||||||
|
MessageBox(0,0,0,0);
|
||||||
if(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED)
|
if(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED)
|
||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue