ReactOS 0.4.16-dev-340-g0540c21
pen.c File Reference
#include <precomp.h>
#include <debug.h>
Include dependency graph for pen.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

HPEN WINAPI CreatePenIndirect (const LOGPEN *lplgpn)
 
HPEN WINAPI CreatePen (int nPenStyle, int nWidth, COLORREF crColor)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 3 of file pen.c.

Function Documentation

◆ CreatePen()

HPEN WINAPI CreatePen ( int  nPenStyle,
int  nWidth,
COLORREF  crColor 
)

Definition at line 21 of file pen.c.

25{
26/* HPEN hPen;
27 PBRUSH_ATTR Pen_Attr;
28*/
29 if (nPenStyle < PS_SOLID) nPenStyle = PS_SOLID;
30 if (nPenStyle > PS_DASHDOTDOT)
31 {
32 if (nPenStyle == PS_NULL) return GetStockObject(NULL_PEN);
33 if (nPenStyle != PS_INSIDEFRAME) nPenStyle = PS_SOLID;
34 }
35#if 0
36 hPen = hGetPEBHandle(hctPenHandle, nPenStyle);
37 if ( nWidth || nPenStyle || !hPen )
38 {
39 return NtGdiCreatePen(nPenStyle, nWidth, crColor, NULL);
40 }
41
42 if ((GdiGetHandleUserData( hPen, GDI_OBJECT_TYPE_PEN, (PVOID) &Pen_Attr)) &&
43 ( Pen_Attr != NULL ))
44 {
45 if ( Pen_Attr->lbColor != crColor)
46 {
47 Pen_Attr->lbColor = crColor;
48 Pen_Attr->AttrFlags |= ATTR_NEW_COLOR;
49 }
50 return hPen;
51 }
52 DeleteObject(hPen);
53#endif
54 return NtGdiCreatePen(nPenStyle, nWidth, crColor, NULL);
55}
#define NULL
Definition: types.h:112
pKey DeleteObject()
HGDIOBJ FASTCALL hGetPEBHandle(HANDLECACHETYPE, COLORREF)
Definition: misc.c:880
#define GDI_OBJECT_TYPE_PEN
Definition: gdi.h:54
PVOID GdiGetHandleUserData(_In_ HGDIOBJ hobj)
Definition: gditools.c:68
__kernel_entry W32KAPI HPEN APIENTRY NtGdiCreatePen(_In_ INT iPenStyle, _In_ INT iPenWidth, _In_ COLORREF cr, _In_opt_ HBRUSH hbr)
#define ATTR_NEW_COLOR
Definition: ntgdihdl.h:193
@ hctPenHandle
Definition: ntgdityp.h:346
#define PS_NULL
Definition: wingdi.h:591
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define NULL_PEN
Definition: wingdi.h:904
#define PS_INSIDEFRAME
Definition: wingdi.h:593
#define PS_SOLID
Definition: wingdi.h:586
#define PS_DASHDOTDOT
Definition: wingdi.h:590

◆ CreatePenIndirect()

HPEN WINAPI CreatePenIndirect ( const LOGPEN lplgpn)

Definition at line 10 of file pen.c.

12{
13 /* Note same behoir as Windows 2000/XP/VISTA, they do not care if plgpn is NULLī, it will crash */
14 return CreatePen(lplgpn->lopnStyle, lplgpn->lopnWidth.x, lplgpn->lopnColor);
15}
COLORREF lopnColor
Definition: wingdi.h:1847
POINT lopnWidth
Definition: wingdi.h:1846
UINT lopnStyle
Definition: wingdi.h:1845
long x
Definition: polytest.cpp:48
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)