37#include "commoncontrols.h"
44#define IMAGELIST_MAGIC (('L' << 8) | 'I')
104 return pHIMAGELIST_QueryInterface !=
NULL;
108#define B(x,y) ((x?0xf0:0)|(y?0xf:0))
109#define ROW1(a,b,c,d,e,f,g,h) B(a,b),B(c,d),B(e,f),B(g,h)
110#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), \
111 ROW1(a,b,c,d,e,f,g,h), ROW1(a,b,c,d,e,f,g,h)
112#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)
113#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), \
114 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), \
115 ROW2(a,b,c,d,e,f,g,h,i,j,k,l)
121 ROW32(0,0,0,0,0,0,0,0),
122 ROW32(0,0,1,1,1,1,0,0),
123 ROW32(0,1,1,1,1,1,1,0),
124 ROW32(0,1,1,0,0,1,1,0),
125 ROW32(0,1,1,0,0,1,1,0),
126 ROW32(0,1,1,1,1,1,1,0),
127 ROW32(0,0,1,1,1,1,0,0),
128 ROW32(0,0,0,0,0,0,0,0)
133 ROW48(0,0,0,0,0,0,0,0,0,0,0,0),
134 ROW48(0,1,1,1,1,1,1,1,1,1,1,0),
135 ROW48(0,1,1,0,0,0,0,0,0,1,1,0),
136 ROW48(0,1,0,0,0,0,0,0,1,0,1,0),
137 ROW48(0,1,0,0,0,0,0,1,0,0,1,0),
138 ROW48(0,1,0,0,0,0,1,0,0,0,1,0),
139 ROW48(0,1,0,0,0,1,0,0,0,0,1,0),
140 ROW48(0,1,0,0,1,0,0,0,0,0,1,0),
141 ROW48(0,1,0,1,0,0,0,0,0,0,1,0),
142 ROW48(0,1,1,0,0,0,0,0,0,1,1,0),
143 ROW48(0,1,1,1,1,1,1,1,1,1,1,0),
144 ROW48(0,0,0,0,0,0,0,0,0,0,0,0)
153 ok(
himl !=
NULL,
"Failed to create image list, %d x %d.\n",
cx,
cy);
161 char className[] =
"bmwnd";
162 char winName[] =
"Test Bitmap";
234 printf(
"%c%c",
p[
j] & 0xf0 ?
'X' :
' ',
p[
j] & 0xf ?
'X' :
' ');
237 printf(
"%c%c",
q[
j] & 0xf0 ?
'X' :
' ',
q[
j] & 0xf ?
'X' :
' ');
273 "%s: bits different\n", loc);
287 ok(
count > 2,
"Tests need an ImageList with more than 2 images\n");
290 ret = pImageList_BeginDrag(
himl, 1, 0, 0);
291 drag = pImageList_GetDragImage(
NULL,
NULL);
292 ok(
ret && drag,
"ImageList_BeginDrag() failed\n");
293 ret = pImageList_BeginDrag(
himl, 0, 3, 5);
294 ok(!
ret,
"ImageList_BeginDrag() returned TRUE\n");
295 drag = pImageList_GetDragImage(
NULL, &hotspot);
296 ok(!!drag,
"No active ImageList drag left\n");
297 ok(hotspot.
x == 0 && hotspot.
y == 0,
"New ImageList drag was created\n");
298 pImageList_EndDrag();
299 drag = pImageList_GetDragImage(
NULL,
NULL);
300 ok(!drag,
"ImageList drag was not destroyed\n");
303 pImageList_BeginDrag(
himl, 0, 0, 0);
305 ok(!
ret,
"ImageList_BeginDrag() returned TRUE\n");
306 drag = pImageList_GetDragImage(
NULL, &hotspot);
307 ok(drag && hotspot.
x == 0 && hotspot.
y == 0,
"Active drag should not have been canceled\n");
308 pImageList_EndDrag();
309 drag = pImageList_GetDragImage(
NULL,
NULL);
310 ok(!drag,
"ImageList drag was not destroyed\n");
312 ret = pImageList_BeginDrag(
himl, -17, 0, 0);
313 drag = pImageList_GetDragImage(
NULL,
NULL);
314 ok(
ret && drag,
"ImageList drag was created\n");
315 pImageList_EndDrag();
316 ret = pImageList_BeginDrag(
himl, -1, 0, 0);
317 drag = pImageList_GetDragImage(
NULL,
NULL);
318 ok(
ret && drag,
"ImageList drag was created\n");
319 pImageList_EndDrag();
320 pImageList_Destroy(
himl);
334#define HOTSPOTS_MAX 4
349 int dx1 = hotspots[
i].dx;
350 int dy1 = hotspots[
i].dy;
351 int dx2 = hotspots[
j].dx;
352 int dy2 = hotspots[
j].dy;
353 int correctx, correcty, newx, newy;
358 ret = pImageList_BeginDrag(himl1, 0, dx1, dy1);
359 ok(
ret != 0,
"BeginDrag failed for { %d, %d }\n", dx1, dy1);
360 sprintf(loc,
"BeginDrag (%d,%d)\n",
i,
j);
364 ret = pImageList_SetDragCursorImage(himl2, 0, dx2, dy2);
365 ok(
ret != 0,
"SetDragCursorImage failed for {%d, %d}{%d, %d}\n",
367 sprintf(loc,
"SetDragCursorImage (%d,%d)\n",
i,
j);
371 himlNew = pImageList_GetDragImage(
NULL, &ppt);
372 ok(ppt.
x == dx1 && ppt.
y == dy1,
373 "Expected drag hotspot [%d,%d] got [%d,%d]\n",
374 dx1, dy1, ppt.
x, ppt.
y);
376 pImageList_GetIconSize(himlNew, &newx, &newy);
379 ok(newx == correctx && newy == correcty,
380 "Expected drag image size [%d,%d] got [%d,%d]\n",
381 correctx, correcty, newx, newy);
382 sprintf(loc,
"GetDragImage (%d,%d)\n",
i,
j);
384 pImageList_EndDrag();
392 pImageList_Destroy(himl2);
393 pImageList_Destroy(himl1);
407 ok(
himl!=0,
"failed to create imagelist\n");
411 ok(hicon1 != 0,
"no hicon1\n");
413 ok(hicon2 != 0,
"no hicon2\n");
415 ok(hicon3 != 0,
"no hicon3\n");
418 ok(!pImageList_Remove(
himl, 0),
"Removed nonexistent icon.\n");
420 ok(pImageList_Remove(
himl, -1),
"Removed nonexistent icon\n");
423 ok(0 == pImageList_ReplaceIcon(
himl, -1, hicon1),
"Failed to add icon1.\n");
424 ok(1 == pImageList_ReplaceIcon(
himl, -1, hicon2),
"Failed to add icon2.\n");
425 ok(2 == pImageList_ReplaceIcon(
himl, -1, hicon3),
"Failed to add icon3.\n");
428 ok(!pImageList_Remove(
himl, 4711),
"removed nonexistent icon\n");
431 ok(pImageList_Remove(
himl, 0),
"Can't remove 0\n");
432 ok(pImageList_Remove(
himl, 0),
"Can't remove 0\n");
433 ok(pImageList_Remove(
himl, 0),
"Can't remove 0\n");
436 ok(!pImageList_Remove(
himl, 0),
"Removed nonexistent icon.\n");
439 ok(pImageList_Destroy(
himl),
"Failed to destroy imagelist.\n");
441 ok(-1 == pImageList_ReplaceIcon((
HIMAGELIST)0xdeadbeef, -1, hicon1),
"Don't crash on bad handle\n");
452 ok(0 == pImageList_GetImageCount((
HIMAGELIST)0xdeadbeef),
"don't crash on bad handle\n");
454 if (!pImageList_SetImageCount)
456 win_skip(
"ImageList_SetImageCount not available\n");
461 ok(
himl != 0,
"Failed to create imagelist.\n");
463 ok(pImageList_SetImageCount(
himl, 3),
"couldn't increase image count\n");
464 ok(pImageList_GetImageCount(
himl) == 3,
"invalid image count after increase\n");
465 ok(pImageList_SetImageCount(
himl, 1),
"couldn't decrease image count\n");
466 ok(pImageList_GetImageCount(
himl) == 1,
"invalid image count after decrease to 1\n");
467 ok(pImageList_SetImageCount(
himl, 0),
"couldn't decrease image count\n");
468 ok(pImageList_GetImageCount(
himl) == 0,
"invalid image count after decrease to 0\n");
470 ok(pImageList_Destroy(
himl),
"Failed to destroy imagelist.\n");
485 if (!pImageList_DrawIndirect)
487 win_skip(
"ImageList_DrawIndirect not available, skipping test\n");
497 ok(
himl != 0,
"Failed to create imagelist.\n");
501 ok(hbm1 != 0,
"no bitmap 1\n");
503 ok(hbm2 != 0,
"no bitmap 2\n");
505 ok(hbm3 != 0,
"no bitmap 3\n");
508 ok(0 == pImageList_Add(
himl, hbm1, 0),
"failed to add bitmap 1\n");
509 ok(1 == pImageList_Add(
himl, hbm2, 0),
"failed to add bitmap 2\n");
511 if (pImageList_SetImageCount)
513 ok(pImageList_SetImageCount(
himl,3),
"Setimage count failed\n");
515 ok(pImageList_Replace(
himl, 2, hbm3, 0),
"failed to replace bitmap 3\n");
518 memset(&imldp, 0,
sizeof (imldp));
519 ok(!pImageList_DrawIndirect(&imldp),
"zero data succeeded!\n");
521 ok(!pImageList_DrawIndirect(&imldp),
"zero hdc succeeded!\n");
523 ok(!pImageList_DrawIndirect(&imldp),
"zero himl succeeded!\n");
525 ok(!pImageList_DrawIndirect(&imldp),
"bad himl succeeded!\n");
535 ok(pImageList_DrawIndirect(&imldp),
"should succeed\n");
537 ok(pImageList_DrawIndirect(&imldp),
"should succeed\n");
539 ok(pImageList_DrawIndirect(&imldp),
"should succeed\n");
541 ok(!pImageList_DrawIndirect(&imldp),
"should fail\n");
544 ok(pImageList_Remove(
himl, 0),
"removing 1st bitmap\n");
545 ok(pImageList_Remove(
himl, 0),
"removing 2nd bitmap\n");
546 ok(pImageList_Remove(
himl, 0),
"removing 3rd bitmap\n");
549 ok(pImageList_Destroy(
himl),
"Failed to destroy imagelist.\n");
567 memset(&bmi, 0,
sizeof(bmi));
570 ok(
ret,
"GetDIBits failed\n");
586 ok(hicon1 !=
NULL,
"failed to create hicon1\n");
588 for (
i = 0;
i < 8;
i++)
590 himl[
i] = pImageList_Create(32, 32,
sizes[
i], 0, 3);
592 ok(0 == pImageList_ReplaceIcon(
himl[
i], -1, hicon1),
"Failed to add icon1 to himl[%d].\n",
i);
593 if (
i == 0 ||
i == 1 ||
i == 7)
595 pImageList_GetImageInfo(
himl[
i], 0, &
info);
600 for (
i = 0;
i < 8;
i++)
601 for (
j = 0;
j < 8;
j++)
603 hmerge = pImageList_Merge(
himl[
i], 0,
himl[
j], 0, 0, 0);
604 ok(hmerge !=
NULL,
"merge himl[%d], himl[%d] failed\n",
i,
j);
606 pImageList_GetImageInfo(hmerge, 0, &
info);
609 if (
i == 4 &&
j == 7)
611 "wrong biBitCount %d when merging lists %d (%d) and %d (%d)\n",
bpp,
i,
sizes[
i],
j,
sizes[
j]);
614 "wrong biBitCount %d when merging lists %d (%d) and %d (%d)\n",
bpp,
i,
sizes[
i],
j,
sizes[
j]);
615 ok(
info.hbmMask != 0,
"Imagelist merged from %d and %d had no mask\n",
i,
j);
617 pImageList_Destroy(hmerge);
620 for (
i = 0;
i < 8;
i++)
621 pImageList_Destroy(
himl[
i]);
630 himl1 = pImageList_Create(32, 32, 0, 0, 3);
631 ok(himl1 !=
NULL,
"failed to create himl1\n");
633 himl2 = pImageList_Create(32, 32, 0, 0, 3);
634 ok(himl2 !=
NULL,
"failed to create himl2\n");
637 ok(hicon1 !=
NULL,
"failed to create hicon1\n");
639 if (!himl1 || !himl2 || !hicon1)
642 ok(0 == pImageList_ReplaceIcon(himl2, -1, hicon1),
"Failed to add icon1 to himl2.\n");
646 hmerge = pImageList_Merge(himl1, -1, himl2, 0, 0, 0);
647 ok(hmerge !=
NULL,
"merge himl1,-1 failed\n");
649 pImageList_Destroy(hmerge);
651 hmerge = pImageList_Merge(himl1, 0, himl2, 0, 0, 0);
652 ok(hmerge !=
NULL,
"merge himl1,0 failed\n");
654 pImageList_Destroy(hmerge);
657 pImageList_Destroy(himl2);
658 himl2 = pImageList_Create(32, 32, 0, 0, 3);
659 ok(himl2 !=
NULL,
"failed to recreate himl2\n");
663 hmerge = pImageList_Merge(himl1, -1, himl2, -1, 0, 0);
664 ok(hmerge !=
NULL,
"merge himl2,-1 failed\n");
666 pImageList_Destroy(hmerge);
668 hmerge = pImageList_Merge(himl1, -1, himl2, 0, 0, 0);
669 ok(hmerge !=
NULL,
"merge himl2,0 failed\n");
671 pImageList_Destroy(hmerge);
674 ok(0 == pImageList_ReplaceIcon(himl2, -1, hicon1),
"Failed to re-add icon1 to himl2.\n");
676 hmerge = pImageList_Merge(himl2, 0, himl2, 0, 0, 0);
677 ok(hmerge !=
NULL,
"merge himl2 with itself failed\n");
679 pImageList_Destroy(hmerge);
682 ok(0 == pImageList_ReplaceIcon(himl1, -1, hicon1),
"Failed to add icon1 to himl1.\n");
684 hmerge = pImageList_Merge(himl1, 0, himl2, 0, 0, 0);
685 ok(hmerge !=
NULL,
"merge himl1 with himl2 failed\n");
687 pImageList_Destroy(hmerge);
689 hmerge = pImageList_Merge(himl1, 0, himl2, 0, 8, 16);
690 ok(hmerge !=
NULL,
"merge himl1 with himl2 8,16 failed\n");
692 pImageList_Destroy(hmerge);
694 pImageList_Destroy(himl1);
695 pImageList_Destroy(himl2);
718 ok(0,
"unexpected call\n");
724 ok(0,
"unexpected call\n");
730 ok(0,
"unexpected call\n");
738 return IStream_Read(
stream->stream, pv,
cb, pcbRead);
745 return IStream_Write(
stream->stream, pv,
cb, pcbWritten);
757 ok(new_pos !=
NULL,
"Unexpected out position pointer.\n");
762 ok(0,
"unexpected call\n");
769 ok(0,
"unexpected call\n");
777 ok(0,
"unexpected call\n");
783 ok(0,
"unexpected call\n");
789 ok(0,
"unexpected call\n");
796 ok(0,
"unexpected call\n");
803 ok(0,
"unexpected call\n");
810 ok(0,
"unexpected call\n");
816 ok(0,
"unexpected call\n");
844 ok(
hr ==
S_OK,
"Failed to create a stream, hr %#x.\n",
hr);
849 IStream_Release(
stream->stream);
854 return ((
width *
bpp + 31) / 8) & ~3;
864 hdr_size =
sizeof(*bmfh) +
sizeof(*bmih);
867 ok(bmfh->
bfType == ((
'M' << 8) |
'B'),
"wrong bfType 0x%02x\n", bmfh->
bfType);
868 ok(bmfh->
bfSize == hdr_size,
"wrong bfSize 0x%02x\n", bmfh->
bfSize);
873 ok(bmih->
biSize ==
sizeof(*bmih),
"wrong biSize %d\n", bmih->
biSize);
888 fwrite(bm_data, 1, bm_data_size,
f);
897 return (
header->usVersion & 0xff00) == 0x600;
911 grow_aligned = (
WORD)(grow + 3) & ~3;
915 grow = (
WORD)(grow + 2 + 3) & ~3;
917 "Unexpected cGrow %d, expected %d\n", ilh->
cGrow, grow);
922 ok(ilh->
cGrow == grow_aligned,
"Unexpected cGrow %d, expected %d\n", ilh->
cGrow, grow_aligned);
925 ok(ilh->
cx ==
cx,
"wrong cx %d (expected %d)\n", ilh->
cx,
cx);
926 ok(ilh->
cy ==
cy,
"wrong cy %d (expected %d)\n", ilh->
cy,
cy);
929 "wrong flags %04x\n", ilh->
flags);
930 ok(ilh->
ovls[0] == -1,
"wrong ovls[0] %04x\n", ilh->
ovls[0]);
931 ok(ilh->
ovls[1] == -1,
"wrong ovls[1] %04x\n", ilh->
ovls[1]);
932 ok(ilh->
ovls[2] == -1,
"wrong ovls[2] %04x\n", ilh->
ovls[2]);
933 ok(ilh->
ovls[3] == -1,
"wrong ovls[3] %04x\n", ilh->
ovls[3]);
946 memset(&bmi, 0,
sizeof(bmi));
971 const int tile_count = 4;
981 sz->
cy = ((
header->cMaxImage + tile_count - 1) / tile_count) *
header->cy;
1001 ret = pImageList_GetImageCount(
himl);
1004 ret = pImageList_GetIconSize(
himl, &cxx, &cyy);
1005 ok(
ret,
"ImageList_GetIconSize failed\n");
1006 ok(cxx ==
cx,
"%s: wrong cx %d (expected %d)\n",
comment, cxx,
cx);
1007 ok(cyy ==
cy,
"%s: wrong cy %d (expected %d)\n",
comment, cyy,
cy);
1011 ok(
b,
"%s: ImageList_Write failed\n",
comment);
1016 hr = IStream_Stat(
stream.stream, &
stat, STATFLAG_NONAME);
1017 ok(
hr ==
S_OK,
"Stat() failed, hr %#x.\n",
hr);
1021 ok(
data != 0,
"%s: ImageList_Write didn't write any data\n",
comment);
1022 ok(
stat.cbSize.LowPart >
sizeof(
ILHEAD),
"%s: ImageList_Write wrote not enough data\n",
comment);
1038 IStream_Seek(
stream.stream, mv, STREAM_SEEK_SET,
NULL);
1040 ok(himl2 !=
NULL,
"%s: Failed to deserialize imagelist\n",
comment);
1041 pImageList_Destroy(himl2);
1056 ok(
ret != -1,
"Failed to add image to imagelist.\n");
1113 ok(
himl != 0,
"ImageList_Create failed\n");
1120 ret = pImageList_Remove(
himl, 4);
1121 ok(
ret,
"ImageList_Remove failed\n");
1124 ret = pImageList_Remove(
himl, 5);
1125 ok(
ret,
"ImageList_Remove failed\n");
1128 ret = pImageList_Remove(
himl, 6);
1129 ok(
ret,
"ImageList_Remove failed\n");
1132 ret = pImageList_Remove(
himl, 7);
1133 ok(
ret,
"ImageList_Remove failed\n");
1136 ret = pImageList_Remove(
himl, -2);
1137 ok(!
ret,
"ImageList_Remove(-2) should fail\n");
1140 ret = pImageList_Remove(
himl, 20);
1141 ok(!
ret,
"ImageList_Remove(20) should fail\n");
1144 ret = pImageList_Remove(
himl, -1);
1145 ok(
ret,
"ImageList_Remove(-1) failed\n");
1148 ret = pImageList_Destroy(
himl);
1149 ok(
ret,
"ImageList_Destroy failed\n");
1154 ok(
himl != 0,
"ImageList_Create failed\n");
1158 ok(
ret == 0,
"ImageList_Add returned %d, expected 0\n",
ret);
1161 ret = pImageList_Destroy(
himl);
1162 ok(
ret,
"ImageList_Destroy failed\n");
1165 ok(
himl != 0,
"ImageList_Create failed\n");
1169 ok(
ret == 0,
"ImageList_Add returned %d, expected 0\n",
ret);
1172 ok(
ret == 9,
"ImageList_Add returned %d, expected 9\n",
ret);
1175 ret = pImageList_Destroy(
himl);
1176 ok(
ret,
"ImageList_Destroy failed\n");
1179 ok(
himl != 0,
"ImageList_Create failed\n");
1181 ret = pImageList_Destroy(
himl);
1182 ok(
ret,
"ImageList_Destroy failed\n");
1185 ok(
himl != 0,
"ImageList_Create failed\n");
1187 ret = pImageList_Destroy(
himl);
1188 ok(
ret,
"ImageList_Destroy failed\n");
1191 ok(
himl != 0,
"ImageList_Create failed\n");
1193 ret = pImageList_Destroy(
himl);
1194 ok(
ret,
"ImageList_Destroy failed\n");
1197 ok(
himl != 0,
"ImageList_Create failed\n");
1199 ret = pImageList_Destroy(
himl);
1200 ok(
ret,
"ImageList_Destroy failed\n");
1203 ok(
himl != 0,
"ImageList_Create failed\n");
1205 ret = pImageList_Destroy(
himl);
1206 ok(
ret,
"ImageList_Destroy failed\n");
1209 ok(
himl != 0,
"ImageList_Create failed\n");
1211 ret = pImageList_Destroy(
himl);
1212 ok(
ret,
"ImageList_Destroy failed\n");
1215 ok(
himl != 0,
"ImageList_Create failed\n");
1217 ret = pImageList_Destroy(
himl);
1218 ok(
ret,
"ImageList_Destroy failed\n");
1221 ok(
himl != 0,
"ImageList_Create failed\n");
1223 ret = pImageList_Destroy(
himl);
1224 ok(
ret,
"ImageList_Destroy failed\n");
1227 ok(
himl != 0,
"ImageList_Create failed\n");
1229 ret = pImageList_Destroy(
himl);
1230 ok(
ret,
"ImageList_Destroy failed\n");
1233 ok(
himl != 0,
"ImageList_Create failed\n");
1236 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 0,
"Failed to add icon.\n");
1237 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 1,
"Failed to add icon.\n");
1240 ret = pImageList_Destroy(
himl);
1241 ok(
ret,
"ImageList_Destroy failed\n");
1244 ok(
himl != 0,
"ImageList_Create failed\n");
1247 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 0,
"Failed to add icon.\n");
1248 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 1,
"Failed to add icon.\n");
1251 ret = pImageList_Destroy(
himl);
1252 ok(
ret,
"ImageList_Destroy failed\n");
1255 ok(
himl != 0,
"ImageList_Create failed\n");
1258 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 0,
"Failed to add icon.\n");
1259 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 1,
"Failed to add icon.\n");
1262 ret = pImageList_Destroy(
himl);
1263 ok(
ret,
"ImageList_Destroy failed\n");
1266 ok(
himl != 0,
"ImageList_Create failed\n");
1269 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 0,
"Failed to add icon.\n");
1270 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 1,
"Failed to add icon.\n");
1272 ok( pImageList_ReplaceIcon(
himl, -1, icon) == 2,
"Failed to add icon\n");
1275 ok( pImageList_Remove(
himl, -1) ==
TRUE,
"Failed to remove icon.\n");
1277 ok( pImageList_SetImageCount(
himl, 22) ==
TRUE,
"Failed to set image count.\n");
1279 ok( pImageList_SetImageCount(
himl, 0) ==
TRUE,
"Failed to set image count.\n");
1281 ok( pImageList_SetImageCount(
himl, 42) ==
TRUE,
"Failed to set image count.\n");
1283 ret = pImageList_Destroy(
himl);
1284 ok(
ret,
"ImageList_Destroy failed\n");
1286 for (grow = 1; grow <= 16; grow++)
1289 ok(
himl != 0,
"ImageList_Create failed\n");
1291 ret = pImageList_Destroy(
himl);
1292 ok(
ret,
"ImageList_Destroy failed\n");
1296 ok(
himl != 0,
"ImageList_Create failed\n");
1298 ret = pImageList_Destroy(
himl);
1299 ok(
ret,
"ImageList_Destroy failed\n");
1305 ok(
himl != 0,
"ImageList_Create failed\n");
1307 ret = pImageList_Destroy(
himl);
1308 ok(
ret,
"ImageList_Destroy failed\n");
1311 ok(
himl != 0,
"ImageList_Create failed\n");
1313 ret = pImageList_Destroy(
himl);
1314 ok(
ret,
"ImageList_Destroy failed\n");
1332 if (!pSHGetImageList)
1334 win_skip(
"SHGetImageList not available, skipping test\n");
1348 IImageList_GetImageCount(iml, &
out);
1349 ok(
out > 0,
"IImageList_GetImageCount returned out <= 0\n");
1356 IImageList_GetImageRect(iml, 0, &
rect);
1358 "IImageList_GetImageRect returned r:%d,b:%d\n",
1361 IImageList_Release(iml);
1389 const INT32 tolerance = 8;
1395 return (dr <= tolerance && dg <= tolerance && db <= tolerance);
1401 bits[0] = 0x00FFFFFF;
1402 pImageList_DrawIndirect(ildp);
1404 "ImageList_DrawIndirect: Pixel %08X, Expected a close match to %08X from line %d\n",
1413 0, 0, 0, 0, 0, 0,
CLR_NONE,
CLR_NONE, fStyle, 0,
ILS_NORMAL, 0, 0x00000000};
1421 0, 0, 0, 0, 0, 0,
CLR_NONE,
CLR_NONE,
ILD_IMAGE |
ILD_ROP, dwRop,
ILS_NORMAL, 0, 0x00000000};
1429 0, 0, 0, 0, 0, 0,
CLR_NONE,
CLR_NONE, fStyle, 0, fState, Frame, 0x00000000};
1438 0, 0, 0, 0, 0, 0,
CLR_NONE,
CLR_NONE, fStyle, 0, fState, Frame, 0x00000000};
1439 bits[0] = 0x00FFFFFF;
1440 pImageList_DrawIndirect(&ildp);
1443 "ImageList_DrawIndirect: Pixel %08X, Expected a close match to %08X from line %d\n",
1455 int iImage = -1, iAlphaImage = -1, iTransparentImage = -1;
1457 UINT32 maskBits = 0x00000000, inverseMaskBits = 0xFFFFFFFF;
1458 int bpp, broken_value;
1464 ok(
hdcDst != 0,
"CreateCompatibleDC(0) failed to return a valid DC\n");
1470 ok(hbmMask != 0,
"CreateBitmap failed\n");
1473 hbmInverseMask =
CreateBitmap(2, 1, 1, 1, &inverseMaskBits);
1474 ok(hbmInverseMask != 0,
"CreateBitmap failed\n");
1475 if(!hbmInverseMask)
goto cleanup;
1478 ok(
himl != 0,
"ImageList_Create failed\n");
1485 iImage = pImageList_Add(
himl, hbmImage, hbmMask);
1486 ok(iImage != -1,
"ImageList_Add failed\n");
1487 if(iImage == -1)
goto cleanup;
1491 if(!hbmAlphaImage)
goto cleanup;
1493 iAlphaImage = pImageList_Add(
himl, hbmAlphaImage, hbmMask);
1494 ok(iAlphaImage != -1,
"ImageList_Add failed\n");
1495 if(iAlphaImage == -1)
goto cleanup;
1499 if(!hbmTransparentImage)
goto cleanup;
1501 iTransparentImage = pImageList_Add(
himl, hbmTransparentImage, hbmMask);
1502 ok(iTransparentImage != -1,
"ImageList_Add failed\n");
1503 if(iTransparentImage == -1)
goto cleanup;
1508 ok (hbmDst &&
bits,
"CreateDIBSection failed to return a valid bitmap and buffer\n");
1509 if (!hbmDst || !
bits)
1516 if (
bpp == 16 ||
bpp == 24) broken_value = 0x00D4D9DD;
1517 else broken_value = 0x00B4BDC4;
1526 if (
bpp == 16 ||
bpp == 24) broken_value = 0x00D4D9DD;
1527 else broken_value = 0x009DA8B1;
1529 if (
bpp == 16 ||
bpp == 24) broken_value = 0x00D4D9DD;
1530 else broken_value = 0x008C99A3;
1573 if(hbmTransparentImage)
1578 ret = pImageList_Destroy(
himl);
1579 ok(
ret,
"ImageList_Destroy failed\n");
1591 if (!pHIMAGELIST_QueryInterface)
1593 win_skip(
"XP imagelist functions not available\n");
1599 ret = IImageList_AddRef(imgl);
1600 ok(
ret == 2,
"Expected 2, got %d\n",
ret);
1609 ret = IImageList_AddRef(imgl);
1610 ok(
ret == 2,
"Expected 2, got %d\n",
ret);
1613 ret = IImageList_Release(imgl);
1614 ok(
ret == 0,
"Expected 0, got %d\n",
ret);
1620 hr = pHIMAGELIST_QueryInterface((
HIMAGELIST)imgl, &IID_IImageList, (
void**)&imgl2);
1622 ok(imgl2 == imgl,
"got different pointer\n");
1623 ret = IImageList_Release(imgl);
1625 IImageList_Release(imgl);
1627 if (!pImageList_CoCreateInstance)
1629 win_skip(
"Vista imagelist functions not available\n");
1633 hr = pImageList_CoCreateInstance(&CLSID_ImageList,
NULL, &IID_IImageList, (
void **) &imgl);
1637 IImageList_Release(imgl);
1644 hr = (pHIMAGELIST_QueryInterface)(
himl, &IID_IImageList, (
void **) &imgl);
1648 IImageList_Release(imgl);
1650 pImageList_Destroy(
himl);
1653 hr = pImageList_CoCreateInstance(&CLSID_ImageList,
NULL, &IID_IImageList2, (
void**)&imagelist);
1656 win_skip(
"IImageList2 is not supported.\n");
1660 IImageList2_Release(imagelist);
1677 ok(
himl != 0,
"failed to create imagelist\n");
1683 ok(hicon1 != 0,
"no hicon1\n");
1685 ok(hicon2 != 0,
"no hicon2\n");
1687 ok(hicon3 != 0,
"no hicon3\n");
1690 hr = IImageList_Remove(imgl, 0);
1694 hr = IImageList_Remove(imgl, -1);
1695 ok(
hr ==
S_OK,
"removed nonexistent icon\n");
1699 ok( IImageList_ReplaceIcon(imgl, -1, hicon1, &
ret) ==
S_OK && (
ret == 0),
"failed to add icon1\n");
1701 ok( IImageList_ReplaceIcon(imgl, -1, hicon2, &
ret) ==
S_OK && (
ret == 1),
"failed to add icon2\n");
1703 ok( IImageList_ReplaceIcon(imgl, -1, hicon3, &
ret) ==
S_OK && (
ret == 2),
"failed to add icon3\n");
1709 ok( IImageList_Remove(imgl,0) ==
S_OK,
"can't remove 0\n");
1710 ok( IImageList_Remove(imgl,0) ==
S_OK,
"can't remove 0\n");
1711 ok( IImageList_Remove(imgl,0) ==
S_OK,
"can't remove 0\n");
1716 IImageList_Release(imgl);
1731 ok(
himl != 0,
"failed to create imagelist\n");
1736 hr = IImageList_SetImageCount(imgl, 3);
1739 hr = IImageList_GetImageCount(imgl, &
ret);
1740 ok(
hr ==
S_OK &&
ret == 3,
"invalid image count after increase\n");
1741 hr = IImageList_SetImageCount(imgl, 1);
1744 hr = IImageList_GetImageCount(imgl, &
ret);
1745 ok(
hr ==
S_OK &&
ret == 1,
"invalid image count after decrease to 1\n");
1746 hr = IImageList_SetImageCount(imgl, 0);
1749 hr = IImageList_GetImageCount(imgl, &
ret);
1750 ok(
hr ==
S_OK &&
ret == 0,
"invalid image count after decrease to 0\n");
1752 IImageList_Release(imgl);
1776 ok(
himl!=0,
"failed to create imagelist\n");
1782 ok(hbm1 != 0,
"no bitmap 1\n");
1784 ok(hbm2 != 0,
"no bitmap 2\n");
1786 ok(hbm3 != 0,
"no bitmap 3\n");
1790 ok( IImageList_Add(imgl, hbm1, 0, &
ret) ==
S_OK && (
ret == 0),
"failed to add bitmap 1\n");
1792 ok( IImageList_Add(imgl, hbm2, 0, &
ret) ==
S_OK && (
ret == 1),
"failed to add bitmap 2\n");
1794 ok( IImageList_SetImageCount(imgl, 3) ==
S_OK,
"Setimage count failed\n");
1795 ok( IImageList_Replace(imgl, 2, hbm3, 0) ==
S_OK,
"failed to replace bitmap 3\n");
1800 IImageList_Draw(imgl,
NULL);
1803 memset(&imldp, 0,
sizeof (imldp));
1804 hr = IImageList_Draw(imgl, &imldp);
1818 ok( IImageList_Draw(imgl, &imldp) ==
S_OK,
"should succeed\n");
1820 ok( IImageList_Draw(imgl, &imldp) ==
S_OK,
"should succeed\n");
1822 ok( IImageList_Draw(imgl, &imldp) ==
S_OK,
"should succeed\n");
1824 ok( IImageList_Draw(imgl, &imldp) ==
E_INVALIDARG,
"should fail\n");
1827 ok( IImageList_Remove(imgl, 0) ==
S_OK,
"removing 1st bitmap\n");
1828 ok( IImageList_Remove(imgl, 0) ==
S_OK,
"removing 2nd bitmap\n");
1829 ok( IImageList_Remove(imgl, 0) ==
S_OK,
"removing 3rd bitmap\n");
1832 IImageList_Release(imgl);
1852 himl1 = pImageList_Create(32,32,0,0,3);
1853 ok(himl1 !=
NULL,
"failed to create himl1\n");
1855 himl2 = pImageList_Create(32,32,0,0,3);
1856 ok(himl2 !=
NULL,
"failed to create himl2\n");
1859 ok(hicon1 !=
NULL,
"failed to create hicon1\n");
1861 if (!himl1 || !himl2 || !hicon1)
1869 ok( IImageList_ReplaceIcon(imgl2, -1, hicon1, &
ret) ==
S_OK && (
ret == 0),
"add icon1 to himl2 failed\n");
1874 IImageList_Merge(imgl1, -1,
NULL, 0, 0, 0, &IID_IImageList, (
void**)&
merge);
1875 IImageList_Merge(imgl1, -1, (
IUnknown*) imgl2, 0, 0, 0, &IID_IImageList,
NULL);
1879 hr = IImageList_Merge(imgl1, -1, (
IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (
void **) &
merge);
1880 ok(
hr ==
S_OK,
"merge himl1,-1 failed\n");
1883 hr = IImageList_Merge(imgl1, 0, (
IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (
void **) &
merge);
1884 ok(
hr ==
S_OK,
"merge himl1,0 failed\n");
1888 IImageList_Release(imgl2);
1889 himl2 = pImageList_Create(32,32,0,0,3);
1890 ok(himl2 !=
NULL,
"failed to recreate himl2\n");
1894 hr = IImageList_Merge(imgl1, -1, (
IUnknown *) imgl2, -1, 0, 0, &IID_IImageList, (
void **) &
merge);
1895 ok(
hr ==
S_OK,
"merge himl2,-1 failed\n");
1898 hr = IImageList_Merge(imgl1, -1, (
IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (
void **) &
merge);
1899 ok(
hr ==
S_OK,
"merge himl2,0 failed\n");
1904 ok( IImageList_ReplaceIcon(imgl2, -1, hicon1, &
ret) ==
S_OK && (
ret == 0),
"re-add icon1 to himl2 failed\n");
1906 hr = IImageList_Merge(imgl2, 0, (
IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (
void **) &
merge);
1907 ok(
hr ==
S_OK,
"merge himl2 with itself failed\n");
1912 ok( IImageList_ReplaceIcon(imgl1, -1, hicon1, &
ret) ==
S_OK && (
ret == 0),
"add icon1 to himl1 failed\n");
1914 hr = IImageList_Merge(imgl1, 0, (
IUnknown *) imgl2, 0, 0, 0, &IID_IImageList, (
void **) &
merge);
1915 ok(
hr ==
S_OK,
"merge himl1 with himl2 failed\n");
1918 hr = IImageList_Merge(imgl1, 0, (
IUnknown *) imgl2, 0, 8, 16, &IID_IImageList, (
void **) &
merge);
1919 ok(
hr ==
S_OK,
"merge himl1 with himl2 8,16 failed\n");
1922 IImageList_Release(imgl1);
1923 IImageList_Release(imgl2);
1944 ok(
cx == 0x1abe11ed,
"got %d\n",
cx);
1949 ok(
cy == 0x1abe11ed,
"got %d\n",
cy);
1951 pImageList_Destroy(
himl);
1980 rc = pImageList_Destroy((
HIMAGELIST)0xdeadbeef);
1981 ok(rc ==
FALSE,
"ImageList_Destroy(0xdeadbeef) should fail and not crash\n");
1987 pImageList_GetIconSize(
himl, &
cx, &
cy);
1988 ok (
cx == 0,
"Wrong cx (%i)\n",
cx);
1989 ok (
cy == 14,
"Wrong cy (%i)\n",
cy);
1990 pImageList_Destroy(
himl);
1994 pImageList_GetIconSize(
himl, &
cx, &
cy);
1995 ok (
cx == 0,
"Wrong cx (%i)\n",
cx);
1996 ok (
cy == 0,
"Wrong cy (%i)\n",
cy);
1997 pImageList_Destroy(
himl);
2001 pImageList_GetIconSize(
himl, &
cx, &
cy);
2002 ok (
cx == 0,
"Wrong cx (%i)\n",
cx);
2003 ok (
cy == 0,
"Wrong cy (%i)\n",
cy);
2005 pImageList_SetImageCount(
himl, 3);
2006 ret = pImageList_GetImageCount(
himl);
2007 ok(
ret == 3,
"Unexpected image count after increase\n");
2010 pImageList_Destroy(
himl);
2032 int i,
depth = ilc & 0xfe;
2038 memset(bmi_buffer, 0,
sizeof(bmi_buffer));
2055 "%d: %s: got color[%d] %02x %02x %02x expect %02x %02x %02x\n",
depth,
name,
i,
2077 memset(bmi_buffer, 0,
sizeof(bmi_buffer));
2095 for (
i = 0;
i < 256;
i++)
2100 table[
i].rgbReserved = 0;
2106 ok(0,
"unhandled depth %d\n",
bpp);
2126 himl = pImageList_Create(16, 16, ilc, 0, 3);
2129 memset(bmi_buffer, 0,
sizeof(bmi_buffer));
2168 ret = pImageList_Remove(
himl, -1);
2174 rgb[0].rgbRed = 0xff;
2175 rgb[1].rgbGreen = 0xff;
2176 rgb[2].rgbBlue = 0xff;
2181 ret = pImageList_Remove(
himl, -1);
2187 pImageList_Destroy(
himl);
2188 himl = pImageList_Create(16, 16, ilc, 0, 3);
2196 rgb[0].rgbRed = 0xff;
2197 rgb[0].rgbBlue = 0xff;
2198 rgb[1].rgbRed = 0xff;
2199 rgb[1].rgbGreen = 0xff;
2200 rgb[2].rgbGreen = 0xff;
2201 rgb[2].rgbBlue = 0xff;
2202 memcpy(
rgb + 16, default_table + 16, 240 *
sizeof(
rgb[0]));
2206 pImageList_Destroy(
himl);
2207 himl = pImageList_Create(16, 16, ilc, 0, 3);
2211 ret = pImageList_Remove(
himl, -1);
2214 rgb[0].rgbRed = 0xcc;
2215 rgb[1].rgbBlue = 0xcc;
2216 ret = pImageList_SetColorTable(
himl, 0, 2,
rgb);
2222 memcpy(
rgb + 2, default_table + 2, 254 *
sizeof(
rgb[0]));
2229 pImageList_Destroy(
himl);
2239 count = pImageList_GetImageCount(
dst);
2240 ok(!
count,
"ImageList not empty.\n");
2242 count = pImageList_GetImageCount(
src);
2243 ok(
count > 2,
"Tests need an ImageList with more than 2 images\n");
2247 ok(!
ret,
"ImageList_Copy() should have returned FALSE\n");
2248 count = pImageList_GetImageCount(
dst);
2249 ok(
count == 0,
"Expected no image in dst ImageList, got %d\n",
count);
2251 pImageList_Destroy(
dst);
2252 pImageList_Destroy(
src);
2265 pImageList_Destroy(
list );
2272 pImageList_Destroy(
list );
2288 IImageList_Clone(imgl, &IID_IImageList,
NULL);
2291 hr = IImageList_Clone(imgl, &IID_IImageList, (
void**)&imgl2);
2293 ref = IImageList_Release(imgl2);
2296 IImageList_Release(imgl);
2312 IImageList_GetBkColor(imgl,
NULL);
2315 hr = IImageList_GetBkColor(imgl, &
color);
2318 IImageList_Release(imgl);
2334 IImageList_SetBkColor(imgl,
RGB(0, 0, 0),
NULL);
2344 hr = IImageList_GetBkColor(imgl, &
color);
2348 IImageList_Release(imgl);
2364 IImageList_GetImageCount(imgl,
NULL);
2368 hr = IImageList_GetImageCount(imgl, &
count);
2372 IImageList_Release(imgl);
2385 hr = IImageList_GetIconSize(imgl,
NULL,
NULL);
2388 hr = IImageList_GetIconSize(imgl, &
cx,
NULL);
2391 hr = IImageList_GetIconSize(imgl,
NULL, &
cy);
2394 IImageList_Release(imgl);
2401#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
2402#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 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 @541 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)