comctl32/tests/imagelist.c seems to throw an exception during GetDIBits(), but for some reason, the test continues and succeeds (except in Valgrind, which is why I noticed). Do other folks also see a seh exception in the +seh log on this test?
I narrowed the test case down a bit (see patch). Can anyone clue me in on what's going on here?
diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index 3d4c333..20d2af8 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -967,6 +967,37 @@ static void test_imagelist_storage(void) iml_clear_stream_data(); } +static void DoTest0() +{ + HBITMAP hbm; + HIMAGELIST himl; + + himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 1, 1); + ok(himl != 0, "ImageList_Create failed\n"); + hbm = create_bitmap(BMP_CX, BMP_CX, RGB(0,0,0), "foo"); + ImageList_Add(himl, hbm, NULL); + trace("DoTest0: about to call check_iml_data and crash in ImageList_Write\n"); + /* crash is in gdi32/dib.c in memcpy in + * case 24: // 24 bpp srcDIB -> 24 bpp dstDIB + * widthb = min(srcwidthb, abs(dstwidthb)); + * for (y = 0; y < lines; y++, dbits+=dstwidthb, sbits+=srcwidthb) + * memcpy(dbits, sbits, widthb); <- first byte read from *sbits crashes + * A normal run with +seh shows + * + * trace:seh:raise_exception code=c0000005 flags=0 addr=0x7e9e9dba + * trace:seh:raise_exception info[0]=00000000 + * trace:seh:raise_exception info[1]=00450000 + * trace:seh:raise_exception eax=00450000 ebx=7ea35d0c ecx=00000000 edx=0000002d esi=7ea2bd50 edi=00000240 + * trace:seh:raise_exception ebp=0033fa18 esp=0033f510 cs=0073 ds=007b es=007b fs=0033 gs=003b flags=10202 + * where 450000 is the value of sbits. + * Oddly, the test keeps running (except under Valgrind, where it aborts, but Valgrind gets info[1] wrong). + */ + + check_iml_data(himl, BMP_CX, BMP_CX, 1, 2, BMP_CX * 4, BMP_CX * 1, 24, "foo"); + trace("DoTest0: the exception seems to not be fatal?\n"); +} + + START_TEST(imagelist) { desktopDC=GetDC(NULL); @@ -974,6 +1005,7 @@ START_TEST(imagelist) InitCommonControls(); + DoTest0(); testHotspot(); DoTest1(); DoTest2();