Author: gedmurphy
Date: Thu Apr 19 13:33:53 2007
New Revision: 26421
URL:
http://svn.reactos.org/svn/reactos?rev=26421&view=rev
Log:
revert base changes. The original test case was wrong
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 Thu Apr 19 13:33:53 2007
@@ -1564,18 +1564,24 @@
if( buffer == NULL ) return sizeof(BITMAP);
if (Count < sizeof(BITMAP)) return 0;
- Count = sizeof(BITMAP);
-
if(bmp->dib)
{
+
+ if(Count < (INT) sizeof(DIBSECTION))
+ {
+ if (Count > (INT) sizeof(BITMAP)) Count = sizeof(BITMAP);
+ }
+ else
+ {
+ if (Count > (INT) sizeof(DIBSECTION)) Count = sizeof(DIBSECTION);
+ }
memcpy(buffer, bmp->dib, Count);
- /* Windows returns bytes copied, not DIBSECTION size */
return Count;
}
else
{
BITMAP Bitmap;
-
+ if (Count > (INT) sizeof(BITMAP)) Count = sizeof(BITMAP);
Bitmap.bmType = 0;
Bitmap.bmWidth = bmp->SurfObj.sizlBitmap.cx;
Bitmap.bmHeight = bmp->SurfObj.sizlBitmap.cy;