diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 4f62635eb06..4de6b28c632 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -397,12 +397,12 @@ static HBITMAP copy_bitmap( HBITMAP bitmap ) */ static BOOL is_dib_monochrome( const BITMAPINFO* info ) { - if (info->bmiHeader.biBitCount != 1) return FALSE; - if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) { const RGBTRIPLE *rgb = ((const BITMAPCOREINFO*)info)->bmciColors; + if (((const BITMAPCOREINFO*)info)->bmciHeader.bcBitCount != 1) return FALSE; + /* Check if the first color is black */ if ((rgb->rgbtRed == 0) && (rgb->rgbtGreen == 0) && (rgb->rgbtBlue == 0)) { @@ -418,6 +418,8 @@ static BOOL is_dib_monochrome( const BITMAPINFO* info ) { const RGBQUAD *rgb = info->bmiColors; + if (info->bmiHeader.biBitCount != 1) return FALSE; + /* Check if the first color is black */ if ((rgb->rgbRed == 0) && (rgb->rgbGreen == 0) && (rgb->rgbBlue == 0) && (rgb->rgbReserved == 0)) diff --git a/dlls/user32/tests/cursoricon.c b/dlls/user32/tests/cursoricon.c index 232a02e70b4..6648ede4aa7 100644 --- a/dlls/user32/tests/cursoricon.c +++ b/dlls/user32/tests/cursoricon.c @@ -2584,7 +2584,6 @@ static void test_monochrome_icon(void) ok(icon_info.fIcon == TRUE, "fIcon is %u.\n", icon_info.fIcon); ok(icon_info.xHotspot == 0, "xHotspot is %u.\n", icon_info.xHotspot); ok(icon_info.yHotspot == 0, "yHotspot is %u.\n", icon_info.yHotspot); -todo_wine_if(monochrome && use_core_info) if (monochrome) ok(icon_info.hbmColor == NULL, "Got hbmColor %p!\n", icon_info.hbmColor); else