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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index b4b43c83a5d..817bdbc1c21 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -383,7 +383,6 @@ 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,9 +3093,9 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count) UINT newImageCount = 1; /*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 1, expand when exceeded.*/ himl->cMaxImage = newImageCount; - himl->cMaxImage = newImageCount; } } else /*if (ilc == ILC_COLORDDB)*/ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10039