[ros-diffs] [greatlrd] 33404: revert r33403 for it break abiword we need fixing gdi32.dll bugs before we can fix it correct

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Sat May 10 13:42:01 CEST 2008


Author: greatlrd
Date: Sat May 10 06:42:00 2008
New Revision: 33404

URL: http://svn.reactos.org/svn/reactos?rev=33404&view=rev
Log:
revert  r33403 for it break abiword
we need fixing gdi32.dll bugs before we can fix it correct

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/objects/bitmaps.c?rev=33404&r1=33403&r2=33404&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Sat May 10 06:42:00 2008
@@ -43,24 +43,22 @@
    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 @@
          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
    {



More information about the Ros-diffs mailing list