From 604ab3e4c0f17f716a56bf2d4b60ee72f96db227 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Mon, 25 Sep 2006 05:25:11 +0000 Subject: [PATCH] Fixed some bugs in win32k function BITMAP_GetObject. svn path=/trunk/; revision=24266 --- reactos/subsystems/win32/win32k/objects/bitmaps.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reactos/subsystems/win32/win32k/objects/bitmaps.c b/reactos/subsystems/win32/win32k/objects/bitmaps.c index 2040b81297f..4ae2c8987bb 100644 --- a/reactos/subsystems/win32/win32k/objects/bitmaps.c +++ b/reactos/subsystems/win32/win32k/objects/bitmaps.c @@ -1556,8 +1556,12 @@ BITMAPOBJ_CopyBitmap(HBITMAP hBitmap) 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_GetObject(BITMAPOBJ * bmp, INT count, LPVOID buffer) 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; }