diff --git "a/win32ss/user/user32/windows/cursoricon.c" "b/win32ss/user/user32/windows/cursoricon.c" index a3f8a48602e..febb13baa75 100644 --- "a/win32ss/user/user32/windows/cursoricon.c" +++ "b/win32ss/user/user32/windows/cursoricon.c" @@ -152,6 +152,53 @@ static BOOL is_dib_monochrome( const BITMAPINFO* info ) } } +#ifdef __REACTOS__ +static BOOL is_bmp_monochrome( const BITMAPINFO* info ) +{ + if (is_dib_monochrome(info)) + return TRUE; + + if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) + { + const RGBTRIPLE *rgb = ((const BITMAPCOREINFO*)info)->bmciColors; +ERR("BITMAPCOREHEADER\n"); + if (((const BITMAPCOREINFO*)info)->bmciHeader.bcBitCount != 1) return FALSE; + + /* Check if the first color is white */ + if (RGB(rgb[0].rgbtRed, rgb[0].rgbtGreen, rgb[0].rgbtBlue) == + RGB(0xff, 0xff, 0xff)) + { + /* Check if the second color is black */ + if (RGB(rgb[1].rgbtRed, rgb[1].rgbtGreen, rgb[1].rgbtBlue) == + RGB(0, 0, 0)) + { + return TRUE; + } + } + + return FALSE; + } + else /* assume BITMAPINFOHEADER */ + { + const RGBQUAD *rgb = info->bmiColors; + if (info->bmiHeader.biBitCount != 1) return FALSE; + + /* Check if the first color is white */ + if (RGBA(rgb[0].rgbRed, rgb[0].rgbGreen, rgb[0].rgbBlue, + rgb[0].rgbReserved) == RGBA(0xff, 0xff, 0xff, 0)) + { + /* Check if the second color is black */ + if (RGBA(rgb[1].rgbRed, rgb[1].rgbGreen, rgb[1].rgbBlue, + rgb[1].rgbReserved) == RGBA(0, 0, 0, 0)) + { + return TRUE; + } + } + return FALSE; + } +} +#endif + static int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) { unsigned int colors, size, masks = 0; @@ -1285,7 +1332,11 @@ create_bitmap: hbmpRet = CreateDIBSection(hdc, pbmiScaled, DIB_RGB_COLORS, NULL, 0, 0); else { +#ifdef __REACTOS__ + if(is_bmp_monochrome(pbmiCopy) || (fuLoad & LR_MONOCHROME)) +#else if(is_dib_monochrome(pbmiCopy) || (fuLoad & LR_MONOCHROME)) +#endif hbmpRet = CreateBitmap(cxDesired, cyDesired, 1, 1, NULL); else hbmpRet = CreateCompatibleBitmap(hdcScreen, cxDesired, cyDesired);