Author: gedmurphy
Date: Wed Oct 31 19:22:59 2007
New Revision: 30018
URL:
http://svn.reactos.org/svn/reactos?rev=30018&view=rev
Log:
- 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
Modified:
trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Wed Oct 31 19:22:59 2007
@@ -48,7 +48,7 @@
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 @@
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 @@
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
{