comctl32[2/2]: toolbar: fix the layout of TBUTTON_INFO on Win64
Mikołaj Zalewski
mikolaj at zalewski.pl
Sun Jan 25 09:11:48 CST 2009
Dmitry Timoshkov wrote:
> "Mikołaj Zalewski" <mikolaj at zalewski.pl> wrote:
>
>>>> +/* Note: TOOLBAR_DumpButton assumes the layout of the beginning of
>>>> the structure
>>>> + * is the same as of TBBUTTON */
>>>> typedef struct
>>>> {
>>>> INT iBitmap;
>>>> @@ -96,6 +98,9 @@ typedef struct
>>>> BYTE fsStyle;
>>>> BYTE bHot;
>>>> BYTE bDropDownPressed;
>>>> +#ifdef _WIN64
>>>> + BYTE bReserved64[4];
>>>> +#endif
>>>> DWORD_PTR dwData;
>>>> INT_PTR iString;
>>>> INT nRow;
>>>
>>>
>>>
>>> Then probably it would make sense to make TBBUTTON the first member
>>> of the above
>>> structure. That would help in avoiding possible layout problems in
>>> future.
>>>
>> The bHot and bDropDownPressed would then be called bReserved[0] and
>> bReserved[1] so this could make more harm than good.
>
>
> You can make a union for that case, with an appropriate comment.
>
TBBUTTON is an official Windows API structure. Adding a union inside
and doing it just because of some internals of our toolbar
implementation is IMHO not the best idea.
Mikolaj
More information about the wine-devel
mailing list