- Allow creation of icons without color bitmap in CreateIconIndirect

- Compare color and mask size if color is present, compare height against height
- Fixes 13 user32 cursoricon winetests
- DbgPrint -> ERR or FIXME

svn path=/trunk/; revision=40526
This commit is contained in:
Gregor Schneider 2009-04-15 12:36:37 +00:00
parent f9e8538d24
commit 75230872e0
2 changed files with 13 additions and 14 deletions

View file

@ -285,7 +285,7 @@ LoadCursorIconImage(
if (fuLoad & LR_SHARED)
{
DbgPrint("FIXME: need LR_SHARED support for loading icon images from files\n");
FIXME("Need LR_SHARED support for loading icon images from files\n");
}
hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL,
@ -491,7 +491,7 @@ LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad)
if (Hit)
{
DbgPrint("We have a thread overrun, these are already freed! pi -> %d bi -> %d\n", PrivateInfo, BitmapInfo);
ERR("We have a thread overrun, these are already freed! pi -> %d, bi -> %d\n", PrivateInfo, BitmapInfo);
RtlFreeHeap(GetProcessHeap(), 0, PrivateInfo);
if (fuLoad & LR_LOADFROMFILE)
UnmapViewOfFile(BitmapInfo);

View file

@ -345,20 +345,19 @@ CreateIconIndirect(PICONINFO IconInfo)
{
return (HICON)0;
}
/* FIXME - does there really *have* to be a color bitmap? monochrome cursors don't have one */
if(/*IconInfo->hbmColor &&*/ !GetObjectW(IconInfo->hbmColor, sizeof(BITMAP), &ColorBitmap))
/* Try to get color bitmap */
if (GetObjectW(IconInfo->hbmColor, sizeof(BITMAP), &ColorBitmap))
{
return (HICON)0;
/* Compare size of color and mask bitmap*/
if(ColorBitmap.bmWidth != MaskBitmap.bmWidth ||
ColorBitmap.bmHeight != MaskBitmap.bmHeight)
{
ERR("Color and mask size are different!");
SetLastError(ERROR_INVALID_PARAMETER);
return (HICON)0;
}
}
/* FIXME - i doubt this is right (monochrome cursors */
/*if(ColorBitmap.bmWidth != MaskBitmap.bmWidth ||
ColorBitmap.bmHeight != MaskBitmap.bmWidth)
{
SetLastError(ERROR_INVALID_PARAMETER);
return (HICON)0;
}*/
return (HICON)NtUserCreateCursorIconHandle(IconInfo, TRUE);
}