ReactOS  0.4.15-dev-1384-g878186b
painting.c File Reference
#include <precomp.h>
Include dependency graph for painting.c:

Go to the source code of this file.

Functions

BOOL WINAPI LineTo (_In_ HDC hdc, _In_ INT x, _In_ INT y)
 
BOOL WINAPI MoveToEx (_In_ HDC hdc, _In_ INT x, _In_ INT y, _Out_opt_ LPPOINT ppt)
 
BOOL WINAPI Ellipse (_In_ HDC hdc, _In_ INT left, _In_ INT top, _In_ INT right, _In_ INT bottom)
 
BOOL WINAPI Rectangle (_In_ HDC hdc, _In_ INT left, _In_ INT top, _In_ INT right, _In_ INT bottom)
 
BOOL WINAPI RoundRect (_In_ HDC hdc, _In_ INT left, _In_ INT top, _In_ INT right, _In_ INT bottom, _In_ INT width, _In_ INT height)
 
COLORREF WINAPI GetPixel (_In_ HDC hdc, _In_ INT x, _In_ INT y)
 
COLORREF WINAPI SetPixel (_In_ HDC hdc, _In_ INT x, _In_ INT y, _In_ COLORREF crColor)
 
BOOL WINAPI SetPixelV (_In_ HDC hdc, _In_ INT x, _In_ INT y, _In_ COLORREF crColor)
 
BOOL WINAPI FillRgn (_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbr)
 
BOOL WINAPI FrameRgn (_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbr, _In_ INT nWidth, _In_ INT nHeight)
 
BOOL WINAPI InvertRgn (_In_ HDC hdc, _In_ HRGN hrgn)
 
BOOL WINAPI PaintRgn (_In_ HDC hdc, _In_ HRGN hrgn)
 
BOOL WINAPI PolyBezier (_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ DWORD cpt)
 
BOOL WINAPI PolyBezierTo (_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ DWORD cpt)
 
BOOL WINAPI PolyDraw (_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_reads_(cpt) const BYTE *aj, _In_ INT cpt)
 
BOOL WINAPI Polygon (_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ INT cpt)
 
BOOL WINAPI Polyline (_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ INT cpt)
 
BOOL WINAPI PolylineTo (_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ DWORD cpt)
 
BOOL WINAPI PolyPolygon (_In_ HDC hdc, _In_ const POINT *apt, _In_reads_(csz) const INT *asz, _In_ INT csz)
 
BOOL WINAPI PolyPolyline (_In_ HDC hdc, _In_ CONST POINT *apt, _In_reads_(csz) CONST DWORD *asz, _In_ DWORD csz)
 
BOOL WINAPI ExtFloodFill (_In_ HDC hdc, _In_ INT xStart, _In_ INT yStart, _In_ COLORREF crFill, _In_ UINT fuFillType)
 
BOOL WINAPI FloodFill (_In_ HDC hdc, _In_ INT xStart, _In_ INT yStart, _In_ COLORREF crFill)
 
BOOL WINAPI BitBlt (_In_ HDC hdcDest, _In_ INT xDest, _In_ INT yDest, _In_ INT cx, _In_ INT cy, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ DWORD dwRop)
 
BOOL WINAPI PatBlt (_In_ HDC hdc, _In_ INT nXLeft, _In_ INT nYLeft, _In_ INT nWidth, _In_ INT nHeight, _In_ DWORD dwRop)
 
BOOL WINAPI PolyPatBlt (_In_ HDC hdc, _In_ DWORD dwRop, _In_ PPOLYPATBLT pPoly, _In_ DWORD nCount, _In_ DWORD dwMode)
 
BOOL WINAPI StretchBlt (_In_ HDC hdcDest, _In_ INT xDest, _In_ INT yDest, _In_ INT cxDest, _In_ INT cyDest, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ DWORD dwRop)
 
BOOL WINAPI MaskBlt (_In_ HDC hdcDest, _In_ INT xDest, _In_ INT yDest, _In_ INT cx, _In_ INT cy, _In_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ HBITMAP hbmMask, _In_ INT xMask, _In_ INT yMask, _In_ DWORD dwRop)
 
BOOL WINAPI PlgBlt (_In_ HDC hdcDest, _In_reads_(3) const POINT *ppt, _In_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cx, _In_ INT cy, _In_opt_ HBITMAP hbmMask, _In_ INT xMask, _In_ INT yMask)
 
BOOL WINAPI GdiAlphaBlend (_In_ HDC hdcDst, _In_ INT xDst, _In_ INT yDst, _In_ INT cxDst, _In_ INT cyDst, _In_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ BLENDFUNCTION blendfn)
 
BOOL WINAPI GdiTransparentBlt (_In_ HDC hdcDst, _In_ INT xDst, _In_ INT yDst, _In_ INT cxDst, _In_ INT cyDst, _In_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ UINT crTransparent)
 
BOOL WINAPI GdiGradientFill (_In_ HDC hdc, _In_reads_(nVertex) PTRIVERTEX pVertex, _In_ ULONG nVertex, _In_ PVOID pMesh, _In_ ULONG nCount, _In_ ULONG ulMode)
 

Function Documentation

◆ BitBlt()

BOOL WINAPI BitBlt ( _In_ HDC  hdcDest,
_In_ INT  xDest,
_In_ INT  yDest,
_In_ INT  cx,
_In_ INT  cy,
_In_opt_ HDC  hdcSrc,
_In_ INT  xSrc,
_In_ INT  ySrc,
_In_ DWORD  dwRop 
)

Definition at line 447 of file painting.c.

457 {
458  /* Use PatBlt for no source blt, like windows does */
459  if (!ROP_USES_SOURCE(dwRop))
460  {
461  return PatBlt(hdcDest, xDest, yDest, cx, cy, dwRop);
462  }
463 
464  /* For meta DCs we use StretchBlt */
466  StretchBlt,
467  FALSE,
468  hdcDest,
469  xDest,
470  yDest,
471  cx,
472  cy,
473  hdcSrc,
474  xSrc,
475  ySrc,
476  cx,
477  cy,
478  dwRop);
479 
480  if ( GdiConvertAndCheckDC(hdcDest) == NULL ) return FALSE;
481 
482  return NtGdiBitBlt(hdcDest, xDest, yDest, cx, cy, hdcSrc, xSrc, ySrc, dwRop, 0, 0);
483 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
BOOL WINAPI PatBlt(_In_ HDC hdc, _In_ INT nXLeft, _In_ INT nYLeft, _In_ INT nWidth, _In_ INT nHeight, _In_ DWORD dwRop)
Definition: painting.c:487
static HDC hdcSrc
Definition: xlate.c:32
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
BOOL WINAPI StretchBlt(_In_ HDC hdcDest, _In_ INT xDest, _In_ INT yDest, _In_ INT cxDest, _In_ INT cyDest, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ DWORD dwRop)
Definition: painting.c:625
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
__kernel_entry W32KAPI BOOL APIENTRY NtGdiBitBlt(_In_ HDC hdcDst, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ DWORD rop4, _In_ DWORD crBackColor, _In_ FLONG fl)
#define ROP_USES_SOURCE(Rop)
Definition: gdi32p.h:88
#define NULL
Definition: types.h:112
_Out_opt_ int * cx
Definition: commctrl.h:581

◆ Ellipse()

BOOL WINAPI Ellipse ( _In_ HDC  hdc,
_In_ INT  left,
_In_ INT  top,
_In_ INT  right,
_In_ INT  bottom 
)

Definition at line 71 of file painting.c.

77 {
79 
80  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
81 
82  return NtGdiEllipse(hdc, left, top, right, bottom);
83 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
BOOL WINAPI Ellipse(_In_ HDC hdc, _In_ INT left, _In_ INT top, _In_ INT right, _In_ INT bottom)
Definition: painting.c:71
HDC hdc
Definition: main.c:9
#define NULL
Definition: types.h:112
__kernel_entry W32KAPI BOOL APIENTRY NtGdiEllipse(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ ExtFloodFill()

BOOL WINAPI ExtFloodFill ( _In_ HDC  hdc,
_In_ INT  xStart,
_In_ INT  yStart,
_In_ COLORREF  crFill,
_In_ UINT  fuFillType 
)

Definition at line 413 of file painting.c.

419 {
420  HANDLE_METADC(BOOL, ExtFloodFill, FALSE, hdc, xStart, yStart, crFill, fuFillType);
421 
422  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
423 
424  return NtGdiExtFloodFill(hdc, xStart, yStart, crFill, fuFillType);
425 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
HDC hdc
Definition: main.c:9
BOOL WINAPI ExtFloodFill(_In_ HDC hdc, _In_ INT xStart, _In_ INT yStart, _In_ COLORREF crFill, _In_ UINT fuFillType)
Definition: painting.c:413
#define NULL
Definition: types.h:112
__kernel_entry W32KAPI BOOL APIENTRY NtGdiExtFloodFill(_In_ HDC hdc, _In_ INT x, _In_ INT y, _In_ COLORREF crColor, _In_ UINT iFillType)

Referenced by FloodFill().

◆ FillRgn()

BOOL WINAPI FillRgn ( _In_ HDC  hdc,
_In_ HRGN  hrgn,
_In_ HBRUSH  hbr 
)

Definition at line 183 of file painting.c.

187 {
188 
189  if ((hrgn == NULL) || (hbr == NULL))
190  return FALSE;
191 
193 
194  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
195 
196  return NtGdiFillRgn(hdc, hrgn, hbr);
197 }
BOOL WINAPI FillRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbr)
Definition: painting.c:183
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
__kernel_entry W32KAPI BOOL APIENTRY NtGdiFillRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbrush)
Definition: bitblt.c:1230
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
#define NULL
Definition: types.h:112

Referenced by HEADER_DrawItem(), CardWindow::PaintCardRgn(), PaintRgn(), PlayEnhMetaFileRecord(), PlayMetaFileRecord(), print_preview(), Test_FrameRgn(), and TOOLTIPS_Refresh().

◆ FloodFill()

BOOL WINAPI FloodFill ( _In_ HDC  hdc,
_In_ INT  xStart,
_In_ INT  yStart,
_In_ COLORREF  crFill 
)

Definition at line 433 of file painting.c.

438 {
439  return ExtFloodFill(hdc, xStart, yStart, crFill, FLOODFILLBORDER);
440 }
HDC hdc
Definition: main.c:9
BOOL WINAPI ExtFloodFill(_In_ HDC hdc, _In_ INT xStart, _In_ INT yStart, _In_ COLORREF crFill, _In_ UINT fuFillType)
Definition: painting.c:413
#define FLOODFILLBORDER
Definition: wingdi.h:643

◆ FrameRgn()

BOOL WINAPI FrameRgn ( _In_ HDC  hdc,
_In_ HRGN  hrgn,
_In_ HBRUSH  hbr,
_In_ INT  nWidth,
_In_ INT  nHeight 
)

Definition at line 205 of file painting.c.

211 {
212 
213  if ((hrgn == NULL) || (hbr == NULL))
214  return FALSE;
215 
216  HANDLE_METADC(BOOL, FrameRgn, FALSE, hdc, hrgn, hbr, nWidth, nHeight);
217 
218  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
219 
220  return NtGdiFrameRgn(hdc, hrgn, hbr, nWidth, nHeight);
221 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
__kernel_entry W32KAPI BOOL APIENTRY NtGdiFrameRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbrush, _In_ INT xWidth, _In_ INT yHeight)
Definition: bitblt.c:1287
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
BOOL WINAPI FrameRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbr, _In_ INT nWidth, _In_ INT nHeight)
Definition: painting.c:205
#define NULL
Definition: types.h:112

◆ GdiAlphaBlend()

BOOL WINAPI GdiAlphaBlend ( _In_ HDC  hdcDst,
_In_ INT  xDst,
_In_ INT  yDst,
_In_ INT  cxDst,
_In_ INT  cyDst,
_In_ HDC  hdcSrc,
_In_ INT  xSrc,
_In_ INT  ySrc,
_In_ INT  cxSrc,
_In_ INT  cySrc,
_In_ BLENDFUNCTION  blendfn 
)

Definition at line 771 of file painting.c.

