/** Internal functions ********************************************************/
+INIT_FUNCTION
NTSTATUS
+NTAPI
InitDcImpl()
{
psurfDefaultBitmap = SURFACE_ShareLockSurface(StockObjects[DEFAULT_BITMAP]);
void
DC_InitHack(PDC pdc)
{
- HRGN hVisRgn;
-
TextIntRealizeFont(pdc->pdcattr->hlfntNew,NULL);
pdc->pdcattr->iCS_CP = ftGdiGetTextCharsetInfo(pdc,NULL,0);
ASSERT(pdc->dclevel.ppal);
/* Select regions */
- // FIXME: too complicated, broken error handling
pdc->rosdc.hClipRgn = NULL;
pdc->rosdc.hGCClipRgn = NULL;
- hVisRgn = NtGdiCreateRectRgn(0, 0, pdc->dclevel.sizl.cx, pdc->dclevel.sizl.cy);
- ASSERT(hVisRgn);
- GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn);
- GreDeleteObject(hVisRgn);
- ASSERT(pdc->prgnVis);
}
VOID
pdc->dcattr.ptlViewportOrg.y = 0;
pdc->dcattr.szlViewportExt.cx = 1;
pdc->dcattr.szlViewportExt.cy = 1;
- pdc->dcattr.szlVirtualDevicePixel.cx = 0;
- pdc->dcattr.szlVirtualDevicePixel.cy = 0;
- pdc->dcattr.szlVirtualDeviceMm.cx = 0;
- pdc->dcattr.szlVirtualDeviceMm.cy = 0;
+ pdc->dcattr.szlVirtualDevicePixel.cx = ppdev->gdiinfo.ulHorzRes;
+ pdc->dcattr.szlVirtualDevicePixel.cy = ppdev->gdiinfo.ulVertRes;
+ pdc->dcattr.szlVirtualDeviceMm.cx = ppdev->gdiinfo.ulHorzSize;
+ pdc->dcattr.szlVirtualDeviceMm.cy = ppdev->gdiinfo.ulVertSize;
pdc->dcattr.szlVirtualDeviceSize.cx = 0;
pdc->dcattr.szlVirtualDeviceSize.cy = 0;
/* Setup regions */
pdc->prgnAPI = NULL;
- pdc->prgnVis = NULL; // FIXME
- pdc->prgnRao = NULL;
+ pdc->prgnRao = NULL;
+ /* Allocate a Vis region */
+ pdc->prgnVis = IntSysCreateRectpRgn(0, 0, pdc->dclevel.sizl.cx, pdc->dclevel.sizl.cy);
+ ASSERT(pdc->prgnVis);
+ GDIOBJ_CopyOwnership(pdc->BaseObject.hHmgr, pdc->prgnVis->BaseObject.hHmgr);
/* Setup palette */
pdc->dclevel.hpal = StockObjects[DEFAULT_PALETTE];
PDC pDC;
BOOL ret = FALSE;
- /* FIXME: This function has broken error handling */
-
if (!GDIOBJ_SetOwnership(hDC, Owner))
{
DPRINT1("GDIOBJ_SetOwnership failed\n");
{
DPRINT1("Attempted to Delete 0x%x currently being destroyed!!!\n", hDC);
}
-
+
return TRUE;
}