Author: gschneider
Date: Wed Apr 15 16:36:37 2009
New Revision: 40526
URL:
http://svn.reactos.org/svn/reactos?rev=40526&view=rev
Log:
- 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
Modified:
trunk/reactos/dll/win32/user32/windows/bitmap.c
trunk/reactos/dll/win32/user32/windows/icon.c
Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/b…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] Wed Apr 15 16:36:37 2009
@@ -285,7 +285,7 @@
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 @@
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);
Modified: trunk/reactos/dll/win32/user32/windows/icon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/i…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/icon.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/icon.c [iso-8859-1] Wed Apr 15 16:36:37 2009
@@ -345,20 +345,19 @@
{
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);
}