37#include "commoncontrols.h"
48#define IMAGELIST_MAGIC (('L' << 8) | 'I')
108 return pHIMAGELIST_QueryInterface !=
NULL;
112#define B(x,y) ((x?0xf0:0)|(y?0xf:0))
113#define ROW1(a,b,c,d,e,f,g,h) B(a,b),B(c,d),B(e,f),B(g,h)
114#define ROW32(a,b,c,d,e,f,g,h) ROW1(a,b,c,d,e,f,g,h), ROW1(a,b,c,d,e,f,g,h), \
115 ROW1(a,b,c,d,e,f,g,h), ROW1(a,b,c,d,e,f,g,h)
116#define ROW2(a,b,c,d,e,f,g,h,i,j,k,l) ROW1(a,b,c,d,e,f,g,h),B(i,j),B(k,l)
117#define ROW48(a,b,c,d,e,f,g,h,i,j,k,l) ROW2(a,b,c,d,e,f,g,h,i,j,k,l), \
118 ROW2(a,b,c,d,e,f,g,h,i,j,k,l), ROW2(a,b,c,d,e,f,g,h,i,j,k,l), \
119 ROW2(a,b,c,d,e,f,g,h,i,j,k,l)
125 ROW32(0,0,0,0,0,0,0,0),
126 ROW32(0,0,1,1,1,1,0,0),
127 ROW32(0,1,1,1,1,1,1,0),
128 ROW32(0,1,1,0,0,1,1,0),
129 ROW32(0,1,1,0,0,1,1,0),
130 ROW32(0,1,1,1,1,1,1,0),
131 ROW32(0,0,1,1,1,1,0,0),
132 ROW32(0,0,0,0,0,0,0,0)
137 ROW48(0,0,0,0,0,0,0,0,0,0,0,0),
138 ROW48(0,1,1,1,1,1,1,1,1,1,1,0),
139 ROW48(0,1,1,0,0,0,0,0,0,1,1,0),
140 ROW48(0,1,0,0,0,0,0,0,1,0,1,0),
141 ROW48(0,1,0,0,0,0,0,1,0,0,1,0),
142 ROW48(0,1,0,0,0,0,1,0,0,0,1,0),
143 ROW48(0,1,0,0,0,1,0,0,0,0,1,0),
144 ROW48(0,1,0,0,1,0,0,0,0,0,1,0),
145 ROW48(0,1,0,1,0,0,0,0,0,0,1,0),
146 ROW48(0,1,1,0,0,0,0,0,0,1,1,0),
147 ROW48(0,1,1,1,1,1,1,1,1,1,1,0),
148 ROW48(0,0,0,0,0,0,0,0,0,0,0,0)
157 ok(
himl !=
NULL,
"Failed to create image list, %d x %d.\n",
cx,
cy);
165 char className[] =
"bmwnd";
166 char winName[] =
"Test Bitmap";
238 printf(
"%c%c",
p[
j] & 0xf0 ?
'X' :
' ',
p[
j] & 0xf ?
'X' :
' ');
241 printf(
"%c%c",
q[
j] & 0xf0 ?
'X' :
' ',
q[
j] & 0xf ?
'X' :
' ');
277 "%s: bits different\n", loc);
291 ok(
count > 2,
"Tests need an ImageList with more than 2 images\n");
294 ret = pImageList_BeginDrag(
himl, 1, 0, 0);
295 drag = pImageList_GetDragImage(
NULL,
NULL);
296 ok(
ret && drag,
"ImageList_BeginDrag() failed\n");
297 ret = pImageList_BeginDrag(
himl, 0, 3, 5);
298 ok(!
ret,
"ImageList_BeginDrag() returned TRUE\n");
299 drag = pImageList_GetDragImage(
NULL, &hotspot);
300 ok(!!drag,
"No active ImageList drag left\n");
301 ok(hotspot.
x == 0 && hotspot.
y == 0,
"New ImageList drag was created\n");
302 pImageList_EndDrag();
303 drag = pImageList_GetDragImage(
NULL,
NULL);
304 ok(!drag,
"ImageList drag was not destroyed\n");
307 pImageList_BeginDrag(
himl, 0, 0, 0);
309 ok(!
ret,
"ImageList_BeginDrag() returned TRUE\n");
310 drag = pImageList_GetDragImage(
NULL, &hotspot);
311 ok(drag && hotspot.
x == 0 && hotspot.
y == 0,
"Active drag should not have been canceled\n");
312 pImageList_EndDrag();
313 drag = pImageList_GetDragImage(
NULL,
NULL);
314 ok(!drag,
"ImageList drag was not destroyed\n");
316 ret = pImageList_BeginDrag(
himl, -17, 0, 0);
317 drag = pImageList_GetDragImage(
NULL,
NULL);
318 ok(
ret && drag,
"ImageList drag was created\n");
319 pImageList_EndDrag();
320 ret = pImageList_BeginDrag(
himl, -1, 0, 0);
321 drag = pImageList_GetDragImage(
NULL,
NULL);
322 ok(
ret && drag,
"ImageList drag was created\n");
323 pImageList_EndDrag();
324 pImageList_Destroy(
himl);
338#define HOTSPOTS_MAX 4
353 int dx1 = hotspots[
i].dx;
354 int dy1 = hotspots[
i].dy;
355 int dx2 = hotspots[
j].dx;
356 int dy2 = hotspots[
j].dy;
357 int correctx, correcty, newx, newy;
362 ret = pImageList_BeginDrag(himl1, 0, dx1, dy1);
363 ok(
ret != 0,
"BeginDrag failed for { %d, %d }\n", dx1, dy1);
364 sprintf(loc,
"BeginDrag (%d,%d)\n",
i,
j);
368 ret = pImageList_SetDragCursorImage(himl2, 0, dx2, dy2);
369 ok(
ret != 0,
"SetDragCursorImage failed for {%d, %d}{%d, %d}\n",
371 sprintf(loc,
"SetDragCursorImage (%d,%d)\n",
i,
j);
375 himlNew = pImageList_GetDragImage(
NULL, &ppt);
376 ok(ppt.
x == dx1 && ppt.
y == dy1,
377 "Expected drag hotspot [%d,%d] got [%d,%d]\n",
378 dx1, dy1, ppt.
x, ppt.
y);
380 pImageList_GetIconSize(himlNew, &newx, &newy);
383 ok(newx == correctx && newy == correcty,
384 "Expected drag image size [%d,%d] got [%d,%d]\n",
385 correctx, correcty, newx, newy);
386 sprintf(loc,
"GetDragImage (%d,%d)\n",
i,
j);
388 pImageList_EndDrag();
396 pImageList_Destroy(himl2);
397 pImageList_Destroy(himl1);
411 ok(
himl!=0,
"failed to create imagelist\n");
415 ok(hicon1 != 0,
"no hicon1\n");
417 ok(hicon2 != 0,
"no hicon2\n");
419 ok(hicon3 != 0,
"no hicon3\n");
422 ok(!pImageList_Remove(
himl, 0),
"Removed nonexistent icon.\n");
424 ok(pImageList_Remove(
himl, -1),
"Removed nonexistent icon\n");
427 ok(0 == pImageList_ReplaceIcon(
himl, -1, hicon1),
"Failed to add icon1.\n");
428 ok(1 == pImageList_ReplaceIcon(
himl, -1, hicon2),
"Failed to add icon2.\n");
429 ok(2 == pImageList_ReplaceIcon(
himl, -1, hicon3),
"Failed to add icon3.\n");
432 ok(!pImageList_Remove(
himl, 4711),
"removed nonexistent icon\n");
435 ok(pImageList_Remove(
himl, 0),
"Can't remove 0\n");
436 ok(pImageList_Remove(
himl, 0),
"Can't remove 0\n");
437 ok(pImageList_Remove(
himl, 0),
"Can't remove 0\n");
440 ok(!pImageList_Remove(
himl, 0),
"Removed nonexistent icon.\n");
443 ok(pImageList_Destroy(
himl),
"Failed to destroy imagelist.\n");
445 ok(-1 == pImageList_ReplaceIcon((
HIMAGELIST)0xdeadbeef, -1, hicon1),
"Don't crash on bad handle\n");
456 ok(0 == pImageList_GetImageCount((
HIMAGELIST)0xdeadbeef),
"don't crash on bad handle\n");
458 if (!pImageList_SetImageCount)
460 win_skip(
"ImageList_SetImageCount not available\n");
465 ok(
himl != 0,
"Failed to create imagelist.\n");
467 ok(pImageList_SetImageCount(
himl, 3),
"couldn't increase image count\n");
468 ok(pImageList_GetImageCount(
himl) == 3,
"invalid image count after increase\n");
469 ok(pImageList_SetImageCount(
himl, 1),
"couldn't decrease image count\n");
470 ok(pImageList_GetImageCount(
himl) == 1,
"invalid image count after decrease to 1\n");
471 ok(pImageList_SetImageCount(
himl, 0),
"couldn't decrease image count\n");
472 ok(pImageList_GetImageCount(
himl) == 0,
"invalid image count after decrease to 0\n");
474 ok(pImageList_Destroy(
himl),
"Failed to destroy imagelist.\n");
489 if (!pImageList_DrawIndirect)
491 win_skip(
"ImageList_DrawIndirect not available, skipping test\n");
501 ok(
himl != 0,
"Failed to create imagelist.\n");
505 ok(hbm1 != 0,
"no bitmap 1\n");
507 ok(hbm2 != 0,
"no bitmap 2\n");
509 ok(hbm3 != 0,
"no bitmap 3\n");
512 ok(0 == pImageList_Add(
himl, hbm1, 0),
"failed to add bitmap 1\n");
513 ok(1 == pImageList_Add(
himl, hbm2, 0),
"failed to add bitmap 2\n");
515 if (pImageList_SetImageCount)
517 ok(pImageList_SetImageCount(
himl,3),
"Setimage count failed\n");
519 ok(pImageList_Replace(
himl, 2, hbm3, 0),
"failed to replace bitmap 3\n");
522 memset(&imldp, 0,
sizeof (imldp));
523 ok(!pImageList_DrawIndirect(&imldp),
"zero data succeeded!\n");
525 ok(!pImageList_DrawIndirect(&imldp),
"zero hdc succeeded!\n");
527 ok(!pImageList_DrawIndirect(&imldp),
"zero himl succeeded!\n");
529 ok(!pImageList_DrawIndirect(&imldp),
"bad himl succeeded!\n");
539 ok(pImageList_DrawIndirect(&imldp),
"should succeed\n");
541 ok(pImageList_DrawIndirect(&imldp),
"should succeed\n");
543 ok(pImageList_DrawIndirect(&imldp),
"should succeed\n");
545 ok(!pImageList_DrawIndirect(&imldp),
"should fail\n");
548 ok(pImageList_Remove(
himl, 0),
"removing 1st bitmap\n");
549 ok(pImageList_Remove(
himl, 0),
"removing 2nd bitmap\n");
550 ok(pImageList_Remove(
himl, 0),
"removing 3rd bitmap\n");
553 ok(pImageList_Destroy(
himl),
"Failed to destroy imagelist.\n");
571 memset(&bmi, 0,
sizeof(bmi));
574 ok(
ret,
"GetDIBits failed\n");
590 ok(hicon1 !=
NULL,
"failed to create hicon1\n");
592 for (
i = 0;
i < 8;
i++)
594 himl[
i] = pImageList_Create(32, 32,
sizes[
i], 0, 3);
596 ok(0 == pImageList_ReplaceIcon(
himl[
i], -1, hicon1),
"Failed to add icon1 to himl[%d].\n",
i);
597 if (
i == 0 ||
i == 1 ||
i == 7)
599 pImageList_GetImageInfo(
himl[
i], 0, &
info);
604 for (
i = 0;
i < 8;
i++)
605 for (
j = 0;
j < 8;
j++)
607 hmerge = pImageList_Merge(
himl[
i], 0,
himl[
j], 0, 0, 0);
608 ok(hmerge !=
NULL,
"merge himl[%d], himl[%d] failed\n",
i,
j);
610 pImageList_GetImageInfo(hmerge, 0, &
info);
613 if (
i == 4 &&
j == 7)
615 "wrong biBitCount %d when merging lists %d (%d) and %d (%d)\n",
bpp,
i,
sizes[
i],
j,
sizes[
j]);
618 "wrong biBitCount %d when merging lists %d (%d) and %d (%d)\n",
bpp,
i,
sizes[
i],
j,
sizes[
j]);
619 ok(
info.hbmMask != 0,
"Imagelist merged from %d and %d had no mask\n",
i,
j);
621 pImageList_Destroy(hmerge);
624 for (
i = 0;
i < 8;
i++)
625 pImageList_Destroy(
himl[
i]);
634 himl1 = pImageList_Create(32, 32, 0, 0, 3);
635 ok(himl1 !=
NULL,
"failed to create himl1\n");
637 himl2 = pImageList_Create(32, 32, 0, 0, 3);
638 ok(himl2 !=
NULL,
"failed to create himl2\n");
641 ok(hicon1 !=
NULL,
"failed to create hicon1\n");
643 if (!himl1 || !himl2 || !hicon1)
646 ok(0 == pImageList_ReplaceIcon(himl2, -1, hicon1),
"Failed to add icon1 to himl2.\n");
650 hmerge = pImageList_Merge(himl1, -1, himl2, 0, 0, 0);
651 ok(hmerge !=
NULL,
"merge himl1,-1 failed\n");
653 pImageList_Destroy(hmerge);
655 hmerge = pImageList_Merge(himl1, 0, himl2, 0, 0, 0);
656 ok(hmerge !=
NULL,
"merge himl1,0 failed\n");
658 pImageList_Destroy(hmerge);
661 pImageList_Destroy(himl2);
662 himl2 = pImageList_Create(32, 32, 0, 0, 3);
663 ok(himl2 !=
NULL,
"failed to recreate himl2\n");
667 hmerge = pImageList_Merge(himl1, -1, himl2, -1, 0, 0);
668 ok(hmerge !=
NULL,
"merge himl2,-1 failed\n");
670 pImageList_Destroy(hmerge);
672 hmerge = pImageList_Merge(himl1, -1, himl2, 0, 0, 0);
673 ok(hmerge !=
NULL,
"merge himl2,0 failed\n");
675 pImageList_Destroy(hmerge);
678 ok(0 == pImageList_ReplaceIcon(himl2, -1, hicon1),
"Failed to re-add icon1 to himl2.\n");
680 hmerge = pImageList_Merge(himl2, 0, himl2, 0, 0, 0);
681 ok(hmerge !=
NULL,
"merge himl2 with itself failed\n");
683 pImageList_Destroy(hmerge);
686 ok(0 == pImageList_ReplaceIcon(himl1, -1, hicon1),
"Failed to add icon1 to himl1.\n");
688 hmerge = pImageList_Merge(himl1, 0, himl2, 0, 0, 0);
689 ok(hmerge !=
NULL,
"merge himl1 with himl2 failed\n");
691 pImageList_Destroy(hmerge);
693 hmerge = pImageList_Merge(himl1, 0, himl2, 0, 8, 16);
694 ok(hmerge !=
NULL,
"merge himl1 with himl2 8,16 failed\n");
696 pImageList_Destroy(hmerge);
698 pImageList_Destroy(himl1);
699 pImageList_Destroy(himl2);
722 ok(0,
"unexpected call\n");
728 ok(0,
"unexpected call\n");
734 ok(0,
"unexpected call\n");
742 return IStream_Read(
stream->stream, pv,
cb, pcbRead);
749 return IStream_Write(
stream->stream, pv,
cb, pcbWritten);
761 ok(new_pos !=
NULL,
"Unexpected out position pointer.\n");
766 ok(0,
"unexpected call\n");
773 ok(0,
"unexpected call\n");
781 ok(0,
"unexpected call\n");
787 ok(0,
"unexpected call\n");
793 ok(0,
"unexpected call\n");
800 ok(0,
"unexpected call\n");
807 ok(0,
"unexpected call\n");
814 ok(0,
"unexpected call\n");
820 ok(0,
"unexpected call\n");
848 ok(
hr ==
S_OK,
"Failed to create a stream, hr %#x.\n",
hr);
853 IStream_Release(
stream->stream);
858 return ((
width *
bpp + 31) / 8) & ~3;
868 hdr_size =
sizeof(*bmfh) +
sizeof(*bmih);
871 ok(bmfh->
bfType == ((
'M' << 8) |
'B'),
"wrong bfType 0x%02x\n", bmfh->
bfType);
872 ok(bmfh->
bfSize == hdr_size,
"wrong bfSize 0x%02x\n", bmfh->
bfSize);
877 ok(bmih->
biSize ==
sizeof(*bmih),
"wrong biSize %d\n", bmih->
biSize);
892 fwrite(bm_data, 1, bm_data_size,
f);
901 return (
header->usVersion & 0xff00) == 0x600;
915 grow_aligned = (
WORD)(grow + 3) & ~3;
919 grow = (
WORD)(grow + 2 + 3) & ~3;
921 "Unexpected cGrow %d, expected %d\n", ilh->
cGrow, grow);
926 ok(ilh->
cGrow == grow_aligned,
"Unexpected cGrow %d, expected %d\n", ilh->
cGrow, grow_aligned);
929 ok(ilh->
cx ==
cx,
"wrong cx %d (expected %d)\n", ilh->
cx,
cx);
930 ok(ilh->
cy ==
cy,
"wrong cy %d (expected %d)\n", ilh->
cy,
cy);
933 "wrong flags %04x\n", ilh->
flags);
934 ok(ilh->
ovls[0] == -1,
"wrong ovls[0] %04x\n", ilh->
ovls[0]);
935 ok(ilh->
ovls[1] == -1,
"wrong ovls[1] %04x\n", ilh->
ovls[1]);
936 ok(ilh->
ovls[2] == -1,
"wrong ovls[2] %04x\n", ilh->
ovls[2]);
937 ok(ilh->
ovls[3] == -1,
"wrong ovls[3] %04x\n", ilh->
ovls[3]);
950 memset(&bmi, 0,
sizeof(bmi));
975 const int tile_count = 4;
985 sz->
cy = ((
header->cMaxImage + tile_count - 1) / tile_count) *
header->cy;
1005 ret = pImageList_GetImageCount(
himl);
1008 ret = pImageList_GetIconSize(
himl, &cxx, &cyy);
1009 ok(
ret,
"ImageList_GetIconSize failed\n");
1010 ok(cxx ==
cx,
"%s: wrong cx %d (expected %d)\n",
comment, cxx,
cx);
1011 ok(cyy ==
cy,
"%s: wrong cy %d (expected %d)\n",
comment, cyy,
cy);
1015 ok(
b,
"%s: ImageList_Write failed\n",
comment);
1020 hr = IStream_Stat(
stream.stream, &
stat, STATFLAG_NONAME);
1021 ok(
hr ==
S_OK,
"Stat() failed, hr %#x.\n",
hr);
1025 ok(
data != 0,
"%s: ImageList_Write didn't write any data\n",
comment);
1026 ok(
stat.cbSize.LowPart >
sizeof(
ILHEAD),
"%s: ImageList_Write wrote not enough data\n",
comment);
1042 IStream_Seek(
stream.stream, mv, STREAM_SEEK_SET,
NULL);
1044 ok(himl2 !=
NULL,
"%s: Failed to deserialize imagelist\n",
comment);
1045 pImageList_Destroy(himl2);
1060 ok(
ret != -1,
"Failed to add image to imagelist.\n");
1117 ok(
himl != 0,
"ImageList_Create failed\n");
1124 ret = pImageList_Remove(
himl, 4);
1125 ok(
ret,
"ImageList_Remove failed\n");
1128 ret = pImageList_Remove(
himl, 5);
1129 ok(
ret,
"ImageList_Remove failed\n");
1132 ret = pImageList_Remove(
himl, 6);
1133 ok(
ret,
"ImageList_Remove failed\n");
1136 ret = pImageList_Remove(
himl, 7);
1137 ok(
ret,
"ImageList_Remove failed\n");
1140 ret = pImageList_Remove(
himl, -2);
1141 ok(!
ret,
"ImageList_Remove(-2) should fail\n");
1144 ret = pImageList_Remove(
himl, 20);
1145 ok(!
ret,
"ImageList_Remove(20) should fail\n");
1148 ret = pImageList_Remove(
himl, -1);
1149 ok(
ret,
"ImageList_Remove(-1) failed\n");
1152 ret = pImageList_Destroy(
himl);
1153 ok(
ret,
"ImageList_Destroy failed\n");
1158 ok(
himl != 0,
"ImageList_Create failed\n");
1162 ok(
ret == 0,
"ImageList_Add returned %d, expected 0\n",
ret);
1165 ret = pImageList_Destroy(
himl);
1166 ok(
ret,
"ImageList_Destroy failed\n");
1169 ok(
himl != 0,
"ImageList_Create failed\n");
1173 ok(
ret == 0,
"ImageList_Add returned %d, expected 0\n",
ret);
1176 ok(
ret == 9,
"ImageList_Add returned %d, expected 9\n",
ret);
1179 ret = pImageList_Destroy(
himl);
1180 ok(
ret,
"ImageList_Destroy failed\n");
1183 ok(
himl != 0,
"ImageList_Create failed\n");
1185 ret = pImageList_Destroy(
himl);
1186 ok(
ret,
"ImageList_Destroy failed\n");
1189 ok(
himl != 0,
"ImageList_Create failed\n");
1191 ret = pImageList_Destroy(
himl);
1192 ok(
ret,
"ImageList_Destroy failed\n");
1195 ok(
himl != 0,
"ImageList_Create failed\n");
1197 ret = pImageList_Destroy(
himl);
1198 ok(
ret,
"ImageList_Destroy failed\n");
1201 ok(
himl != 0,
"ImageList_Create failed\n");
1203 ret = pImageList_Destroy(
himl);
1204 ok(
ret,
"ImageList_Destroy failed\n");
1207 ok(
himl != 0,
"ImageList_Create failed\n");
1209 ret = pImageList_Destroy(
himl);
1210 ok(
ret,
"ImageList_Destroy failed\n");
1213 ok(
himl != 0,
"ImageList_Create failed\n");
1215 ret = pImageList_Destroy(
himl);
1216 ok(
ret,
"ImageList_Destroy failed\n");
1219 ok(
himl != 0,
"ImageList_Create failed\n");
1221 ret = pImageList_Destroy(
himl);
1222 ok(
ret,
"ImageList_Destroy failed\n");
1225 ok(
himl != 0,
"ImageList_Create failed\n");
1227 ret = pImageList_Destroy(
himl);
1228 ok(
ret,
"ImageList_Destroy failed\n");
1231 ok(
himl != 0,
"ImageList_Create failed\n");
1233 ret = pImageList_Destroy(
himl);
1234 ok(
ret,
"ImageList_Destroy failed\n");
1237 ok(
himl != 0,
"ImageList_Create failed\n");
1240 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 0,
"Failed to add icon.\n");
1241 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 1,
"Failed to add icon.\n");
1244 ret = pImageList_Destroy(
himl);
1245 ok(
ret,
"ImageList_Destroy failed\n");
1248 ok(
himl != 0,
"ImageList_Create failed\n");
1251 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 0,
"Failed to add icon.\n");
1252 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 1,
"Failed to add icon.\n");
1255 ret = pImageList_Destroy(
himl);
1256 ok(
ret,
"ImageList_Destroy failed\n");
1259 ok(
himl != 0,
"ImageList_Create failed\n");
1262 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 0,
"Failed to add icon.\n");
1263 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 1,
"Failed to add icon.\n");
1266 ret = pImageList_Destroy(
himl);
1267 ok(
ret,
"ImageList_Destroy failed\n");
1270 ok(
himl != 0,
"ImageList_Create failed\n");
1273 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 0,
"Failed to add icon.\n");
1274 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 1,
"Failed to add icon.\n");
1276 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 2,
"Failed to add icon\n");
1279 ok( pImageList_Remove(
himl, -1) ==
TRUE,
"Failed to remove icon.\n");
1281 ok( pImageList_SetImageCount(
himl, 22) ==
TRUE,
"Failed to set image count.\n");
1283 ok( pImageList_SetImageCount(
himl, 0) ==
TRUE,
"Failed to set image count.\n");
1285 ok( pImageList_SetImageCount(
himl, 42) ==
TRUE,
"Failed to set image count.\n");
1287 ret = pImageList_Destroy(
himl);
1288 ok(
ret,
"ImageList_Destroy failed\n");
1290 for (grow = 1; grow <= 16; grow++)
1293 ok(
himl != 0,
"ImageList_Create failed\n");
1295 ret = pImageList_Destroy(
himl);
1296 ok(
ret,
"ImageList_Destroy failed\n");
1300 ok(
himl != 0,
"ImageList_Create failed\n");
1302 ret = pImageList_Destroy(
himl);
1303 ok(
ret,
"ImageList_Destroy failed\n");
1309 ok(
himl != 0,
"ImageList_Create failed\n");
1311 ret = pImageList_Destroy(
himl);
1312 ok(
ret,
"ImageList_Destroy failed\n");
1315 ok(
himl != 0,
"ImageList_Create failed\n");
1317 ret = pImageList_Destroy(
himl);
1318 ok(
ret,
"ImageList_Destroy failed\n");
1336 if (!pSHGetImageList)
1338 win_skip(
"SHGetImageList not available, skipping test\n");
1352 IImageList_GetImageCount(iml, &
out);
1353 ok(
out > 0,
"IImageList_GetImageCount returned out <= 0\n");
1360 IImageList_GetImageRect(iml, 0, &
rect);
1362 "IImageList_GetImageRect returned r:%d,b:%d\n",
1365 IImageList_Release(iml);
1393 const INT32 tolerance = 8;
1399 return (dr <= tolerance && dg <= tolerance && db <= tolerance);
1405 bits[0] = 0x00FFFFFF;
1406 pImageList_DrawIndirect(ildp);
1408 "ImageList_DrawIndirect: Pixel %08X, Expected a close match to %08X from line %d\n",
1417 0, 0, 0, 0, 0, 0,
CLR_NONE,
CLR_NONE, fStyle, 0,
ILS_NORMAL, 0, 0x00000000};
1425 0, 0, 0, 0, 0, 0,
CLR_NONE,
CLR_NONE,
ILD_IMAGE |
ILD_ROP, dwRop,
ILS_NORMAL, 0, 0x00000000};
1433 0, 0, 0, 0, 0, 0,
CLR_NONE,
CLR_NONE, fStyle, 0, fState, Frame, 0x00000000};
1442 0, 0, 0, 0, 0, 0,
CLR_NONE,
CLR_NONE, fStyle, 0, fState, Frame, 0x00000000};
1443 bits[0] = 0x00FFFFFF;
1444 pImageList_DrawIndirect(&ildp);
1447 "ImageList_DrawIndirect: Pixel %08X, Expected a close match to %08X from line %d\n",
1459 int iImage = -1, iAlphaImage = -1, iTransparentImage = -1;
1461 UINT32 maskBits = 0x00000000, inverseMaskBits = 0xFFFFFFFF;
1462 int bpp, broken_value;
1468 ok(
hdcDst != 0,
"CreateCompatibleDC(0) failed to return a valid DC\n");
1474 ok(hbmMask != 0,
"CreateBitmap failed\n");
1477 hbmInverseMask =
CreateBitmap(2, 1, 1, 1, &inverseMaskBits);
1478 ok(hbmInverseMask != 0,
"CreateBitmap failed\n");
1479 if(!hbmInverseMask)
goto cleanup;
1482 ok(
himl != 0,
"ImageList_Create failed\n");
1489 iImage = pImageList_Add(
himl, hbmImage, hbmMask);
1490 ok(iImage != -1,
"ImageList_Add failed\n");
1491 if(iImage == -1)
goto cleanup;
1495 if(!hbmAlphaImage)
goto cleanup;
1497 iAlphaImage = pImageList_Add(
himl, hbmAlphaImage, hbmMask);
1498 ok(iAlphaImage != -1,
"ImageList_Add failed\n");
1499 if(iAlphaImage == -1)
goto cleanup;
1503 if(!hbmTransparentImage)
goto cleanup;
1505 iTransparentImage = pImageList_Add(
himl, hbmTransparentImage, hbmMask);
1506 ok(iTransparentImage != -1,
"ImageList_Add failed\n");
1507 if(iTransparentImage == -1)
goto cleanup;
1512 ok (hbmDst &&
bits,
"CreateDIBSection failed to return a valid bitmap and buffer\n");
1513 if (!hbmDst || !
bits)
1520 if (
bpp == 16 ||
bpp == 24) broken_value = 0x00D4D9DD;
1521 else broken_value = 0x00B4BDC4;
1530 if (
bpp == 16 ||
bpp == 24) broken_value = 0x00D4D9DD;
1531 else broken_value = 0x009DA8B1;
1533 if (
bpp == 16 ||
bpp == 24) broken_value = 0x00D4D9DD;
1534 else broken_value = 0x008C99A3;
1577 if(hbmTransparentImage)
1582 ret = pImageList_Destroy(
himl);
1583 ok(
ret,
"ImageList_Destroy failed\n");
1595 if (!pHIMAGELIST_QueryInterface)
1597 win_skip(
"XP imagelist functions not available\n");
1603 ret = IImageList_AddRef(imgl);
1604 ok(
ret == 2,
"Expected 2, got %d\n",
ret);
1613 ret = IImageList_AddRef(imgl);
1614 ok(
ret == 2,
"Expected 2, got %d\n",
ret);
1617 ret = IImageList_Release(imgl);
1618 ok(
ret == 0,
"Expected 0, got %d\n",
ret);
1624 hr = pHIMAGELIST_QueryInterface((
HIMAGELIST)imgl, &IID_IImageList, (
void**)&imgl2);
1626 ok(imgl2 == imgl,
"got different pointer\n");
1627 ret = IImageList_Release(imgl);
1629 IImageList_Release(imgl);
1631 if (!pImageList_CoCreateInstance)
1633 win_skip(
"Vista imagelist functions not available\n");
1637 hr = pImageList_CoCreateInstance(&CLSID_ImageList,
NULL, &IID_IImageList, (
void **) &imgl);
1641 IImageList_Release(imgl);
1648 hr = (pHIMAGELIST_QueryInterface)(
himl, &IID_IImageList, (
void **) &imgl);
1652 IImageList_Release(imgl);
1654 pImageList_Destroy(
himl);
1657 hr = pImageList_CoCreateInstance(&CLSID_ImageList,
NULL, &IID_IImageList2, (
void**)&imagelist);
1660 win_skip(
"IImageList2 is not supported.\n");
1664 IImageList2_Release(imagelist);
1681 ok(
himl != 0,
"failed to create imagelist\n");
1687 ok(hicon1 != 0,
"no hicon1\n");
1689 ok(hicon2 != 0,
"no hicon2\n");
1691 ok(hicon3 != 0,
"no hicon3\n");
1694 hr = IImageList_Remove(imgl, 0);
1698 hr = IImageList_Remove(imgl, -1);
1699 ok(
hr ==
S_OK,
"removed nonexistent icon\n");
1703 ok( IImageList_ReplaceIcon(imgl, -1, hicon1, &
ret) ==
S_OK && (
ret == 0),
"failed to add icon1\n");
1705 ok( IImageList_ReplaceIcon(imgl, -1, hicon2, &
ret) ==
S_OK && (
ret == 1),
"failed to add icon2\n");
1707 ok( IImageList_ReplaceIcon(imgl, -1, hicon3, &
ret) ==
S_OK && (
ret == 2),
"failed to add icon3\n");
1713 ok( IImageList_Remove(imgl,0) ==
S_OK,
"can't remove 0\n");
1714 ok( IImageList_Remove(imgl,0) ==
S_OK,
"can't remove 0\n");
1715 ok( IImageList_Remove(imgl,0) ==
S_OK,
"can't remove 0\n");
1720 IImageList_Release(imgl);
1735 ok(
himl != 0,
"failed to create imagelist\n");
1740 hr = IImageList_SetImageCount(imgl, 3);
1743 hr = IImageList_GetImageCount(imgl, &
ret);
1744 ok(
hr ==
S_OK &&
ret == 3,
"invalid image count after increase\n");
1745 hr = IImageList_SetImageCount(imgl, 1);
1748 hr = IImageList_GetImageCount(imgl, &
ret);
1749 ok(
hr ==
S_OK &&
ret == 1,
"invalid image count after decrease to 1\n");
1750 hr = IImageList_SetImageCount(imgl, 0);
1753 hr = IImageList_GetImageCount(imgl, &
ret);
1754 ok(
hr ==
S_OK &&
ret == 0,
"invalid image count after decrease to 0\n");
1756 IImageList_Release(imgl);
1780 ok(
himl!=0,
"failed to create imagelist\n");
1786 ok(hbm1 != 0,
"no bitmap 1\n");
1788 ok(hbm2 != 0,
"no bitmap 2\n");
1790 ok(hbm3 != 0,
"no bitmap 3\n");
1794 ok( IImageList_Add(imgl, hbm1, 0, &
ret) ==
S_OK && (
ret == 0),
"failed to add bitmap 1\n");
1796 ok( IImageList_Add(imgl, hbm2, 0, &
ret) ==
S_OK && (
ret == 1),
"failed to add bitmap 2\n");
1798 ok( IImageList_SetImageCount(imgl, 3) ==
S_OK,
"Setimage count failed\n");
1799 ok( IImageList_Replace(imgl, 2, hbm3, 0) ==
S_OK,
"failed to replace bitmap 3\n");
1804 IImageList_Draw(imgl,
NULL);
1807 memset(&imldp, 0,
sizeof (imldp));
1808 hr = IImageList_Draw(imgl, &imldp);
1822 ok( IImageList_Draw(imgl, &imldp) ==
S_OK,
"should succeed\n");
1824 ok( IImageList_Draw(imgl, &imldp) ==
S_OK,
"should succeed\n");
1826 ok( IImageList_Draw(imgl, &imldp) ==
S_OK,
"should succeed\n");
1828 ok( IImageList_Draw(imgl, &imldp) ==
E_INVALIDARG,
"should fail\n");
1831 ok( IImageList_Remove(imgl, 0) ==
S_OK,
"removing 1st bitmap\n");
1832 ok( IImageList_Remove(imgl, 0) ==
S_OK,
"removing 2nd bitmap\n");
1833 ok( IImageList_Remove(imgl, 0) ==
S_OK,
"removing 3rd bitmap\n");
1836 IImageList_Release(imgl);
1856 himl1 = pImageList_Create(32,32,0,0,3);
1857 ok(himl1 !=
NULL,
"failed to create himl1\n");
1859 himl2 = pImageList_Create(32,32,0,0,3);
1860 ok(himl2 !=
NULL,
"failed to create himl2\n");
1863 ok(hicon1 !=
NULL,
"failed to create hicon1\n");
1865 if (!himl1 || !himl2 || !hicon1)
1873 ok( IImageList_ReplaceIcon(imgl2, -1, hicon1, &
ret) ==
S_OK && (
ret == 0),
"add icon1 to himl2 failed\n");
1878 IImageList_Merge(imgl1, -1,
NULL, 0, 0, 0, &IID_IImageList, (
void**)&
merge);
1879 IImageList_Merge(imgl1, -1, (
IUnknown*) imgl2, 0, 0, 0, &IID_IImageList,
NULL);
1883 hr = IImageList_Merge(imgl1, -1, (
IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (
void **) &
merge);
1884 ok(
hr ==
S_OK,
"merge himl1,-1 failed\n");
1887 hr = IImageList_Merge(imgl1, 0, (
IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (
void **) &
merge);
1888 ok(
hr ==
S_OK,
"merge himl1,0 failed\n");
1892 IImageList_Release(imgl2);
1893 himl2 = pImageList_Create(32,32,0,0,3);
1894 ok(himl2 !=
NULL,
"failed to recreate himl2\n");
1898 hr = IImageList_Merge(imgl1, -1, (
IUnknown *) imgl2, -1, 0, 0, &IID_IImageList, (
void **) &
merge);
1899 ok(
hr ==
S_OK,
"merge himl2,-1 failed\n");
1902 hr = IImageList_Merge(imgl1, -1, (
IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (
void **) &
merge);
1903 ok(
hr ==
S_OK,
"merge himl2,0 failed\n");
1908 ok( IImageList_ReplaceIcon(imgl2, -1, hicon1, &
ret) ==
S_OK && (
ret == 0),
"re-add icon1 to himl2 failed\n");
1910 hr = IImageList_Merge(imgl2, 0, (
IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (
void **) &
merge);
1911 ok(
hr ==
S_OK,
"merge himl2 with itself failed\n");
1916 ok( IImageList_ReplaceIcon(imgl1, -1, hicon1, &
ret) ==
S_OK && (
ret == 0),
"add icon1 to himl1 failed\n");
1918 hr = IImageList_Merge(imgl1, 0, (
IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (
void **) &
merge);
1919 ok(
hr ==
S_OK,
"merge himl1 with himl2 failed\n");
1922 hr = IImageList_Merge(imgl1, 0, (
IUnknown *) imgl2, 0, 8, 16, &IID_IImageList, (
void **) &
merge);
1923 ok(
hr ==
S_OK,
"merge himl1 with himl2 8,16 failed\n");
1926 IImageList_Release(imgl1);
1927 IImageList_Release(imgl2);
1948 ok(
cx == 0x1abe11ed,
"got %d\n",
cx);
1953 ok(
cy == 0x1abe11ed,
"got %d\n",
cy);
1955 pImageList_Destroy(
himl);
1984 rc = pImageList_Destroy((
HIMAGELIST)0xdeadbeef);
1985 ok(rc ==
FALSE,
"ImageList_Destroy(0xdeadbeef) should fail and not crash\n");
1991 pImageList_GetIconSize(
himl, &
cx, &
cy);
1992 ok (
cx == 0,
"Wrong cx (%i)\n",
cx);
1993 ok (
cy == 14,
"Wrong cy (%i)\n",
cy);
1994 pImageList_Destroy(
himl);
1998 pImageList_GetIconSize(
himl, &
cx, &
cy);
1999 ok (
cx == 0,
"Wrong cx (%i)\n",
cx);
2000 ok (
cy == 0,
"Wrong cy (%i)\n",
cy);
2001 pImageList_Destroy(
himl);
2005 pImageList_GetIconSize(
himl, &
cx, &
cy);
2006 ok (
cx == 0,
"Wrong cx (%i)\n",
cx);
2007 ok (
cy == 0,
"Wrong cy (%i)\n",
cy);
2009 pImageList_SetImageCount(
himl, 3);
2010 ret = pImageList_GetImageCount(
himl);
2011 ok(
ret == 3,
"Unexpected image count after increase\n");
2014 pImageList_Destroy(
himl);
2036 int i,
depth = ilc & 0xfe;
2042 memset(bmi_buffer, 0,
sizeof(bmi_buffer));
2059 "%d: %s: got color[%d] %02x %02x %02x expect %02x %02x %02x\n",
depth,
name,
i,
2081 memset(bmi_buffer, 0,
sizeof(bmi_buffer));
2099 for (
i = 0;
i < 256;
i++)
2104 table[
i].rgbReserved = 0;
2110 ok(0,
"unhandled depth %d\n",
bpp);
2130 himl = pImageList_Create(16, 16, ilc, 0, 3);
2133 memset(bmi_buffer, 0,
sizeof(bmi_buffer));
2172 ret = pImageList_Remove(
himl, -1);
2178 rgb[0].rgbRed = 0xff;
2179 rgb[1].rgbGreen = 0xff;
2180 rgb[2].rgbBlue = 0xff;
2185 ret = pImageList_Remove(
himl, -1);
2191 pImageList_Destroy(
himl);
2192 himl = pImageList_Create(16, 16, ilc, 0, 3);
2200 rgb[0].rgbRed = 0xff;
2201 rgb[0].rgbBlue = 0xff;
2202 rgb[1].rgbRed = 0xff;
2203 rgb[1].rgbGreen = 0xff;
2204 rgb[2].rgbGreen = 0xff;
2205 rgb[2].rgbBlue = 0xff;
2206 memcpy(
rgb + 16, default_table + 16, 240 *
sizeof(
rgb[0]));
2210 pImageList_Destroy(
himl);
2211 himl = pImageList_Create(16, 16, ilc, 0, 3);
2215 ret = pImageList_Remove(
himl, -1);
2218 rgb[0].rgbRed = 0xcc;
2219 rgb[1].rgbBlue = 0xcc;
2220 ret = pImageList_SetColorTable(
himl, 0, 2,
rgb);
2226 memcpy(
rgb + 2, default_table + 2, 254 *
sizeof(
rgb[0]));
2233 pImageList_Destroy(
himl);
2243 count = pImageList_GetImageCount(
dst);
2244 ok(!
count,
"ImageList not empty.\n");
2246 count = pImageList_GetImageCount(
src);
2247 ok(
count > 2,
"Tests need an ImageList with more than 2 images\n");
2251 ok(!
ret,
"ImageList_Copy() should have returned FALSE\n");
2252 count = pImageList_GetImageCount(
dst);
2253 ok(
count == 0,
"Expected no image in dst ImageList, got %d\n",
count);
2255 pImageList_Destroy(
dst);
2256 pImageList_Destroy(
src);
2269 pImageList_Destroy(
list );
2276 pImageList_Destroy(
list );
2292 IImageList_Clone(imgl, &IID_IImageList,
NULL);
2295 hr = IImageList_Clone(imgl, &IID_IImageList, (
void**)&imgl2);
2297 ref = IImageList_Release(imgl2);
2300 IImageList_Release(imgl);
2316 IImageList_GetBkColor(imgl,
NULL);
2319 hr = IImageList_GetBkColor(imgl, &
color);
2322 IImageList_Release(imgl);
2338 IImageList_SetBkColor(imgl,
RGB(0, 0, 0),
NULL);
2348 hr = IImageList_GetBkColor(imgl, &
color);
2352 IImageList_Release(imgl);
2368 IImageList_GetImageCount(imgl,
NULL);
2372 hr = IImageList_GetImageCount(imgl, &
count);
2376 IImageList_Release(imgl);
2389 hr = IImageList_GetIconSize(imgl,
NULL,
NULL);
2392 hr = IImageList_GetIconSize(imgl, &
cx,
NULL);
2395 hr = IImageList_GetIconSize(imgl,
NULL, &
cy);
2398 IImageList_Release(imgl);
2405#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
2406#define X2(f, ord) p##f = (void*)GetProcAddress(hComCtl32, (const char *)ord);
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter merge(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define STDMETHODCALLTYPE
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
BOOL WINAPI ImageList_Draw(HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, UINT fStyle)
HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void **ppv)
BOOL WINAPI ImageList_Remove(HIMAGELIST himl, INT i)
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
BOOL WINAPI ImageList_Replace(HIMAGELIST himl, INT i, HBITMAP hbmImage, HBITMAP hbmMask)
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
BOOL WINAPI ImageList_GetImageInfo(HIMAGELIST himl, INT i, IMAGEINFO *pImageInfo)
VOID WINAPI ImageList_EndDrag(void)
HRESULT WINAPI ImageList_CoCreateInstance(REFCLSID rclsid, const IUnknown *punkOuter, REFIID riid, void **ppv)
BOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS *pimldp)
HIMAGELIST WINAPI ImageList_GetDragImage(POINT *ppt, POINT *pptHotspot)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
UINT WINAPI ImageList_SetColorTable(HIMAGELIST himl, UINT uStartIndex, UINT cEntries, const RGBQUAD *prgb)
static void imagelist_get_bitmap_size(HIMAGELIST himl, UINT count, SIZE *sz)
HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, COLORREF clrMask, UINT uType, UINT uFlags)
HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2, INT dx, INT dy)
BOOL WINAPI ImageList_Write(HIMAGELIST himl, IStream *pstm)
BOOL WINAPI ImageList_Copy(HIMAGELIST himlDst, INT iDst, HIMAGELIST himlSrc, INT iSrc, UINT uFlags)
BOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, INT iTrack, INT dxHotspot, INT dyHotspot)
INT WINAPI ImageList_GetImageCount(HIMAGELIST himl)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
BOOL WINAPI ImageList_SetImageCount(HIMAGELIST himl, UINT iImageCount)
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
DWORD WINAPI ImageList_GetFlags(HIMAGELIST himl)
BOOL WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag, INT iDrag, INT dxHotspot, INT dyHotspot)
HIMAGELIST WINAPI ImageList_Read(IStream *pstm)
#define GetProcAddress(x, y)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
static void cleanup(void)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI GetHGlobalFromStream(IStream *pstm, HGLOBAL *phglobal)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei width
GLdouble GLdouble GLdouble GLdouble q
GLboolean GLboolean GLboolean b
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
static GLint image_size(GLint width, GLint height, GLenum format, GLenum type)
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
static void check_ImageList_DrawIndirect_fState(HDC hdc, HIMAGELIST himl, UINT32 *bits, int i, UINT fStyle, UINT fState, DWORD Frame, UINT32 expected, int line)
static void test_create_destroy(void)
static BOOL is_v6_header(const ILHEAD *header)
static HRESULT STDMETHODCALLTYPE Test_Stream_Write(IStream *iface, const void *pv, ULONG cb, ULONG *pcbWritten)
static HRESULT STDMETHODCALLTYPE Test_Stream_LockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static HRESULT STDMETHODCALLTYPE Test_Stream_CopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
static void check_ImageList_DrawIndirect_broken(HDC hdc, HIMAGELIST himl, UINT32 *bits, int i, UINT fStyle, UINT fState, DWORD Frame, UINT32 expected, UINT32 broken_expected, int line)
static ULONG STDMETHODCALLTYPE Test_Stream_AddRef(IStream *iface)
static void test_DrawIndirect(void)
static const IStreamVtbl Test_Stream_Vtbl
static void get_default_color_table(HDC hdc, int bpp, RGBQUAD *table)
static void check_bits(HWND hwnd, HIMAGELIST himl, int idx, int size, const BYTE *checkbits, LPCSTR loc)
static HRESULT STDMETHODCALLTYPE Test_Stream_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
static ULONG STDMETHODCALLTYPE Test_Stream_Release(IStream *iface)
static void check_ImageList_DrawIndirect(IMAGELISTDRAWPARAMS *ildp, UINT32 *bits, UINT32 expected, int line)
static const BYTE bitmap_bits[48 *48/8]
static void test_IImageList_Merge(void)
static void test_IImageList_GetBkColor(void)
static HRESULT STDMETHODCALLTYPE Test_Stream_Seek(IStream *iface, LARGE_INTEGER offset, DWORD origin, ULARGE_INTEGER *new_pos)
static struct memstream * impl_from_IStream(IStream *iface)
static BOOL colour_match(UINT32 x, UINT32 y)
static HRESULT STDMETHODCALLTYPE Test_Stream_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
static HRESULT STDMETHODCALLTYPE Test_Stream_Clone(IStream *iface, IStream **ppstm)
static HRESULT STDMETHODCALLTYPE Test_Stream_Read(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
static void test_IImageList_Add_Remove(void)
static void test_hotspot(void)
static void test_IImageList_GetImageCount(void)
static BOOL is_v6_test(void)
static void test_iimagelist(void)
static void force_redraw(HWND hwnd)
static HRESULT STDMETHODCALLTYPE Test_Stream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
#define ROW32(a, b, c, d, e, f, g, h)
static void test_IImageList_GetIconSize(void)
static HRESULT STDMETHODCALLTYPE Test_Stream_Revert(IStream *iface)
static void cleanup_memstream(struct memstream *stream)
static HDC show_image(HWND hwnd, HIMAGELIST himl, int idx, int size, LPCSTR loc, BOOL clear)
static void test_shell_imagelist(void)
static void image_list_init(HIMAGELIST himl, INT grow)
static void test_copy(void)
static void check_iml_data(HIMAGELIST himl, INT cx, INT cy, INT cur, INT max, INT grow, INT flags, const char *comment)
static const BYTE empty_bits[48 *48/8]
#define ROW48(a, b, c, d, e, f, g, h, i, j, k, l)
static void test_IImageList_Get_SetImageCount(void)
static void init_memstream(struct memstream *stream)
static void test_IImageList_SetBkColor(void)
static void test_imagelist_storage(void)
static void test_imagecount(void)
static HRESULT STDMETHODCALLTYPE Test_Stream_QueryInterface(IStream *iface, REFIID riid, void **ppvObject)
static HRESULT STDMETHODCALLTYPE Test_Stream_Commit(IStream *iface, DWORD grfCommitFlags)
static HIMAGELIST createImageList(int cx, int cy)
static void check_ImageList_DrawIndirect_fStyle(HDC hdc, HIMAGELIST himl, UINT32 *bits, int i, UINT fStyle, UINT32 expected, int line)
static void test_ImageList_DrawIndirect(void)
static void image_list_add_bitmap(HIMAGELIST himl, BYTE grey, int i)
static const BYTE icon_bits[32 *32/8]
static void check_ImageList_DrawIndirect_ILD_ROP(HDC hdc, HIMAGELIST himl, UINT32 *bits, int i, DWORD dwRop, UINT32 expected, int line)
static INT DIB_GetWidthBytes(int width, int bpp)
static ULONG check_bitmap_data(const ILHEAD *header, const char *bm_data, ULONG bm_data_size, const SIZE *bmpsize, INT bpp, const char *comment)
static void test_IImageList_Clone(void)
static void init_functions(void)
static void check_color_table(const char *name, HDC hdc, HIMAGELIST himl, UINT ilc, RGBQUAD *expect, RGBQUAD *broken_expect)
static void test_add_remove(void)
static HBITMAP create_test_bitmap(HDC hdc, int bpp, UINT32 pixel1, UINT32 pixel2)
static void test_iconsize(void)
static void test_color_table(UINT ilc)
static void check_ilhead_data(const ILHEAD *ilh, INT cx, INT cy, INT cur, INT max, INT grow, INT flags)
static void test_loadimage(void)
static void dump_bits(const BYTE *p, const BYTE *q, int size)
static void test_begindrag(void)
static HWND create_window(void)
static void test_merge(void)
static void test_IImageList_Draw(void)
static void test_merge_colors(void)
static int get_color_format(HBITMAP bmp)
#define comment(fmt, arg1)
#define IDB_BITMAP_128x15
static HMODULE MODULEINFO DWORD cb
static HBITMAP create_bitmap(void)
static const struct @531 sizes[]
@ COINIT_APARTMENTTHREADED
#define WS_OVERLAPPEDWINDOW
_Out_opt_ int _Out_opt_ int * cy
#define IMAGELISTDRAWPARAMS_V3_SIZE
#define ILD_PRESERVEALPHA
BITMAPINFOHEADER bmiHeader
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
INT WINAPI DrawTextA(HDC hdc, LPCSTR str, INT count, LPRECT rect, UINT flags)
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
_In_ ULONG _In_ ULONG rgb
HGDIOBJ WINAPI GetStockObject(_In_ int)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
HPALETTE WINAPI CreateHalftonePalette(_In_opt_ HDC)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HICON WINAPI CreateIcon(_In_opt_ HINSTANCE, _In_ int, _In_ int, _In_ BYTE, _In_ BYTE, _In_ const BYTE *, _In_ const BYTE *)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
#define LR_CREATEDIBSECTION
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE hInstance, _In_ LPCSTR lpIconName)
HDC WINAPI GetDC(_In_opt_ HWND)
#define MAKEINTRESOURCEW(i)
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
BOOL WINAPI DestroyIcon(_In_ HICON)