mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +00:00
[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) svn path=/trunk/; revision=50408
This commit is contained in:
parent
e8a298b190
commit
f0264e4afc
|
@ -1173,13 +1173,21 @@ HICON WINAPI CreateIcon(
|
||||||
iinfo.fIcon = TRUE;
|
iinfo.fIcon = TRUE;
|
||||||
iinfo.xHotspot = nWidth / 2;
|
iinfo.xHotspot = nWidth / 2;
|
||||||
iinfo.yHotspot = nHeight / 2;
|
iinfo.yHotspot = nHeight / 2;
|
||||||
iinfo.hbmMask = CreateBitmap( nWidth, nHeight, 1, 1, lpANDbits );
|
if (bPlanes * bBitsPixel > 1)
|
||||||
|
{
|
||||||
iinfo.hbmColor = CreateBitmap( nWidth, nHeight, bPlanes, bBitsPixel, lpXORbits );
|
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 );
|
hIcon = CreateIconIndirect( &iinfo );
|
||||||
|
|
||||||
DeleteObject( iinfo.hbmMask );
|
DeleteObject( iinfo.hbmMask );
|
||||||
DeleteObject( iinfo.hbmColor );
|
if (iinfo.hbmColor) DeleteObject( iinfo.hbmColor );
|
||||||
|
|
||||||
return hIcon;
|
return hIcon;
|
||||||
}
|
}
|
||||||
|
@ -1498,7 +1506,7 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mask = CreateBitmap( width, height, 1, 1, NULL );
|
mask = CreateBitmap( width, height * 2, 1, 1, NULL );
|
||||||
if(!mask)
|
if(!mask)
|
||||||
{
|
{
|
||||||
ERR("Unable to create mask bitmap!\n");
|
ERR("Unable to create mask bitmap!\n");
|
||||||
|
|
Loading…
Reference in a new issue