Commit 93047e27 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

When creating black & white cursor icon, handle special case where

hbmColor is null and hbmMask specify a bitmap having twice the height and formatted so the upper half is the icon AND bitmask and the lower one is the OR bitmask.
parent 8a4c4ef2
...@@ -1807,10 +1807,10 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo) ...@@ -1807,10 +1807,10 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo)
HICON16 hObj; HICON16 hObj;
int sizeXor,sizeAnd; int sizeXor,sizeAnd;
GetObjectA( iconinfo->hbmColor, sizeof(bmpXor), &bmpXor ); if (iconinfo->hbmColor) GetObjectA( iconinfo->hbmColor, sizeof(bmpXor), &bmpXor );
GetObjectA( iconinfo->hbmMask, sizeof(bmpAnd), &bmpAnd ); GetObjectA( iconinfo->hbmMask, sizeof(bmpAnd), &bmpAnd );
sizeXor = bmpXor.bmHeight * bmpXor.bmWidthBytes; sizeXor = iconinfo->hbmColor ? (bmpXor.bmHeight * bmpXor.bmWidthBytes) : 0;
sizeAnd = bmpAnd.bmHeight * bmpAnd.bmWidthBytes; sizeAnd = bmpAnd.bmHeight * bmpAnd.bmWidthBytes;
hObj = GlobalAlloc16( GMEM_MOVEABLE, hObj = GlobalAlloc16( GMEM_MOVEABLE,
...@@ -1833,16 +1833,16 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo) ...@@ -1833,16 +1833,16 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo)
info->ptHotSpot.y = iconinfo->yHotspot; info->ptHotSpot.y = iconinfo->yHotspot;
} }
info->nWidth = bmpXor.bmWidth; info->nWidth = bmpAnd.bmWidth;
info->nHeight = bmpXor.bmHeight; info->nHeight = iconinfo->hbmColor ? bmpAnd.bmHeight : (bmpAnd.bmHeight / 2);
info->nWidthBytes = bmpXor.bmWidthBytes; info->nWidthBytes = bmpAnd.bmWidthBytes;
info->bPlanes = bmpXor.bmPlanes; info->bPlanes = bmpAnd.bmPlanes;
info->bBitsPerPixel = bmpXor.bmBitsPixel; info->bBitsPerPixel = bmpAnd.bmBitsPixel;
/* Transfer the bitmap bits to the CURSORICONINFO structure */ /* Transfer the bitmap bits to the CURSORICONINFO structure */
GetBitmapBits( iconinfo->hbmMask ,sizeAnd,(char*)(info + 1) ); GetBitmapBits( iconinfo->hbmMask, sizeAnd, (char*)(info + 1) );
GetBitmapBits( iconinfo->hbmColor,sizeXor,(char*)(info + 1) +sizeAnd); if (iconinfo->hbmColor) GetBitmapBits( iconinfo->hbmColor, sizeXor, (char*)(info + 1) + sizeAnd );
GlobalUnlock16( hObj ); GlobalUnlock16( hObj );
} }
return HICON_32(hObj); return HICON_32(hObj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment