On Fri Feb 6 10:25:55 2026 +0000, Kun Yang wrote:
@zhiyi 我已经更新了,我认为wine test只能测试一些对于windows可见的接口校验,这个问题由于HIMAGELIST是不公开的,因此在wine中接口层不能简单地判断出错误,我通过ImageList_GetImageInfo来获取其中的hbitmap来判断,因为错误的实例中hbitmap为空,导致只显示掩码。最直观的问题展示还是绘制到窗口之后。关于cMaxImage的个数,是根据wine原先的逻辑,由于初始给的很大,就不会在Imagelist_Add中溢出从而增长,导致在这个修改下只有4个图标是正常的,而设置为2是沿用了init中的逻辑,当前图像个数+1,所以超出这个范围可以正常更新,我认为这个部分不太好用wine test进行测试。 (I have updated the code. I believe wine test can only validate some interface checks that are visible to Windows app. This issue arises because HIMAGELIST is not publicly exposed, making it difficult for the interface layer in Wine to simply detect errors. To work around this, I used ImageList_GetImageInfo to retrieve the hbitmap for validation, as in erroneous instances the hbitmap is null, resulting in only the mask being displayed. The most straightforward way to observe the problem is still after rendering to the window. Regarding the count of cMaxImage, it follows Wine's original logic. Since the initial allocation is large enough, it prevents overflow and subsequent resizing during ImageList_Add, which under this modification would cause only 4 icons to display correctly. Setting it to 2 aligns with the initialization logic—current image count + 1—so exceeding this range allows for proper updates. I think this part is not very suitable for testing via Wine tests.) Please see wine/dlls/comctl32/imagelist.c#struct _IMAGELIST around line 53
struct _IMAGELIST
{
IImageList2 IImageList2_iface; /* 00: IImageList vtable */
INT cCurImage; /* 04: ImageCount */
INT cMaxImage; /* 08: maximages */
INT cGrow; /* 0C: cGrow */
INT cx; /* 10: cx */
INT cy; /* 14: cy */
Wine has the same structure layout for some fields, including cMaxImage. So you can cast the HIMAGELIST pointer to struct _IMAGELIST on Windows and get the cMaxImage. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10039#note_128962