From 182f353b2f447b958c17086504e4f18f559e7deb Mon Sep 17 00:00:00 2001 From: Whindmar Saksit Date: Sun, 6 Apr 2025 19:00:54 +0200 Subject: [PATCH] [COMCTL32] ImageList_LoadImageW with CLR_NONE should not use a mask (#7869) CORE-16146 --- dll/win32/comctl32/imagelist.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dll/win32/comctl32/imagelist.c b/dll/win32/comctl32/imagelist.c index e56431edc6f..1ebf0cf484e 100644 --- a/dll/win32/comctl32/imagelist.c +++ b/dll/win32/comctl32/imagelist.c @@ -2263,7 +2263,20 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, DeleteObject (handle); return NULL; } +#ifdef __REACTOS__ + if (clrMask == CLR_NONE) + nImageCount = ImageList_Add(himl, handle, NULL); + else + nImageCount = ImageList_AddMasked(himl, handle, clrMask); + + if (nImageCount < 0) + { + ImageList_Destroy(himl); + himl = NULL; + } +#else ImageList_AddMasked (himl, handle, clrMask); +#endif } else if ((uType == IMAGE_ICON) || (uType == IMAGE_CURSOR)) { ICONINFO ii;