[GDI32_APITEST]
[reactos.git] / rostests / apitests / gdi32 / SetDIBitsToDevice.c
1 /*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for SetDIBitsToDevice
5 * PROGRAMMERS: Timo Kreuzer
6 */
7
8 #include <apitest.h>
9
10 #include <wingdi.h>
11 #include "init.h"
12
13 static void
14 Test_SetDIBitsToDevice_Params()
15 {
16 UCHAR ajBmiBuffer[sizeof(BITMAPINFO) + 4];
17 PBITMAPINFO pbmi = (PBITMAPINFO)ajBmiBuffer;
18 ULONG aulBits[16];
19 INT ret;
20
21 /* Setup the bitmap info */
22 pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
23 pbmi->bmiHeader.biWidth = 2;
24 pbmi->bmiHeader.biHeight = -4;
25 pbmi->bmiHeader.biPlanes = 1;
26 pbmi->bmiHeader.biBitCount = 32;
27 pbmi->bmiHeader.biCompression = BI_RGB;
28 pbmi->bmiHeader.biSizeImage = 0;
29 pbmi->bmiHeader.biXPelsPerMeter = 0;
30 pbmi->bmiHeader.biYPelsPerMeter = 0;
31 pbmi->bmiHeader.biClrUsed = 0;
32 pbmi->bmiHeader.biClrImportant = 0;
33
34 /* Test a normal operation */
35 SetLastError(0xdeadc0de);
36 ret = SetDIBitsToDevice(ghdcDIB32,
37 0, // XDest,
38 0, // YDest,
39 2, // dwWidth,
40 2, // dwHeight,
41 0, // XSrc,
42 0, // YSrc,
43 0, // uStartScan,
44 2, // cScanLines,
45 aulBits, // lpvBits,
46 pbmi,
47 DIB_RGB_COLORS);
48 ok_dec(ret, 2);
49 ok_err(0xdeadc0de);
50
51 /* Test hdc == NULL */
52 SetLastError(0xdeadc0de);
53 ret = SetDIBitsToDevice(NULL,
54 0, // XDest,
55 0, // YDest,
56 2, // dwWidth,
57 2, // dwHeight,
58 0, // XSrc,
59 0, // YSrc,
60 0, // uStartScan,
61 2, // cScanLines,
62 aulBits, // lpvBits,
63 pbmi,
64 DIB_RGB_COLORS);
65 ok_dec(ret, 0);
66 ok_err(ERROR_INVALID_HANDLE);
67
68 /* Test truncated hdc */
69 SetLastError(0xdeadc0de);
70 ret = SetDIBitsToDevice((HDC)((ULONG_PTR)ghdcDIB32 & 0xFFFF),
71 0, // XDest,
72 0, // YDest,
73 2, // dwWidth,
74 2, // dwHeight,
75 0, // XSrc,
76 0, // YSrc,
77 0, // uStartScan,
78 2, // cScanLines,
79 aulBits, // lpvBits,
80 pbmi,
81 DIB_RGB_COLORS);
82 ok_dec(ret, 0);
83 ok_err(ERROR_INVALID_HANDLE);
84
85 /* Test invalid ColorUse */
86 SetLastError(0xdeadc0de);
87 ret = SetDIBitsToDevice(ghdcDIB32,
88 0, // XDest,
89 0, // YDest,
90 2, // dwWidth,
91 2, // dwHeight,
92 0, // XSrc,
93 0, // YSrc,
94 0, // uStartScan,
95 2, // cScanLines,
96 aulBits, // lpvBits,
97 pbmi,
98 7);
99 ok_dec(ret, 0);
100 ok_err(0xdeadc0de);
101
102 /* test unaligned buffer */
103 SetLastError(0xdeadc0de);
104 ret = SetDIBitsToDevice(ghdcDIB32,
105 0, // XDest,
106 0, // YDest,
107 2, // dwWidth,
108 2, // dwHeight,
109 0, // XSrc,
110 0, // YSrc,
111 0, // uStartScan,
112 2, // cScanLines,
113 (BYTE*)aulBits + 1, // lpvBits,
114 pbmi,
115 DIB_RGB_COLORS);
116 ok_dec(ret, 2);
117 ok_err(0xdeadc0de);
118
119 /* test unaligned and huge scanline buffer */
120 SetLastError(0xdeadc0de);
121 ret = SetDIBitsToDevice(ghdcDIB32,
122 0, // XDest,
123 0, // YDest,
124 2, // dwWidth,
125 2, // dwHeight,
126 0, // XSrc,
127 0, // YSrc,
128 0, // uStartScan,
129 20000000, // cScanLines,
130 (BYTE*)aulBits + 1, // lpvBits,
131 pbmi,
132 DIB_RGB_COLORS);
133 todo_ros ok_dec(ret, 0);
134 ok_err(0xdeadc0de);
135
136 /* test unaligned illegal buffer */
137 SetLastError(0xdeadc0de);
138 ret = SetDIBitsToDevice(ghdcDIB32,
139 0, // XDest,
140 0, // YDest,
141 2, // dwWidth,
142 2, // dwHeight,
143 0, // XSrc,
144 0, // YSrc,
145 0, // uStartScan,
146 2, // cScanLines,
147 (BYTE*)0x7fffffff, // lpvBits,
148 pbmi,
149 DIB_RGB_COLORS);
150 todo_ros ok_dec(ret, 0);
151 ok_err(0xdeadc0de);
152
153 /* Test negative XDest */
154 SetLastError(0xdeadc0de);
155 ret = SetDIBitsToDevice(ghdcDIB32,
156 -100, // XDest,
157 0, // YDest,
158 2, // dwWidth,
159 2, // dwHeight,
160 0, // XSrc,
161 0, // YSrc,
162 0, // uStartScan,
163 2, // cScanLines,
164 aulBits, // lpvBits,
165 pbmi,
166 DIB_RGB_COLORS);
167 ok_dec(ret, 2);
168 ok_err(0xdeadc0de);
169
170 /* Test huge XDest */
171 SetLastError(0xdeadc0de);
172 ret = SetDIBitsToDevice(ghdcDIB32,
173 LONG_MAX, // XDest,
174 0, // YDest,
175 2, // dwWidth,
176 2, // dwHeight,
177 0, // XSrc,
178 0, // YSrc,
179 0, // uStartScan,
180 2, // cScanLines,
181 aulBits, // lpvBits,
182 pbmi,
183 DIB_RGB_COLORS);
184 ok_dec(ret, 2);
185 ok_err(0xdeadc0de);
186
187 /* Test XSrc outside of the DIB */
188 SetLastError(0xdeadc0de);
189 ret = SetDIBitsToDevice(ghdcDIB32,
190 0, // XDest,
191 0, // YDest,
192 2, // dwWidth,
193 2, // dwHeight,
194 100, // XSrc,
195 0, // YSrc,
196 0, // uStartScan,
197 2, // cScanLines,
198 aulBits, // lpvBits,
199 pbmi,
200 DIB_RGB_COLORS);
201 ok_dec(ret, 2);
202 ok_err(0xdeadc0de);
203
204 /* Test YSrc outside of the DIB */
205 SetLastError(0xdeadc0de);
206 ret = SetDIBitsToDevice(ghdcDIB32,
207 0, // XDest,
208 0, // YDest,
209 2, // dwWidth,
210 2, // dwHeight,
211 0, // XSrc,
212 100, // YSrc,
213 0, // uStartScan,
214 2, // cScanLines,
215 aulBits, // lpvBits,
216 pbmi,
217 DIB_RGB_COLORS);
218 ok_dec(ret, 2);
219 ok_err(0xdeadc0de);
220
221 /* Test uStartScan outside of the DIB */
222 SetLastError(0xdeadc0de);
223 ret = SetDIBitsToDevice(ghdcDIB32,
224 0, // XDest,
225 0, // YDest,
226 2, // dwWidth,
227 2, // dwHeight,
228 0, // XSrc,
229 0, // YSrc,
230 100, // uStartScan,
231 5, // cScanLines,
232 aulBits, // lpvBits,
233 pbmi,
234 DIB_RGB_COLORS);
235 ok_dec(ret, 5);
236 ok_err(0xdeadc0de);
237
238 /* Test cScanLines larger than the DIB */
239 SetLastError(0xdeadc0de);
240 ret = SetDIBitsToDevice(ghdcDIB32,
241 0, // XDest,
242 0, // YDest,
243 2, // dwWidth,
244 2, // dwHeight,
245 0, // XSrc,
246 0, // YSrc,
247 0, // uStartScan,
248 7, // cScanLines,
249 aulBits, // lpvBits,
250 pbmi,
251 DIB_RGB_COLORS);
252 todo_ros ok_dec(ret, 7);
253 ok_err(0xdeadc0de);
254
255 /* Test large cScanlines */
256 SetLastError(0xdeadc0de);
257 ret = SetDIBitsToDevice(ghdcDIB32,
258 0, // XDest,
259 0, // YDest,
260 2, // dwWidth,
261 2, // dwHeight,
262 0, // XSrc,
263 0, // YSrc,
264 0, // uStartScan,
265 2000, // cScanLines,
266 aulBits, // lpvBits,
267 pbmi,
268 DIB_RGB_COLORS);
269 todo_ros ok_dec(ret, 0);
270 ok_err(0xdeadc0de);
271
272 /* Test uStartScan and cScanLines larger than the DIB */
273 SetLastError(0xdeadc0de);
274 ret = SetDIBitsToDevice(ghdcDIB32,
275 0, // XDest,
276 0, // YDest,
277 2, // dwWidth,
278 2, // dwHeight,
279 0, // XSrc,
280 0, // YSrc,
281 100, // uStartScan,
282 7, // cScanLines,
283 aulBits, // lpvBits,
284 pbmi,
285 DIB_RGB_COLORS);
286 ok_dec(ret, 7);
287 ok_err(0xdeadc0de);
288
289 /* Test lpvBits == NULL */
290 SetLastError(0xdeadc0de);
291 ret = SetDIBitsToDevice(ghdcDIB32,
292 0, // XDest,
293 0, // YDest,
294 2, // dwWidth,
295 2, // dwHeight,
296 0, // XSrc,
297 0, // YSrc,
298 0, // uStartScan,
299 2, // cScanLines,
300 NULL, // lpvBits,
301 pbmi,
302 DIB_RGB_COLORS);
303 ok_dec(ret, 0);
304 ok_err(0xdeadc0de);
305
306 /* Test pbmi == NULL */
307 SetLastError(0xdeadc0de);
308 ret = SetDIBitsToDevice(ghdcDIB32,
309 0, // XDest,
310 0, // YDest,
311 2, // dwWidth,
312 2, // dwHeight,
313 0, // XSrc,
314 0, // YSrc,
315 0, // uStartScan,
316 2, // cScanLines,
317 aulBits, // lpvBits,
318 NULL,
319 DIB_RGB_COLORS);
320 ok_dec(ret, 0);
321 ok_err(0xdeadc0de);
322
323 /* Test huge positive DIB height, result is limited to dwHeight */
324 pbmi->bmiHeader.biHeight = 10000;
325 SetLastError(0xdeadc0de);
326 ret = SetDIBitsToDevice(ghdcDIB32,
327 0, // XDest,
328 1, // YDest,
329 2, // dwWidth,
330 3, // dwHeight,
331 0, // XSrc,
332 1, // YSrc,
333 0, // uStartScan,
334 7, // cScanLines,
335 aulBits, // lpvBits,
336 pbmi,
337 DIB_RGB_COLORS);
338 ok_dec(ret, 4);
339 ok_err(0xdeadc0de);
340
341 /* Test huge negative DIB height */
342 pbmi->bmiHeader.biHeight = -10000;
343 SetLastError(0xdeadc0de);
344 ret = SetDIBitsToDevice(ghdcDIB32,
345 0, // XDest,
346 0, // YDest,
347 2, // dwWidth,
348 2, // dwHeight,
349 0, // XSrc,
350 0, // YSrc,
351 0, // uStartScan,
352 7, // cScanLines,
353 aulBits, // lpvBits,
354 pbmi,
355 DIB_RGB_COLORS);
356 ok_dec(ret, 7);
357 ok_err(0xdeadc0de);
358
359 /* Test what happens when we cause an integer overflow */
360 pbmi->bmiHeader.biHeight = LONG_MIN;
361 SetLastError(0xdeadc0de);
362 ret = SetDIBitsToDevice(ghdcDIB32,
363 0, // XDest,
364 0, // YDest,
365 2, // dwWidth,
366 2, // dwHeight,
367 0, // XSrc,
368 0, // YSrc,
369 0, // uStartScan,
370 2, // cScanLines,
371 aulBits, // lpvBits,
372 pbmi,
373 DIB_RGB_COLORS);
374 ok_dec(ret, 2);
375 ok_err(0xdeadc0de);
376
377 /* Now also test a huge value of uStartScan */
378 SetLastError(0xdeadc0de);
379 ret = SetDIBitsToDevice(ghdcDIB32,
380 0, // XDest,
381 0, // YDest,
382 2, // dwWidth,
383 2, // dwHeight,
384 0, // XSrc,
385 0, // YSrc,
386 abs(pbmi->bmiHeader.biHeight) - 3, // uStartScan,
387 9, // cScanLines,
388 aulBits, // lpvBits,
389 pbmi,
390 DIB_RGB_COLORS);
391 ok_dec(ret, 3);
392 ok_err(0xdeadc0de);
393
394 /* Now also test a huge value of uStartScan */
395 pbmi->bmiHeader.biHeight = LONG_MIN + 1;
396 SetLastError(0xdeadc0de);
397 ret = SetDIBitsToDevice(ghdcDIB32,
398 0, // XDest,
399 0, // YDest,
400 2, // dwWidth,
401 2, // dwHeight,
402 0, // XSrc,
403 0, // YSrc,
404 abs(pbmi->bmiHeader.biHeight) - 3, // uStartScan,
405 9, // cScanLines,
406 aulBits, // lpvBits,
407 pbmi,
408 DIB_RGB_COLORS);
409 ok_dec(ret, 5);
410 ok_err(0xdeadc0de);
411
412 /* Now also test a huge value of uStartScan */
413 pbmi->bmiHeader.biHeight = LONG_MIN + 7;
414 SetLastError(0xdeadc0de);
415 ret = SetDIBitsToDevice(ghdcDIB32,
416 0, // XDest,
417 0, // YDest,
418 2, // dwWidth,
419 2, // dwHeight,
420 0, // XSrc,
421 0, // YSrc,
422 abs(pbmi->bmiHeader.biHeight) - 3, // uStartScan,
423 32, // cScanLines,
424 aulBits, // lpvBits,
425 pbmi,
426 DIB_RGB_COLORS);
427 ok_dec(ret, 17);
428 ok_err(0xdeadc0de);
429
430 /* Test invalid bitmap info header */
431 pbmi->bmiHeader.biSize = 0;
432 SetLastError(0xdeadc0de);
433 ret = SetDIBitsToDevice(ghdcDIB32,
434 0, // XDest,
435 0, // YDest,
436 2, // dwWidth,
437 2, // dwHeight,
438 0, // XSrc,
439 0, // YSrc,
440 0, // uStartScan,
441 2, // cScanLines,
442 aulBits, // lpvBits,
443 pbmi,
444 DIB_RGB_COLORS);
445 ok_dec(ret, 0);
446 ok_err(0xdeadc0de);
447
448 }
449
450
451 static void
452 Test_SetDIBitsToDevice()
453 {
454 UCHAR ajBmiBuffer[sizeof(BITMAPINFO) + 4];
455 PBITMAPINFO pbmi = (PBITMAPINFO)ajBmiBuffer;
456 ULONG aulBits[16];
457 INT ret;
458
459 /* Setup the bitmap info */
460 pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
461 pbmi->bmiHeader.biWidth = 2;
462 pbmi->bmiHeader.biHeight = -2;
463 pbmi->bmiHeader.biPlanes = 1;
464 pbmi->bmiHeader.biBitCount = 32;
465 pbmi->bmiHeader.biCompression = BI_RGB;
466 pbmi->bmiHeader.biSizeImage = 0;
467 pbmi->bmiHeader.biXPelsPerMeter = 0;
468 pbmi->bmiHeader.biYPelsPerMeter = 0;
469 pbmi->bmiHeader.biClrUsed = 0;
470 pbmi->bmiHeader.biClrImportant = 0;
471
472 /* Set pixels */
473 aulBits[0] = 0x11000000;
474 aulBits[1] = 0x00000011;
475 aulBits[2] = 0xFF000000;
476 aulBits[3] = 0x000000FF;
477
478
479 memset(pulDIB32Bits, 0, 4 * 4 * sizeof(ULONG));
480 ret = SetDIBitsToDevice(ghdcDIB32,
481 0, // XDest,
482 0, // YDest,
483 2, // dwWidth,
484 2, // dwHeight,
485 0, // XSrc,
486 0, // YSrc,
487 0, // uStartScan,
488 2, // cScanLines,
489 aulBits, // lpvBits,
490 pbmi,
491 DIB_RGB_COLORS);
492
493 ok_dec(ret, 2);
494 ok_hex(pulDIB32Bits[0], 0x11000000);
495 ok_hex(pulDIB32Bits[1], 0x00000011);
496 ok_hex(pulDIB32Bits[2], 0x00000000);
497 ok_hex(pulDIB32Bits[3], 0x00000000);
498 ok_hex(pulDIB32Bits[4], 0xFF000000);
499 ok_hex(pulDIB32Bits[5], 0x000000FF);
500 ok_hex(pulDIB32Bits[6], 0x00000000);
501 ok_hex(pulDIB32Bits[7], 0x00000000);
502
503 memset(pulDIB32Bits, 0, 4 * 4 * sizeof(ULONG));
504 ret = SetDIBitsToDevice(ghdcDIB32,
505 0, // XDest,
506 1, // YDest,
507 2, // dwWidth,
508 2, // dwHeight,
509 0, // XSrc,
510 0, // YSrc,
511 0, // uStartScan,
512 2, // cScanLines,
513 aulBits, // lpvBits,
514 pbmi,
515 DIB_RGB_COLORS);
516
517 ok_dec(ret, 2);
518 ok_hex(pulDIB32Bits[0], 0x00000000);
519 ok_hex(pulDIB32Bits[1], 0x00000000);
520 ok_hex(pulDIB32Bits[2], 0x00000000);
521 ok_hex(pulDIB32Bits[3], 0x00000000);
522 ok_hex(pulDIB32Bits[4], 0x11000000);
523 ok_hex(pulDIB32Bits[5], 0x00000011);
524 ok_hex(pulDIB32Bits[6], 0x00000000);
525 ok_hex(pulDIB32Bits[7], 0x00000000);
526 ok_hex(pulDIB32Bits[8], 0xFF000000);
527 ok_hex(pulDIB32Bits[9], 0x000000FF);
528 ok_hex(pulDIB32Bits[10], 0x00000000);
529 ok_hex(pulDIB32Bits[11], 0x00000000);
530
531 memset(pulDIB32Bits, 0, 4 * 4 * sizeof(ULONG));
532 ret = SetDIBitsToDevice(ghdcDIB32,
533 0, // XDest,
534 0, // YDest,
535 2, // dwWidth,
536 2, // dwHeight,
537 0, // XSrc,
538 0, // YSrc,
539 0, // uStartScan,
540 1, // cScanLines,
541 aulBits, // lpvBits,
542 pbmi,
543 DIB_RGB_COLORS);
544
545 ok_dec(ret, 1);
546 todo_ros ok_hex(pulDIB32Bits[0], 0x00000000);
547 todo_ros ok_hex(pulDIB32Bits[1], 0x00000000);
548 ok_hex(pulDIB32Bits[2], 0x00000000);
549 ok_hex(pulDIB32Bits[3], 0x00000000);
550 todo_ros ok_hex(pulDIB32Bits[4], 0x11000000);
551 todo_ros ok_hex(pulDIB32Bits[5], 0x00000011);
552 ok_hex(pulDIB32Bits[6], 0x00000000);
553 ok_hex(pulDIB32Bits[7], 0x00000000);
554
555
556 memset(pulDIB32Bits, 0, 4 * 4 * sizeof(ULONG));
557 ret = SetDIBitsToDevice(ghdcDIB32,
558 0, // XDest,
559 0, // YDest,
560 2, // dwWidth,
561 2, // dwHeight,
562 0, // XSrc,
563 0, // YSrc,
564 1, // uStartScan,
565 1, // cScanLines,
566 aulBits, // lpvBits,
567 pbmi,
568 DIB_RGB_COLORS);
569
570 ok_dec(ret, 1);
571 todo_ros ok_hex(pulDIB32Bits[0], 0x11000000);
572 todo_ros ok_hex(pulDIB32Bits[1], 0x00000011);
573 ok_hex(pulDIB32Bits[2], 0x00000000);
574 ok_hex(pulDIB32Bits[3], 0x00000000);
575 todo_ros ok_hex(pulDIB32Bits[4], 0x00000000);
576 todo_ros ok_hex(pulDIB32Bits[5], 0x00000000);
577 ok_hex(pulDIB32Bits[6], 0x00000000);
578 ok_hex(pulDIB32Bits[7], 0x00000000);
579
580 /*****************/
581
582 /* Use bottom-up bitmap */
583 pbmi->bmiHeader.biHeight = 2;
584
585 memset(pulDIB32Bits, 0, 4 * 4 * sizeof(ULONG));
586 ret = SetDIBitsToDevice(ghdcDIB32,
587 0, // XDest,
588 0, // YDest,
589 2, // dwWidth,
590 2, // dwHeight,
591 0, // XSrc,
592 0, // YSrc,
593 0, // uStartScan,
594 2, // cScanLines,
595 aulBits, // lpvBits,
596 pbmi,
597 DIB_RGB_COLORS);
598
599 ok_dec(ret, 2);
600 ok_hex(pulDIB32Bits[0], 0xFF000000);
601 ok_hex(pulDIB32Bits[1], 0x000000FF);
602 ok_hex(pulDIB32Bits[2], 0x00000000);
603 ok_hex(pulDIB32Bits[3], 0x00000000);
604 ok_hex(pulDIB32Bits[4], 0x11000000);
605 ok_hex(pulDIB32Bits[5], 0x00000011);
606 ok_hex(pulDIB32Bits[6], 0x00000000);
607 ok_hex(pulDIB32Bits[7], 0x00000000);
608
609 memset(pulDIB32Bits, 0, 4 * 4 * sizeof(ULONG));
610 ret = SetDIBitsToDevice(ghdcDIB32,
611 0, // XDest,
612 1, // YDest,
613 2, // dwWidth,
614 2, // dwHeight,
615 0, // XSrc,
616 0, // YSrc,
617 0, // uStartScan,
618 2, // cScanLines,
619 aulBits, // lpvBits,
620 pbmi,
621 DIB_RGB_COLORS);
622
623 ok_dec(ret, 2);
624 ok_hex(pulDIB32Bits[0], 0x00000000);
625 ok_hex(pulDIB32Bits[1], 0x00000000);
626 ok_hex(pulDIB32Bits[2], 0x00000000);
627 ok_hex(pulDIB32Bits[3], 0x00000000);
628 ok_hex(pulDIB32Bits[4], 0xFF000000);
629 ok_hex(pulDIB32Bits[5], 0x000000FF);
630 ok_hex(pulDIB32Bits[6], 0x00000000);
631 ok_hex(pulDIB32Bits[7], 0x00000000);
632 ok_hex(pulDIB32Bits[8], 0x11000000);
633 ok_hex(pulDIB32Bits[9], 0x00000011);
634 ok_hex(pulDIB32Bits[10], 0x00000000);
635 ok_hex(pulDIB32Bits[11], 0x00000000);
636
637 memset(pulDIB32Bits, 0, 4 * 4 * sizeof(ULONG));
638 ret = SetDIBitsToDevice(ghdcDIB32,
639 0, // XDest,
640 0, // YDest,
641 2, // dwWidth,
642 2, // dwHeight,
643 0, // XSrc,
644 0, // YSrc,
645 0, // uStartScan,
646 1, // cScanLines,
647 aulBits, // lpvBits,
648 pbmi,
649 DIB_RGB_COLORS);
650
651 ok_dec(ret, 1);
652 todo_ros ok_hex(pulDIB32Bits[0], 0x00000000);
653 todo_ros ok_hex(pulDIB32Bits[1], 0x00000000);
654 ok_hex(pulDIB32Bits[2], 0x00000000);
655 ok_hex(pulDIB32Bits[3], 0x00000000);
656 todo_ros ok_hex(pulDIB32Bits[4], 0x11000000);
657 todo_ros ok_hex(pulDIB32Bits[5], 0x00000011);
658 ok_hex(pulDIB32Bits[6], 0x00000000);
659 ok_hex(pulDIB32Bits[7], 0x00000000);
660
661
662 memset(pulDIB32Bits, 0, 4 * 4 * sizeof(ULONG));
663 ret = SetDIBitsToDevice(ghdcDIB32,
664 0, // XDest,
665 0, // YDest,
666 2, // dwWidth,
667 2, // dwHeight,
668 0, // XSrc,
669 0, // YSrc,
670 1, // uStartScan,
671 1, // cScanLines,
672 aulBits, // lpvBits,
673 pbmi,
674 DIB_RGB_COLORS);
675
676 ok_dec(ret, 1);
677 todo_ros ok_hex(pulDIB32Bits[0], 0x11000000);
678 todo_ros ok_hex(pulDIB32Bits[1], 0x00000011);
679 ok_hex(pulDIB32Bits[2], 0x00000000);
680 ok_hex(pulDIB32Bits[3], 0x00000000);
681 todo_ros ok_hex(pulDIB32Bits[4], 0x00000000);
682 todo_ros ok_hex(pulDIB32Bits[5], 0x00000000);
683 ok_hex(pulDIB32Bits[6], 0x00000000);
684 ok_hex(pulDIB32Bits[7], 0x00000000);
685
686 }
687
688
689 START_TEST(SetDIBitsToDevice)
690 {
691 InitStuff();
692
693 Test_SetDIBitsToDevice_Params();
694 Test_SetDIBitsToDevice();
695
696
697 }