mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 19:21:38 +00:00
Bugfix : hal lock surface so it does not crash any longer
svn path=/trunk/; revision=21574
This commit is contained in:
parent
becc8a8d30
commit
e55cbd36de
1 changed files with 19 additions and 6 deletions
|
@ -130,13 +130,26 @@ HRESULT Hal_DDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURF
|
|||
OutputDebugStringA("Here ddRVal lock");
|
||||
return Lock.ddRVal;
|
||||
}
|
||||
|
||||
|
||||
// FIXME ??? is this right ??
|
||||
RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC2));
|
||||
memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC));
|
||||
pDDSD->dwSize = sizeof(DDSURFACEDESC2);
|
||||
|
||||
pDDSD->lpSurface = (LPVOID) Lock.lpSurfData;
|
||||
if (pDDSD != NULL)
|
||||
{
|
||||
if (pDDSD->dwSize == sizeof(DDSURFACEDESC2))
|
||||
{
|
||||
RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC2));
|
||||
// FIXME the interanl mddsdPrimary shall be DDSURFACEDESC2
|
||||
memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC));
|
||||
pDDSD->dwSize = sizeof(DDSURFACEDESC2);
|
||||
}
|
||||
if (pDDSD->dwSize == sizeof(DDSURFACEDESC))
|
||||
{
|
||||
RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC));
|
||||
memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC));
|
||||
pDDSD->dwSize = sizeof(DDSURFACEDESC);
|
||||
}
|
||||
|
||||
pDDSD->lpSurface = (LPVOID) Lock.lpSurfData;
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue