mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:42:57 +00:00
Fixed some bugs in win32k function BITMAP_GetObject.
svn path=/trunk/; revision=24266
This commit is contained in:
parent
6f10b47b94
commit
604ab3e4c0
1 changed files with 6 additions and 1 deletions
|
@ -1556,8 +1556,12 @@ BITMAPOBJ_CopyBitmap(HBITMAP hBitmap)
|
||||||
INT STDCALL
|
INT STDCALL
|
||||||
BITMAP_GetObject(BITMAPOBJ * bmp, INT count, LPVOID buffer)
|
BITMAP_GetObject(BITMAPOBJ * bmp, INT count, LPVOID buffer)
|
||||||
{
|
{
|
||||||
|
if( !buffer ) return sizeof(BITMAP);
|
||||||
|
if (count < sizeof(BITMAP)) return 0;
|
||||||
|
|
||||||
if(bmp->dib)
|
if(bmp->dib)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(count < (INT) sizeof(DIBSECTION))
|
if(count < (INT) sizeof(DIBSECTION))
|
||||||
{
|
{
|
||||||
if (count > (INT) sizeof(BITMAP)) count = sizeof(BITMAP);
|
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.bmWidthBytes = abs(bmp->SurfObj.lDelta);
|
||||||
Bitmap.bmPlanes = 1;
|
Bitmap.bmPlanes = 1;
|
||||||
Bitmap.bmBitsPixel = BitsPerFormat(bmp->SurfObj.iBitmapFormat);
|
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);
|
memcpy(buffer, &Bitmap, count);
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue