comctl32: fix MSVC build in imagelist.c

carlo.bramix at carlo.bramix at
Mon Jan 30 08:24:03 CST 2012

If I can say my opinion, I disagree on the usage of HeapAlloc/HeapFree for that known amount of memory.
Instead, for granting compatibility with MSVC, I would continue to use a structure in stack memory by simply using _alloca() and something like this:

_alloca(FIELD_OFFSET(BITMAPINFO, bmiColors[256]));

or this:


and leaving all other lines of code unchanged.


Carlo Bramini.

> Thomas Faber <thfabba at> writes:
>> This removes the use of a Variable-Length Array in ImageList_CreateImage
>> and replaces it with HeapAlloc/HeapFree, as it is done in several
>> other functions in this file.
>> Alas, FIELD_OFFSET is "not const enough" for ANSI C.
>Using sizeof instead would be preferable.
>Alexandre Julliard
>julliard at

More information about the wine-devel mailing list