From: Kun Yang <yangkun@uniontech.com> Logs: When CreateDIBSection does not return a valid hbitmap, the source image is lost that only masked icon is shown in imagelist. Signed-off-by: Kun Yang <yangkun@uniontech.com> --- dlls/comctl32/imagelist.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index 978aeaa7755..614c185bbf5 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -383,6 +383,7 @@ IMAGELIST_InternalExpandBitmaps(HIMAGELIST himl, INT nImageCount) himl->item_flags = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, himl->item_flags, nNewCount * sizeof(*himl->item_flags)); himl->cMaxImage = nNewCount; + ERR("1111. himl->cCurImage %d\n", himl->cCurImage); DeleteDC (hdcBitmap); } @@ -3094,8 +3095,8 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count) /*if CreateDIBSection failed, allocate for 1 image only.*/ bmi->bmiHeader.biHeight = newImageCount * himl->cy; hbmNewBitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, 0, 0); - /*the max image count is set to 2, expand when exceeded.*/ - himl->cMaxImage = newImageCount + 1; + /*the max image count is set to 1, expand when exceeded.*/ + himl->cMaxImage = newImageCount; } } else /*if (ilc == ILC_COLORDDB)*/ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10039