Author: tkreuzer Date: Mon Jan 17 01:22:16 2011 New Revision: 50408
URL: http://svn.reactos.org/svn/reactos?rev=50408&view=rev Log: [USER32] Fix CreateIcon and CreateIconIndirect. Fixes user32_winetest:cursoricon. (Yes we execute less tests, but that is correct! wine probably only passes these tests by chance)
Modified: trunk/reactos/dll/win32/user32/windows/cursoricon.c
Modified: trunk/reactos/dll/win32/user32/windows/cursoricon.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/cu... ============================================================================== --- trunk/reactos/dll/win32/user32/windows/cursoricon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/cursoricon.c [iso-8859-1] Mon Jan 17 01:22:16 2011 @@ -1173,13 +1173,21 @@ iinfo.fIcon = TRUE; iinfo.xHotspot = nWidth / 2; iinfo.yHotspot = nHeight / 2; - iinfo.hbmMask = CreateBitmap( nWidth, nHeight, 1, 1, lpANDbits ); - iinfo.hbmColor = CreateBitmap( nWidth, nHeight, bPlanes, bBitsPixel, lpXORbits ); + if (bPlanes * bBitsPixel > 1) + { + iinfo.hbmColor = CreateBitmap( nWidth, nHeight, bPlanes, bBitsPixel, lpXORbits ); + iinfo.hbmMask = CreateBitmap( nWidth, nHeight, 1, 1, lpANDbits ); + } + else + { + iinfo.hbmMask = CreateBitmap( nWidth, nHeight * 2, 1, 1, lpANDbits ); + iinfo.hbmColor = NULL; + }
hIcon = CreateIconIndirect( &iinfo );
DeleteObject( iinfo.hbmMask ); - DeleteObject( iinfo.hbmColor ); + if (iinfo.hbmColor) DeleteObject( iinfo.hbmColor );
return hIcon; } @@ -1498,7 +1506,7 @@ } else { - mask = CreateBitmap( width, height, 1, 1, NULL ); + mask = CreateBitmap( width, height * 2, 1, 1, NULL ); if(!mask) { ERR("Unable to create mask bitmap!\n");