[ros-diffs] [greatlrd] 24266: Fixed some bugs in win32k function BITMAP_GetObject.

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Mon Sep 25 07:25:12 CEST 2006


Author: greatlrd
Date: Mon Sep 25 09:25:11 2006
New Revision: 24266

URL: http://svn.reactos.org/svn/reactos?rev=24266&view=rev
Log:
Fixed some bugs in win32k function BITMAP_GetObject.

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=24266&r1=24265&r2=24266&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Mon Sep 25 09:25:11 2006
@@ -1556,8 +1556,12 @@
 INT STDCALL
 BITMAP_GetObject(BITMAPOBJ * bmp, INT count, LPVOID buffer)
 {
+	if( !buffer ) return sizeof(BITMAP);
+    if (count < sizeof(BITMAP)) return 0;
+
 	if(bmp->dib)
 	{
+
 		if(count < (INT) sizeof(DIBSECTION))
 		{
 			if (count > (INT) sizeof(BITMAP)) count = sizeof(BITMAP);
@@ -1579,7 +1583,8 @@
 		Bitmap.bmWidthBytes = abs(bmp->SurfObj.lDelta);
 		Bitmap.bmPlanes = 1;
 		Bitmap.bmBitsPixel = BitsPerFormat(bmp->SurfObj.iBitmapFormat);
-		Bitmap.bmBits = bmp->SurfObj.pvBits;
+		//Bitmap.bmBits = bmp->SurfObj.pvBits;
+		Bitmap.bmBits = NULL; /* not set accoring wine test confirm in win2k */
 		memcpy(buffer, &Bitmap, count);
 		return count;
 	}




More information about the Ros-diffs mailing list