mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:53:07 +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
|
@ -132,11 +132,24 @@ HRESULT Hal_DDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURF
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME ??? is this right ??
|
// FIXME ??? is this right ??
|
||||||
|
if (pDDSD != NULL)
|
||||||
|
{
|
||||||
|
if (pDDSD->dwSize == sizeof(DDSURFACEDESC2))
|
||||||
|
{
|
||||||
RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC2));
|
RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC2));
|
||||||
|
// FIXME the interanl mddsdPrimary shall be DDSURFACEDESC2
|
||||||
memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC));
|
memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC));
|
||||||
pDDSD->dwSize = sizeof(DDSURFACEDESC2);
|
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;
|
pDDSD->lpSurface = (LPVOID) Lock.lpSurfData;
|
||||||
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue