From af690c12248e4b390fb55bc7592fb2f465beb529 Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Wed, 16 Jun 2021 14:09:21 +0200 Subject: [PATCH] [0.4.9][COMCTL32] Fix regression on showing current mouse pointer in main.cpl (#2829) GetIconInfo() fill info.hbmColor with NULL HBITMAP handle on black/white bitmaps. CORE-17062 It broke by 0.4.9-dev-719-g b3fb8555bf9abcc04eeac31c7153d33e2f027fc0 fix is squashed port of 2 commits: 0.4.15-dev-534-g 887764e6075fdde7fb81d2a54d5255164c046511 (fix) 0.4.15-dev-2705-g a3cadf630a9b3a61f4ae8525aef7af07e4b53c0d (nitpick) --- dll/win32/comctl32/static.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dll/win32/comctl32/static.c b/dll/win32/comctl32/static.c index d9e2fe30dc7..7ebb371f2a2 100644 --- a/dll/win32/comctl32/static.c +++ b/dll/win32/comctl32/static.c @@ -94,11 +94,24 @@ static BOOL get_icon_size( HICON handle, SIZE *size ) if (!GetIconInfo(handle, &info)) return FALSE; +#ifdef __REACTOS__ + ret = GetObjectW(info.hbmMask, sizeof(bmp), &bmp); +#else ret = GetObjectW(info.hbmColor, sizeof(bmp), &bmp); +#endif if (ret) { size->cx = bmp.bmWidth; size->cy = bmp.bmHeight; +#ifdef __REACTOS__ + /* + If this structure defines a black and white icon, this bitmask is formatted + so that the upper half is the icon AND bitmask and the lower half is + the icon XOR bitmask. + */ + if (!info.hbmColor) + size->cy /= 2; +#endif } DeleteObject(info.hbmMask);