From dc6e9467cc2291d487d3ac25d60816eac06a7c9e Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sat, 10 May 2008 11:42:00 +0000 Subject: [PATCH] revert r33403 for it break abiword we need fixing gdi32.dll bugs before we can fix it correct svn path=/trunk/; revision=33404 --- .../subsystems/win32/win32k/objects/bitmaps.c | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/bitmaps.c b/reactos/subsystems/win32/win32k/objects/bitmaps.c index 8100d9bfd31..851e6895755 100644 --- a/reactos/subsystems/win32/win32k/objects/bitmaps.c +++ b/reactos/subsystems/win32/win32k/objects/bitmaps.c @@ -43,24 +43,22 @@ IntGdiCreateBitmap( SIZEL Size; LONG WidthBytes; - /* NOTE: Windows also doesn't store nr. of planes separately! */ BitsPixel = BITMAPOBJ_GetRealBitsPixel(BitsPixel * Planes); /* Check parameters */ - - if ( (Height <= 0) || (Width <= 0) || (Width > 0x7FFFFFFF) || - (Planes > 32) || (BitsPixel > 32) || (BitsPixel == 0) ) - { - DPRINT1("Width = %d, Height = %d BitsPixel = %d\n", Width, Height, BitsPixel); - SetLastWin32Error(ERROR_INVALID_PARAMETER); - return 0; - } + if (BitsPixel == 0 || Width < 0) + { + DPRINT1("Width = %d, Height = %d BitsPixel = %d\n", Width, Height, BitsPixel); + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return 0; + } WidthBytes = BITMAPOBJ_GetWidthBytes(Width, Planes * BitsPixel); - Size.cx = Width; - Size.cy = Height; + Size.cx = abs(Width); + Size.cy = abs(Height); + /* Create the bitmap object. */ hBitmap = IntCreateBitmap(Size, WidthBytes, BitmapFormat(BitsPixel, BI_RGB), @@ -114,7 +112,14 @@ NtGdiCreateBitmap( ProbeForRead(pUnsafeBits, cjBits, 1); } - hBitmap = IntGdiCreateBitmap(Width, Height, Planes, BitsPixel, pUnsafeBits); + if (0 == Width || 0 == Height) + { + hBitmap = IntGdiCreateBitmap (1, 1, 1, 1, NULL); + } + else + { + hBitmap = IntGdiCreateBitmap(Width, Height, Planes, BitsPixel, pUnsafeBits); + } } _SEH_HANDLE {