{
HDC hdcSave;
PDC pdcSave;
ASSERT(iSaveLevel > 0);
DPRINT("DC_vRestoreDC(%p, %ld)\n", pdc->BaseObject.hHmgr, iSaveLevel);
/* Loop the save levels */while (pdc->dclevel.lSaveDepth > iSaveLevel)
{
hdcSave = pdc->dclevel.hdcSave;
DPRINT("RestoreDC = %p\n", hdcSave);
/* Set us as the owner */if (!GreSetObjectOwner(hdcSave, GDI_OBJ_HMGR_POWNED))
{
/* Could not get ownership. That's bad! */DPRINT1("Could not get ownership of saved DC (%p) for hdc %p!\n",
hdcSave, pdc->BaseObject.hHmgr);
return;// FALSE;
}
/* Lock the saved dc */
pdcSave = DC_LockDc(hdcSave);
if (!pdcSave)
{
/* WTF? Internal error! */DPRINT1("Could not lock the saved DC (%p) for dc %p!\n",
hdcSave, pdc->BaseObject.hHmgr);
return;// FALSE;
}
/* Remove the saved dc from the queue */
pdc->dclevel.hdcSave = pdcSave->dclevel.hdcSave;
/* Decrement save level */
pdc->dclevel.lSaveDepth--;
/* Is this the state we want? */if (pdc->dclevel.lSaveDepth == iSaveLevel)
{
/* Copy the state back */DC_vCopyState(pdcSave, pdc, FALSE);
/* Only memory DC's change their surface */if (pdc->dctype == DCTYPE_MEMORY)
DC_vSelectSurface(pdc, pdcSave->dclevel.pSurface);
// Restore Path by removing it, if the Save flag is set.// BeginPath will takecare of the rest.if (pdc->dclevel.hPath && pdc->dclevel.flPath & DCPATH_SAVE)
{
PATH_Delete(pdc->dclevel.hPath);
pdc->dclevel.hPath = 0;
pdc->dclevel.flPath &= ~DCPATH_SAVE;
}
}
/* Prevent save dc from being restored */
pdcSave->dclevel.lSaveDepth = 1;
/* Unlock it */DC_UnlockDc(pdcSave);
/* Delete the saved dc */GreDeleteObject(hdcSave);
}
DPRINT("Leave DC_vRestoreDC()\n");
}
Generated on Sun May 27 2012 06:10:31 for ReactOS by
1.7.6.1
ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.