{
PDC NewDC, OrigDC;
PDC_ATTR nDc_Attr, oDc_Attr;
- HDC hNewDC, DisplayDC;
+ HDC hNewDC, DisplayDC = NULL;
HRGN hVisRgn;
UNICODE_STRING DriverName;
DWORD Layout = 0;
nDc_Attr->ulDirty_ = oDc_Attr->ulDirty_;
nDc_Attr->iCS_CP = oDc_Attr->iCS_CP;
+ NewDC->erclWindow = (RECTL){0,0,1,1};
+
DC_UnlockDc(NewDC);
DC_UnlockDc(OrigDC);
if (NULL != DisplayDC)
NewDC->flGraphics = PrimarySurface.DevInfo.flGraphicsCaps;
NewDC->flGraphics2 = PrimarySurface.DevInfo.flGraphicsCaps2;
- if (!CreateAsIC)
- {
- NewDC->DcLevel.hpal = NtGdiGetStockObject(DEFAULT_PALETTE);
+ NewDC->DcLevel.hpal = NtGdiGetStockObject(DEFAULT_PALETTE);
- nDc_Attr->jROP2 = R2_COPYPEN;
+ nDc_Attr->jROP2 = R2_COPYPEN;
- NewDC->erclWindow.top = NewDC->erclWindow.left = 0;
- NewDC->erclWindow.right = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulHorzRes;
- NewDC->erclWindow.bottom = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulVertRes;
- NewDC->DcLevel.flPath &= ~DCPATH_CLOCKWISE; // Default is CCW.
+ NewDC->erclWindow.top = NewDC->erclWindow.left = 0;
+ NewDC->erclWindow.right = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulHorzRes;
+ NewDC->erclWindow.bottom = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulVertRes;
+ NewDC->DcLevel.flPath &= ~DCPATH_CLOCKWISE; // Default is CCW.
- nDc_Attr->iCS_CP = ftGdiGetTextCharsetInfo(NewDC,NULL,0);
+ nDc_Attr->iCS_CP = ftGdiGetTextCharsetInfo(NewDC,NULL,0);
- DC_UnlockDc( NewDC );
+ hVisRgn = NtGdiCreateRectRgn(0, 0, ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulHorzRes,
+ ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulVertRes);
- hVisRgn = NtGdiCreateRectRgn(0, 0, ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulHorzRes,
- ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulVertRes);
- if (hVisRgn)
- {
- GdiSelectVisRgn(hNewDC, hVisRgn);
- NtGdiDeleteObject(hVisRgn);
- }
+ if (!CreateAsIC)
+ {
+ NewDC->pSurfInfo = NULL;
+// NewDC->DcLevel.pSurface =
+ DC_UnlockDc( NewDC );
/* Initialize the DC state */
DC_InitDC(hNewDC);
IntGdiSetTextColor(hNewDC, RGB(0, 0, 0));
- IntGdiSetTextAlign(hNewDC, TA_TOP);
IntGdiSetBkColor(hNewDC, RGB(255, 255, 255));
- IntGdiSetBkMode(hNewDC, OPAQUE);
}
else
{
cannot accept a handle to an information context.
*/
NewDC->DC_Type = DC_TYPE_INFO;
+// NewDC->pSurfInfo =
+ NewDC->DcLevel.pSurface = NULL;
+ nDc_Attr->crBackgroundClr = nDc_Attr->ulBackgroundClr = RGB(255, 255, 255);
+ nDc_Attr->crForegroundClr = RGB(0, 0, 0);
DC_UnlockDc( NewDC );
}
+
+ if (hVisRgn)
+ {
+ GdiSelectVisRgn(hNewDC, hVisRgn);
+ NtGdiDeleteObject(hVisRgn);
+ }
+
+ IntGdiSetTextAlign(hNewDC, TA_TOP);
+ IntGdiSetBkMode(hNewDC, OPAQUE);
+
return hNewDC;
}
PLOGPEN pLogPen;
PEXTLOGPEN pExtLogPen;
INT cbRetCount;
- BOOLEAN isOldPen;
- isOldPen = (pPenObject->flAttrs & GDIBRUSH_IS_OLDSTYLEPEN) > 0;
- if ((pPenObject->ulPenStyle & PS_STYLE_MASK) == PS_NULL)
- {
- /* PS_NULL can be retrieved as LOGPEN or as EXTLOGPEN */
- if (cbCount == sizeof(LOGPEN))
- {
- isOldPen = TRUE;
- }
- else if (cbCount == sizeof(EXTLOGPEN))
- {
- isOldPen = FALSE;
- }
- }
-
- if (isOldPen)
+ if (pPenObject->flAttrs & GDIBRUSH_IS_OLDSTYLEPEN)
{
cbRetCount = sizeof(LOGPEN);
if (pBuffer)
{
+
if (cbCount < cbRetCount) return 0;
- pLogPen = (PLOGPEN)pBuffer;
- pLogPen->lopnWidth = pPenObject->ptPenWidth;
- pLogPen->lopnStyle = pPenObject->ulPenStyle;
- pLogPen->lopnColor = pPenObject->BrushAttr.lbColor;
+
+ if ( (pPenObject->ulPenStyle & PS_STYLE_MASK) == PS_NULL &&
+ cbCount == sizeof(EXTLOGPEN))
+ {
+ pExtLogPen = (PEXTLOGPEN)pBuffer;
+ pExtLogPen->elpPenStyle = pPenObject->ulPenStyle;
+ pExtLogPen->elpWidth = 0;
+ pExtLogPen->elpBrushStyle = pPenObject->ulStyle;
+ pExtLogPen->elpColor = pPenObject->BrushAttr.lbColor;
+ pExtLogPen->elpHatch = 0;
+ pExtLogPen->elpNumEntries = 0;
+ cbRetCount = sizeof(EXTLOGPEN);
+ }
+ else
+ {
+ pLogPen = (PLOGPEN)pBuffer;
+ pLogPen->lopnWidth = pPenObject->ptPenWidth;
+ pLogPen->lopnStyle = pPenObject->ulPenStyle;
+ pLogPen->lopnColor = pPenObject->BrushAttr.lbColor;
+ }
}
}
else