783 {
784  if (hdcSrc == NULL ) return FALSE;
785 
787 
789  AlphaBlend,
790  FALSE,
791  hdcDst,
792  xDst,
793  yDst,
794  cxDst,
795  cyDst,
796  hdcSrc,
797  xSrc,
798  ySrc,
799  cxSrc,
800  cySrc,
801  blendfn);
802 
803  if ( GdiConvertAndCheckDC(hdcDst) == NULL ) return FALSE;
804 
805  return NtGdiAlphaBlend(hdcDst,
806  xDst,
807  yDst,
808  cxDst,
809  cyDst,
810  hdcSrc,
811  xSrc,
812  ySrc,
813  cxSrc,
814  cySrc,
815  blendfn,
816  0);
817 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
static HDC hdcSrc
Definition: xlate.c:32
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define GDI_OBJECT_TYPE_METADC
Definition: gdi.h:57
__kernel_entry W32KAPI BOOL APIENTRY NtGdiAlphaBlend(_In_ HDC hdcDst, _In_ LONG DstX, _In_ LONG DstY, _In_ LONG DstCx, _In_ LONG DstCy, _In_ HDC hdcSrc, _In_ LONG SrcX, _In_ LONG SrcY, _In_ LONG SrcCx, _In_ LONG SrcCy, _In_ BLENDFUNCTION BlendFunction, _In_ HANDLE hcmXform)
static HDC hdcDst
Definition: xlate.c:32
#define NULL
Definition: types.h:112
#define AlphaBlend
Definition: misc.c:293

◆ GdiGradientFill()

BOOL WINAPI GdiGradientFill ( _In_ HDC  hdc,
_In_reads_(nVertex) PTRIVERTEX  pVertex,
_In_ ULONG  nVertex,
_In_ PVOID  pMesh,
_In_ ULONG  nCount,
_In_ ULONG  ulMode 
)

Definition at line 863 of file painting.c.

870 {
871  HANDLE_METADC(BOOL, GradientFill, FALSE, hdc, pVertex, nVertex, pMesh, nCount, ulMode);
872 
873  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
874 
875  return NtGdiGradientFill(hdc, pVertex, nVertex, pMesh, nCount, ulMode);
876 }
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID pMesh
Definition: winddi.h:3649
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX * pVertex
Definition: winddi.h:3649
HDC hdc
Definition: main.c:9
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
Definition: winddi.h:3649
#define NULL
Definition: types.h:112
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGradientFill(_In_ HDC hdc, _In_ PTRIVERTEX pVertex, _In_ ULONG nVertex, _In_ PVOID pMesh, _In_ ULONG nMesh, _In_ ULONG ulMode)
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG nVertex
Definition: winddi.h:3649

◆ GdiTransparentBlt()

BOOL WINAPI GdiTransparentBlt ( _In_ HDC  hdcDst,
_In_ INT  xDst,
_In_ INT  yDst,
_In_ INT  cxDst,
_In_ INT  cyDst,
_In_ HDC  hdcSrc,
_In_ INT  xSrc,
_In_ INT  ySrc,
_In_ INT  cxSrc,
_In_ INT  cySrc,
_In_ UINT  crTransparent 
)

Definition at line 825 of file painting.c.

837 {
840  FALSE,
841  hdcDst,
842  xDst,
843  yDst,
844  cxDst,
845  cyDst,
846  hdcSrc,
847  xSrc,
848  ySrc,
849  cxSrc,
850  cySrc,
851  crTransparent);
852 
853  if ( GdiConvertAndCheckDC(hdcDst) == NULL ) return FALSE;
854 
855  return NtGdiTransparentBlt(hdcDst, xDst, yDst, cxDst, cyDst, hdcSrc, xSrc, ySrc, cxSrc, cySrc, crTransparent);
856 }
#define TransparentBlt
Definition: misc.c:292
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
static HDC hdcSrc
Definition: xlate.c:32
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
__kernel_entry W32KAPI BOOL APIENTRY NtGdiTransparentBlt(_In_ HDC hdcDst, _In_ INT xDst, _In_ INT yDst, _In_ INT cxDst, _In_ INT cyDst, _In_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ COLORREF TransColor)
unsigned int BOOL
Definition: ntddk_ex.h:94
static HDC hdcDst
Definition: xlate.c:32
#define NULL
Definition: types.h:112

◆ GetPixel()

COLORREF WINAPI GetPixel ( _In_ HDC  hdc,
_In_ INT  x,
_In_ INT  y 
)

Definition at line 133 of file painting.c.

137 {
139  if (!GdiValidateHandle((HGDIOBJ) hdc)) return CLR_INVALID;
140  return NtGdiGetPixel(hdc, x, y);
141 }
#define CLR_INVALID
Definition: wingdi.h:882
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
__kernel_entry W32KAPI DWORD APIENTRY NtGdiGetPixel(_In_ HDC hdc, _In_ INT x, _In_ INT y)
Definition: bitblt.c:1447
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define GDI_OBJECT_TYPE_DC
Definition: gdi.h:46
HDC hdc
Definition: main.c:9
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
BOOL WINAPI GdiValidateHandle(HGDIOBJ)
Definition: misc.c:712

◆ InvertRgn()

BOOL WINAPI InvertRgn ( _In_ HDC  hdc,
_In_ HRGN  hrgn 
)

Definition at line 229 of file painting.c.

