2013-01-24 23:00:42 +00:00
|
|
|
|
#include <precomp.h>
|
2009-10-12 03:35:35 +00:00
|
|
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* @implemented
|
|
|
|
|
*/
|
|
|
|
|
HPEN WINAPI
|
|
|
|
|
CreatePenIndirect(
|
|
|
|
|
const LOGPEN *lplgpn)
|
|
|
|
|
{
|
|
|
|
|
/* Note same behoir as Windows 2000/XP/VISTA, they do not care if plgpn is NULL<4C>, it will crash */
|
|
|
|
|
return CreatePen(lplgpn->lopnStyle, lplgpn->lopnWidth.x, lplgpn->lopnColor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* @implemented
|
|
|
|
|
*/
|
|
|
|
|
HPEN WINAPI
|
|
|
|
|
CreatePen(
|
|
|
|
|
int nPenStyle,
|
|
|
|
|
int nWidth,
|
|
|
|
|
COLORREF crColor)
|
|
|
|
|
{
|
2011-03-27 05:40:30 +00:00
|
|
|
|
/* HPEN hPen;
|
|
|
|
|
PBRUSH_ATTR Pen_Attr;
|
|
|
|
|
*/
|
|
|
|
|
if (nPenStyle < PS_SOLID) nPenStyle = PS_SOLID;
|
2009-10-12 03:35:35 +00:00
|
|
|
|
if (nPenStyle > PS_DASHDOTDOT)
|
|
|
|
|
{
|
2010-12-27 16:23:59 +00:00
|
|
|
|
if (nPenStyle == PS_NULL) return GetStockObject(NULL_PEN);
|
|
|
|
|
if (nPenStyle != PS_INSIDEFRAME) nPenStyle = PS_SOLID;
|
2009-10-12 03:35:35 +00:00
|
|
|
|
}
|
2011-03-27 05:40:30 +00:00
|
|
|
|
#if 0
|
|
|
|
|
hPen = hGetPEBHandle(hctPenHandle, nPenStyle);
|
|
|
|
|
if ( nWidth || nPenStyle || !hPen )
|
|
|
|
|
{
|
|
|
|
|
return NtGdiCreatePen(nPenStyle, nWidth, crColor, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((GdiGetHandleUserData( hPen, GDI_OBJECT_TYPE_PEN, (PVOID) &Pen_Attr)) &&
|
|
|
|
|
( Pen_Attr != NULL ))
|
|
|
|
|
{
|
|
|
|
|
if ( Pen_Attr->lbColor != crColor)
|
|
|
|
|
{
|
|
|
|
|
Pen_Attr->lbColor = crColor;
|
|
|
|
|
Pen_Attr->AttrFlags |= ATTR_NEW_COLOR;
|
|
|
|
|
}
|
|
|
|
|
return hPen;
|
|
|
|
|
}
|
|
|
|
|
DeleteObject(hPen);
|
|
|
|
|
#endif
|
2009-10-12 03:35:35 +00:00
|
|
|
|
return NtGdiCreatePen(nPenStyle, nWidth, crColor, NULL);
|
|
|
|
|
}
|
|
|
|
|
|