mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
cleanup NtGdiDdCreateSurface
we can now create a surface from DdCreateSurface. svn path=/trunk/; revision=23164
This commit is contained in:
parent
5483a9b9dc
commit
f2f19d2e9a
1 changed files with 19 additions and 29 deletions
|
@ -344,42 +344,32 @@ DWORD STDCALL NtGdiDdCreateSurface(
|
|||
DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED;
|
||||
PDD_DIRECTDRAW pDirectDraw;
|
||||
PDD_DIRECTDRAW_GLOBAL lgpl;
|
||||
#ifdef DX_DEBUG
|
||||
|
||||
DPRINT1("NtGdiDdCreateSurface\n");
|
||||
#endif
|
||||
|
||||
pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW);
|
||||
if (pDirectDraw == NULL)
|
||||
{
|
||||
#ifdef DX_DEBUG
|
||||
DPRINT1("Can not lock the DirectDraw handle\n");
|
||||
#endif
|
||||
return DDHAL_DRIVER_NOTHANDLED;
|
||||
}
|
||||
|
||||
/* backup the orignal PDev and info */
|
||||
lgpl = puCreateSurfaceData->lpDD;
|
||||
|
||||
/* use our cache version instead */
|
||||
puCreateSurfaceData->lpDD = &pDirectDraw->Global;
|
||||
if (pDirectDraw != NULL)
|
||||
{
|
||||
|
||||
/* make the call */
|
||||
if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_CANCREATESURFACE))
|
||||
{
|
||||
#ifdef DX_DEBUG
|
||||
DPRINT1("DirectDraw HAL does not support Create Surface");
|
||||
#endif
|
||||
ddRVal = DDHAL_DRIVER_NOTHANDLED;
|
||||
}
|
||||
else
|
||||
{
|
||||
ddRVal = pDirectDraw->DD.CreateSurface(puCreateSurfaceData);
|
||||
if ((pDirectDraw->DD.dwFlags & DDHAL_CB32_CREATESURFACE))
|
||||
{
|
||||
/* backup the orignal PDev and info */
|
||||
lgpl = puCreateSurfaceData->lpDD;
|
||||
|
||||
/* use our cache version instead */
|
||||
puCreateSurfaceData->lpDD = &pDirectDraw->Global;
|
||||
|
||||
/* make the call */
|
||||
ddRVal = pDirectDraw->DD.CreateSurface(puCreateSurfaceData);
|
||||
|
||||
/* But back the orignal PDev */
|
||||
puCreateSurfaceData->lpDD = lgpl;
|
||||
}
|
||||
|
||||
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
||||
}
|
||||
|
||||
/* But back the orignal PDev */
|
||||
puCreateSurfaceData->lpDD = lgpl;
|
||||
|
||||
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
||||
return ddRVal;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue