_In_ INT y)
{
if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) return CLR_INVALID;
- if (!GdiIsHandleValid((HGDIOBJ) hdc)) return CLR_INVALID;
+ if (!GdiValidateHandle((HGDIOBJ) hdc)) return CLR_INVALID;
return NtGdiGetPixel(hdc, x, y);
}
_In_ INT nHeight,
_In_ DWORD dwRop)
{
+ PDC_ATTR pdcattr;
+
HANDLE_METADC(BOOL, PatBlt, FALSE, hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop);
- /* FIXME some part need be done in user mode */
+ /* Get the DC attribute */
+ pdcattr = GdiGetDcAttr(hdc);
+ if (pdcattr && !(pdcattr->ulDirty_ & DC_DIBSECTION))
+ {
+ PGDIBSPATBLT pgO;
+
+ pgO = GdiAllocBatchCommand(hdc, GdiBCPatBlt);
+ if (pgO)
+ {
+ pgO->nXLeft = nXLeft;
+ pgO->nYLeft = nYLeft;
+ pgO->nWidth = nWidth;
+ pgO->nHeight = nHeight;
+ pgO->dwRop = dwRop;
+ /* Snapshot attributes */
+ pgO->hbrush = pdcattr->hbrush;
+ pgO->crForegroundClr = pdcattr->crForegroundClr;
+ pgO->crBackgroundClr = pdcattr->crBackgroundClr;
+ pgO->crBrushClr = pdcattr->crBrushClr;
+ pgO->ulForegroundClr = pdcattr->ulForegroundClr;
+ pgO->ulBackgroundClr = pdcattr->ulBackgroundClr;
+ pgO->ulBrushClr = pdcattr->ulBrushClr;
+ return TRUE;
+ }
+ }
return NtGdiPatBlt( hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop);
}
UINT i;
BOOL bResult;
HBRUSH hbrOld;
+ PDC_ATTR pdcattr;
/* Handle meta DCs */
if ((GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE) ||
(GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_ALTDC_TYPE))
{
- if (!GdiIsHandleValid(hdc))
+ if (!GdiValidateHandle(hdc))
{
return FALSE;
}
return bResult;
}
- /* FIXME some part need be done in user mode */
+ /* Get the DC attribute */
+ pdcattr = GdiGetDcAttr(hdc);
+ if (nCount && pdcattr && !(pdcattr->ulDirty_ & DC_DIBSECTION))
+ {
+ PGDIBSPPATBLT pgO;
+ PTEB pTeb = NtCurrentTeb();
+
+ pgO = GdiAllocBatchCommand(hdc, GdiBCPolyPatBlt);
+ if (pgO)
+ {
+ USHORT cjSize = sizeof(GDIBSPPATBLT) + (nCount-1) * sizeof(PATRECT);
+
+ if ((pTeb->GdiTebBatch.Offset + cjSize) <= GDIBATCHBUFSIZE)
+ {
+ pgO->Count = nCount;
+ pgO->Mode = dwMode;
+ pgO->rop4 = dwRop;
+ /* Snapshot attributes */
+ pgO->crForegroundClr = pdcattr->crForegroundClr;
+ pgO->crBackgroundClr = pdcattr->crBackgroundClr;
+ pgO->crBrushClr = pdcattr->crBrushClr;
+ pgO->ulForegroundClr = pdcattr->ulForegroundClr;
+ pgO->ulBackgroundClr = pdcattr->ulBackgroundClr;
+ pgO->ulBrushClr = pdcattr->ulBrushClr;
+ RtlCopyMemory(pgO->pRect, pPoly, nCount * sizeof(PATRECT));
+ // Recompute offset, remember one is already accounted for in the structure.
+ pTeb->GdiTebBatch.Offset += (nCount-1) * sizeof(PATRECT);
+ return TRUE;
+ }
+ }
+ }
return NtGdiPolyPatBlt(hdc, dwRop, pPoly, nCount, dwMode);
}