ReactOS  0.4.10-dev-348-gbcec1fd
ExtCreatePen.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS api tests
3  * LICENSE: GPL - See COPYING in the top level directory
4  * PURPOSE: Test for ExtCreatePen
5  * PROGRAMMERS: Timo Kreuzer
6  */
7 
8 #include "precomp.h"
9 
10 #define ok_lasterror(err) \
11  ok(GetLastError() == err, "expected last error " #err " but got 0x%lx\n", GetLastError());
12 
13 #define ok_elp(hPen, elp, pstyle, width, bstyle, color, hatch, cstyle) \
14  ok(GetObjectA(hPen, sizeof(elpBuffer), elp) != 0, "GetObject failed\n"); \
15  ok((elp)->elpPenStyle == (pstyle), "Wrong elpPenStyle, expected 0x%lx, got 0x%lx\n", (DWORD)pstyle, (elp)->elpPenStyle); \
16  ok((elp)->elpWidth == width, "Wrong elpWidth, expected %lu, got %lu\n", (DWORD)width, (elp)->elpWidth); \
17  ok((elp)->elpBrushStyle == (bstyle), "Wrong elpBrushStyle, expected 0x%x, got 0x%x\n", bstyle, (elp)->elpBrushStyle); \
18  ok((elp)->elpColor == color, "Wrong elpColor, expected 0x%lx, got 0x%lx\n", (COLORREF)color, (elp)->elpColor); \
19  ok((elp)->elpHatch == hatch, "Wrong elpHatch, expected 0x%p, got 0x%p\n", (PVOID)hatch, (PVOID)(elp)->elpHatch); \
20  ok((elp)->elpNumEntries == cstyle, "Wrong elpNumEntries, expected %lu got %lu\n", (DWORD)cstyle, (elp)->elpNumEntries);
21 
23 {
24  HPEN hPen;
25  LOGBRUSH logbrush;
26  struct
27  {
28  EXTLOGPEN extlogpen;
29  ULONG styles[16];
30  } elpBuffer;
31  PEXTLOGPEN pelp = &elpBuffer.extlogpen;
32 
33  DWORD adwStyles[17] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
34 
35  /* Test NULL logbrush */
36  SetLastError(0);
37  _SEH2_TRY
38  {
39  hPen = ExtCreatePen(PS_COSMETIC, 1, NULL, 0, 0);
40  }
42  {
43  SetLastError(0xdeadc0de);
44  }
45  _SEH2_END;
46  ok_lasterror(0xdeadc0de);
47 
48  logbrush.lbStyle = BS_SOLID;
49  logbrush.lbColor = RGB(1, 2, 3);
50  logbrush.lbHatch = 0;
51  hPen = ExtCreatePen(PS_COSMETIC, 1, &logbrush, 0, 0);
52  ok(hPen != NULL, "ExtCreatePen failed\n");
53  ok_elp(hPen, pelp, PS_COSMETIC, 1, BS_SOLID, RGB(1,2,3), 0, 0);
54 
55  /* Test if we have an EXTPEN */
56  ok(GDI_HANDLE_GET_TYPE(hPen) == GDI_OBJECT_TYPE_EXTPEN, "hPen=%p\n", hPen);
57  DeleteObject(hPen);
58 
59  /* Test invalid style mask (0x0F) */
60  SetLastError(0xdeadc0de);
61  hPen = ExtCreatePen(9, 1, &logbrush, 0, 0);
62  ok(hPen == NULL, "ExtCreatePen should fail\n");
64 
65  /* Test PS_ALTERNATE with PS_GEOMETRIC */
66  SetLastError(0xdeadc0de);
67  hPen = ExtCreatePen(PS_ALTERNATE | PS_GEOMETRIC, 1, &logbrush, 0, NULL);
68  ok(hPen == NULL, "ExtCreatePen should fail\n");
70 
71  /* Test invalid endcap mask (0xF00) */
72  SetLastError(0xdeadc0de);
73  hPen = ExtCreatePen(0x300, 1, &logbrush, 0, 0);
74  ok(hPen == NULL, "ExtCreatePen should fail\n");
76 
77  /* Test invalid join mask (F000) */
78  SetLastError(0xdeadc0de);
79  hPen = ExtCreatePen(0x3000, 1, &logbrush, 0, 0);
80  ok(hPen == NULL, "ExtCreatePen should fail\n");
82 
83  /* Test invalid type mask (F0000) */
84  SetLastError(0xdeadc0de);
85  hPen = ExtCreatePen(0x20000, 1, &logbrush, 0, 0);
86  ok(hPen == NULL, "ExtCreatePen should fail\n");
88 
89  /* Test PS_COSMETIC with dwWidth != 1 */
90  SetLastError(0xdeadc0de);
91  hPen = ExtCreatePen(PS_COSMETIC, -1, &logbrush, 0, 0);
92  ok(hPen != NULL, "ExtCreatePen failed\n");
93  ok_lasterror(0xdeadc0de);
94  ok_elp(hPen, pelp, PS_COSMETIC, 1, BS_SOLID, RGB(1,2,3), 0, 0);
95  DeleteObject(hPen);
96  SetLastError(0xdeadc0de);
97  hPen = ExtCreatePen(PS_COSMETIC, 2, &logbrush, 0, 0);
98  ok(hPen == NULL, "ExtCreatePen should fail\n");
100  SetLastError(0xdeadc0de);
101  hPen = ExtCreatePen(PS_COSMETIC, 0, &logbrush, 0, 0);
102  ok(hPen == NULL, "ExtCreatePen should fail\n");
104 
105  /* Test PS_COSMETIC with PS_ENDCAP_SQUARE */
106  SetLastError(0xdeadc0de);
107  hPen = ExtCreatePen(PS_COSMETIC | PS_ENDCAP_SQUARE, 1, &logbrush, 0, NULL);
108  ok(hPen != NULL, "ExtCreatePen failed\n");
109  ok_lasterror(0xdeadc0de);
110  ok_elp(hPen, pelp, PS_COSMETIC | PS_ENDCAP_SQUARE, 1, BS_SOLID, RGB(1,2,3), 0, 0);
111  DeleteObject(hPen);
112 
113  /* Test styles without PS_USERSTYLE */
114  SetLastError(0xdeadc0de);
115  hPen = ExtCreatePen(PS_GEOMETRIC, 1, &logbrush, 16, adwStyles);
116  ok(hPen == NULL, "ExtCreatePen should fail\n");
118  SetLastError(0xdeadc0de);
119  hPen = ExtCreatePen(PS_GEOMETRIC, 1, &logbrush, 0, adwStyles);
120  ok(hPen == NULL, "ExtCreatePen should fail\n");
122  SetLastError(0xdeadc0de);
123  hPen = ExtCreatePen(PS_GEOMETRIC, 1, &logbrush, 16, NULL);
124  ok(hPen == NULL, "ExtCreatePen should fail\n");
126 
127  /* Test PS_USERSTYLE */
128  SetLastError(0xdeadc0de);
129  hPen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 5, &logbrush, 16, adwStyles);
130  ok(hPen != NULL, "ExtCreatePen failed\n");
131  ok_lasterror(0xdeadc0de);
132  ok_elp(hPen, pelp, PS_GEOMETRIC | PS_USERSTYLE, 5, BS_SOLID, RGB(1,2,3), 0, 16);
133  DeleteObject(hPen);
134 
135  /* Test PS_USERSTYLE with PS_COSMETIC */
136  SetLastError(0xdeadc0de);
137  hPen = ExtCreatePen(PS_COSMETIC | PS_USERSTYLE, 5, &logbrush, 16, adwStyles);
138  ok(hPen == NULL, "ExtCreatePen should fail\n");
140 
141  /* Test PS_USERSTYLE with 17 styles */
142  SetLastError(0xdeadc0de);
143  hPen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 5, &logbrush, 17, adwStyles);
144  ok(hPen == NULL, "ExtCreatePen should fail\n");
146 
147  /* Test PS_USERSTYLE with 1 style */
148  SetLastError(0xdeadc0de);
149  hPen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 5, &logbrush, 1, adwStyles);
150  ok(hPen != NULL, "ExtCreatePen failed\n");
151  ok_lasterror(0xdeadc0de);
152  ok_elp(hPen, pelp, PS_GEOMETRIC | PS_USERSTYLE, 5, BS_SOLID, RGB(1,2,3), 0, 1);
153  DeleteObject(hPen);
154 
155  /* Test PS_USERSTYLE with NULL lpStyles */
156  SetLastError(0xdeadc0de);
157  hPen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 1, &logbrush, 2, NULL);
158  ok(hPen == NULL, "ExtCreatePen should fail\n");
160 
161  /* Test PS_NULL */
162  SetLastError(0xdeadc0de);
163  hPen = ExtCreatePen(PS_NULL, 1, &logbrush, 0, NULL);
164  ok(hPen == GetStockObject(NULL_PEN), "ExtCreatePen should return NULL_PEN, but returned %p\n", hPen);
165  ok_lasterror(0xdeadc0de);
166 
167  /* When the size is anything other than sizeof(EXTLOGPEN), we will get a LOGPEN! */
168  ok(GetObjectA(hPen, sizeof(EXTLOGPEN) + 1, pelp) == sizeof(LOGPEN), "GetObject failed\n");
169 
170  /* ACHTUNG: special handling, we want sizeof(EXTLOGPEN) and nothing else */
171  ok(GetObjectA(hPen, sizeof(EXTLOGPEN), pelp) == sizeof(EXTLOGPEN), "GetObject failed\n");
172  ok(pelp->elpPenStyle == PS_NULL, "Wrong elpPenStyle, expected PS_NULL, got 0x%lx\n", pelp->elpPenStyle);
173  ok(pelp->elpWidth == 0, "Wrong elpWidth, expected 0, got %lu\n", pelp->elpWidth);
174  ok(pelp->elpBrushStyle == BS_SOLID, "Wrong elpBrushStyle, expected BS_SOLID, got 0x%x\n", pelp->elpBrushStyle);
175  ok(pelp->elpColor == 0, "Wrong elpColor, expected 0, got 0x%lx\n", pelp->elpColor);
176  ok(pelp->elpHatch == 0, "Wrong elpHatch, expected 0, got 0x%p\n", (PVOID)pelp->elpColor);
177  ok(pelp->elpNumEntries == 0, "Wrong elpNumEntries, expected %u got %lu\n", 0, pelp->elpNumEntries);
178 
179  /* Test PS_NULL with styles */
180  SetLastError(0xdeadc0de);
181  hPen = ExtCreatePen(PS_NULL, 1, &logbrush, 1, adwStyles);
182  ok(hPen == NULL, "ExtCreatePen should fail\n");
184 
185  /* Test 0 width */
186  SetLastError(0xdeadc0de);
187  hPen = ExtCreatePen(PS_GEOMETRIC, 0, &logbrush, 0, 0);
188  ok(hPen != NULL, "ExtCreatePen failed\n");
189  ok_lasterror(0xdeadc0de);
190  ok_elp(hPen, pelp, PS_GEOMETRIC, 0, BS_SOLID, RGB(1,2,3), 0, 0);
191  DeleteObject(hPen);
192 
193  /* Test negative width */
194  SetLastError(0xdeadc0de);
195  hPen = ExtCreatePen(PS_GEOMETRIC, -7942, &logbrush, 0, 0);
196  ok(hPen != NULL, "ExtCreatePen failed\n");
197  ok_lasterror(0xdeadc0de);
198  ok_elp(hPen, pelp, PS_GEOMETRIC, 7942, BS_SOLID, RGB(1,2,3), 0, 0);
199  DeleteObject(hPen);
200 
201 }
202 
203 BOOL
205  DWORD dwPenStyle,
206  DWORD dwWidth,
207  DWORD dwStyleCount,
208  PDWORD pdwStyles,
209  UINT lbStyle,
210  ULONG_PTR lbHatch,
211  PBOOL pbExpectException,
212  PEXTLOGPEN pelpExpect)
213 {
214  *pbExpectException = FALSE;
215 
216  if ((dwPenStyle & PS_STYLE_MASK) == PS_USERSTYLE)
217  {
218  if (pdwStyles == NULL)
219  {
220  return FALSE;
221  }
222  }
223  else
224  {
225  if ((dwStyleCount != 0) || (pdwStyles != NULL))
226  {
227  return FALSE;
228  }
229  }
230 
231  if (lbStyle == BS_PATTERN)
232  {
233  if (lbHatch == 0) return FALSE;
234  }
235 
236  if (lbStyle == BS_DIBPATTERNPT)
237  {
238  if (lbHatch == 0) return FALSE;
239  if (lbHatch < 0xFFFF)
240  {
241  *pbExpectException = TRUE;
242  return FALSE;
243  }
244  }
245 
246  if (lbStyle == BS_DIBPATTERN)
247  {
248  return FALSE;
249  }
250 
251  if ((dwPenStyle & PS_STYLE_MASK) == PS_USERSTYLE)
252  {
253  if (dwStyleCount == 0)
254  {
255  return FALSE;
256  }
257 
258  if (dwStyleCount > 16)
259  {
260  return FALSE;
261  }
262 
263  if ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC)
264  {
265  if (pdwStyles[0] == 0)
266  {
267  return FALSE;
268  }
269  }
270  else
271  {
272  if ((pdwStyles[0] == 0) && (dwStyleCount == 1))
273  {
274  return FALSE;
275  }
276  }
277  }
278 
279  if ((dwPenStyle & PS_STYLE_MASK) == PS_NULL)
280  {
281  pelpExpect->elpPenStyle = PS_NULL;
282  pelpExpect->elpWidth = 0;
283  pelpExpect->elpBrushStyle = BS_SOLID;
284  pelpExpect->elpColor = 0;
285  pelpExpect->elpHatch = 0;
286  pelpExpect->elpNumEntries = 0;
287  return TRUE;
288  }
289 
290 
291  if (((dwPenStyle & PS_STYLE_MASK) >> 0) > PS_ALTERNATE) return FALSE;
292  if (((dwPenStyle & PS_ENDCAP_MASK) >> 8) > 2) return FALSE;
293  if (((dwPenStyle & PS_JOIN_MASK) >> 12) > 2) return FALSE;
294  if (((dwPenStyle & PS_TYPE_MASK) >> 16) > 1) return FALSE;
295 
296  dwWidth = abs(((LONG)dwWidth));
297 
298  if ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC)
299  {
300  if (dwWidth != 1) return FALSE;
301 
302  if ((lbStyle != BS_SOLID) &&
303  (lbStyle != BS_HATCHED))
304  {
305  return FALSE;
306  }
307 
308  if (lbStyle == BS_HATCHED)
309  {
310  if ((lbHatch != 8) &&
311  (lbHatch != 10) &&
312  (lbHatch != 12))
313  {
314  return FALSE;
315  }
316 
317  if (lbHatch >= HS_API_MAX)
318  {
319  return FALSE;
320  }
321  }
322 
323  if ((dwPenStyle & PS_STYLE_MASK) == PS_INSIDEFRAME)
324  {
325  return FALSE;
326  }
327  }
328  else
329  {
330  if ((dwPenStyle & PS_STYLE_MASK) == PS_ALTERNATE)
331  {
332  return FALSE;
333  }
334 
335  if (((dwPenStyle & PS_STYLE_MASK) != PS_SOLID) &&
336  ((dwPenStyle & PS_STYLE_MASK) != PS_INSIDEFRAME) &&
337  ((dwPenStyle & PS_STYLE_MASK) != PS_USERSTYLE))
338  {
339  if (dwWidth == 0)
340  {
341  return FALSE;
342  }
343  }
344 
345  if (lbStyle == BS_NULL)
346  {
347  pelpExpect->elpPenStyle = PS_NULL;
348  pelpExpect->elpWidth = 0;
349  pelpExpect->elpBrushStyle = BS_SOLID;
350  pelpExpect->elpColor = 0;
351  pelpExpect->elpHatch = 0;
352  pelpExpect->elpNumEntries = 0;
353  return TRUE;
354  }
355 
356  if (lbStyle > BS_HATCHED)
357  {
358  return FALSE;
359  }
360 
361  if (lbStyle == BS_HATCHED)
362  {
363  if (lbHatch >= HS_API_MAX)
364  {
365  return FALSE;
366  }
367  }
368 
369  }
370 
371  pelpExpect->elpPenStyle = dwPenStyle;
372  pelpExpect->elpWidth = dwWidth;
373  pelpExpect->elpBrushStyle = lbStyle;
374  pelpExpect->elpColor = RGB(1,2,3);
375  pelpExpect->elpHatch = lbHatch;
376  pelpExpect->elpNumEntries = dwStyleCount;
377  //pelpExpect->elpStyleEntry[1];
378 
379  return TRUE;
380 }
381 
382 void
384  DWORD dwPenStyle,
385  DWORD dwWidth,
386  DWORD dwStyleCount,
387  PDWORD pdwStyles,
388  UINT lbStyle,
389  ULONG_PTR lbHatch)
390 {
391  LOGBRUSH lb;
392  HPEN hpen;
393  BOOL bExpectSuccess, bExpectException, bGotException = FALSE;
394  struct
395  {
396  EXTLOGPEN extlogpen;
397  ULONG styles[16];
398  } elpBuffer;
399  PEXTLOGPEN pelp = &elpBuffer.extlogpen;
400  EXTLOGPEN elpExpect;
401 
402  lb.lbStyle = lbStyle;
403  lb.lbColor = RGB(1,2,3);
404  lb.lbHatch = lbHatch;
405 
406  bExpectSuccess = Test_ExtCreatePen_Expect(
407  dwPenStyle,
408  dwWidth,
409  dwStyleCount,
410  pdwStyles,
411  lbStyle,
412  lbHatch,
413  &bExpectException,
414  &elpExpect);
415 
416  _SEH2_TRY
417  {
418  hpen = ExtCreatePen(dwPenStyle, dwWidth, &lb, dwStyleCount, pdwStyles);
419  }
421  {
422  bGotException = TRUE;
423  }
424  _SEH2_END;
425 
426 #define ok2(expression, text, expected, got) \
427  ok(expression, text \
428  "(dwPenStyle=0x%lx, dwWidth=%lu, dwStyleCount=%lu, pdwStyles=%p, lbStyle=%u, lbHatch=%p)\n", \
429  expected, got, dwPenStyle, dwWidth, dwStyleCount, pdwStyles, lbStyle, (PVOID)lbHatch);
430 
431  //ok(bGotException == bExpectException, "ExtCreatePen expected exception=%lu for "
432  // "dwPenStyle=0x%lx, dwWidth=%lu, dwStyleCount=%lu, pdwStyles=%p, lbStyle=%lu, lbHatch=%p\n",
433  // bExpectException, dwPenStyle, dwWidth, dwStyleCount, pdwStyles, lbStyle, (PVOID)lbHatch);
434 
435  ok2(bGotException == bExpectException, "ExtCreatePen expception, expected %u, got %u", bExpectException, bGotException);
436 
437  if (!bExpectSuccess)
438  {
439  ok(hpen == NULL, "ExtCreatePen should fail for "
440  "dwPenStyle=0x%lx, dwWidth=%lu, dwStyleCount=%lu, pdwStyles=%p, lbStyle=%u, lbHatch=%p\n",
441  dwPenStyle, dwWidth, dwStyleCount, pdwStyles, lbStyle, (PVOID)lbHatch);
442  }
443  else
444  {
445  ok(hpen != NULL, "ExtCreatePen failed for "
446  "dwPenStyle=0x%lx, dwWidth=%lu, dwStyleCount=%lu, pdwStyles=%p, lbStyle=%u, lbHatch=%p\n",
447  dwPenStyle, dwWidth, dwStyleCount, pdwStyles, lbStyle, (PVOID)lbHatch);
448  if (hpen != NULL)
449  {
450  if (GetObjectA(hpen, sizeof(elpBuffer), pelp) < sizeof(EXTLOGPEN))
451  {
452  if (!GetObjectA(hpen, sizeof(EXTLOGPEN), pelp))
453  {
454  ok(0, "failed again?\n");
455  return;
456  }
457  }
458 
459  ok2(pelp->elpPenStyle == elpExpect.elpPenStyle, "elpPenStyle, expected 0x%lx, got 0x%lx\n", elpExpect.elpPenStyle, pelp->elpPenStyle);
460  ok2(pelp->elpWidth == elpExpect.elpWidth, "elpWidth, expected 0x%lx, got 0x%lx\n", elpExpect.elpWidth, pelp->elpWidth);
461  ok2(pelp->elpBrushStyle == elpExpect.elpBrushStyle, "elpBrushStyle, expected 0x%x, got 0x%x\n", elpExpect.elpBrushStyle, pelp->elpBrushStyle);
462  ok2(pelp->elpColor == elpExpect.elpColor, "elpColor, expected 0x%lx, got 0x%lx\n", elpExpect.elpColor, pelp->elpColor);
463  ok2(pelp->elpHatch == elpExpect.elpHatch, "elpHatch, expected 0x%lx, got 0x%lx\n", elpExpect.elpHatch, pelp->elpHatch);
464  ok2(pelp->elpNumEntries == elpExpect.elpNumEntries, "elpNumEntries, expected 0x%lx, got 0x%lx\n", elpExpect.elpNumEntries, pelp->elpNumEntries);
465  //for (i = 0; i < pelp->elpNumEntries; i++)
466  //{
467  // ok2(pelp->elpStyleEntry[i] == elpExpect.elpStyleEntry[i], "elpHatch, expected 0x%lx, got 0x%lx\n", elpExpect.elpStyleEntry[i], pelp->elpStyleEntry[i]);
468  //}
469  }
470  }
471 
472 }
473 
475 {
476  ULONG aflPenType[] = {PS_COSMETIC, PS_GEOMETRIC, 0x20000};
477  ULONG iType, iStyle, iEndCap, iJoin, iWidth, iStyleCount, iStyles, iBrushStyle, iHatch;
478  DWORD adwStyles[17] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
479  DWORD adwStyles2[17] = {0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
480 
481  printf("adwStyles=%p, adwStyles2=%p\n", adwStyles, adwStyles2);
482 
483  //for (iType = 0; iType < sizeof(aflPenType) / sizeof(aflPenType[0]); iType++)
484  for (iType = 0; iType < 3; iType++)
485  {
487  //for (iStyle = 0; iStyle < sizeof(aflPenStyle) / sizeof(aflPenStyle[0]); iStyle++)
488  for (iStyle = 0; iStyle < 10; iStyle++)
489  {
490  ULONG aflEndCap[] = {PS_ENDCAP_ROUND, PS_ENDCAP_SQUARE, PS_ENDCAP_FLAT, 0x300, 0x400};
491  for (iEndCap = 0; iEndCap < sizeof(aflEndCap) / sizeof(aflEndCap[0]); iEndCap++)
492  {
493  ULONG aflJoin[] = {PS_JOIN_ROUND, PS_JOIN_BEVEL, PS_JOIN_MITER, 0x3000, 0x4000};
494  for (iJoin = 0; iJoin < sizeof(aflJoin) / sizeof(aflJoin[0]); iJoin++)
495  {
496  DWORD adwWidth[] = {0, 1, 2};
497  ULONG flPenStyle = aflPenType[iType] | aflPenStyle[iStyle] | aflEndCap[iEndCap] | aflJoin[iJoin];
498 
499  for (iWidth = 0; iWidth < sizeof(adwWidth) / sizeof(adwWidth[0]); iWidth++)
500  {
501  ULONG adwStyleCount[] = {0, 1, 2, 16, 17};
502  for (iStyleCount = 0; iStyleCount < sizeof(adwStyleCount) / sizeof(adwStyleCount[0]); iStyleCount++)
503  {
504  PULONG apdwStyles[] = {NULL, adwStyles, adwStyles2};
505  for (iStyles = 0; iStyles < sizeof(apdwStyles) / sizeof(apdwStyles[0]); iStyles++)
506  {
507  UINT albStyle[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
508  for (iBrushStyle = 0; iBrushStyle < sizeof(albStyle) / sizeof(albStyle[0]); iBrushStyle++)
509  {
510  ULONG_PTR alHatch[] = {0, 1, 6, 7, 8, 9, 10, 11, 12, 13};
511 
512  for (iHatch = 0; iHatch < sizeof(alHatch) / sizeof(alHatch[0]); iHatch++)
513  {
514  Test_ExtCreatePen_Helper(flPenStyle,
515  adwWidth[iWidth],
516  adwStyleCount[iStyleCount],
517  apdwStyles[iStyles],
518  albStyle[iBrushStyle],
519  alHatch[iHatch]);
520  }
521  }
522  }
523  }
524  }
525  }
526  }
527  }
528  }
529 
530 }
531 
533 {
535  //Test_ExtCreatePen_Params2();
536 }
537 
HGDIOBJ WINAPI GetStockObject(_In_ int)
DWORD *typedef PVOID
Definition: winlogon.h:52
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
COLORREF elpColor
Definition: wingdi.h:1922
#define abs(i)
Definition: fconv.c:206
#define BS_DIBPATTERN
Definition: wingdi.h:1073
#define PS_ENDCAP_SQUARE
Definition: wingdi.h:593
#define TRUE
Definition: types.h:120
DWORD elpWidth
Definition: wingdi.h:1920
UINT lbStyle
Definition: wingdi.h:1724
#define PS_STYLE_MASK
Definition: wingdi.h:599
#define ok_elp(hPen, elp, pstyle, width, bstyle, color, hatch, cstyle)
Definition: ExtCreatePen.c:13
_In_ ULONG iType
Definition: winddi.h:3748
ULONG_PTR lbHatch
Definition: wingdi.h:1726
void Test_ExtCreatePen_Params()
Definition: ExtCreatePen.c:22
void Test_ExtCreatePen_Params2()
Definition: ExtCreatePen.c:474
#define PS_JOIN_BEVEL
Definition: wingdi.h:595
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define PS_JOIN_MITER
Definition: wingdi.h:596
static HPEN hpen
#define PS_GEOMETRIC
Definition: wingdi.h:581
ULONG_PTR elpHatch
Definition: wingdi.h:1923
DWORD DWORD
Definition: winlogon.h:75
#define BS_NULL
Definition: wingdi.h:1068
#define GDI_OBJECT_TYPE_EXTPEN
Definition: gdi.h:55
DWORD elpNumEntries
Definition: wingdi.h:1924
_SEH2_TRY
Definition: create.c:4250
uint32_t ULONG_PTR
Definition: typedefs.h:63
BOOL bGotException
#define PS_SOLID
Definition: wingdi.h:584
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
DWORD elpPenStyle
Definition: wingdi.h:1919
#define NULL_PEN
Definition: wingdi.h:902
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define PS_ENDCAP_ROUND
Definition: wingdi.h:592
BOOL * PBOOL
Definition: windef.h:161
#define ok_lasterror(err)
Definition: ExtCreatePen.c:10
#define HS_API_MAX
Definition: wingdi.h:580
#define PS_COSMETIC
Definition: wingdi.h:582
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define ok(value,...)
Definition: CComObject.cpp:34
#define PS_ALTERNATE
Definition: wingdi.h:583
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PS_JOIN_ROUND
Definition: wingdi.h:597
#define RGB(r, g, b)
Definition: wingdi.h:2917
COLORREF lbColor
Definition: wingdi.h:1725
#define SetLastError(x)
Definition: compat.h:409
void Test_ExtCreatePen_Helper(DWORD dwPenStyle, DWORD dwWidth, DWORD dwStyleCount, PDWORD pdwStyles, UINT lbStyle, ULONG_PTR lbHatch)
Definition: ExtCreatePen.c:383
START_TEST(ExtCreatePen)
Definition: ExtCreatePen.c:532
#define PS_DASH
Definition: wingdi.h:585
_Inout_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ XLATEOBJ _In_ ULONG iHatch
Definition: winddi.h:3959
#define PS_INSIDEFRAME
Definition: wingdi.h:591
_SEH2_END
Definition: create.c:4424
#define PS_TYPE_MASK
Definition: wingdi.h:601
UINT elpBrushStyle
Definition: wingdi.h:1921
#define PS_ENDCAP_FLAT
Definition: wingdi.h:594
#define PS_ENDCAP_MASK
Definition: wingdi.h:600
#define PS_JOIN_MASK
Definition: wingdi.h:598
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
#define PS_NULL
Definition: wingdi.h:589
#define PS_DASHDOTDOT
Definition: wingdi.h:588
#define PS_DASHDOT
Definition: wingdi.h:587
DWORD * PDWORD
Definition: pedump.c:68
#define BS_PATTERN
Definition: wingdi.h:1071
#define PS_DOT
Definition: wingdi.h:586
#define ok2(expression, text, expected, got)
unsigned int ULONG
Definition: retypes.h:1
BOOL Test_ExtCreatePen_Expect(DWORD dwPenStyle, DWORD dwWidth, DWORD dwStyleCount, PDWORD pdwStyles, UINT lbStyle, ULONG_PTR lbHatch, PBOOL pbExpectException, PEXTLOGPEN pelpExpect)
Definition: ExtCreatePen.c:204
int int iWidth
Definition: wglext.h:519
HPEN WINAPI ExtCreatePen(_In_ DWORD iPenStyle, _In_ DWORD cWidth, _In_ const LOGBRUSH *plbrush, _In_ DWORD cStyle, _In_reads_opt_(cStyle) const DWORD *pstyle)
#define BS_HATCHED
Definition: wingdi.h:1070
#define BS_SOLID
Definition: wingdi.h:1067
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define BS_DIBPATTERNPT
Definition: wingdi.h:1074
#define PS_USERSTYLE
Definition: wingdi.h:590
static const WCHAR dwWidth[]
Definition: provider.c:59
#define printf
Definition: config.h:203