mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 02:10:07 +00:00
- 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:
parent
12d4e8967e
commit
28dafc3348
|
@ -369,7 +369,7 @@ GetDCBrushColor@4
|
||||||
GetDCOrgEx@8
|
GetDCOrgEx@8
|
||||||
GetDCPenColor@4
|
GetDCPenColor@4
|
||||||
GetDIBColorTable@16=NtGdiGetDIBColorTable@16
|
GetDIBColorTable@16=NtGdiGetDIBColorTable@16
|
||||||
GetDIBits@28=NtGdiGetDIBits@28
|
GetDIBits@28
|
||||||
GetDeviceCaps@8=NtGdiGetDeviceCaps@8
|
GetDeviceCaps@8=NtGdiGetDeviceCaps@8
|
||||||
GetDeviceGammaRamp@8
|
GetDeviceGammaRamp@8
|
||||||
GetEnhMetaFileA@4
|
GetEnhMetaFileA@4
|
||||||
|
|
|
@ -1,5 +1,32 @@
|
||||||
#include "precomp.h"
|
#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
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -144,3 +171,27 @@ SetDIBitsToDevice(
|
||||||
FALSE,
|
FALSE,
|
||||||
NULL);
|
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);
|
||||||
|
}
|
||||||
|
|
|
@ -317,20 +317,6 @@ NtGdiGetDIBColorTable (
|
||||||
RGBQUAD * Colors
|
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. */
|
/* Meta are user-mode. */
|
||||||
HENHMETAFILE
|
HENHMETAFILE
|
||||||
STDCALL
|
STDCALL
|
||||||
|
|
|
@ -1007,14 +1007,14 @@ NtUserSetClipboardData(UINT uFormat, HANDLE hMem, DWORD size)
|
||||||
bi.bmiHeader.biYPelsPerMeter = 0;
|
bi.bmiHeader.biYPelsPerMeter = 0;
|
||||||
bi.bmiHeader.biClrUsed = 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);
|
size = bi.bmiHeader.biSizeImage + sizeof(BITMAPINFOHEADER);
|
||||||
|
|
||||||
hCBData = ExAllocatePool(PagedPool, size);
|
hCBData = ExAllocatePool(PagedPool, size);
|
||||||
memcpy(hCBData, &bi, sizeof(BITMAPINFOHEADER));
|
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);
|
UserReleaseDC(NULL, hdc, FALSE);
|
||||||
|
|
||||||
|
|
|
@ -352,13 +352,15 @@ NtGdiSetDIBitsToDeviceInternal(
|
||||||
|
|
||||||
/* Converts a device-dependent bitmap to a DIB */
|
/* Converts a device-dependent bitmap to a DIB */
|
||||||
INT STDCALL
|
INT STDCALL
|
||||||
NtGdiGetDIBits(HDC hDC,
|
NtGdiGetDIBitsInternal(HDC hDC,
|
||||||
HBITMAP hBitmap,
|
HBITMAP hBitmap,
|
||||||
UINT StartScan,
|
UINT StartScan,
|
||||||
UINT ScanLines,
|
UINT ScanLines,
|
||||||
LPVOID Bits,
|
LPBYTE Bits,
|
||||||
LPBITMAPINFO Info,
|
LPBITMAPINFO Info,
|
||||||
UINT Usage)
|
UINT Usage,
|
||||||
|
UINT MaxBits,
|
||||||
|
UINT MaxInfo)
|
||||||
{
|
{
|
||||||
BITMAPOBJ *BitmapObj;
|
BITMAPOBJ *BitmapObj;
|
||||||
SURFOBJ *DestSurfObj;
|
SURFOBJ *DestSurfObj;
|
||||||
|
|
|
@ -180,7 +180,7 @@ NtGdiGetDCPoint 3
|
||||||
NtGdiGetDeviceCaps 2
|
NtGdiGetDeviceCaps 2
|
||||||
NtGdiGetDeviceGammaRamp 2
|
NtGdiGetDeviceGammaRamp 2
|
||||||
# NtGdiGetDeviceCapsAll 2
|
# NtGdiGetDeviceCapsAll 2
|
||||||
# NtGdiGetDIBitsInternal 9
|
NtGdiGetDIBitsInternal 9
|
||||||
# NtGdiGetETM 2
|
# NtGdiGetETM 2
|
||||||
# NtGdiGetEudcTimeStampEx 3
|
# NtGdiGetEudcTimeStampEx 3
|
||||||
NtGdiGetFontData 5
|
NtGdiGetFontData 5
|
||||||
|
@ -782,7 +782,6 @@ NtGdiGetColorSpace 1
|
||||||
NtGdiGetCurrentObject 2
|
NtGdiGetCurrentObject 2
|
||||||
NtGdiGetCurrentPositionEx 2
|
NtGdiGetCurrentPositionEx 2
|
||||||
NtGdiGetDIBColorTable 4
|
NtGdiGetDIBColorTable 4
|
||||||
NtGdiGetDIBits 7
|
|
||||||
NtGdiGetEnhMetaFile 1
|
NtGdiGetEnhMetaFile 1
|
||||||
NtGdiGetEnhMetaFileBits 3
|
NtGdiGetEnhMetaFileBits 3
|
||||||
NtGdiGetEnhMetaFileDescription 3
|
NtGdiGetEnhMetaFileDescription 3
|
||||||
|
|
Loading…
Reference in a new issue