Author: gschneider Date: Wed Apr 15 21:09:17 2009 New Revision: 40531
URL: http://svn.reactos.org/svn/reactos?rev=40531&view=rev Log: - Detect switched color and mask bitmaps in CreateCursorIndirect and switch them back - Don't set the icon hotspot too early in CreateIcon - Fixes five cursoricon winetests
Modified: trunk/reactos/dll/win32/user32/windows/icon.c
Modified: trunk/reactos/dll/win32/user32/windows/icon.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/ic... ============================================================================== --- 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 21:09:17 2009 @@ -195,8 +195,6 @@ ICONINFO IconInfo;
IconInfo.fIcon = TRUE; - IconInfo.xHotspot = nWidth / 2; - IconInfo.yHotspot = nHeight / 2;
if (cBitsPixel == 1) { @@ -347,6 +345,7 @@ { BITMAP ColorBitmap; BITMAP MaskBitmap; + HBITMAP hbmTemp;
if(!IconInfo) { @@ -363,12 +362,19 @@ if (GetObjectW(IconInfo->hbmColor, sizeof(BITMAP), &ColorBitmap)) { /* Compare size of color and mask bitmap*/ - if(ColorBitmap.bmWidth != MaskBitmap.bmWidth || + if (ColorBitmap.bmWidth != MaskBitmap.bmWidth || ColorBitmap.bmHeight != MaskBitmap.bmHeight) { ERR("Color and mask size are different!"); SetLastError(ERROR_INVALID_PARAMETER); return (HICON)0; + } + /* Check if color and mask are switched and switch them back */ + if (MaskBitmap.bmBitsPixel != 1 && ColorBitmap.bmBitsPixel == 1) + { + hbmTemp = IconInfo->hbmMask; + IconInfo->hbmMask = IconInfo->hbmColor; + IconInfo->hbmColor = hbmTemp; } } return (HICON)NtUserCreateCursorIconHandle(IconInfo, TRUE);