27#define WIN32_NO_STATUS
34#include "wine/winternl.h"
36#include "wine/ddk/d3dkmthk.h"
44static BOOL (
WINAPI *pGdiAlphaBlend)(
HDC,
int,
int,
int,
int,
HDC,
int,
int,
int,
int,
BLENDFUNCTION);
50 return ((
width *
bpp + 15) >> 3) & ~1;
55 return ((
width *
bpp + 31) >> 3) & ~3;
61 *
abs(
info->bmiHeader.biHeight );
73 ok(
ret ==
sizeof(bm),
"GetObject returned %d\n",
ret);
75 ok(bm.bmType == 0,
"wrong bm.bmType %d\n", bm.bmType);
76 ok(bm.bmWidth == bmih->
biWidth,
"wrong bm.bmWidth %d\n", bm.bmWidth);
77 ok(bm.bmHeight == bmih->
biHeight,
"wrong bm.bmHeight %d\n", bm.bmHeight);
80 ok(bm.bmPlanes == bmih->
biPlanes,
"wrong bm.bmPlanes %d\n", bm.bmPlanes);
81 ok(bm.bmBitsPixel == expected_depth,
"wrong bm.bmBitsPixel %d != %d\n", bm.bmBitsPixel, expected_depth);
82 ok(bm.bmBits ==
NULL,
"wrong bm.bmBits %p\n", bm.bmBits);
84 assert(
sizeof(
buf) >= bm.bmWidthBytes * bm.bmHeight);
88 test_size[0] = bm.bmWidthBytes * bm.bmHeight;
93 ok(
ret == bm.bmWidthBytes * bm.bmHeight,
"%d != %d\n",
ret, bm.bmWidthBytes * bm.bmHeight);
96 memset(buf_cmp, 0xAA,
sizeof(buf_cmp));
97 memset(buf_cmp, 0, bm.bmWidthBytes * bm.bmHeight);
102 int expect =
i == 1 ? 0 : bm.bmWidthBytes * bm.bmHeight;
108 "Test[%d]: buffers do not match, depth %d\n",
i, bmih->
biBitCount);
113 ok(
ret ==
sizeof(*bma),
"wrong size %d\n",
ret);
125 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
139 memset(&bmih, 0,
sizeof(bmih));
140 bmih.
biSize =
sizeof(bmih);
148 ok(
hbm ==
NULL,
"CreateDIBitmap should fail\n");
150 ok(
hbm ==
NULL,
"CreateDIBitmap should fail\n");
158 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
165 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
172 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
182 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
189 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
196 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
209 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
216 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
223 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
233 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
243 memset(&bm, 0,
sizeof(bm));
252 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
257 ok(pixel == 0x00ffffff,
"Reading a 32 bit pixel from a DDB returned %08x\n", pixel);
269 INT ret, bm_width_bytes, dib_width_bytes;
273 ok(
ret ==
sizeof(bm),
"GetObject returned %d\n",
ret);
275 ok(bm.bmType == 0,
"wrong bm.bmType %d\n", bm.bmType);
276 ok(bm.bmWidth == bmih->
biWidth,
"wrong bm.bmWidth %d\n", bm.bmWidth);
277 ok(bm.bmHeight ==
abs(bmih->
biHeight),
"wrong bm.bmHeight %d\n", bm.bmHeight);
280 if (bm.bmWidthBytes != dib_width_bytes)
281 ok(bm.bmWidthBytes == bm_width_bytes,
"wrong bm.bmWidthBytes %d != %d\n", bm.bmWidthBytes, bm_width_bytes);
283 ok(bm.bmWidthBytes == dib_width_bytes,
"wrong bm.bmWidthBytes %d != %d\n", bm.bmWidthBytes, dib_width_bytes);
284 ok(bm.bmPlanes == bmih->
biPlanes,
"wrong bm.bmPlanes %d\n", bm.bmPlanes);
286 ok(bm.bmBits ==
bits,
"wrong bm.bmBits %p != %p\n", bm.bmBits,
bits);
293 ok(
ret == bm_width_bytes * bm.bmHeight,
294 "%d != %d\n",
ret, bm_width_bytes * bm.bmHeight);
296 memset(
buf, 0xAA, bm.bmWidthBytes * bm.bmHeight + 4096);
298 ok(
ret == bm_width_bytes * bm.bmHeight,
"%d != %d\n",
ret, bm_width_bytes * bm.bmHeight);
305 ok(
ret ==
sizeof(*bma),
"wrong size %d\n",
ret);
306 ok(bm.bmWidth == bmih->
biWidth,
"wrong bm.bmWidth %d\n", bm.bmWidth);
307 ok(bm.bmHeight ==
abs(bmih->
biHeight),
"wrong bm.bmHeight %d\n", bm.bmHeight);
308 ok(bm.bmBits ==
bits,
"wrong bm.bmBits %p != %p\n", bm.bmBits,
bits);
321 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
324 ok(
ret ==
sizeof(*dsa),
"wrong size %d\n",
ret);
328 ok(
ret ==
sizeof(
ds),
"wrong size %d\n",
ret);
330 ok(
ds.dsBm.bmBits ==
bits,
"wrong bm.bmBits %p != %p\n",
ds.dsBm.bmBits,
bits);
331 if (
ds.dsBm.bmWidthBytes != bm_width_bytes)
332 ok(
ds.dsBmih.biSizeImage ==
ds.dsBm.bmWidthBytes *
ds.dsBm.bmHeight,
"%u != %u\n",
333 ds.dsBmih.biSizeImage,
ds.dsBm.bmWidthBytes *
ds.dsBm.bmHeight);
335 ds.dsBmih.biSizeImage = 0;
351 ok(
ret ==
sizeof(
ds.dsBm),
"wrong size %d\n",
ret);
367 ok_(__FILE__,
line)(
c ==
exp,
"SetPixel failed: got 0x%06x expected 0x%06x\n",
c,
exp);
369 ok_(__FILE__,
line)(
c ==
exp,
"GetPixel failed: got 0x%06x expected 0x%06x\n",
c,
exp);
371 ok_(__FILE__,
line)(
c ==
exp,
"GetNearestColor failed: got 0x%06x expected 0x%06x\n",
c,
exp);
373#define test_color(hdc, color, exp) _test_color( __LINE__, hdc, color, exp )
389 "VirtualQuery failed\n");
409 ok(
ret == 16,
"SetDIBits failed: expected 16 got %d\n",
ret);
414 "VirtualQuery failed\n");
430 if (
ret)
ok( written == 8192,
"only wrote %u bytes\n", written );
438 HBITMAP hdib, oldbm, hdib2, oldbm2;
455 HPALETTE hpal, oldpal;
477 ok(hdib ==
NULL &&
bits ==
NULL,
"CreateDIBSection failed for invalid parameter: bmi == 0x0\n");
486 "VirtualQuery failed\n");
490 ok(
info.RegionSize == 0x26000,
"0x%lx != 0x26000\n",
info.RegionSize);
512 ok(hdib ==
NULL,
"CreateDIBSection should fail when asked to create a compressed DIB section\n");
526 "VirtualQuery failed\n");
530 ok(
info.RegionSize == 0x19000,
"0x%lx != 0x19000\n",
info.RegionSize);
545 colors[0].rgbRed = 0xff;
546 colors[0].rgbGreen = 0;
547 colors[0].rgbBlue = 0;
548 colors[1].rgbRed = 0;
549 colors[1].rgbGreen = 0;
550 colors[1].rgbBlue = 0xff;
553 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
556 "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.
dsBmih.
biClrUsed, 2);
564 ok(
ret,
"GetDIBits doesn't work with a BITMAPCOREHEADER\n");
567 "GetDIBits didn't fill in the BITMAPCOREHEADER structure properly\n");
570 ok(
ret,
"GetDIBits doesn't work with a BITMAPCOREHEADER\n");
571 ok((ccolors[0].rgbtRed == 0xff) && (ccolors[0].rgbtGreen == 0) &&
572 (ccolors[0].rgbtBlue == 0) && (ccolors[1].rgbtRed == 0) &&
573 (ccolors[1].rgbtGreen == 0) && (ccolors[1].rgbtBlue == 0xff),
574 "The color table has not been translated to the old BITMAPCOREINFO format\n");
577 ok(hcoredib !=
NULL,
"CreateDIBSection failed with a BITMAPCOREINFO\n");
581 ok(
ret,
"GetDIBits doesn't work with a BITMAPCOREHEADER\n");
582 ok((ccolors[0].rgbtRed == 0xff) && (ccolors[0].rgbtGreen == 0) &&
583 (ccolors[0].rgbtBlue == 0) && (ccolors[1].rgbtRed == 0) &&
584 (ccolors[1].rgbtGreen == 0) && (ccolors[1].rgbtBlue == 0xff),
585 "The color table has not been translated to the old BITMAPCOREINFO format\n");
593 ok(
ret == 2,
"GetDIBColorTable returned %d\n",
ret);
595 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
596 rgb[0].rgbRed,
rgb[0].rgbGreen,
rgb[0].rgbBlue,
rgb[0].rgbReserved,
597 rgb[1].rgbRed,
rgb[1].rgbGreen,
rgb[1].rgbBlue,
rgb[1].rgbReserved);
599 c0 =
RGB(colors[0].rgbRed, colors[0].rgbGreen, colors[0].rgbBlue);
600 c1 =
RGB(colors[1].rgbRed, colors[1].rgbGreen, colors[1].rgbBlue);
617 colors[0].rgbRed = 0xff;
618 colors[0].rgbGreen = 0xff;
619 colors[0].rgbBlue = 0xff;
620 colors[1].rgbRed = 0;
621 colors[1].rgbGreen = 0;
622 colors[1].rgbBlue = 0;
625 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
632 ok(
ret == 2,
"GetDIBColorTable returned %d\n",
ret);
634 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
635 rgb[0].rgbRed,
rgb[0].rgbGreen,
rgb[0].rgbBlue,
rgb[0].rgbReserved,
636 rgb[1].rgbRed,
rgb[1].rgbGreen,
rgb[1].rgbBlue,
rgb[1].rgbReserved);
643 for (
i = 0;
i < 16;
i++) {
644 colors[
i].rgbRed =
i;
645 colors[
i].rgbGreen = 16-
i;
646 colors[
i].rgbBlue = 0;
649 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
652 "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.
dsBmih.
biClrUsed, 16);
658 for (
i = 0;
i < 128;
i++) {
659 colors[
i].rgbRed = 255 -
i * 2;
660 colors[
i].rgbGreen =
i * 2;
661 colors[
i].rgbBlue = 0;
662 colors[255 -
i].rgbRed = 0;
663 colors[255 -
i].rgbGreen =
i * 2;
664 colors[255 -
i].rgbBlue = 255 -
i * 2;
667 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
670 "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.
dsBmih.
biClrUsed, 256);
674 for (
i = 0;
i < 256;
i++) {
677 RGB(colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue));
687 memset(plogpal, 0,
sizeof(logpalbuf));
690 palent[0].
peRed = 0xff;
698 ok(hpal !=
NULL,
"CreatePalette failed\n");
701 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
713 ok(
ret == 2,
"GetDIBColorTable returned %d\n",
ret);
714 ok(
rgb[0].rgbRed == 0xff &&
rgb[0].rgbBlue == 0xff &&
rgb[0].rgbGreen == 0 &&
715 rgb[1].rgbRed == 0 &&
rgb[1].rgbBlue == 0 &&
rgb[1].rgbGreen == 0xff,
716 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
717 rgb[0].rgbRed,
rgb[0].rgbGreen,
rgb[0].rgbBlue,
rgb[0].rgbReserved,
718 rgb[1].rgbRed,
rgb[1].rgbGreen,
rgb[1].rgbBlue,
rgb[1].rgbReserved);
720 c0 =
RGB(palent[0].peRed, palent[0].peGreen, palent[0].peBlue);
721 c1 =
RGB(palent[1].peRed, palent[1].peGreen, palent[1].peBlue);
740 bits[13 * 4] =
bits[13*4 + 1] = 0xff;
747 ok(hdib2 !=
NULL,
"CreateDIBSection failed\n");
753 ok(bits32[0] == 0xff00,
"lower left pixel is %08x\n", bits32[0]);
754 ok(bits32[17] == 0xff00ff,
"bottom but one, left pixel is %08x\n", bits32[17]);
768 memset(plogpal, 0,
sizeof(logpalbuf));
772 for (
i = 0;
i < 128;
i++) {
776 palent[255 -
i].
peRed = 0;
778 palent[255 -
i].
peBlue = 255 -
i * 2;
782 for (
i = 0;
i < 256;
i++) {
787 ok(hpal !=
NULL,
"CreatePalette failed\n");
790 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
801 ok(
ret == 256,
"GetDIBColorTable returned %d\n",
ret);
802 for (
i = 0;
i < 256;
i++) {
803 ok(
rgb[
i].rgbRed == palent[
i].peRed &&
804 rgb[
i].rgbBlue == palent[
i].peBlue &&
805 rgb[
i].rgbGreen == palent[
i].peGreen,
806 "GetDIBColorTable returns table %d: r%02x g%02x b%02x res%02x\n",
810 for (
i = 0;
i < 256;
i++) {
814 RGB(palent[
i].peRed, palent[
i].peGreen, palent[
i].peBlue));
824 ok(hpal !=
NULL,
"CreatePalette failed\n");
828 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
839 ok(
ret == 256,
"GetDIBColorTable returned %d\n",
ret);
840 for (
i = 0;
i < 256;
i++)
842 if (i < pbmi->bmiHeader.biClrUsed)
844 ok(
rgb[
i].rgbRed == palent[
i % 37].peRed &&
845 rgb[
i].rgbBlue == palent[
i % 37].peBlue &&
846 rgb[
i].rgbGreen == palent[
i % 37].peGreen,
847 "GetDIBColorTable returns table %d: r %02x g %02x b %02x res%02x\n",
850 RGB(palent[
i % 37].peRed, palent[
i % 37].peGreen, palent[
i % 37].peBlue));
854 ok(
rgb[
i].rgbRed == 0 &&
rgb[
i].rgbBlue == 0 &&
rgb[
i].rgbGreen == 0,
855 "GetDIBColorTable returns table %d: r %02x g %02x b %02x res%02x\n",
864 for (
i = 0;
i < 256;
i++)
867 ok(colors[
i].rgbRed == palent[
i % 37].peRed &&
868 colors[
i].rgbBlue == palent[
i % 37].peBlue &&
869 colors[
i].rgbGreen == palent[
i % 37].peGreen,
870 "GetDIBits returns table %d: r %02x g %02x b %02x res%02x\n",
871 i, colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
873 ok(colors[
i].rgbRed == 0 && colors[
i].rgbBlue == 0 && colors[
i].rgbGreen == 0,
874 "GetDIBits returns table %d: r %02x g %02x b %02x res%02x\n",
875 i, colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
881 rgb[0].rgbReserved = 123;
883 ok(
ret == 1,
"SetDIBColorTable returned unexpected result %u\n",
ret );
884 ok(
rgb[0].rgbReserved == 123,
"Expected rgbReserved = 123, got %u\n",
rgb[0].rgbReserved );
886 rgb[0].rgbRed =
rgb[0].rgbGreen =
rgb[0].rgbBlue =
rgb[0].rgbReserved = -1;
888 ok(
ret == 1,
"GetDIBColorTable returned unexpected result %u\n",
ret );
889 ok(
rgb[0].rgbRed == 1,
"Expected rgbRed = 1, got %u\n",
rgb[0].rgbRed );
890 ok(
rgb[0].rgbGreen == 2,
"Expected rgbGreen = 2, got %u\n",
rgb[0].rgbGreen );
891 ok(
rgb[0].rgbBlue == 3,
"Expected rgbBlue = 3, got %u\n",
rgb[0].rgbBlue );
892 ok(
rgb[0].rgbReserved == 0,
"Expected rgbReserved = 0, got %u\n",
rgb[0].rgbReserved );
902 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
907 ok(
ret == 0,
"GetDIBColorTable returned %d\n",
ret);
925 BOOL format_ok, expect_ok;
935 skip(
"ROSTESTS-152: Skipping loop in test_dib_formats because it's too big and causes too many failures\n");
939 for (planes = 0; planes <= 64; planes++)
953 default: expect_ok =
FALSE;
break;
971 "GetDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
974 format_ok = expect_ok;
975 if (!planes) expect_ok =
FALSE;
987 if (expect_ok && (planes == 1 || planes *
bpp <= 16) &&
998 "CreateDIBitmap succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1011 "SetDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1012 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
format );
1018 "SetDIBitsToDevice succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1019 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
format,
SRCCOPY );
1025 "StretchDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1051 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
format );
1056 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
format,
SRCCOPY );
1064 if (expect_ok || !
bpp)
1068 "GetDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1087 ok( hdib ==
NULL,
"CreateDIBSection succeeded with null bitfields\n" );
1089 ok( !
ret,
"SetDIBits succeeded with null bitfields\n" );
1092 ok( hdib !=
NULL,
"CreateDIBitmap failed with null bitfields\n" );
1094 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1095 ok(
ret,
"SetDIBitsToDevice failed with null bitfields\n" );
1096 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1097 ok(
ret,
"StretchDIBits failed with null bitfields\n" );
1099 ok(
ret,
"GetDIBits failed with null bitfields\n" );
1108 ok(
ret,
"GetDIBits failed with null bitfields\n" );
1115 ok( hdib ==
NULL,
"CreateDIBSection succeeded with null bitfields\n" );
1117 ok( !
ret,
"SetDIBits succeeded with null bitfields\n" );
1124 ok( hdib !=
NULL,
"CreateDIBSection failed with bad bitfields\n" );
1127 ok(
ret,
"SetDIBits failed with bad bitfields\n" );
1134 ok( hdib ==
NULL,
"CreateDIBSection succeeded with negative width\n" );
1136 ok( hdib ==
NULL,
"CreateDIBitmap succeeded with negative width\n" );
1138 ok( !
ret,
"SetDIBits succeeded with negative width\n" );
1139 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1140 ok( !
ret,
"SetDIBitsToDevice succeeded with negative width\n" );
1141 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1142 ok( !
ret,
"StretchDIBits succeeded with negative width\n" );
1144 ok( !
ret,
"GetDIBits succeeded with negative width\n" );
1150 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with negative width\n" );
1157 ok( hdib ==
NULL,
"CreateDIBSection succeeded with zero width\n" );
1159 ok( hdib !=
NULL,
"CreateDIBitmap failed with zero width\n" );
1162 ok( !
ret ||
broken(
ret),
"SetDIBits succeeded with zero width\n" );
1163 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1164 ok( !
ret ||
broken(
ret),
"SetDIBitsToDevice succeeded with zero width\n" );
1165 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1166 ok( !
ret ||
broken(
ret),
"StretchDIBits succeeded with zero width\n" );
1168 ok( !
ret,
"GetDIBits succeeded with zero width\n" );
1174 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with zero width\n" );
1181 ok( hdib ==
NULL,
"CreateDIBSection succeeded with zero height\n" );
1183 ok( hdib !=
NULL,
"CreateDIBitmap failed with zero height\n" );
1186 ok( !
ret,
"SetDIBits succeeded with zero height\n" );
1187 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1188 ok( !
ret,
"SetDIBitsToDevice succeeded with zero height\n" );
1189 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1190 ok( !
ret,
"StretchDIBits succeeded with zero height\n" );
1192 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with zero height\n" );
1198 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with zero height\n" );
1207 ok( hdib ==
NULL,
"CreateDIBSection succeeded with DIB_PAL_COLORS+1\n" );
1209 ok( hdib !=
NULL,
"CreateDIBitmap failed with DIB_PAL_COLORS+1\n" );
1212 ok( !
ret,
"SetDIBits succeeded with DIB_PAL_COLORS+1\n" );
1213 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_PAL_COLORS+1 );
1214 ok(
ret,
"SetDIBitsToDevice failed with DIB_PAL_COLORS+1\n" );
1215 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_PAL_COLORS+1,
SRCCOPY );
1216 ok(
ret,
"StretchDIBits failed with DIB_PAL_COLORS+1\n" );
1218 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+1\n" );
1224 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+1\n" );
1231 ok( hdib ==
NULL,
"CreateDIBSection succeeded with DIB_PAL_COLORS+2\n" );
1233 ok( hdib ==
NULL,
"CreateDIBitmap succeeded with DIB_PAL_COLORS+2\n" );
1236 ok( !
ret,
"SetDIBits succeeded with DIB_PAL_COLORS+2\n" );
1237 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_PAL_COLORS+2 );
1238 ok( !
ret,
"SetDIBitsToDevice succeeded with DIB_PAL_COLORS+2\n" );
1239 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_PAL_COLORS+2,
SRCCOPY );
1240 ok( !
ret,
"StretchDIBits succeeded with DIB_PAL_COLORS+2\n" );
1242 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+2\n" );
1248 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+2\n" );
1255 ok( hdib !=
NULL,
"CreateDIBSection failed with large size\n" );
1263 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1270 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1277 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1284 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1291 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1321 colors[0].rgbRed = 0xff;
1322 colors[0].rgbGreen = 0xff;
1323 colors[0].rgbBlue = 0xff;
1324 colors[1].rgbRed = 0x0;
1325 colors[1].rgbGreen = 0x0;
1326 colors[1].rgbBlue = 0x0;
1333 ok(mono_ds !=
NULL,
"CreateDIBSection rets NULL\n");
1338 ok(ds_bits[0] == 0xff,
"out_bits %02x\n", ds_bits[0]);
1339 ok(ds_bits[4] == 0x80,
"out_bits %02x\n", ds_bits[4]);
1346 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1347 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1351 colors[0].rgbRed = 0x0;
1352 colors[0].rgbGreen = 0x0;
1353 colors[0].rgbBlue = 0x0;
1354 colors[1].rgbRed = 0xff;
1355 colors[1].rgbGreen = 0xff;
1356 colors[1].rgbBlue = 0xff;
1358 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1359 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1368 colors[0].rgbRed = 0x0;
1369 colors[0].rgbGreen = 0x0;
1370 colors[0].rgbBlue = 0x0;
1371 colors[1].rgbRed = 0xff;
1372 colors[1].rgbGreen = 0xff;
1373 colors[1].rgbBlue = 0xff;
1376 ok(mono_ds !=
NULL,
"CreateDIBSection rets NULL\n");
1381 ok(ds_bits[0] == 0x00,
"out_bits %02x\n", ds_bits[0]);
1382 ok(ds_bits[4] == 0x7f,
"out_bits %02x\n", ds_bits[4]);
1386 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1387 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1391 colors[0].rgbRed = 0xff;
1392 colors[0].rgbGreen = 0xff;
1393 colors[0].rgbBlue = 0xff;
1394 colors[1].rgbRed = 0x0;
1395 colors[1].rgbGreen = 0x0;
1396 colors[1].rgbBlue = 0x0;
1398 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1399 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1405 colors[0].rgbRed = 0xff;
1406 colors[0].rgbGreen = 0xff;
1407 colors[0].rgbBlue = 0xff;
1408 colors[1].rgbRed = 0x0;
1409 colors[1].rgbGreen = 0x0;
1410 colors[1].rgbBlue = 0x0;
1416 ok(ds_bits[0] == 0xff,
"out_bits %02x\n", ds_bits[0]);
1417 ok(ds_bits[4] == 0x80,
"out_bits %02x\n", ds_bits[4]);
1424 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1425 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1429 colors[0].rgbRed = 0x0;
1430 colors[0].rgbGreen = 0x0;
1431 colors[0].rgbBlue = 0x0;
1432 colors[1].rgbRed = 0xff;
1433 colors[1].rgbGreen = 0xff;
1434 colors[1].rgbBlue = 0xff;
1436 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1437 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1446 colors[0].rgbRed = 0xff;
1447 colors[0].rgbGreen = 0x0;
1448 colors[0].rgbBlue = 0x0;
1449 colors[1].rgbRed = 0xfe;
1450 colors[1].rgbGreen = 0x0;
1451 colors[1].rgbBlue = 0x0;
1454 ok(mono_ds !=
NULL,
"CreateDIBSection rets NULL\n");
1459 ok(ds_bits[0] == 0xff,
"out_bits %02x\n", ds_bits[0]);
1460 ok(ds_bits[4] == 0x80,
"out_bits %02x\n", ds_bits[4]);
1464 colors[0].rgbRed = 0x0;
1465 colors[0].rgbGreen = 0x0;
1466 colors[0].rgbBlue = 0x0;
1467 colors[1].rgbRed = 0xff;
1468 colors[1].rgbGreen = 0xff;
1469 colors[1].rgbBlue = 0xff;
1471 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1472 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1476 colors[0].rgbRed = 0xff;
1477 colors[0].rgbGreen = 0xff;
1478 colors[0].rgbBlue = 0xff;
1479 colors[1].rgbRed = 0x0;
1480 colors[1].rgbGreen = 0x0;
1481 colors[1].rgbBlue = 0x0;
1483 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1484 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1495 char buf[256], buf_cmp[256];
1511 "expected ERROR_NOT_ENOUGH_MEMORY, got %u\n",
GetLastError());
1522 "expected ERROR_NOT_ENOUGH_MEMORY, got %u\n",
GetLastError());
1529 ok(!
hbmp,
"CreateBitmap should fail\n");
1532 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1540 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
1542 ok(bm.bmType == 0,
"wrong bm.bmType %d\n", bm.bmType);
1543 ok(bm.bmWidth == 15,
"wrong bm.bmWidth %d\n", bm.bmWidth);
1544 ok(bm.bmHeight == 15,
"wrong bm.bmHeight %d\n", bm.bmHeight);
1545 ok(bm.bmWidthBytes == 2,
"wrong bm.bmWidthBytes %d\n", bm.bmWidthBytes);
1546 ok(bm.bmPlanes == 1,
"wrong bm.bmPlanes %d\n", bm.bmPlanes);
1547 ok(bm.bmBitsPixel == 1,
"wrong bm.bmBitsPixel %d\n", bm.bmBitsPixel);
1548 ok(bm.bmBits ==
NULL,
"wrong bm.bmBits %p\n", bm.bmBits);
1550 assert(
sizeof(
buf) >= bm.bmWidthBytes * bm.bmHeight);
1554 ok(
ret == bm.bmWidthBytes * bm.bmHeight,
"%d != %d\n",
ret, bm.bmWidthBytes * bm.bmHeight);
1556 memset(buf_cmp, 0xAA,
sizeof(buf_cmp));
1557 memset(buf_cmp, 0, bm.bmWidthBytes * bm.bmHeight);
1561 ok(
ret == bm.bmWidthBytes * bm.bmHeight,
"%d != %d\n",
ret, bm.bmWidthBytes * bm.bmHeight);
1562 ok(!
memcmp(
buf, buf_cmp,
sizeof(
buf)),
"buffers do not match\n");
1567 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
1569 ok(bm.bmType == 0,
"wrong bm.bmType %d\n", bm.bmType);
1570 ok(bm.bmWidth == 15,
"wrong bm.bmWidth %d\n", bm.bmWidth);
1571 ok(bm.bmHeight == 15,
"wrong bm.bmHeight %d\n", bm.bmHeight);
1572 ok(bm.bmWidthBytes == 2,
"wrong bm.bmWidthBytes %d\n", bm.bmWidthBytes);
1573 ok(bm.bmPlanes == 1,
"wrong bm.bmPlanes %d\n", bm.bmPlanes);
1574 ok(bm.bmBitsPixel == 1,
"wrong bm.bmBitsPixel %d\n", bm.bmBitsPixel);
1575 ok(bm.bmBits ==
NULL,
"wrong bm.bmBits %p\n", bm.bmBits);
1579 ok(
ret == bm.bmWidthBytes * bm.bmHeight,
"%d != %d\n",
ret, bm.bmWidthBytes * bm.bmHeight);
1580 ok(!
memcmp(
buf, buf_cmp,
sizeof(
buf)),
"buffers do not match\n");
1583 ok(hbmp_old ==
hbmp,
"wrong old bitmap %p\n", hbmp_old);
1587 ok(
ret ==
sizeof(*bma),
"wrong size %d\n",
ret);
1604 return (
r*
r +
g*
g +
b*
b < (255-
r)*(255-
r) + (255-
g)*(255-
g) + (255-
b)*(255-
b)) ? 0x000000 : 0xffffff;
1609 if (fg == 0 || bg == 0xffffff)
return RGB(
r,
g,
b) != 0xffffff &&
RGB(
r,
g,
b) != bg;
1615 static const WORD pattern_bits[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa };
1629 "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n",
res,
r,
g,
b, fg, bg );
1632 "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n",
res,
r,
g,
b, fg, bg );
1635 "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n",
res,
r,
g,
b, fg, bg );
1643 "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n",
res,
r,
g,
b, fg, bg );
1646 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1655 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1664 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1670 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1674 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
1675 info->bmiHeader.biHeight = -16;
1676 info->bmiHeader.biWidth = 16;
1677 info->bmiHeader.biBitCount = 1;
1678 info->bmiHeader.biPlanes = 1;
1680 colors[0].rgbRed = 0xff;
1681 colors[0].rgbGreen = 0xff;
1682 colors[0].rgbBlue = 0xf0;
1683 colors[1].rgbRed = 0x20;
1684 colors[1].rgbGreen = 0x0;
1685 colors[1].rgbBlue = 0x0;
1687 memset( bits_ptr, 0x55, 64 );
1692 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1694 colors[0].rgbRed = 0x0;
1695 colors[0].rgbGreen = 0x0;
1696 colors[0].rgbBlue = 0x10;
1697 colors[1].rgbRed = 0xff;
1698 colors[1].rgbGreen = 0xf0;
1699 colors[1].rgbBlue = 0xff;
1701 memset( bits_ptr, 0x55, 64 );
1706 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1713 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1720 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1727 static const COLORREF colors[][2] =
1729 {
RGB(0x00,0x00,0x00),
RGB(0xff,0xff,0xff) },
1730 {
RGB(0xff,0xff,0xff),
RGB(0x00,0x00,0x00) },
1731 {
RGB(0x00,0x00,0x00),
RGB(0xff,0xff,0xfe) },
1732 {
RGB(0x00,0x01,0x00),
RGB(0xff,0xff,0xff) },
1733 {
RGB(0x00,0x00,0x00),
RGB(0x80,0x80,0x80) },
1734 {
RGB(0x80,0x80,0x80),
RGB(0xff,0xff,0xff) },
1735 {
RGB(0x30,0x40,0x50),
RGB(0x60,0x70,0x80) },
1736 {
RGB(0xa0,0xa0,0xa0),
RGB(0x20,0x30,0x10) },
1748 skip(
"ROSTESTS-153: Skipping test_mono_bitmap because it causes too many failures and takes too long\n");
1760 for (col = 0; col <
sizeof(colors) /
sizeof(colors[0]); col++)
1765 for (
i = 0;
i < 256;
i++)
1775 for (
r = 0;
r < 256;
r += 15)
1776 for (
g = 0;
g < 256;
g += 15)
1777 for (
b = 0;
b < 256;
b += 15)
1797 "GetObject failed or returned a wrong structure size\n");
1798 ok(!
bmp.bmBits,
"bmBits must be NULL for device-dependent bitmaps\n");
1810 UINT dib_size, dib32_size;
1822 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
1823 info->bmiHeader.biWidth = 32;
1824 info->bmiHeader.biHeight = 32;
1825 info->bmiHeader.biPlanes = 1;
1826 info->bmiHeader.biBitCount =
bpp;
1828 info->bmiHeader.biXPelsPerMeter = 0;
1829 info->bmiHeader.biYPelsPerMeter = 0;
1830 info->bmiHeader.biClrUsed = 0;
1831 info->bmiHeader.biClrImportant = 0;
1833 for (
i=0;
i < (1u <<
bpp);
i++)
1836 info->bmiColors[
i].rgbRed =
c;
1837 info->bmiColors[
i].rgbGreen =
c;
1838 info->bmiColors[
i].rgbBlue =
c;
1839 info->bmiColors[
i].rgbReserved = 0;
1843 dib_size =
bpp * (
info->bmiHeader.biWidth *
info->bmiHeader.biHeight) / 8;
1844 dib32_size = 32 * (
info->bmiHeader.biWidth *
info->bmiHeader.biHeight) / 8;
1847 for (
i=0;
i < dib_size;
i++)
1865 for (
i=0;
i < (1u <<
bpp);
i++)
1870 "color table entry %d differs (bpp %d)\n",
i,
bpp );
1872 ok( !
memcmp(
bits, bits2, dib_size ),
"bit mismatch (bpp %d)\n",
bpp );
1879 "color table mismatch (bpp %d)\n",
bpp );
1885 "color table mismatch (bpp %d)\n",
bpp );
1891 "color table mismatch (bpp %d)\n",
bpp );
1899 pixel = ((
DWORD *)bits2)[
info->bmiHeader.biWidth *
info->bmiHeader.biHeight - 1];
1900 ok(pixel != 0,
"Pixel: 0x%08x\n", pixel);
1958 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
1961 info->bmiHeader.biPlanes = 1;
1962 info->bmiHeader.biBitCount =
bpp;
1969 ok(
info->bmiHeader.biSizeImage != 0,
"GetDIBits failed to get the DIB attributes\n");
1991 for (
i=0;
i < (1u <<
bpp);
i++)
1996 "color table entry %d differs (bpp %d)\n",
i,
bpp );
1999 ok( !
memcmp(
bits, bits2,
info->bmiHeader.biSizeImage ),
"bit mismatch (bpp %d)\n",
bpp );
2010 for (
i = 0;
i < (1 <<
info->bmiHeader.biBitCount);
i++)
2011 ok( colors[
i] ==
i,
"%d: got %d (bpp %d)\n",
i, colors[
i],
bpp );
2028 static const BYTE bmp_bits_1[16 * 2] =
2030 0xff,0xff, 0,0, 0xff,0xff, 0,0,
2031 0xff,0xff, 0,0, 0xff,0xff, 0,0,
2032 0xff,0xff, 0,0, 0xff,0xff, 0,0,
2033 0xff,0xff, 0,0, 0xff,0xff, 0,0
2036 static const BYTE dib_bits_1[16 * 4] =
2038 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0,
2039 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0,
2040 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0,
2041 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0
2044 static const BYTE bmp_bits_24[16 * 16*3] =
2046 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2047 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2048 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2049 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2050 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2051 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2052 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2053 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2054 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2055 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2056 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2057 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2058 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2059 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2060 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2061 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2062 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2063 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2064 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2065 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2066 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2067 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2068 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2069 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2070 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2071 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2072 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2073 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2074 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2075 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2076 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2077 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2080 static const BYTE dib_bits_24[16 * 16*3] =
2082 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2083 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2084 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2085 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2086 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2087 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2088 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2089 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2090 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2091 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2092 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2093 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2094 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2095 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2096 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2097 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2098 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2099 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2100 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2101 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2102 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2103 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2104 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2105 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2106 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2107 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2108 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2109 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2110 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2111 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2112 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2113 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
2129 ok(
hbmp != 0,
"CreateBitmap failed\n");
2131 memset(&bm, 0xAA,
sizeof(bm));
2133 ok(
bytes ==
sizeof(bm),
"GetObject returned %d\n",
bytes);
2134 ok(bm.bmType == 0,
"wrong bmType %d\n", bm.bmType);
2135 ok(bm.bmWidth == 16,
"wrong bmWidth %d\n", bm.bmWidth);
2136 ok(bm.bmHeight == 16,
"wrong bmHeight %d\n", bm.bmHeight);
2137 ok(bm.bmWidthBytes == 2,
"wrong bmWidthBytes %d\n", bm.bmWidthBytes);
2138 ok(bm.bmPlanes == 1,
"wrong bmPlanes %u\n", bm.bmPlanes);
2139 ok(bm.bmBitsPixel == 1,
"wrong bmBitsPixel %d\n", bm.bmBitsPixel);
2140 ok(!bm.bmBits,
"wrong bmBits %p\n", bm.bmBits);
2143 ok(
bytes ==
sizeof(bmp_bits_1),
"expected 16*2 got %d bytes\n",
bytes);
2145 ok(
bytes ==
sizeof(bmp_bits_1),
"expected 16*2 got %d bytes\n",
bytes);
2146 ok(!
memcmp(
buf, bmp_bits_1,
sizeof(bmp_bits_1)),
"bitmap bits don't match\n");
2149 memset(bi, 0,
sizeof(*bi));
2161 ok(
lines == 0,
"GetDIBits copied %d lines with hdc = 0\n",
lines);
2172 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2178 ok(colors[0].rgbRed == 0 && colors[0].rgbGreen == 0 &&
2179 colors[0].rgbBlue == 0 && colors[0].rgbReserved == 0,
2180 "expected bmiColors[0] 0,0,0,0 - got %x %x %x %x\n",
2181 colors[0].rgbRed, colors[0].rgbGreen, colors[0].rgbBlue, colors[0].rgbReserved);
2182 ok(colors[1].rgbRed == 0xff && colors[1].rgbGreen == 0xff &&
2183 colors[1].rgbBlue == 0xff && colors[1].rgbReserved == 0,
2184 "expected bmiColors[0] 0xff,0xff,0xff,0 - got %x %x %x %x\n",
2185 colors[1].rgbRed, colors[1].rgbGreen, colors[1].rgbBlue, colors[1].rgbReserved);
2186 for (
i = 2;
i < 256;
i++)
2188 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2189 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2190 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2191 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2195 ok(!
memcmp(
buf, dib_bits_1,
sizeof(dib_bits_1)),
"DIB bits don't match\n");
2201 ok(((
WORD*)colors)[0] == 0,
"Color 0 is %d\n", ((
WORD*)colors)[0]);
2202 ok(((
WORD*)colors)[1] == 1,
"Color 1 is %d\n", ((
WORD*)colors)[1]);
2203 for (
i = 2;
i < 256;
i++)
2204 ok(((
WORD*)colors)[
i] == 0xAAAA,
"Color %d is %d\n",
i, ((
WORD*)colors)[1]);
2207 memset(bi, 0,
sizeof(*bi));
2220 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2226 for (
i = 0;
i < 256;
i++)
2228 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2229 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2230 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2231 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2235 ok(!
memcmp(
buf, dib_bits_24,
sizeof(dib_bits_24)),
"DIB bits don't match\n");
2240 ok(
hbmp != 0,
"CreateBitmap failed\n");
2244 ok(
lines == bm.bmHeight,
"SetDIBits copied %d lines of %d, error %u\n",
2247 memset(&bm, 0xAA,
sizeof(bm));
2249 ok(
bytes ==
sizeof(bm),
"GetObject returned %d\n",
bytes);
2250 ok(bm.bmType == 0,
"wrong bmType %d\n", bm.bmType);
2251 ok(bm.bmWidth == 16,
"wrong bmWidth %d\n", bm.bmWidth);
2252 ok(bm.bmHeight == 16,
"wrong bmHeight %d\n", bm.bmHeight);
2253 ok(bm.bmWidthBytes ==
get_bitmap_stride(bm.bmWidth, bm.bmBitsPixel),
"wrong bmWidthBytes %d\n", bm.bmWidthBytes);
2256 ok(!bm.bmBits,
"wrong bmBits %p\n", bm.bmBits);
2259 ok(
bytes == bm.bmWidthBytes * bm.bmHeight,
"expected %d got %d bytes\n", bm.bmWidthBytes * bm.bmHeight,
bytes);
2261 ok(
bytes == bm.bmWidthBytes * bm.bmHeight,
"expected %d got %d bytes\n",
2262 bm.bmWidthBytes * bm.bmHeight,
bytes);
2265 memset(bi, 0,
sizeof(*bi));
2278 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2284 ok(colors[0].rgbRed == 0 && colors[0].rgbGreen == 0 &&
2285 colors[0].rgbBlue == 0 && colors[0].rgbReserved == 0,
2286 "expected bmiColors[0] 0,0,0,0 - got %x %x %x %x\n",
2287 colors[0].rgbRed, colors[0].rgbGreen, colors[0].rgbBlue, colors[0].rgbReserved);
2288 ok(colors[1].rgbRed == 0xff && colors[1].rgbGreen == 0xff &&
2289 colors[1].rgbBlue == 0xff && colors[1].rgbReserved == 0,
2290 "expected bmiColors[0] 0xff,0xff,0xff,0 - got %x %x %x %x\n",
2291 colors[1].rgbRed, colors[1].rgbGreen, colors[1].rgbBlue, colors[1].rgbReserved);
2292 for (
i = 2;
i < 256;
i++)
2294 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2295 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2296 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2297 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2301 ok(!
memcmp(
buf, dib_bits_1,
sizeof(dib_bits_1)),
"DIB bits don't match\n");
2307 ok(((
WORD*)colors)[0] == 0,
"Color 0 is %d\n", ((
WORD*)colors)[0]);
2308 ok(((
WORD*)colors)[1] == 1,
"Color 1 is %d\n", ((
WORD*)colors)[1]);
2309 for (
i = 2;
i < 256;
i++)
2310 ok(((
WORD*)colors)[
i] == 0xAAAA,
"Color %d is %d\n",
i, ((
WORD*)colors)[
i]);
2313 memset(bi, 0,
sizeof(*bi));
2326 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2332 for (
i = 0;
i < 16;
i++)
2346 "expected bmiColors[%d] %x %x %x %x - got %x %x %x %x\n",
i,
2348 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2352 memset(bi, 0,
sizeof(*bi));
2365 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2371 for (
i = 0;
i < 256;
i++)
2375 if (i < 10 || i >= 246)
2384 expect.rgbRed = (
i & 0x07) << 5;
2385 expect.rgbGreen = (
i & 0x38) << 2;
2391 "expected bmiColors[%d] %x %x %x %x - got %x %x %x %x\n",
i,
2393 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2397 memset(bi, 0,
sizeof(*bi));
2410 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2416 for (
i = 0;
i < 256;
i++)
2418 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2419 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2420 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2421 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2425 ok(!
memcmp(
buf, dib_bits_24,
sizeof(dib_bits_24)),
"DIB bits don't match\n");
2450 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2456 ok(
hbm !=
NULL,
"CreateCompatibleBitmap failed?\n");
2460 ok(
ret == 1,
"GetDIBits failed\n");
2469 ok( !bitmasks[0],
"red mask is set\n" );
2470 ok( !bitmasks[1],
"green mask is set\n" );
2471 ok( !bitmasks[2],
"blue mask is set\n" );
2476 ok(
ret == 1,
"GetDIBits failed\n");
2478 ok( bitmasks[0] != 0,
"red mask is not set\n" );
2479 ok( bitmasks[1] != 0,
"green mask is not set\n" );
2480 ok( bitmasks[2] != 0,
"blue mask is not set\n" );
2484 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2492 ok( bitmasks[0] != 0,
"red mask is not set\n" );
2493 ok( bitmasks[1] != 0,
"green mask is not set\n" );
2494 ok( bitmasks[2] != 0,
"blue mask is not set\n" );
2498 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2505 ok( !bitmasks[0],
"red mask is set\n" );
2506 ok( !bitmasks[1],
"green mask is set\n" );
2507 ok( !bitmasks[2],
"blue mask is set\n" );
2515 ok( bitmasks[0] != 0,
"red mask is not set\n" );
2516 ok( bitmasks[1] != 0,
"green mask is not set\n" );
2517 ok( bitmasks[2] != 0,
"blue mask is not set\n" );
2521 else skip(
"bitmap in colortable mode, skipping BI_BITFIELDS tests\n");
2538 bitmasks[0] = 0x0000ff;
2539 bitmasks[1] = 0x00ff00;
2540 bitmasks[2] = 0xff0000;
2542 ok(
hbm != 0,
"failed to create bitmap\n" );
2544 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2547 ok(
ret == 1,
"GetDIBits failed\n");
2553 ok( !bitmasks[0],
"red mask is set\n" );
2554 ok( !bitmasks[1],
"green mask is set\n" );
2555 ok( !bitmasks[2],
"blue mask is set\n" );
2559 ok(
ret == 1,
"GetDIBits failed\n");
2566 ok( bitmasks[0] == 0xff0000,
"wrong red mask %08x\n", bitmasks[0] );
2567 ok( bitmasks[1] == 0x00ff00,
"wrong green mask %08x\n", bitmasks[1] );
2568 ok( bitmasks[2] == 0x0000ff,
"wrong blue mask %08x\n", bitmasks[2] );
2585 bitmasks[0] = 0x0000ff;
2586 bitmasks[1] = 0x00ff00;
2587 bitmasks[2] = 0xff0000;
2589 ok(
hbm != 0,
"failed to create bitmap\n" );
2593 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2596 ok(
ret == 1,
"GetDIBits failed\n");
2600 ok( !bitmasks[0],
"red mask is set\n" );
2601 ok( !bitmasks[1],
"green mask is set\n" );
2602 ok( !bitmasks[2],
"blue mask is set\n" );
2606 ok(
ret == 1,
"GetDIBits failed\n");
2607 ok( bitmasks[0] == 0x0000ff,
"wrong red mask %08x\n", bitmasks[0] );
2608 ok( bitmasks[1] == 0x00ff00,
"wrong green mask %08x\n", bitmasks[1] );
2609 ok( bitmasks[2] == 0xff0000,
"wrong blue mask %08x\n", bitmasks[2] );
2629 ok(
hbm == 0,
"creating 24-bpp BI_BITFIELDS dibsection should fail\n" );
2632 ok(
hbm != 0,
"failed to create bitmap\n" );
2634 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2637 ok(
ret == 1,
"GetDIBits failed\n");
2642 ok( !bitmasks[0],
"red mask is set\n" );
2643 ok( !bitmasks[1],
"green mask is set\n" );
2644 ok( !bitmasks[2],
"blue mask is set\n" );
2648 ok(
ret == 1,
"GetDIBits failed\n");
2650 ok( !bitmasks[0],
"red mask is set\n" );
2651 ok( !bitmasks[1],
"green mask is set\n" );
2652 ok( !bitmasks[2],
"blue mask is set\n" );
2664 DWORD depths[] = {8, 15, 16, 24, 32};
2669 ok(
hdc != 0,
"GetDC(0) failed\n");
2671 ok(
hbm != 0,
"CreateCompatibleBitmap failed\n");
2674 ok(hbm_old == 0,
"SelectObject should fail\n");
2680 ok(
hdc != 0,
"GetDC(0) failed\n");
2682 ok(
hbm != 0,
"CreateCompatibleBitmap failed\n");
2685 ok(hbm_old != 0,
"SelectObject failed\n");
2687 ok(hbm_old ==
hbm,
"SelectObject failed\n");
2696 ok(
hbm != 0,
"CreateBitmap failed\n");
2699 ok(hbm_old != 0,
"SelectObject failed\n");
2701 ok(hbm_old ==
hbm,
"SelectObject failed\n");
2705 for(
i = 0;
i <
sizeof(depths)/
sizeof(depths[0]);
i++) {
2711 ok(
hbm != 0,
"CreateBitmap failed\n");
2714 if(depths[
i] ==
bpp ||
2715 (
bpp == 16 && depths[
i] == 15)
2717 ok(hbm_old != 0,
"SelectObject failed, BITSPIXEL: %d, created depth: %d\n",
bpp, depths[
i]);
2720 ok(hbm_old == 0,
"SelectObject should fail. BITSPIXELS: %d, created depth: %d\n",
bpp, depths[
i]);
2723 memset(&bm, 0xAA,
sizeof(bm));
2725 ok(
bytes ==
sizeof(bm),
"GetObject returned %d\n",
bytes);
2726 ok(bm.bmType == 0,
"wrong bmType %d\n", bm.bmType);
2727 ok(bm.bmWidth == 10,
"wrong bmWidth %d\n", bm.bmWidth);
2728 ok(bm.bmHeight == 10,
"wrong bmHeight %d\n", bm.bmHeight);
2729 ok(bm.bmWidthBytes ==
get_bitmap_stride(bm.bmWidth, bm.bmBitsPixel),
"wrong bmWidthBytes %d\n", bm.bmWidthBytes);
2730 ok(bm.bmPlanes == planes,
"wrong bmPlanes %u\n", bm.bmPlanes);
2731 if(depths[
i] == 15) {
2732 ok(bm.bmBitsPixel == 16,
"wrong bmBitsPixel %d(15 bpp special)\n", bm.bmBitsPixel);
2734 ok(bm.bmBitsPixel == depths[
i],
"wrong bmBitsPixel %d\n", bm.bmBitsPixel);
2736 ok(!bm.bmBits,
"wrong bmBits %p\n", bm.bmBits);
2755 memset(&bm, 0xDA,
sizeof(bm));
2760 ok_(__FILE__,
line)(bm.bmType == 0,
"wrong bmType, expected 0 got %d\n", bm.bmType);
2761 ok_(__FILE__,
line)(bm.bmWidth == 1,
"wrong bmWidth, expected 1 got %d\n", bm.bmWidth);
2762 ok_(__FILE__,
line)(bm.bmHeight == 1,
"wrong bmHeight, expected 1 got %d\n", bm.bmHeight);
2763 ok_(__FILE__,
line)(bm.bmWidthBytes == 2,
"wrong bmWidthBytes, expected 2 got %d\n", bm.bmWidthBytes);
2764 ok_(__FILE__,
line)(bm.bmPlanes == 1,
"wrong bmPlanes, expected 1 got %u\n", bm.bmPlanes);
2765 ok_(__FILE__,
line)(bm.bmBitsPixel == 1,
"wrong bmBitsPixel, expected 1 got %d\n", bm.bmBitsPixel);
2766 ok_(__FILE__,
line)(!bm.bmBits,
"wrong bmBits %p\n", bm.bmBits);
2769#define test_mono_1x1_bmp(a) test_mono_1x1_bmp_dbg((a), __LINE__)
2795 ok(bm == bm1 && bm == bm4 && bm == bm5 && bm == curObj1 && bm == old1,
2796 "0: %p, 1: %p, 4: %p, 5: %p, curObj1 %p, old1 %p\n",
2797 bm, bm1, bm4, bm5, curObj1, old1);
2798 ok(bm != bm2 && bm != bm3,
"0: %p, 2: %p, 3: %p\n", bm, bm2, bm3);
2800 ok(bm != curObj2,
"0: %p, curObj2 %p\n", bm, curObj2);
2801 ok(old2 == 0,
"old2 %p\n", old2);
2826 bmp.bmWidthBytes = 28;
2828 bmp.bmBitsPixel = 1;
2836 for(
i = 1;
i <= 33;
i++) {
2840 bmp.bmWidthBytes = 28;
2842 bmp.bmBitsPixel =
i;
2848 ok(bm == 0,
"CreateBitmapIndirect for %d bpp succeeded\n",
i);
2861 }
else if(
i <= 16) {
2863 }
else if(
i <= 24) {
2865 }
else if(
i <= 32) {
2868 ok(
bmp.bmBitsPixel ==
expect,
"CreateBitmapIndirect for a %d bpp bitmap created a %d bpp bitmap, expected %d\n",
2890 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2951 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2963 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2968 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2982 int overwritten_bytes = 0;
2994 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
2995 info->bmiHeader.biWidth = 2;
2996 info->bmiHeader.biHeight = 2;
2997 info->bmiHeader.biPlanes = 1;
3001 ok(
ret != 0,
"GetDIBits failed got %d\n",
ret);
3005 overwritten_bytes++;
3006 ok(overwritten_bytes == 0,
"GetDIBits wrote past the buffer given\n");
3016 *srcBuffer = 0xFEDCBA98;
3017 *dstBuffer = 0x89ABCDEF;
3020 "BitBlt with dwRop %06X. Expected 0x%08X, got 0x%08X from line %d\n",