Author: jgardou Date: Wed Jul 14 15:42:44 2010 New Revision: 48041
URL: http://svn.reactos.org/svn/reactos?rev=48041&view=rev Log: [USER32] - WINE creates an alpha bitmap on icon creation, we do it when drawing it, so we need to create a bitmap which holds alpha information. - Add error handling to CreateIconIndirect.
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] Wed Jul 14 15:42:44 2010 @@ -485,8 +485,8 @@ else { if (!(*mask = CreateBitmap( width, height, 1, 1, NULL ))) goto done; - if (!(*color = CreateBitmap( width, height, GetDeviceCaps( screen_dc, PLANES ), - GetDeviceCaps( screen_dc, BITSPIXEL ), NULL ))) + if (!(*color = CreateBitmap( width, height, bmi->bmiHeader.biPlanes, + bmi->bmiHeader.biBitCount, NULL ))) { DeleteObject( *mask ); goto done; @@ -1475,10 +1475,29 @@ height = bmpXor.bmHeight; if (bmpXor.bmPlanes * bmpXor.bmBitsPixel != 1) { - color = CreateCompatibleBitmap( screen_dc, width, height ); + color = CreateBitmap( width, height, bmpXor.bmPlanes, bmpXor.bmBitsPixel, NULL ); + if(!color) + { + ERR("Unable to create color bitmap!\n"); + return NULL; + } mask = CreateBitmap( width, height, 1, 1, NULL ); - } - else mask = CreateBitmap( width, height * 2, 1, 1, NULL ); + if(!mask) + { + ERR("Unable to create mask bitmap!\n"); + DeleteObject(color); + return NULL; + } + } + else + { + mask = CreateBitmap( width, height * 2, 1, 1, NULL ); + if(!mask) + { + ERR("Unable to create mask bitmap!\n"); + return NULL; + } + } } else {