user32: Correctly determine bit count for BITMAPCOREINFO in is_dib_monochrome.
Signed-off-by: Mark Jansen <learn0more@gmail.com> Signed-off-by: Thomas Faber <thomas.faber@reactos.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6ad5cfbebd
commit
e1f1a60f87
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue