From: Jeff Smith whydoubt@gmail.com
--- dlls/gdiplus/tests/image.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 48a4652e688..2523ee61f71 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -1562,8 +1562,6 @@ static void test_fromhicon(void) info.hbmColor = hbmColor; hIcon = CreateIconIndirect(&info); ok(hIcon != 0, "CreateIconIndirect failed\n"); - DeleteObject(hbmMask); - DeleteObject(hbmColor);
stat = GdipCreateBitmapFromHICON(hIcon, &bitmap); ok(stat == Ok || @@ -1589,6 +1587,28 @@ static void test_fromhicon(void) } DestroyIcon(hIcon);
+ /* color icon 1 bit - color-only */ + info = iconinfo_base; + info.hbmColor = hbmColor; + hIcon = CreateIconIndirect(&info); + ok(hIcon == 0, "CreateIconIndirect expected to fail\n"); + + /* color icon 1 bit - mask-only */ + info = iconinfo_base; + info.hbmMask = hbmMask; + hIcon = CreateIconIndirect(&info); + ok(hIcon != 0, "CreateIconIndirect failed\n"); + + stat = GdipCreateBitmapFromHICON(hIcon, &bitmap); + todo_wine + expect(InvalidParameter, stat); + if (stat == Ok) + GdipDisposeImage((GpImage*)bitmap); + DestroyIcon(hIcon); + + DeleteObject(hbmMask); + DeleteObject(hbmColor); + /* color icon 8 bpp */ hbmMask = CreateBitmap(16, 16, 1, 8, bmp_bits); ok(hbmMask != 0, "CreateBitmap failed\n");