mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 04:13:35 +00:00
Bugfix : hal lock surface so it does not crash any longer
svn path=/trunk/; revision=21574
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user