86{
87 HPEN hPen;
89 static ULONG aulStyleAlternate[] = { 1, 1 };
90 static ULONG aulStyleDash[] = { 6, 2 };
91 static ULONG aulStyleDot[] = { 1, 1 };
92 static ULONG aulStyleDashDot[] = { 3, 2, 1, 2 };
93 static ULONG aulStyleDashDotDot[] = { 3, 1, 1, 1, 1, 1 };
95
97
99 {
101 }
102
103 if (bOldStylePen)
104 {
106 }
107 else
108 {
110 }
111
112 if (!pbrushPen)
113 {
115 DPRINT(
"Can't allocate pen\n");
116 return 0;
117 }
118
120
121 if (bOldStylePen)
122 {
123
126 }
127 else
128 {
130 {
134 break;
135
136 default:
137 goto ExitCleanup;
138 }
139
141 {
145 break;
146
147 default:
148 goto ExitCleanup;
149 }
150
152 {
155 goto ExitCleanup;
156
157 break;
158
160 break;
161
162 default:
163 goto ExitCleanup;
164 }
165 }
166
169 pbrushPen->ulPenStyle = dwPenStyle;
170 pbrushPen->BrushAttr.lbColor = ulColor;
171 pbrushPen->iBrushStyle = ulBrushStyle;
172
173 pbrushPen->hbmClient = (
HANDLE)ulClientHatch;
174 pbrushPen->dwStyleCount = 0;
175 pbrushPen->pStyle =
NULL;
176 pbrushPen->ulStyleSize = 0;
178
180 {
183 break;
184
187 break;
188
191 pbrushPen->pStyle = aulStyleAlternate;
192 pbrushPen->dwStyleCount =
_countof(aulStyleAlternate);
193 break;
194
197 pbrushPen->pStyle = aulStyleDot;
198 pbrushPen->dwStyleCount =
_countof(aulStyleDot);
199 break;
200
203 pbrushPen->pStyle = aulStyleDash;
204 pbrushPen->dwStyleCount =
_countof(aulStyleDash);
205 break;
206
209 pbrushPen->pStyle = aulStyleDashDot;
210 pbrushPen->dwStyleCount =
_countof(aulStyleDashDot);
211 break;
212
215 pbrushPen->pStyle = aulStyleDashDotDot;
216 pbrushPen->dwStyleCount =
_countof(aulStyleDashDotDot);
217 break;
218
221 break;
222
224 {
227
228 for(
i = 0; (
i < dwStyleCount) && !has_neg;
i++)
229 {
230 has_neg = has_neg || (((
INT)(pStyle[
i])) < 0);
231 all_zero = all_zero && (pStyle[
i] == 0);
232 }
233
234 if(all_zero || has_neg)
235 {
236 goto ExitCleanup;
237 }
238 }
239
241 pbrushPen->dwStyleCount = dwStyleCount;
242 pbrushPen->pStyle = pStyle;
243 break;
244
245 default:
246 DPRINT1(
"IntGdiExtCreatePen unknown penstyle %x\n", dwPenStyle);
247 goto ExitCleanup;
248 }
249
250 if (pbrushPen->pStyle !=
NULL)
251 {
252 for (
i = 0;
i < pbrushPen->dwStyleCount;
i++)
253 {
254 pbrushPen->ulStyleSize += pbrushPen->pStyle[
i];
255 }
256 }
257
258 NT_ASSERT((pbrushPen->dwStyleCount == 0) || (pbrushPen->pStyle !=
NULL));
259
261 return hPen;
262
263ExitCleanup:
265 pbrushPen->pStyle =
NULL;
267
269}
#define ERROR_NOT_ENOUGH_MEMORY
static const WCHAR dwWidth[]
#define ERROR_INVALID_PARAMETER
#define BR_IS_OLDSTYLEPEN
#define BR_IS_INSIDEFRAME
#define BR_IS_DEFAULTSTYLE
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
#define PEN_UnlockPen(pPenObj)
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
PBRUSH NTAPI PEN_AllocExtPenWithHandle(VOID)
PBRUSH NTAPI PEN_AllocPenWithHandle(VOID)
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
#define FLOATOBJ_SetLong(pf, l)