ReactOS 0.4.15-dev-7834-g00c4b3d
NtGdiPolyPolyDraw.c File Reference
#include "../win32nt.h"
Include dependency graph for NtGdiPolyPolyDraw.c:

Go to the source code of this file.

Functions

static void Test_Params (void)
 
 START_TEST (NtGdiPolyPolyDraw)
 

Function Documentation

◆ START_TEST()

START_TEST ( NtGdiPolyPolyDraw  )

Definition at line 207 of file NtGdiPolyPolyDraw.c.

208{
209 Test_Params();
210
211}
static void Test_Params(void)

◆ Test_Params()

static void Test_Params ( void  )
static

Definition at line 13 of file NtGdiPolyPolyDraw.c.

14{
16 ULONG Count1[4] = {3, 2, 4, 3};
17 ULONG Count2[2] = {0, 3};
18 ULONG Count3[2] = {0, 0};
19 ULONG Count4[2] = {1, 3};
20 ULONG Count5[2] = {0x80000001, 0x80000001};
21 POINT Points[6] = {{0,0}, {1,1}, {3,-3}, {-2,2}, {4,2}, {2,4}};
22 HDC hDC;
23
24 SetLastError(0);
26 TEST(ret == 0);
27 TEST(GetLastError() == 0);
28
29 SetLastError(0);
31 TEST(ret == 0);
32 TEST(GetLastError() == 0);
33
34 SetLastError(0);
36 TEST(ret == 0);
37 TEST(GetLastError() == 0);
38
39 SetLastError(0);
41 TEST(ret == 0);
42 TEST(GetLastError() == 0);
43
44 SetLastError(0);
46 TEST(ret == 0);
47 TEST(GetLastError() == 0);
48
49 SetLastError(0);
51 TEST(ret == 0);
52 TEST(GetLastError() == 0);
53
54 SetLastError(0);
56 TEST(ret == 0);
57 TEST(GetLastError() == 0);
58
60
61 /* Test with an invalid DC */
62
63 SetLastError(0);
64 ret = NtGdiPolyPolyDraw(0, Points, Count1, 2, 1);
65 TEST(ret == 0);
67
68 hDC = (HDC)0x12345;
69
70 SetLastError(0);
71 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 0);
72 TEST(ret == 0);
73 TEST(GetLastError() == 0);
74
75 SetLastError(0);
76 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 1);
77 TEST(ret == 0);
79
80 SetLastError(0);
81 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 2);
82 TEST(ret == 0);
84
85 SetLastError(0xdeadbeef);
86 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 3);
87 TEST(ret == 0);
88 ok_long(GetLastError(), 0xdeadbeef);
89
90 SetLastError(0xdeadbeef);
91 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 4);
92 TEST(ret == 0);
93 ok_long(GetLastError(), 0xdeadbeef);
94
95 SetLastError(0xdeadbeef);
96 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 5);
97 TEST(ret == 0);
98 ok_long(GetLastError(), 0xdeadbeef);
99
100 SetLastError(0);
101 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 6);
102 TEST(ret == 0);
103 TEST(GetLastError() == 0);
104
105 SetLastError(0);
106 ret = NtGdiPolyPolyDraw((HDC)1, Points, Count1, 1, 6);
108 TEST(GetLastError() == 0);
109
110 SetLastError(0);
111 ret = NtGdiPolyPolyDraw((HDC)0, Points, Count1, 1, 6);
112 TEST(ret == 0);
113 TEST(GetLastError() == 0);
114
115 SetLastError(0);
116 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 0, 1);
117 TEST(ret == 0);
118 TEST(GetLastError() == 0);
119
120 SetLastError(0);
121 ret = NtGdiPolyPolyDraw(hDC, Points, Count2, 2, 1);
122 TEST(ret == 0);
124
125 SetLastError(0);
126 ret = NtGdiPolyPolyDraw(hDC, Points, NULL, 2, 1);
127 TEST(ret == 0);
128 TEST(GetLastError() == 0);
129
130 SetLastError(0);
131 ret = NtGdiPolyPolyDraw(hDC, Points, (PVOID)(LONG_PTR)0x81000000, 2, 1);
132 TEST(ret == 0);
133 TEST(GetLastError() == 0);
134
135 SetLastError(0);
136 ret = NtGdiPolyPolyDraw(hDC, NULL, Count1, 2, 1);
137 TEST(ret == 0);
138 TEST(GetLastError() == 0);
139
140 SetLastError(0);
141 ret = NtGdiPolyPolyDraw(hDC, (PVOID)(LONG_PTR)0x81000000, Count1, 2, 1);
142 TEST(ret == 0);
143 TEST(GetLastError() == 0);
144
145
147
148 /* Test with a valid DC */
149
151 ASSERT(hDC);
152
153 SetLastError(0);
154 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 0);
155 TEST(ret == 0);
156 TEST(GetLastError() == 0);
157
158 SetLastError(0);
159 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 1);
160 TEST(ret == 1);
161 TEST(GetLastError() == 0);
162
163 SetLastError(0);
164 ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 2);
165 TEST(ret == 1);
166 TEST(GetLastError() == 0);
167
168#if 0
169 SetLastError(0);
170 // better don't do this on win xp!!! (random crashes)
171// ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 3);
172 TEST(ret == 0);
174
175 SetLastError(0);
176 // better don't do this on win xp!!! (random crashes)
177// ret = NtGdiPolyPolyDraw(hDC, Points, Count1, 2, 4);
178 TEST(ret == 0);
180
181#endif
182
183 SetLastError(0);
184 ret = NtGdiPolyPolyDraw(hDC, Points, Count2, 2, 1);
185 TEST(ret == 0);
187
188 SetLastError(0);
189 ret = NtGdiPolyPolyDraw(hDC, Points, Count3, 2, 1);
190 TEST(ret == 0);
191 TEST(GetLastError() == 0);
192
193 SetLastError(0);
194 ret = NtGdiPolyPolyDraw(hDC, Points, Count4, 2, 1);
195 TEST(ret == 0);
197
198 SetLastError(0);
199 ret = NtGdiPolyPolyDraw(hDC, Points, Count5, 2, 1);
200 TEST(ret == 0);
201 TEST(GetLastError() == 87);
202
203}
static HDC hDC
Definition: 3dtext.c:33
#define ok_long(expression, result)
Definition: atltest.h:133
#define NULL
Definition: types.h:112
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define GDI_OBJECT_TYPE_REGION
Definition: gdi.h:47
#define GDI_HANDLE_BASETYPE_MASK
Definition: gdi.h:18
#define ASSERT(a)
Definition: mode.c:44
#define TEST(x)
Definition: precomp.h:20
static HDC
Definition: imagelist.c:92
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
__kernel_entry W32KAPI ULONG_PTR APIENTRY NtGdiPolyPolyDraw(_In_ HDC hdc, _In_ PPOINT ppt, _In_reads_(ccpt) PULONG pcpt, _In_ ULONG ccpt, _In_ INT iFunc)
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)

Referenced by START_TEST().