232 {
233 
234  if (hrgn == NULL)
235  return FALSE;
236 
238 
239  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
240 
241  return NtGdiInvertRgn(hdc, hrgn);
242 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI InvertRgn(_In_ HDC hdc, _In_ HRGN hrgn)
Definition: painting.c:229
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
#define NULL
Definition: types.h:112
__kernel_entry W32KAPI BOOL APIENTRY NtGdiInvertRgn(_In_ HDC hdc, _In_ HRGN hrgn)
Definition: bitblt.c:1311

Referenced by PaintSelectionRect(), PlayEnhMetaFileRecord(), and PlayMetaFileRecord().

◆ LineTo()

BOOL WINAPI LineTo ( _In_ HDC  hdc,
_In_ INT  x,
_In_ INT  y 
)

Definition at line 9 of file painting.c.

13 {
15 
16  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
17 
18  return NtGdiLineTo(hdc, x, y);
19 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
__kernel_entry W32KAPI BOOL APIENTRY NtGdiLineTo(_In_ HDC hdc, _In_ INT x, _In_ INT y)
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI LineTo(_In_ HDC hdc, _In_ INT x, _In_ INT y)
Definition: painting.c:9
HDC hdc
Definition: main.c:9
#define NULL
Definition: types.h:112
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ MaskBlt()

BOOL WINAPI MaskBlt ( _In_ HDC  hdcDest,
_In_ INT  xDest,
_In_ INT  yDest,
_In_ INT  cx,
_In_ INT  cy,
_In_ HDC  hdcSrc,
_In_ INT  xSrc,
_In_ INT  ySrc,
_In_ HBITMAP  hbmMask,
_In_ INT  xMask,
_In_ INT  yMask,
_In_ DWORD  dwRop 
)

Definition at line 675 of file painting.c.

688 {
690  MaskBlt,
691  FALSE,
692  hdcDest,
693  xDest,
694  yDest,
695  cx,
696  cy,
697  hdcSrc,
698  xSrc,
699  ySrc,
700  hbmMask,
701  xMask,
702  yMask,
703  dwRop);
704 
705  if ( GdiConvertAndCheckDC(hdcDest) == NULL ) return FALSE;
706 
707  return NtGdiMaskBlt(hdcDest,
708  xDest,
709  yDest,
710  cx,
711  cy,
712  hdcSrc,
713  xSrc,
714  ySrc,
715  hbmMask,
716  xMask,
717  yMask,
718  dwRop,
719  GetBkColor(hdcSrc));
720 }
COLORREF WINAPI GetBkColor(_In_ HDC)
Definition: dc.c:956
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
static HDC hdcSrc
Definition: xlate.c:32
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
BOOL WINAPI MaskBlt(_In_ HDC hdcDest, _In_ INT xDest, _In_ INT yDest, _In_ INT cx, _In_ INT cy, _In_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ HBITMAP hbmMask, _In_ INT xMask, _In_ INT yMask, _In_ DWORD dwRop)
Definition: painting.c:675
#define NULL
Definition: types.h:112
_Out_opt_ int * cx
Definition: commctrl.h:581
__kernel_entry W32KAPI BOOL APIENTRY NtGdiMaskBlt(_In_ HDC hdc, _In_ INT xDst, _In_ INT yDst, _In_ INT cx, _In_ INT cy, _In_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_opt_ HBITMAP hbmMask, _In_ INT xMask, _In_ INT yMask, _In_ DWORD dwRop4, _In_ DWORD crBackColor)

◆ MoveToEx()

BOOL WINAPI MoveToEx ( _In_ HDC  hdc,
_In_ INT  x,
_In_ INT  y,
_Out_opt_ LPPOINT  ppt 
)

Definition at line 24 of file painting.c.

29 {
30  PDC_ATTR pdcattr;
31 
32  HANDLE_METADC(BOOL, MoveTo, FALSE, hdc, x, y, ppt);
33 
34  /* Get the DC attribute */
35  pdcattr = GdiGetDcAttr(hdc);
36  if (pdcattr == NULL)
37  {
39  return FALSE;
40  }
41 
42  if (ppt)
43  {
44  if ( pdcattr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit!
45  {
46  ppt->x = pdcattr->ptfxCurrent.x; // ret prev before change.
47  ppt->y = pdcattr->ptfxCurrent.y;
48  DPtoLP (hdc, ppt, 1); // reconvert back.
49  }
50  else
51  {
52  ppt->x = pdcattr->ptlCurrent.x;
53  ppt->y = pdcattr->ptlCurrent.y;
54  }
55  }
56 
57  pdcattr->ptlCurrent.x = x;
58  pdcattr->ptlCurrent.y = y;
59 
60  pdcattr->ulDirty_ &= ~DIRTY_PTLCURRENT;
61  pdcattr->ulDirty_ |= ( DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); // Set dirty
62  return TRUE;
63 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define TRUE
Definition: types.h:120
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:451
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
BOOL WINAPI DPtoLP(_In_ HDC hdc, _Inout_updates_(c) LPPOINT lppt, _In_ int c)
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
LONG y
Definition: windef.h:330
#define DIRTY_PTFXCURRENT
Definition: ntgdihdl.h:154
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
ULONG ulDirty_
Definition: ntgdihdl.h:298
#define DIRTY_STYLESTATE
Definition: ntgdihdl.h:155
LONG x
Definition: windef.h:329
#define SetLastError(x)
Definition: compat.h:611
HDC hdc
Definition: main.c:9
POINTL ptfxCurrent
Definition: ntgdihdl.h:316
#define DIRTY_PTLCURRENT
Definition: ntgdihdl.h:153
#define NULL
Definition: types.h:112
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
POINTL ptlCurrent
Definition: ntgdihdl.h:315

◆ PaintRgn()

BOOL WINAPI PaintRgn ( _In_ HDC  hdc,
_In_ HRGN  hrgn 
)

Definition at line 250 of file painting.c.

253 {
255 }
BOOL WINAPI FillRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbr)
Definition: painting.c:183
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
#define OBJ_BRUSH
Definition: objidl.idl:1410
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:441

Referenced by draw_graphics(), PlayEnhMetaFileRecord(), PlayMetaFileRecord(), and Test_PaintRgn().

◆ PatBlt()

BOOL WINAPI PatBlt ( _In_ HDC  hdc,
_In_ INT  nXLeft,
_In_ INT  nYLeft,
_In_ INT  nWidth,
_In_ INT  nHeight,
_In_ DWORD  dwRop 
)

Definition at line 487 of file painting.c.

494 {
495  PDC_ATTR pdcattr;
496 
497  HANDLE_METADC(BOOL, PatBlt, FALSE, hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop);
498 
499  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
500 
501  /* Get the DC attribute */
502  pdcattr = GdiGetDcAttr(hdc);
503  if (pdcattr && !(pdcattr->ulDirty_ & DC_DIBSECTION))
504  {
505  PGDIBSPATBLT pgO;
506 
508  if (pgO)
509  {
510  pdcattr->ulDirty_ |= DC_MODE_DIRTY;
511  pgO->nXLeft = nXLeft;
512  pgO->nYLeft = nYLeft;
513  pgO->nWidth = nWidth;
514  pgO->nHeight = nHeight;
515  pgO->dwRop = dwRop;
516  /* Snapshot attributes */
517  pgO->hbrush = pdcattr->hbrush;
518  pgO->crForegroundClr = pdcattr->crForegroundClr;
519  pgO->crBackgroundClr = pdcattr->crBackgroundClr;
520  pgO->crBrushClr = pdcattr->crBrushClr;
521  pgO->ulForegroundClr = pdcattr->ulForegroundClr;
522  pgO->ulBackgroundClr = pdcattr->ulBackgroundClr;
523  pgO->ulBrushClr = pdcattr->ulBrushClr;
524  return TRUE;
525  }
526  }
527  return NtGdiPatBlt( hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop);
528 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
__kernel_entry W32KAPI BOOL APIENTRY NtGdiPatBlt(_In_ HDC hdcDest, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_ DWORD dwRop)
Definition: bitblt.c:919
COLORREF crBackgroundClr
Definition: ntgdityp.h:472
HANDLE hbrush
Definition: ntgdihdl.h:299
#define TRUE
Definition: types.h:120
DWORD dwRop
Definition: ntgdityp.h:470
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:451
BOOL WINAPI PatBlt(_In_ HDC hdc, _In_ INT nXLeft, _In_ INT nYLeft, _In_ INT nWidth, _In_ INT nHeight, _In_ DWORD dwRop)
Definition: painting.c:487
COLORREF crForegroundClr
Definition: ntgdityp.h:471
#define DC_DIBSECTION
Definition: ntgdihdl.h:159
COLORREF crBrushClr
Definition: ntgdityp.h:473
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
ULONG ulBackgroundClr
Definition: ntgdihdl.h:302
HANDLE hbrush
Definition: ntgdityp.h:469
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
ULONG ulDirty_
Definition: ntgdihdl.h:298
COLORREF crBackgroundClr
Definition: ntgdihdl.h:301
COLORREF crBrushClr
Definition: ntgdihdl.h:305
HDC hdc
Definition: main.c:9
#define DC_MODE_DIRTY
Definition: ntgdihdl.h:166
ULONG ulBackgroundClr
Definition: ntgdityp.h:477
ULONG ulBrushClr
Definition: ntgdityp.h:478
ULONG ulForegroundClr
Definition: ntgdihdl.h:304
ULONG ulBrushClr
Definition: ntgdihdl.h:306
ULONG ulForegroundClr
Definition: ntgdityp.h:476
#define NULL
Definition: types.h:112
COLORREF crForegroundClr
Definition: ntgdihdl.h:303
FORCEINLINE PVOID GdiAllocBatchCommand(HDC hdc, USHORT Cmd)
Definition: gdi32p.h:381

Referenced by BitBlt(), and PolyPatBlt().

◆ PlgBlt()

BOOL WINAPI PlgBlt ( _In_ HDC  hdcDest,
_In_reads_(3) const POINT ppt,
_In_ HDC  hdcSrc,
_In_ INT  xSrc,
_In_ INT  ySrc,
_In_ INT  cx,
_In_ INT  cy,
_In_opt_ HBITMAP  hbmMask,
_In_ INT  xMask,
_In_ INT  yMask 
)

Definition at line 728 of file painting.c.

739 {
741  PlgBlt,
742  FALSE,
743  hdcDest,
744  ppt,
745  hdcSrc,
746  xSrc,
747  ySrc,
748  cx,
749  cy,
750  hbmMask,
751  xMask,
752  yMask);
753 
754  if ( GdiConvertAndCheckDC(hdcDest) == NULL ) return FALSE;
755 
756  return NtGdiPlgBlt(hdcDest,
757  (LPPOINT)ppt,
758  hdcSrc,
759  xSrc,
760  ySrc,
761  cx,
762  cy,
763  hbmMask,
764  xMask,
765  yMask,
766  GetBkColor(hdcSrc));
767 }
COLORREF WINAPI GetBkColor(_In_ HDC)
Definition: dc.c:956
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
static HDC hdcSrc
Definition: xlate.c:32
BOOL WINAPI PlgBlt(_In_ HDC hdcDest, _In_reads_(3) const POINT *ppt, _In_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cx, _In_ INT cy, _In_opt_ HBITMAP hbmMask, _In_ INT xMask, _In_ INT yMask)
Definition: painting.c:728
__kernel_entry W32KAPI BOOL APIENTRY NtGdiPlgBlt(_In_ HDC hdcTrg, _In_reads_(3) LPPOINT pptlTrg, _In_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_opt_ HBITMAP hbmMask, _In_ INT xMask, _In_ INT yMask, _In_ DWORD crBackColor)
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
#define NULL
Definition: types.h:112
_Out_opt_ int * cx
Definition: commctrl.h:581

◆ PolyBezier()

BOOL WINAPI PolyBezier ( _In_ HDC  hdc,
_In_reads_(cpt) const POINT apt,
_In_ DWORD  cpt 
)

Definition at line 263 of file painting.c.

267 {
268  HANDLE_METADC(BOOL, PolyBezier, FALSE, hdc, apt, cpt);
269 
270  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
271 
272  return NtGdiPolyPolyDraw(hdc ,(PPOINT)apt, &cpt, 1, GdiPolyBezier);
273 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
BOOL WINAPI PolyBezier(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ DWORD cpt)
Definition: painting.c:263
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
__kernel_entry W32KAPI ULONG_PTR APIENTRY NtGdiPolyPolyDraw(_In_ HDC hdc, _In_ PPOINT ppt, _In_reads_(ccpt) PULONG pcpt, _In_ ULONG ccpt, _In_ INT iFunc)
HDC hdc
Definition: main.c:9
#define NULL
Definition: types.h:112

Referenced by Bezier(), DrawPrimitive(), PlayEnhMetaFileRecord(), test_all_functions(), and test_emf_polybezier().

◆ PolyBezierTo()

BOOL WINAPI PolyBezierTo ( _In_ HDC  hdc,
_In_reads_(cpt) const POINT apt,
_In_ DWORD  cpt 
)

Definition at line 281 of file painting.c.

285 {
286  HANDLE_METADC(BOOL, PolyBezierTo, FALSE, hdc, apt, cpt);
287 
288  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
289 
290  return NtGdiPolyPolyDraw(hdc , (PPOINT)apt, &cpt, 1, GdiPolyBezierTo);
291 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
__kernel_entry W32KAPI ULONG_PTR APIENTRY NtGdiPolyPolyDraw(_In_ HDC hdc, _In_ PPOINT ppt, _In_reads_(ccpt) PULONG pcpt, _In_ ULONG ccpt, _In_ INT iFunc)
HDC hdc
Definition: main.c:9
#define NULL
Definition: types.h:112
BOOL WINAPI PolyBezierTo(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ DWORD cpt)
Definition: painting.c:281

Referenced by MainWndProc(), PlayEnhMetaFileRecord(), test_all_functions(), and test_emf_polybezier().

◆ PolyDraw()

BOOL WINAPI PolyDraw ( _In_ HDC  hdc,
_In_reads_(cpt) const POINT apt,
_In_reads_(cpt) const BYTE aj,
_In_ INT  cpt 
)

Definition at line 299 of file painting.c.

304 {
305  HANDLE_METADC(BOOL, PolyDraw, FALSE, hdc, apt, aj, cpt);
306 
307  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
308 
309  return NtGdiPolyDraw(hdc, (PPOINT)apt, (PBYTE)aj, cpt);
310 }
__kernel_entry W32KAPI BOOL APIENTRY NtGdiPolyDraw(_In_ HDC hdc, _In_reads_(cpt) LPPOINT ppt, _In_reads_(cpt) LPBYTE pjAttr, _In_ ULONG cpt)
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
HDC hdc
Definition: main.c:9
BOOL WINAPI PolyDraw(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_reads_(cpt) const BYTE *aj, _In_ INT cpt)
Definition: painting.c:299
#define NULL
Definition: types.h:112
BYTE * PBYTE
Definition: pedump.c:66

◆ Polygon()

BOOL WINAPI Polygon ( _In_ HDC  hdc,
_In_reads_(cpt) const POINT apt,
_In_ INT  cpt 
)

Definition at line 318 of file painting.c.

322 {
323  HANDLE_METADC(BOOL, Polygon, FALSE, hdc, apt, cpt);
324 
325  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
326 
327  return NtGdiPolyPolyDraw(hdc , (PPOINT)apt, (PULONG)&cpt, 1, GdiPolyPolygon);
328 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI Polygon(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ INT cpt)
Definition: painting.c:318
__kernel_entry W32KAPI ULONG_PTR APIENTRY NtGdiPolyPolyDraw(_In_ HDC hdc, _In_ PPOINT ppt, _In_reads_(ccpt) PULONG pcpt, _In_ ULONG ccpt, _In_ INT iFunc)
HDC hdc
Definition: main.c:9
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112

◆ Polyline()

BOOL WINAPI Polyline ( _In_ HDC  hdc,
_In_reads_(cpt) const POINT apt,
_In_ INT  cpt 
)

Definition at line 336 of file painting.c.

340 {
341  HANDLE_METADC(BOOL, Polyline, FALSE, hdc, apt, cpt);
342 
343  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
344 
345  return NtGdiPolyPolyDraw(hdc, (PPOINT)apt, (PULONG)&cpt, 1, GdiPolyPolyLine);
346 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
__kernel_entry W32KAPI ULONG_PTR APIENTRY NtGdiPolyPolyDraw(_In_ HDC hdc, _In_ PPOINT ppt, _In_reads_(ccpt) PULONG pcpt, _In_ ULONG ccpt, _In_ INT iFunc)
BOOL WINAPI Polyline(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ INT cpt)
Definition: painting.c:336
HDC hdc
Definition: main.c:9
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112

◆ PolylineTo()

BOOL WINAPI PolylineTo ( _In_ HDC  hdc,
_In_reads_(cpt) const POINT apt,
_In_ DWORD  cpt 
)

Definition at line 354 of file painting.c.

358 {
359  HANDLE_METADC(BOOL, PolylineTo, FALSE, hdc, apt, cpt);
360 
361  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
362 
363  return NtGdiPolyPolyDraw(hdc , (PPOINT)apt, &cpt, 1, GdiPolyLineTo);
364 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
__kernel_entry W32KAPI ULONG_PTR APIENTRY NtGdiPolyPolyDraw(_In_ HDC hdc, _In_ PPOINT ppt, _In_reads_(ccpt) PULONG pcpt, _In_ ULONG ccpt, _In_ INT iFunc)
HDC hdc
Definition: main.c:9
BOOL WINAPI PolylineTo(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ DWORD cpt)
Definition: painting.c:354
#define NULL
Definition: types.h:112

Referenced by PlayEnhMetaFileRecord(), test_all_functions(), and test_emf_paths().

◆ PolyPatBlt()

BOOL WINAPI PolyPatBlt ( _In_ HDC  hdc,
_In_ DWORD  dwRop,
_In_ PPOLYPATBLT  pPoly,
_In_ DWORD  nCount,
_In_ DWORD  dwMode 
)

Definition at line 532 of file painting.c.

538 {
539  UINT i;
540  BOOL bResult;
541  HBRUSH hbrOld;
542  PDC_ATTR pdcattr;
543 
544  /* Handle meta DCs */
547  {
548  if (!GdiValidateHandle(hdc))
549  {
550  return FALSE;
551  }
552 
553  /* Save the current DC brush */
554  hbrOld = SelectObject(hdc, GetStockObject(DC_BRUSH));
555 
556  /* Assume success */
557  bResult = TRUE;
558 
559  /* Loop all rect */
560  for (i = 0; i < nCount; i++)
561  {
562  /* Select the brush for this rect */
563  SelectObject(hdc, pPoly[i].hBrush);
564 
565  /* Do the PatBlt operation for this rect */
566  bResult &= PatBlt(hdc,
567  pPoly[i].nXLeft,
568  pPoly[i].nYLeft,
569  pPoly[i].nWidth,
570  pPoly[i].nHeight,
571  dwRop);
572  }
573 
574  /* Restore the old brush */
575  SelectObject(hdc, hbrOld);
576 
577  return bResult;
578  }
579 
580  /* Get the DC attribute */
581  pdcattr = GdiGetDcAttr(hdc);
582  if (nCount && pdcattr && !(pdcattr->ulDirty_ & DC_DIBSECTION))
583  {
584  PGDIBSPPATBLT pgO;
585  PTEB pTeb = NtCurrentTeb();
586 
588  if (pgO)
589  {
590  USHORT cjSize = 0;
591  if (nCount > 1) cjSize = (nCount-1) * sizeof(PATRECT);
592 
593  if ((pTeb->GdiTebBatch.Offset + cjSize) <= GDIBATCHBUFSIZE)
594  {
595  pdcattr->ulDirty_ |= DC_MODE_DIRTY;
596  pgO->Count = nCount;
597  pgO->Mode = dwMode;
598  pgO->rop4 = dwRop;
599  /* Snapshot attributes */
600  pgO->crForegroundClr = pdcattr->crForegroundClr;
601  pgO->crBackgroundClr = pdcattr->crBackgroundClr;
602  pgO->crBrushClr = pdcattr->crBrushClr;
603  pgO->ulForegroundClr = pdcattr->ulForegroundClr;
604  pgO->ulBackgroundClr = pdcattr->ulBackgroundClr;
605  pgO->ulBrushClr = pdcattr->ulBrushClr;
606  RtlCopyMemory(pgO->pRect, pPoly, nCount * sizeof(PATRECT));
607  // Recompute offset and return size, remember one is already accounted for in the structure.
608  pTeb->GdiTebBatch.Offset += cjSize;
609  ((PGDIBATCHHDR)pgO)->Size += cjSize;
610  return TRUE;
611  }
612  // Reset offset and count then fall through
613  pTeb->GdiTebBatch.Offset -= sizeof(GDIBSPPATBLT);
614  pTeb->GdiBatchCount--;
615  }
616  }
617  return NtGdiPolyPatBlt(hdc, dwRop, pPoly, nCount, dwMode);
618 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
DWORD rop4
Definition: ntgdityp.h:491
COLORREF crBackgroundClr
Definition: ntgdityp.h:495
PATRECT pRect[1]
Definition: ntgdityp.h:501
ULONG ulBrushClr
Definition: ntgdityp.h:499
#define TRUE
Definition: types.h:120
COLORREF crForegroundClr
Definition: ntgdityp.h:494
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:451
BOOL WINAPI PatBlt(_In_ HDC hdc, _In_ INT nXLeft, _In_ INT nYLeft, _In_ INT nWidth, _In_ INT nHeight, _In_ DWORD dwRop)
Definition: painting.c:487
#define DC_DIBSECTION
Definition: ntgdihdl.h:159
struct _GDIBATCHHDR * PGDIBATCHHDR
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
ULONG ulBackgroundClr
Definition: ntgdihdl.h:302
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD Count
Definition: ntgdityp.h:493
struct _GDIBSPPATBLT GDIBSPPATBLT
#define GDIBATCHBUFSIZE
Definition: ntgdityp.h:200
ULONG ulBackgroundClr
Definition: ntgdityp.h:498
__kernel_entry W32KAPI BOOL APIENTRY NtGdiPolyPatBlt(_In_ HDC hdc, _In_ DWORD rop4, _In_reads_(cPoly) PPOLYPATBLT pPoly, _In_ DWORD cPoly, _In_ DWORD dwMode)
COLORREF crBrushClr
Definition: ntgdityp.h:496
ULONG ulDirty_
Definition: ntgdihdl.h:298
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
COLORREF crBackgroundClr
Definition: ntgdihdl.h:301
COLORREF crBrushClr
Definition: ntgdihdl.h:305
GDI_TEB_BATCH GdiTebBatch
Definition: compat.h:716
ULONG GdiBatchCount
Definition: compat.h:746
HDC hdc
Definition: main.c:9
#define DC_MODE_DIRTY
Definition: ntgdihdl.h:166
Definition: compat.h:694
ULONG Offset
Definition: compat.h:690
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned short USHORT
Definition: pedump.c:61
ULONG ulForegroundClr
Definition: ntgdihdl.h:304
ULONG ulBrushClr
Definition: ntgdihdl.h:306
unsigned int UINT
Definition: ndis.h:50
COLORREF crForegroundClr
Definition: ntgdihdl.h:303
_In_ ULONG cjSize
Definition: winddi.h:3634
DWORD Mode
Definition: ntgdityp.h:492
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
FORCEINLINE PVOID GdiAllocBatchCommand(HDC hdc, USHORT Cmd)
Definition: gdi32p.h:381
BOOL WINAPI GdiValidateHandle(HGDIOBJ)
Definition: misc.c:712
ULONG ulForegroundClr
Definition: ntgdityp.h:497

◆ PolyPolygon()

BOOL WINAPI PolyPolygon ( _In_ HDC  hdc,
_In_ const POINT apt,
_In_reads_(csz) const INT asz,
_In_ INT  csz 
)

Definition at line 372 of file painting.c.

377 {
378  HANDLE_METADC(BOOL, PolyPolygon, FALSE, hdc, apt, asz, csz);
379 
380  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
381 
382  return NtGdiPolyPolyDraw(hdc, (PPOINT)apt, (PULONG)asz, csz, GdiPolyPolygon);
383 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
BOOL WINAPI PolyPolygon(_In_ HDC hdc, _In_ const POINT *apt, _In_reads_(csz) const INT *asz, _In_ INT csz)
Definition: painting.c:372
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
__kernel_entry W32KAPI ULONG_PTR APIENTRY NtGdiPolyPolyDraw(_In_ HDC hdc, _In_ PPOINT ppt, _In_reads_(ccpt) PULONG pcpt, _In_ ULONG ccpt, _In_ INT iFunc)
HDC hdc
Definition: main.c:9
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112

◆ PolyPolyline()

BOOL WINAPI PolyPolyline ( _In_ HDC  hdc,
_In_ CONST POINT apt,
_In_reads_(csz) CONST DWORD asz,
_In_ DWORD  csz 
)

Definition at line 391 of file painting.c.

396 {
398  return FALSE;
399 
400  HANDLE_METADC(BOOL, PolyPolyline, FALSE, hdc, apt, asz, csz);
401 
402  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
403 
404  return NtGdiPolyPolyDraw(hdc , (PPOINT)apt, (PULONG)asz, csz, GdiPolyPolyLine);
405 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
__kernel_entry W32KAPI ULONG_PTR APIENTRY NtGdiPolyPolyDraw(_In_ HDC hdc, _In_ PPOINT ppt, _In_reads_(ccpt) PULONG pcpt, _In_ ULONG ccpt, _In_ INT iFunc)
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HDC hdc
Definition: main.c:9
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
BOOL WINAPI PolyPolyline(_In_ HDC hdc, _In_ CONST POINT *apt, _In_reads_(csz) CONST DWORD *asz, _In_ DWORD csz)
Definition: painting.c:391

◆ Rectangle()

BOOL WINAPI Rectangle ( _In_ HDC  hdc,
_In_ INT  left,
_In_ INT  top,
_In_ INT  right,
_In_ INT  bottom 
)

Definition at line 91 of file painting.c.

97 {
99 
100  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
101 
102  return NtGdiRectangle(hdc, left, top, right, bottom);
103 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
__kernel_entry W32KAPI BOOL APIENTRY NtGdiRectangle(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
BOOL WINAPI Rectangle(_In_ HDC hdc, _In_ INT left, _In_ INT top, _In_ INT right, _In_ INT bottom)
Definition: painting.c:91
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HDC hdc
Definition: main.c:9
#define NULL
Definition: types.h:112
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ RoundRect()

BOOL WINAPI RoundRect ( _In_ HDC  hdc,
_In_ INT  left,
_In_ INT  top,
_In_ INT  right,
_In_ INT  bottom,
_In_ INT  width,
_In_ INT  height 
)

Definition at line 111 of file painting.c.

119 {
121 
122  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
123 
125 }
GLint GLint GLsizei width
Definition: gl.h:1546
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
BOOL WINAPI RoundRect(_In_ HDC hdc, _In_ INT left, _In_ INT top, _In_ INT right, _In_ INT bottom, _In_ INT width, _In_ INT height)
Definition: painting.c:111
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint bottom
Definition: glext.h:7726
__kernel_entry W32KAPI BOOL APIENTRY NtGdiRoundRect(_In_ HDC hdc, _In_ INT x1, _In_ INT y1, _In_ INT x2, _In_ INT y2, _In_ INT x3, _In_ INT y3)
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HDC hdc
Definition: main.c:9
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define NULL
Definition: types.h:112
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ SetPixel()

COLORREF WINAPI SetPixel ( _In_ HDC  hdc,
_In_ INT  x,
_In_ INT  y,
_In_ COLORREF  crColor 
)

Definition at line 149 of file painting.c.

154 {
156 
157  if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
158 
159  return NtGdiSetPixel(hdc, x, y, crColor);
160 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
#define CLR_INVALID
Definition: wingdi.h:882
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
COLORREF WINAPI SetPixel(_In_ HDC hdc, _In_ INT x, _In_ INT y, _In_ COLORREF crColor)
Definition: painting.c:149
#define FALSE
Definition: types.h:117
DWORD COLORREF
Definition: windef.h:300
HDC hdc
Definition: main.c:9
__kernel_entry W32KAPI COLORREF APIENTRY NtGdiSetPixel(_In_ HDC hdcDst, _In_ INT x, _In_ INT y, _In_ COLORREF crColor)
Definition: bitblt.c:1358
#define NULL
Definition: types.h:112
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by SetPixelV().

◆ SetPixelV()

BOOL WINAPI SetPixelV ( _In_ HDC  hdc,
_In_ INT  x,
_In_ INT  y,
_In_ COLORREF  crColor 
)

Definition at line 168 of file painting.c.

173 {
174  return SetPixel(hdc, x, y, crColor) != CLR_INVALID;
175 }
#define CLR_INVALID
Definition: wingdi.h:882
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
COLORREF WINAPI SetPixel(_In_ HDC hdc, _In_ INT x, _In_ INT y, _In_ COLORREF crColor)
Definition: painting.c:149
HDC hdc
Definition: main.c:9
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ StretchBlt()

BOOL WINAPI StretchBlt ( _In_ HDC  hdcDest,
_In_ INT  xDest,
_In_ INT  yDest,
_In_ INT  cxDest,
_In_ INT  cyDest,
_In_opt_ HDC  hdcSrc,
_In_ INT  xSrc,
_In_ INT  ySrc,
_In_ INT  cxSrc,
_In_ INT  cySrc,
_In_ DWORD  dwRop 
)

Definition at line 625 of file painting.c.

637 {
639  StretchBlt,
640  FALSE,
641  hdcDest,
642  xDest,
643  yDest,
644  cxDest,
645  cyDest,
646  hdcSrc,
647  xSrc,
648  ySrc,
649  cxSrc,
650  cySrc,
651  dwRop);
652 
653  if ( GdiConvertAndCheckDC(hdcDest) == NULL ) return FALSE;
654 
655  return NtGdiStretchBlt(hdcDest,
656  xDest,
657  yDest,
658  cxDest,
659  cyDest,
660  hdcSrc,
661  xSrc,
662  ySrc,
663  cxSrc,
664  cySrc,
665  dwRop,
666  0);
667 }
HDC WINAPI GdiConvertAndCheckDC(HDC hdc)
Definition: dc.c:416
static HDC hdcSrc
Definition: xlate.c:32
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
BOOL WINAPI StretchBlt(_In_ HDC hdcDest, _In_ INT xDest, _In_ INT yDest, _In_ INT cxDest, _In_ INT cyDest, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ DWORD dwRop)
Definition: painting.c:625
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define NULL
Definition: types.h:112
__kernel_entry W32KAPI BOOL APIENTRY NtGdiStretchBlt(_In_ HDC hdcDst, _In_ INT xDst, _In_ INT yDst, _In_ INT cxDst, _In_ INT cyDst, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ DWORD dwRop, _In_ DWORD dwBackColor)

Referenced by BitBlt().