ReactOS 0.4.16-dev-197-g92996da
pen.c
Go to the documentation of this file.
1#include <precomp.h>
2
3#define NDEBUG
4#include <debug.h>
5
6/*
7 * @implemented
8 */
9HPEN WINAPI
11 const LOGPEN *lplgpn)
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}
16
17/*
18 * @implemented
19 */
20HPEN WINAPI
22 int nPenStyle,
23 int nWidth,
24 COLORREF crColor)
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}
56
#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
COLORREF lopnColor
Definition: wingdi.h:1847
POINT lopnWidth
Definition: wingdi.h:1846
UINT lopnStyle
Definition: wingdi.h:1845
long x
Definition: polytest.cpp:48
DWORD COLORREF
Definition: windef.h:300
#define WINAPI
Definition: msvc.h:6
#define PS_NULL
Definition: wingdi.h:591
HGDIOBJ WINAPI GetStockObject(_In_ int)
HPEN WINAPI CreatePenIndirect(_In_ const LOGPEN *)
#define NULL_PEN
Definition: wingdi.h:904
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define PS_INSIDEFRAME
Definition: wingdi.h:593
#define PS_SOLID
Definition: wingdi.h:586
#define PS_DASHDOTDOT
Definition: wingdi.h:590