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