- Fix param checking and don't send negative values in the SIZEL struct of IntCreateBitmap.

- Fixes displaying of menu bitmaps in apps such as abiword

svn path=/trunk/; revision=30018
This commit is contained in:
Ged Murphy 2007-10-31 16:22:59 +00:00
parent db07c0df92
commit 9c27060580

View file

@ -48,7 +48,7 @@ IntGdiCreateBitmap(
BitsPixel = BITMAPOBJ_GetRealBitsPixel(BitsPixel * Planes);
/* Check parameters */
if (BitsPixel == 0 || Width < 1 || Height < 1)
if (BitsPixel == 0 || Width < 0)
{
DPRINT1("Width = %d, Height = %d BitsPixel = %d\n", Width, Height, BitsPixel);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
@ -58,7 +58,7 @@ IntGdiCreateBitmap(
WidthBytes = BITMAPOBJ_GetWidthBytes(Width, BitsPixel);
Size.cx = Width;
Size.cy = Height;
Size.cy = abs(Height);
/* Create the bitmap object. */
hBitmap = IntCreateBitmap(Size, WidthBytes,
@ -111,7 +111,15 @@ NtGdiCreateBitmap(
UINT cjBits = BITMAPOBJ_GetWidthBytes(Width, BitsPixel) * Height;
ProbeForRead(pUnsafeBits, cjBits, 1);
}
hBitmap = IntGdiCreateBitmap(Width, Height, Planes, BitsPixel, pUnsafeBits);
DPRINT1("calling IntGdiCreateBitmap 1\n");
if (0 == Width || 0 == Height)
{
hBitmap = IntGdiCreateBitmap (1, 1, 1, 1, NULL);
}
else
{
hBitmap = IntGdiCreateBitmap(Width, Height, Planes, BitsPixel, pUnsafeBits);
}
}
_SEH_HANDLE
{