- Removed NtGdiGetDIBits from w32ksvc.db and updated ntgdibad.h.

- Created support function for GetDIBits when calling NtGdiGetDIBitsInternal.
- Connected the gdi32 parts.

svn path=/trunk/; revision=28455
This commit is contained in:
James Tabor 2007-08-22 19:45:06 +00:00
parent 12d4e8967e
commit 28dafc3348
6 changed files with 64 additions and 26 deletions

View file

@ -369,7 +369,7 @@ GetDCBrushColor@4
GetDCOrgEx@8
GetDCPenColor@4
GetDIBColorTable@16=NtGdiGetDIBColorTable@16
GetDIBits@28=NtGdiGetDIBits@28
GetDIBits@28
GetDeviceCaps@8=NtGdiGetDeviceCaps@8
GetDeviceGammaRamp@8
GetEnhMetaFileA@4

View file

@ -1,5 +1,32 @@
#include "precomp.h"
/*
* Return the full scan size for a bitmap.
*
* Based on Wine and Windows Graphics Prog pg 595
*/
UINT
FASTCALL
DIB_BitmapMaxBitsSize( PBITMAPINFO Info, UINT ScanLines )
{
UINT MaxBits = 0;
if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
{
PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER)Info;
MaxBits = Core->bcBitCount * Core->bcPlanes * Core->bcWidth;
}
else /* assume BITMAPINFOHEADER */
{
if ((Info->bmiHeader.biCompression) && (Info->bmiHeader.biCompression != BI_BITFIELDS))
return Info->bmiHeader.biSizeImage;
MaxBits = Info->bmiHeader.biBitCount * Info->bmiHeader.biPlanes * Info->bmiHeader.biWidth;
}
// Planes are over looked by Yuan. I guess assumed always 1.
MaxBits = (MaxBits + 31) / 32; // ScanLineSize = (Width * bitcount + 31)/32
return (MaxBits * ScanLines); // ret the full Size.
}
/*
* @implemented
*/
@ -144,3 +171,27 @@ SetDIBitsToDevice(
FALSE,
NULL);
}
INT
STDCALL
GetDIBits(
HDC hDC,
HBITMAP hbmp,
UINT uStartScan,
UINT cScanLines,
LPVOID lpvBits,
LPBITMAPINFO lpbmi,
UINT uUsage
)
{
return NtGdiGetDIBitsInternal(hDC,
hbmp,
uStartScan,
cScanLines,
lpvBits,
lpbmi,
uUsage,
DIB_BitmapMaxBitsSize( lpbmi, cScanLines ),
0);
}

View file

@ -317,20 +317,6 @@ NtGdiGetDIBColorTable (
RGBQUAD * Colors
);
/* Use NtGdiGetDIBitsInternal. */
INT
STDCALL
NtGdiGetDIBits (
HDC hDC,
HBITMAP hBitmap,
UINT StartScan,
UINT ScanLines,
LPVOID Bits,
LPBITMAPINFO bi,
UINT Usage
);
/* Meta are user-mode. */
HENHMETAFILE
STDCALL

View file

@ -1007,14 +1007,14 @@ NtUserSetClipboardData(UINT uFormat, HANDLE hMem, DWORD size)
bi.bmiHeader.biYPelsPerMeter = 0;
bi.bmiHeader.biClrUsed = 0;
ret = NtGdiGetDIBits(hdc, hMem, 0, bm.bmHeight, NULL, &bi, DIB_RGB_COLORS);
ret = NtGdiGetDIBitsInternal(hdc, hMem, 0, bm.bmHeight, NULL, &bi, DIB_RGB_COLORS, 0, 0);
size = bi.bmiHeader.biSizeImage + sizeof(BITMAPINFOHEADER);
hCBData = ExAllocatePool(PagedPool, size);
memcpy(hCBData, &bi, sizeof(BITMAPINFOHEADER));
ret = NtGdiGetDIBits(hdc, hMem, 0, bm.bmHeight, (LPBYTE)hCBData + sizeof(BITMAPINFOHEADER), &bi, DIB_RGB_COLORS);
ret = NtGdiGetDIBitsInternal(hdc, hMem, 0, bm.bmHeight, (LPBYTE)hCBData + sizeof(BITMAPINFOHEADER), &bi, DIB_RGB_COLORS, 0, 0);
UserReleaseDC(NULL, hdc, FALSE);

View file

@ -352,13 +352,15 @@ NtGdiSetDIBitsToDeviceInternal(
/* Converts a device-dependent bitmap to a DIB */
INT STDCALL
NtGdiGetDIBits(HDC hDC,
NtGdiGetDIBitsInternal(HDC hDC,
HBITMAP hBitmap,
UINT StartScan,
UINT ScanLines,
LPVOID Bits,
LPBYTE Bits,
LPBITMAPINFO Info,
UINT Usage)
UINT Usage,
UINT MaxBits,
UINT MaxInfo)
{
BITMAPOBJ *BitmapObj;
SURFOBJ *DestSurfObj;

View file

@ -180,7 +180,7 @@ NtGdiGetDCPoint 3
NtGdiGetDeviceCaps 2
NtGdiGetDeviceGammaRamp 2
# NtGdiGetDeviceCapsAll 2
# NtGdiGetDIBitsInternal 9
NtGdiGetDIBitsInternal 9
# NtGdiGetETM 2
# NtGdiGetEudcTimeStampEx 3
NtGdiGetFontData 5
@ -782,7 +782,6 @@ NtGdiGetColorSpace 1
NtGdiGetCurrentObject 2
NtGdiGetCurrentPositionEx 2
NtGdiGetDIBColorTable 4
NtGdiGetDIBits 7
NtGdiGetEnhMetaFile 1
NtGdiGetEnhMetaFileBits 3
NtGdiGetEnhMetaFileDescription 3