14 HANDLE_METADC(BOOL
, LineTo
, FALSE
, hdc
, x
, y
);
16 return NtGdiLineTo(hdc
, x
, y
);
26 _Out_opt_ LPPOINT ppt
)
30 HANDLE_METADC(BOOL
, MoveTo
, FALSE
, hdc
, x
, y
, ppt
);
32 /* Get the DC attribute */
33 pdcattr
= GdiGetDcAttr(hdc
);
36 SetLastError(ERROR_INVALID_PARAMETER
);
42 if ( pdcattr
->ulDirty_
& DIRTY_PTLCURRENT
) // Double hit!
44 ppt
->x
= pdcattr
->ptfxCurrent
.x
; // ret prev before change.
45 ppt
->y
= pdcattr
->ptfxCurrent
.y
;
46 DPtoLP (hdc
, ppt
, 1); // reconvert back.
50 ppt
->x
= pdcattr
->ptlCurrent
.x
;
51 ppt
->y
= pdcattr
->ptlCurrent
.y
;
55 pdcattr
->ptlCurrent
.x
= x
;
56 pdcattr
->ptlCurrent
.y
= y
;
58 pdcattr
->ulDirty_
&= ~DIRTY_PTLCURRENT
;
59 pdcattr
->ulDirty_
|= ( DIRTY_PTFXCURRENT
|DIRTY_STYLESTATE
); // Set dirty
76 HANDLE_METADC(BOOL
, Ellipse
, FALSE
, hdc
, left
, top
, right
, bottom
);
78 return NtGdiEllipse(hdc
, left
, top
, right
, bottom
);
94 HANDLE_METADC(BOOL
, Rectangle
, FALSE
, hdc
, left
, top
, right
, bottom
);
96 return NtGdiRectangle(hdc
, left
, top
, right
, bottom
);
114 HANDLE_METADC(BOOL
, RoundRect
, FALSE
, hdc
, left
, top
, right
, bottom
, width
, height
);
116 return NtGdiRoundRect(hdc
, left
, top
, right
, bottom
, width
, height
);
130 if (GDI_HANDLE_GET_TYPE(hdc
) != GDI_OBJECT_TYPE_DC
) return CLR_INVALID
;
131 if (!GdiValidateHandle((HGDIOBJ
) hdc
)) return CLR_INVALID
;
132 return NtGdiGetPixel(hdc
, x
, y
);
145 _In_ COLORREF crColor
)
147 HANDLE_METADC(COLORREF
, SetPixel
, CLR_INVALID
, hdc
, x
, y
, crColor
);
149 return NtGdiSetPixel(hdc
, x
, y
, crColor
);
162 _In_ COLORREF crColor
)
164 return SetPixel(hdc
, x
, y
, crColor
) != CLR_INVALID
;
179 if ((hrgn
== NULL
) || (hbr
== NULL
))
182 HANDLE_METADC(BOOL
, FillRgn
, FALSE
, hdc
, hrgn
, hbr
);
184 return NtGdiFillRgn(hdc
, hrgn
, hbr
);
201 if ((hrgn
== NULL
) || (hbr
== NULL
))
204 HANDLE_METADC(BOOL
, FrameRgn
, FALSE
, hdc
, hrgn
, hbr
, nWidth
, nHeight
);
206 return NtGdiFrameRgn(hdc
, hrgn
, hbr
, nWidth
, nHeight
);
223 HANDLE_METADC(BOOL
, InvertRgn
, FALSE
, hdc
, hrgn
);
225 return NtGdiInvertRgn(hdc
, hrgn
);
238 return FillRgn(hdc
, hrgn
, GetCurrentObject(hdc
, OBJ_BRUSH
));
249 _In_reads_(cpt
) const POINT
*apt
,
252 HANDLE_METADC(BOOL
, PolyBezier
, FALSE
, hdc
, apt
, cpt
);
254 return NtGdiPolyPolyDraw(hdc
,(PPOINT
)apt
, &cpt
, 1, GdiPolyBezier
);
265 _In_reads_(cpt
) const POINT
*apt
,
268 HANDLE_METADC(BOOL
, PolyBezierTo
, FALSE
, hdc
, apt
, cpt
);
270 return NtGdiPolyPolyDraw(hdc
, (PPOINT
)apt
, &cpt
, 1, GdiPolyBezierTo
);
281 _In_reads_(cpt
) const POINT
*apt
,
282 _In_reads_(cpt
) const BYTE
*aj
,
285 HANDLE_METADC(BOOL
, PolyDraw
, FALSE
, hdc
, apt
, aj
, cpt
);
287 return NtGdiPolyDraw(hdc
, (PPOINT
)apt
, (PBYTE
)aj
, cpt
);
298 _In_reads_(cpt
) const POINT
*apt
,
301 HANDLE_METADC(BOOL
, Polygon
, FALSE
, hdc
, apt
, cpt
);
303 return NtGdiPolyPolyDraw(hdc
, (PPOINT
)apt
, (PULONG
)&cpt
, 1, GdiPolyPolygon
);
314 _In_reads_(cpt
) const POINT
*apt
,
317 HANDLE_METADC(BOOL
, Polyline
, FALSE
, hdc
, apt
, cpt
);
319 return NtGdiPolyPolyDraw(hdc
, (PPOINT
)apt
, (PULONG
)&cpt
, 1, GdiPolyPolyLine
);
330 _In_reads_(cpt
) const POINT
*apt
,
333 HANDLE_METADC(BOOL
, PolylineTo
, FALSE
, hdc
, apt
, cpt
);
335 return NtGdiPolyPolyDraw(hdc
, (PPOINT
)apt
, &cpt
, 1, GdiPolyLineTo
);
346 _In_
const POINT
*apt
,
347 _In_reads_(csz
) const INT
*asz
,
350 HANDLE_METADC(BOOL
, PolyPolygon
, FALSE
, hdc
, apt
, asz
, csz
);
352 return NtGdiPolyPolyDraw(hdc
, (PPOINT
)apt
, (PULONG
)asz
, csz
, GdiPolyPolygon
);
363 _In_ CONST POINT
*apt
,
364 _In_reads_(csz
) CONST DWORD
*asz
,
367 if (GDI_HANDLE_GET_TYPE(hdc
) == GDILoObjType_LO_METADC16_TYPE
)
370 HANDLE_METADC(BOOL
, PolyPolyline
, FALSE
, hdc
, apt
, asz
, csz
);
372 return NtGdiPolyPolyDraw(hdc
, (PPOINT
)apt
, (PULONG
)asz
, csz
, GdiPolyPolyLine
);
385 _In_ COLORREF crFill
,
386 _In_ UINT fuFillType
)
388 HANDLE_METADC(BOOL
, ExtFloodFill
, FALSE
, hdc
, xStart
, yStart
, crFill
, fuFillType
);
390 return NtGdiExtFloodFill(hdc
, xStart
, yStart
, crFill
, fuFillType
);
403 _In_ COLORREF crFill
)
405 return ExtFloodFill(hdc
, xStart
, yStart
, crFill
, FLOODFILLBORDER
);
424 /* Use PatBlt for no source blt, like windows does */
425 if (!ROP_USES_SOURCE(dwRop
))
427 return PatBlt(hdcDest
, xDest
, yDest
, cx
, cy
, dwRop
);
430 /* For meta DCs we use StretchBlt */
446 return NtGdiBitBlt(hdcDest
, xDest
, yDest
, cx
, cy
, hdcSrc
, xSrc
, ySrc
, dwRop
, 0, 0);
459 HANDLE_METADC(BOOL
, PatBlt
, FALSE
, hdc
, nXLeft
, nYLeft
, nWidth
, nHeight
, dwRop
);
461 /* FIXME some part need be done in user mode */
462 return NtGdiPatBlt( hdc
, nXLeft
, nYLeft
, nWidth
, nHeight
, dwRop
);
470 _In_ PPOLYPATBLT pPoly
,
478 /* Handle meta DCs */
479 if ((GDI_HANDLE_GET_TYPE(hdc
) == GDILoObjType_LO_METADC16_TYPE
) ||
480 (GDI_HANDLE_GET_TYPE(hdc
) == GDILoObjType_LO_ALTDC_TYPE
))
482 if (!GdiValidateHandle(hdc
))
487 /* Save the current DC brush */
488 hbrOld
= SelectObject(hdc
, GetStockObject(DC_BRUSH
));
494 for (i
= 0; i
< nCount
; i
++)
496 /* Select the brush for this rect */
497 SelectObject(hdc
, pPoly
[i
].hBrush
);
499 /* Do the PatBlt operation for this rect */
500 bResult
&= PatBlt(hdc
,
508 /* Restore the old brush */
509 SelectObject(hdc
, hbrOld
);
514 /* FIXME some part need be done in user mode */
515 return NtGdiPolyPatBlt(hdc
, dwRop
, pPoly
, nCount
, dwMode
);
551 return NtGdiStretchBlt(hdcDest
,
580 _In_ HBITMAP hbmMask
,
601 return NtGdiMaskBlt(hdcDest
,
624 _In_reads_(3) const POINT
* ppt
,
630 _In_opt_ HBITMAP hbmMask
,
648 return NtGdiPlgBlt(hdcDest
,
674 _In_ BLENDFUNCTION blendfn
)
676 if (hdcSrc
== NULL
) return FALSE
;
678 if (GDI_HANDLE_GET_TYPE(hdcSrc
) == GDI_OBJECT_TYPE_METADC
) return FALSE
;
695 return NtGdiAlphaBlend(hdcDst
,
726 _In_ UINT crTransparent
)
743 /* FIXME some part need be done in user mode */
744 return NtGdiTransparentBlt(hdcDst
, xDst
, yDst
, cxDst
, cyDst
, hdcSrc
, xSrc
, ySrc
, cxSrc
, cySrc
, crTransparent
);
754 _In_reads_(nVertex
) PTRIVERTEX pVertex
,
760 HANDLE_METADC(BOOL
, GradientFill
, FALSE
, hdc
, pVertex
, nVertex
, pMesh
, nCount
, ulMode
);
762 /* FIXME some part need be done in user mode */
763 return NtGdiGradientFill(hdc
, pVertex
, nVertex
, pMesh
, nCount
, ulMode
);