mirror of
https://github.com/reactos/reactos.git
synced 2024-07-31 00:28:56 +00:00
revert r33403 for it break abiword
we need fixing gdi32.dll bugs before we can fix it correct svn path=/trunk/; revision=33404
This commit is contained in:
parent
608264fa22
commit
dc6e9467cc
|
@ -43,24 +43,22 @@ IntGdiCreateBitmap(
|
||||||
SIZEL Size;
|
SIZEL Size;
|
||||||
LONG WidthBytes;
|
LONG WidthBytes;
|
||||||
|
|
||||||
|
|
||||||
/* NOTE: Windows also doesn't store nr. of planes separately! */
|
/* NOTE: Windows also doesn't store nr. of planes separately! */
|
||||||
BitsPixel = BITMAPOBJ_GetRealBitsPixel(BitsPixel * Planes);
|
BitsPixel = BITMAPOBJ_GetRealBitsPixel(BitsPixel * Planes);
|
||||||
|
|
||||||
/* Check parameters */
|
/* Check parameters */
|
||||||
|
if (BitsPixel == 0 || Width < 0)
|
||||||
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);
|
||||||
DPRINT1("Width = %d, Height = %d BitsPixel = %d\n", Width, Height, BitsPixel);
|
return 0;
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
}
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
WidthBytes = BITMAPOBJ_GetWidthBytes(Width, Planes * BitsPixel);
|
WidthBytes = BITMAPOBJ_GetWidthBytes(Width, Planes * BitsPixel);
|
||||||
|
|
||||||
Size.cx = Width;
|
Size.cx = abs(Width);
|
||||||
Size.cy = Height;
|
Size.cy = abs(Height);
|
||||||
|
|
||||||
/* Create the bitmap object. */
|
/* Create the bitmap object. */
|
||||||
hBitmap = IntCreateBitmap(Size, WidthBytes,
|
hBitmap = IntCreateBitmap(Size, WidthBytes,
|
||||||
BitmapFormat(BitsPixel, BI_RGB),
|
BitmapFormat(BitsPixel, BI_RGB),
|
||||||
|
@ -114,7 +112,14 @@ NtGdiCreateBitmap(
|
||||||
ProbeForRead(pUnsafeBits, cjBits, 1);
|
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
|
_SEH_HANDLE
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue