mirror of
https://github.com/reactos/reactos.git
synced 2025-06-26 13:09:43 +00:00
[FORMATTING]
- Reformat/refactor some code. No changes. svn path=/trunk/; revision=63919
This commit is contained in:
parent
7cd7bc2b97
commit
ea6842d69a
1 changed files with 325 additions and 349 deletions
|
@ -13,25 +13,38 @@
|
||||||
* 11/16/1999 (RJJ) lifted from wine
|
* 11/16/1999 (RJJ) lifted from wine
|
||||||
*/
|
*/
|
||||||
|
|
||||||
INT FASTCALL DIB_BitmapInfoSize(const BITMAPINFO * info, WORD coloruse, BOOL max)
|
INT
|
||||||
|
FASTCALL DIB_BitmapInfoSize(
|
||||||
|
const BITMAPINFO * info,
|
||||||
|
WORD coloruse,
|
||||||
|
BOOL max)
|
||||||
{
|
{
|
||||||
unsigned int colors, size, masks = 0;
|
unsigned int colors, size, masks = 0;
|
||||||
|
|
||||||
if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
||||||
{
|
{
|
||||||
const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info;
|
const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *) info;
|
||||||
colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0;
|
size = sizeof(BITMAPCOREHEADER);
|
||||||
return sizeof(BITMAPCOREHEADER) + colors *
|
if (core->bcBitCount <= 8)
|
||||||
((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD));
|
{
|
||||||
|
colors = 1 << core->bcBitCount;
|
||||||
|
if (coloruse == DIB_RGB_COLORS)
|
||||||
|
size += colors * sizeof(RGBTRIPLE);
|
||||||
|
else
|
||||||
|
size += colors * sizeof(WORD);
|
||||||
|
}
|
||||||
|
return size;
|
||||||
}
|
}
|
||||||
else /* assume BITMAPINFOHEADER */
|
else /* assume BITMAPINFOHEADER */
|
||||||
{
|
{
|
||||||
colors = max ? 1 << info->bmiHeader.biBitCount : info->bmiHeader.biClrUsed;
|
colors = max ? (1 << info->bmiHeader.biBitCount) : info->bmiHeader.biClrUsed;
|
||||||
if (colors > 256) colors = 256;
|
if (colors > 256)
|
||||||
|
colors = 256;
|
||||||
if (!colors && (info->bmiHeader.biBitCount <= 8))
|
if (!colors && (info->bmiHeader.biBitCount <= 8))
|
||||||
colors = 1 << info->bmiHeader.biBitCount;
|
colors = 1 << info->bmiHeader.biBitCount;
|
||||||
if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
|
if (info->bmiHeader.biCompression == BI_BITFIELDS)
|
||||||
size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) );
|
masks = 3;
|
||||||
|
size = max(info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD));
|
||||||
return size + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD));
|
return size + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,22 +56,28 @@ INT FASTCALL DIB_BitmapInfoSize(const BITMAPINFO * info, WORD coloruse, BOOL max
|
||||||
*/
|
*/
|
||||||
UINT
|
UINT
|
||||||
FASTCALL
|
FASTCALL
|
||||||
DIB_BitmapMaxBitsSize( PBITMAPINFO Info, UINT ScanLines )
|
DIB_BitmapMaxBitsSize(
|
||||||
|
PBITMAPINFO Info,
|
||||||
|
UINT ScanLines)
|
||||||
{
|
{
|
||||||
UINT Ret;
|
UINT Ret;
|
||||||
|
|
||||||
if (!Info) return 0;
|
if (!Info)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if ( Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
||||||
{
|
{
|
||||||
PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER)Info;
|
PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER) Info;
|
||||||
Ret = WIDTH_BYTES_ALIGN32(Core->bcWidth * Core->bcPlanes, Core->bcBitCount) * ScanLines;
|
Ret = WIDTH_BYTES_ALIGN32(Core->bcWidth * Core->bcPlanes,
|
||||||
|
Core->bcBitCount) * ScanLines;
|
||||||
}
|
}
|
||||||
else /* assume BITMAPINFOHEADER */
|
else /* assume BITMAPINFOHEADER */
|
||||||
{
|
{
|
||||||
if (!(Info->bmiHeader.biCompression) || (Info->bmiHeader.biCompression == BI_BITFIELDS))
|
if ((Info->bmiHeader.biCompression == BI_RGB) || (Info->bmiHeader.biCompression == BI_BITFIELDS))
|
||||||
{
|
{
|
||||||
Ret = WIDTH_BYTES_ALIGN32(Info->bmiHeader.biWidth * Info->bmiHeader.biPlanes, Info->bmiHeader.biBitCount) * ScanLines;
|
Ret = WIDTH_BYTES_ALIGN32(
|
||||||
|
Info->bmiHeader.biWidth * Info->bmiHeader.biPlanes,
|
||||||
|
Info->bmiHeader.biBitCount) * ScanLines;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -75,17 +94,18 @@ DIB_BitmapMaxBitsSize( PBITMAPINFO Info, UINT ScanLines )
|
||||||
*/
|
*/
|
||||||
INT
|
INT
|
||||||
WINAPI
|
WINAPI
|
||||||
DIB_GetBitmapInfo(const BITMAPINFOHEADER *header,
|
DIB_GetBitmapInfo(
|
||||||
|
const BITMAPINFOHEADER *header,
|
||||||
PLONG width,
|
PLONG width,
|
||||||
PLONG height,
|
PLONG height,
|
||||||
PWORD planes,
|
PWORD planes,
|
||||||
PWORD bpp,
|
PWORD bpp,
|
||||||
PLONG compr,
|
PLONG compr,
|
||||||
PLONG size )
|
PLONG size)
|
||||||
{
|
{
|
||||||
if (header->biSize == sizeof(BITMAPCOREHEADER))
|
if (header->biSize == sizeof(BITMAPCOREHEADER))
|
||||||
{
|
{
|
||||||
BITMAPCOREHEADER *core = (BITMAPCOREHEADER *)header;
|
BITMAPCOREHEADER *core = (BITMAPCOREHEADER *) header;
|
||||||
*width = core->bcWidth;
|
*width = core->bcWidth;
|
||||||
*height = core->bcHeight;
|
*height = core->bcHeight;
|
||||||
*planes = core->bcPlanes;
|
*planes = core->bcPlanes;
|
||||||
|
@ -108,7 +128,7 @@ DIB_GetBitmapInfo(const BITMAPINFOHEADER *header,
|
||||||
|
|
||||||
if (header->biSize == sizeof(BITMAPV4HEADER))
|
if (header->biSize == sizeof(BITMAPV4HEADER))
|
||||||
{
|
{
|
||||||
BITMAPV4HEADER *v4hdr = (BITMAPV4HEADER *)header;
|
BITMAPV4HEADER *v4hdr = (BITMAPV4HEADER *) header;
|
||||||
*width = v4hdr->bV4Width;
|
*width = v4hdr->bV4Width;
|
||||||
*height = v4hdr->bV4Height;
|
*height = v4hdr->bV4Height;
|
||||||
*planes = v4hdr->bV4Planes;
|
*planes = v4hdr->bV4Planes;
|
||||||
|
@ -120,7 +140,7 @@ DIB_GetBitmapInfo(const BITMAPINFOHEADER *header,
|
||||||
|
|
||||||
if (header->biSize == sizeof(BITMAPV5HEADER))
|
if (header->biSize == sizeof(BITMAPV5HEADER))
|
||||||
{
|
{
|
||||||
BITMAPV5HEADER *v5hdr = (BITMAPV5HEADER *)header;
|
BITMAPV5HEADER *v5hdr = (BITMAPV5HEADER *) header;
|
||||||
*width = v5hdr->bV5Width;
|
*width = v5hdr->bV5Width;
|
||||||
*height = v5hdr->bV5Height;
|
*height = v5hdr->bV5Height;
|
||||||
*planes = v5hdr->bV5Planes;
|
*planes = v5hdr->bV5Planes;
|
||||||
|
@ -129,7 +149,7 @@ DIB_GetBitmapInfo(const BITMAPINFOHEADER *header,
|
||||||
*size = v5hdr->bV5SizeImage;
|
*size = v5hdr->bV5SizeImage;
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
DPRINT("(%lu): wrong size for header\n", header->biSize );
|
DPRINT("(%lu): wrong size for header\n", header->biSize);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,22 +158,28 @@ DIB_GetBitmapInfo(const BITMAPINFOHEADER *header,
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
WINAPI
|
WINAPI
|
||||||
GdiGetBitmapBitsSize(BITMAPINFO *lpbmi)
|
GdiGetBitmapBitsSize(
|
||||||
|
BITMAPINFO *lpbmi)
|
||||||
{
|
{
|
||||||
UINT Ret;
|
UINT Ret;
|
||||||
|
|
||||||
if (!lpbmi) return 0;
|
if (!lpbmi)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if ( lpbmi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
if (lpbmi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
||||||
{
|
{
|
||||||
PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER)lpbmi;
|
PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER) lpbmi;
|
||||||
Ret = WIDTH_BYTES_ALIGN32(Core->bcWidth * Core->bcPlanes, Core->bcBitCount) * Core->bcHeight;
|
Ret =
|
||||||
|
WIDTH_BYTES_ALIGN32(Core->bcWidth * Core->bcPlanes,
|
||||||
|
Core->bcBitCount) * Core->bcHeight;
|
||||||
}
|
}
|
||||||
else /* assume BITMAPINFOHEADER */
|
else /* assume BITMAPINFOHEADER */
|
||||||
{
|
{
|
||||||
if (!(lpbmi->bmiHeader.biCompression) || (lpbmi->bmiHeader.biCompression == BI_BITFIELDS))
|
if (!(lpbmi->bmiHeader.biCompression) || (lpbmi->bmiHeader.biCompression == BI_BITFIELDS))
|
||||||
{
|
{
|
||||||
Ret = WIDTH_BYTES_ALIGN32(lpbmi->bmiHeader.biWidth * lpbmi->bmiHeader.biPlanes, lpbmi->bmiHeader.biBitCount) * abs(lpbmi->bmiHeader.biHeight);
|
Ret = WIDTH_BYTES_ALIGN32(
|
||||||
|
lpbmi->bmiHeader.biWidth * lpbmi->bmiHeader.biPlanes,
|
||||||
|
lpbmi->bmiHeader.biBitCount) * abs(lpbmi->bmiHeader.biHeight);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -166,7 +192,8 @@ GdiGetBitmapBitsSize(BITMAPINFO *lpbmi)
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
HBITMAP WINAPI
|
HBITMAP
|
||||||
|
WINAPI
|
||||||
CreateDIBSection(
|
CreateDIBSection(
|
||||||
HDC hDC,
|
HDC hDC,
|
||||||
CONST BITMAPINFO *BitmapInfo,
|
CONST BITMAPINFO *BitmapInfo,
|
||||||
|
@ -180,30 +207,27 @@ CreateDIBSection(
|
||||||
HBITMAP hBitmap = NULL;
|
HBITMAP hBitmap = NULL;
|
||||||
PVOID bmBits = NULL;
|
PVOID bmBits = NULL;
|
||||||
|
|
||||||
pConvertedInfo = ConvertBitmapInfo(BitmapInfo, Usage,
|
pConvertedInfo = ConvertBitmapInfo(BitmapInfo, Usage, &ConvertedInfoSize,
|
||||||
&ConvertedInfoSize, FALSE);
|
FALSE);
|
||||||
|
|
||||||
if (pConvertedInfo)
|
if (pConvertedInfo)
|
||||||
{
|
{
|
||||||
// Verify header due to converted may == info.
|
// Verify header due to converted may == info.
|
||||||
if ( pConvertedInfo->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER) )
|
if (pConvertedInfo->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER))
|
||||||
{
|
{
|
||||||
if ( pConvertedInfo->bmiHeader.biCompression == BI_JPEG ||
|
if (pConvertedInfo->bmiHeader.biCompression == BI_JPEG
|
||||||
pConvertedInfo->bmiHeader.biCompression == BI_PNG )
|
|| pConvertedInfo->bmiHeader.biCompression == BI_PNG)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bmBits = Bits;
|
bmBits = Bits;
|
||||||
hBitmap = NtGdiCreateDIBSection( hDC,
|
hBitmap = NtGdiCreateDIBSection(hDC, hSection, dwOffset, pConvertedInfo, Usage,
|
||||||
hSection,
|
ConvertedInfoSize, 0, // fl
|
||||||
dwOffset,
|
|
||||||
pConvertedInfo,
|
|
||||||
Usage,
|
|
||||||
ConvertedInfoSize,
|
|
||||||
0, // fl
|
|
||||||
0, // dwColorSpace
|
0, // dwColorSpace
|
||||||
&bmBits);
|
&bmBits);
|
||||||
|
|
||||||
if (BitmapInfo != pConvertedInfo)
|
if (BitmapInfo != pConvertedInfo)
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
||||||
|
|
||||||
|
@ -213,18 +237,19 @@ CreateDIBSection(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Bits) *Bits = bmBits;
|
if (Bits)
|
||||||
|
*Bits = bmBits;
|
||||||
|
|
||||||
return hBitmap;
|
return hBitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
BitBlt(HDC hdcDest, /* handle to destination DC */
|
BitBlt(
|
||||||
|
HDC hdcDest, /* handle to destination DC */
|
||||||
int nXOriginDest, /* x-coord of destination upper-left corner */
|
int nXOriginDest, /* x-coord of destination upper-left corner */
|
||||||
int nYOriginDest, /* y-coord of destination upper-left corner */
|
int nYOriginDest, /* y-coord of destination upper-left corner */
|
||||||
int nWidthDest, /* width of destination rectangle */
|
int nWidthDest, /* width of destination rectangle */
|
||||||
|
@ -240,23 +265,15 @@ BitBlt(HDC hdcDest, /* handle to destination DC */
|
||||||
return PatBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, dwRop);
|
return PatBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, dwRop);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NtGdiBitBlt(hdcDest,
|
return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXSrc,
|
||||||
nXOriginDest,
|
nYSrc, dwRop, 0, 0);
|
||||||
nYOriginDest,
|
|
||||||
nWidthDest,
|
|
||||||
nHeightDest,
|
|
||||||
hdcSrc,
|
|
||||||
nXSrc,
|
|
||||||
nYSrc,
|
|
||||||
dwRop,
|
|
||||||
0,
|
|
||||||
0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
BOOL
|
||||||
|
WINAPI
|
||||||
StretchBlt(
|
StretchBlt(
|
||||||
HDC hdcDest, /* handle to destination DC */
|
HDC hdcDest, /* handle to destination DC */
|
||||||
int nXOriginDest, /* x-coord of destination upper-left corner */
|
int nXOriginDest, /* x-coord of destination upper-left corner */
|
||||||
|
@ -273,20 +290,21 @@ StretchBlt(
|
||||||
{
|
{
|
||||||
if ((nWidthDest != nWidthSrc) || (nHeightDest != nHeightSrc))
|
if ((nWidthDest != nWidthSrc) || (nHeightDest != nHeightSrc))
|
||||||
{
|
{
|
||||||
return NtGdiStretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest,
|
return NtGdiStretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc,
|
||||||
nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc,
|
nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop, 0);
|
||||||
nWidthSrc, nHeightSrc, dwRop, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest,
|
return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc,
|
||||||
nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, dwRop, 0, 0);
|
nXOriginSrc, nYOriginSrc, dwRop, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
HBITMAP WINAPI
|
HBITMAP
|
||||||
CreateBitmap(INT Width,
|
WINAPI
|
||||||
|
CreateBitmap(
|
||||||
|
INT Width,
|
||||||
INT Height,
|
INT Height,
|
||||||
UINT Planes,
|
UINT Planes,
|
||||||
UINT BitsPixel,
|
UINT BitsPixel,
|
||||||
|
@ -306,21 +324,18 @@ CreateBitmap(INT Width,
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
HBITMAP WINAPI
|
HBITMAP
|
||||||
CreateBitmapIndirect(const BITMAP *pbm)
|
WINAPI
|
||||||
|
CreateBitmapIndirect(
|
||||||
|
const BITMAP *pbm)
|
||||||
{
|
{
|
||||||
HBITMAP bitmap = NULL;
|
HBITMAP bitmap = NULL;
|
||||||
|
|
||||||
/* Note windows xp/2003 does not check if pbm is NULL or not */
|
/* Note windows xp/2003 does not check if pbm is NULL or not */
|
||||||
if ( (pbm->bmWidthBytes != 0) &&
|
if ((pbm->bmWidthBytes != 0) && (!(pbm->bmWidthBytes & 1)))
|
||||||
(!(pbm->bmWidthBytes & 1)) )
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
bitmap = CreateBitmap(pbm->bmWidth, pbm->bmHeight, pbm->bmPlanes, pbm->bmBitsPixel,
|
||||||
bitmap = CreateBitmap(pbm->bmWidth,
|
|
||||||
pbm->bmHeight,
|
|
||||||
pbm->bmPlanes,
|
|
||||||
pbm->bmBitsPixel,
|
|
||||||
pbm->bmBits);
|
pbm->bmBits);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -331,7 +346,8 @@ CreateBitmapIndirect(const BITMAP *pbm)
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
HBITMAP WINAPI
|
HBITMAP
|
||||||
|
WINAPI
|
||||||
CreateDiscardableBitmap(
|
CreateDiscardableBitmap(
|
||||||
HDC hDC,
|
HDC hDC,
|
||||||
INT Width,
|
INT Width,
|
||||||
|
@ -340,8 +356,8 @@ CreateDiscardableBitmap(
|
||||||
return CreateCompatibleBitmap(hDC, Width, Height);
|
return CreateCompatibleBitmap(hDC, Width, Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HBITMAP
|
||||||
HBITMAP WINAPI
|
WINAPI
|
||||||
CreateCompatibleBitmap(
|
CreateCompatibleBitmap(
|
||||||
HDC hDC,
|
HDC hDC,
|
||||||
INT Width,
|
INT Width,
|
||||||
|
@ -349,10 +365,10 @@ CreateCompatibleBitmap(
|
||||||
{
|
{
|
||||||
PDC_ATTR pDc_Attr;
|
PDC_ATTR pDc_Attr;
|
||||||
|
|
||||||
if (!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr))
|
if (!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID) & pDc_Attr))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ( !Width || !Height )
|
if (!Width || !Height)
|
||||||
return GetStockObject(DEFAULT_BITMAP);
|
return GetStockObject(DEFAULT_BITMAP);
|
||||||
|
|
||||||
if (!(pDc_Attr->ulDirty_ & DC_DIBSECTION))
|
if (!(pDc_Attr->ulDirty_ & DC_DIBSECTION))
|
||||||
|
@ -368,15 +384,15 @@ CreateCompatibleBitmap(
|
||||||
BITMAPINFOHEADER bmih;
|
BITMAPINFOHEADER bmih;
|
||||||
RGBQUAD rgbquad[256];
|
RGBQUAD rgbquad[256];
|
||||||
} buffer;
|
} buffer;
|
||||||
DIBSECTION* pDIBs = (DIBSECTION*)&buffer;
|
DIBSECTION* pDIBs = (DIBSECTION*) &buffer;
|
||||||
BITMAPINFO* pbmi = (BITMAPINFO*)&buffer.bmih;
|
BITMAPINFO* pbmi = (BITMAPINFO*) &buffer.bmih;
|
||||||
|
|
||||||
hBmp = NtGdiGetDCObject(hDC, GDI_OBJECT_TYPE_BITMAP);
|
hBmp = NtGdiGetDCObject(hDC, GDI_OBJECT_TYPE_BITMAP);
|
||||||
|
|
||||||
if ( GetObjectA(hBmp, sizeof(DIBSECTION), pDIBs) != sizeof(DIBSECTION) )
|
if (GetObjectA(hBmp, sizeof(DIBSECTION), pDIBs) != sizeof(DIBSECTION))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ( pDIBs->dsBm.bmBitsPixel <= 8 )
|
if (pDIBs->dsBm.bmBitsPixel <= 8)
|
||||||
GetDIBColorTable(hDC, 0, 256, buffer.rgbquad);
|
GetDIBColorTable(hDC, 0, 256, buffer.rgbquad);
|
||||||
|
|
||||||
pDIBs->dsBmih.biWidth = Width;
|
pDIBs->dsBmih.biWidth = Width;
|
||||||
|
@ -387,7 +403,6 @@ CreateCompatibleBitmap(
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
INT
|
INT
|
||||||
WINAPI
|
WINAPI
|
||||||
GetDIBits(
|
GetDIBits(
|
||||||
|
@ -402,7 +417,7 @@ GetDIBits(
|
||||||
UINT cjBmpScanSize;
|
UINT cjBmpScanSize;
|
||||||
UINT cjInfoSize;
|
UINT cjInfoSize;
|
||||||
|
|
||||||
if (!hDC || !GdiIsHandleValid((HGDIOBJ)hDC) || !lpbmi)
|
if (!hDC || !GdiIsHandleValid((HGDIOBJ) hDC) || !lpbmi)
|
||||||
{
|
{
|
||||||
GdiSetLastError(ERROR_INVALID_PARAMETER);
|
GdiSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -412,12 +427,12 @@ GetDIBits(
|
||||||
/* Caller must provide maximum size possible */
|
/* Caller must provide maximum size possible */
|
||||||
cjInfoSize = DIB_BitmapInfoSize(lpbmi, uUsage, TRUE);
|
cjInfoSize = DIB_BitmapInfoSize(lpbmi, uUsage, TRUE);
|
||||||
|
|
||||||
if ( lpvBits )
|
if (lpvBits)
|
||||||
{
|
{
|
||||||
if ( lpbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER) )
|
if (lpbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER))
|
||||||
{
|
{
|
||||||
if ( lpbmi->bmiHeader.biCompression == BI_JPEG ||
|
if (lpbmi->bmiHeader.biCompression == BI_JPEG
|
||||||
lpbmi->bmiHeader.biCompression == BI_PNG )
|
|| lpbmi->bmiHeader.biCompression == BI_PNG)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -425,15 +440,8 @@ GetDIBits(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NtGdiGetDIBitsInternal(hDC,
|
return NtGdiGetDIBitsInternal(hDC, hbmp, uStartScan, cScanLines, lpvBits, lpbmi, uUsage,
|
||||||
hbmp,
|
cjBmpScanSize, cjInfoSize);
|
||||||
uStartScan,
|
|
||||||
cScanLines,
|
|
||||||
lpvBits,
|
|
||||||
lpbmi,
|
|
||||||
uUsage,
|
|
||||||
cjBmpScanSize,
|
|
||||||
cjInfoSize);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -441,7 +449,8 @@ GetDIBits(
|
||||||
*/
|
*/
|
||||||
HBITMAP
|
HBITMAP
|
||||||
WINAPI
|
WINAPI
|
||||||
CreateDIBitmap( HDC hDC,
|
CreateDIBitmap(
|
||||||
|
HDC hDC,
|
||||||
const BITMAPINFOHEADER *Header,
|
const BITMAPINFOHEADER *Header,
|
||||||
DWORD Init,
|
DWORD Init,
|
||||||
LPCVOID Bits,
|
LPCVOID Bits,
|
||||||
|
@ -488,7 +497,8 @@ CreateDIBitmap( HDC hDC,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the Compr is incompatible */
|
/* Check if the Compr is incompatible */
|
||||||
if ((compr == BI_JPEG) || (compr == BI_PNG) || (compr == BI_BITFIELDS)) return 0;
|
if ((compr == BI_JPEG) || (compr == BI_PNG) || (compr == BI_BITFIELDS))
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Only DIB_RGB_COLORS (0), DIB_PAL_COLORS (1) and 2 are valid. */
|
/* Only DIB_RGB_COLORS (0), DIB_PAL_COLORS (1) and 2 are valid. */
|
||||||
if (ColorUse > DIB_PAL_COLORS + 1)
|
if (ColorUse > DIB_PAL_COLORS + 1)
|
||||||
|
@ -498,7 +508,8 @@ CreateDIBitmap( HDC hDC,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Negative width is not allowed */
|
/* Negative width is not allowed */
|
||||||
if (width < 0) return 0;
|
if (width < 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Top-down DIBs have a negative height. */
|
/* Top-down DIBs have a negative height. */
|
||||||
height = abs(height);
|
height = abs(height);
|
||||||
|
@ -506,11 +517,11 @@ CreateDIBitmap( HDC hDC,
|
||||||
// For Icm support.
|
// For Icm support.
|
||||||
// GdiGetHandleUserData(hdc, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr))
|
// GdiGetHandleUserData(hdc, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr))
|
||||||
|
|
||||||
if(Data)
|
if (Data)
|
||||||
{
|
{
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
cjBmpScanSize = GdiGetBitmapBitsSize((BITMAPINFO *)Data);
|
cjBmpScanSize = GdiGetBitmapBitsSize((BITMAPINFO *) Data);
|
||||||
CalculateColorTableSize(&Data->bmiHeader, &ColorUse, &InfoSize);
|
CalculateColorTableSize(&Data->bmiHeader, &ColorUse, &InfoSize);
|
||||||
InfoSize += Data->bmiHeader.biSize;
|
InfoSize += Data->bmiHeader.biSize;
|
||||||
}
|
}
|
||||||
|
@ -521,29 +532,21 @@ CreateDIBitmap( HDC hDC,
|
||||||
_SEH2_END
|
_SEH2_END
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
GdiSetLastError(ERROR_INVALID_PARAMETER);
|
GdiSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("pBMI %p, Size bpp %u, dibsize %d, Conv %u, BSS %u\n", Data,bpp,dibsize,InfoSize,cjBmpScanSize);
|
DPRINT("pBMI %p, Size bpp %u, dibsize %d, Conv %u, BSS %u\n", Data, bpp, dibsize, InfoSize,
|
||||||
|
cjBmpScanSize);
|
||||||
|
|
||||||
if ( !width || !height )
|
if (!width || !height)
|
||||||
hBmp = GetStockObject(DEFAULT_BITMAP);
|
hBmp = GetStockObject(DEFAULT_BITMAP);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hBmp = NtGdiCreateDIBitmapInternal(hDC,
|
hBmp = NtGdiCreateDIBitmapInternal(hDC, width, height, Init, (LPBYTE) Bits,
|
||||||
width,
|
(LPBITMAPINFO) Data, ColorUse, InfoSize, cjBmpScanSize, 0, 0);
|
||||||
height,
|
|
||||||
Init,
|
|
||||||
(LPBYTE)Bits,
|
|
||||||
(LPBITMAPINFO)Data,
|
|
||||||
ColorUse,
|
|
||||||
InfoSize,
|
|
||||||
cjBmpScanSize,
|
|
||||||
0,
|
|
||||||
0);
|
|
||||||
}
|
}
|
||||||
return hBmp;
|
return hBmp;
|
||||||
}
|
}
|
||||||
|
@ -553,7 +556,8 @@ CreateDIBitmap( HDC hDC,
|
||||||
*/
|
*/
|
||||||
INT
|
INT
|
||||||
WINAPI
|
WINAPI
|
||||||
SetDIBits(HDC hDC,
|
SetDIBits(
|
||||||
|
HDC hDC,
|
||||||
HBITMAP hBitmap,
|
HBITMAP hBitmap,
|
||||||
UINT uStartScan,
|
UINT uStartScan,
|
||||||
UINT cScanLines,
|
UINT cScanLines,
|
||||||
|
@ -568,14 +572,15 @@ SetDIBits(HDC hDC,
|
||||||
INT LinesCopied = 0;
|
INT LinesCopied = 0;
|
||||||
BOOL newDC = FALSE;
|
BOOL newDC = FALSE;
|
||||||
|
|
||||||
if ( !lpvBits || (GDI_HANDLE_GET_TYPE(hBitmap) != GDI_OBJECT_TYPE_BITMAP) )
|
if (!lpvBits || (GDI_HANDLE_GET_TYPE(hBitmap) != GDI_OBJECT_TYPE_BITMAP))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ( lpbmi )
|
if (lpbmi)
|
||||||
{
|
{
|
||||||
if ( lpbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER) )
|
if (lpbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER))
|
||||||
{
|
{
|
||||||
if ( lpbmi->bmiHeader.biCompression == BI_JPEG || lpbmi->bmiHeader.biCompression == BI_PNG )
|
if (lpbmi->bmiHeader.biCompression == BI_JPEG
|
||||||
|
|| lpbmi->bmiHeader.biCompression == BI_PNG)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -585,24 +590,25 @@ SetDIBits(HDC hDC,
|
||||||
|
|
||||||
hDCc = NtGdiGetDCforBitmap(hBitmap); // hDC can be NULL, so, get it from the bitmap.
|
hDCc = NtGdiGetDCforBitmap(hBitmap); // hDC can be NULL, so, get it from the bitmap.
|
||||||
SavehDC = hDCc;
|
SavehDC = hDCc;
|
||||||
if ( !hDCc ) // No DC associated with bitmap, Clone or Create one.
|
if (!hDCc) // No DC associated with bitmap, Clone or Create one.
|
||||||
{
|
{
|
||||||
nhDC = CreateCompatibleDC(hDC);
|
nhDC = CreateCompatibleDC(hDC);
|
||||||
if ( !nhDC ) return 0;
|
if (!nhDC)
|
||||||
|
return 0;
|
||||||
newDC = TRUE;
|
newDC = TRUE;
|
||||||
SavehDC = nhDC;
|
SavehDC = nhDC;
|
||||||
}
|
}
|
||||||
else if ( !SaveDC(hDCc) )
|
else if (!SaveDC(hDCc))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
hOldBitmap = SelectObject(SavehDC, hBitmap);
|
hOldBitmap = SelectObject(SavehDC, hBitmap);
|
||||||
|
|
||||||
if ( hOldBitmap )
|
if (hOldBitmap)
|
||||||
{
|
{
|
||||||
if ( hDC )
|
if (hDC)
|
||||||
hPal = SelectPalette(SavehDC, (HPALETTE)GetCurrentObject(hDC, OBJ_PAL), FALSE);
|
hPal = SelectPalette(SavehDC, (HPALETTE) GetCurrentObject(hDC, OBJ_PAL), FALSE);
|
||||||
|
|
||||||
if ( lpbmi->bmiHeader.biSize < sizeof(BITMAPINFOHEADER))
|
if (lpbmi->bmiHeader.biSize < sizeof(BITMAPINFOHEADER))
|
||||||
{
|
{
|
||||||
PBITMAPCOREINFO pbci = (PBITMAPCOREINFO) lpbmi;
|
PBITMAPCOREINFO pbci = (PBITMAPCOREINFO) lpbmi;
|
||||||
dwWidth = pbci->bmciHeader.bcWidth;
|
dwWidth = pbci->bmciHeader.bcWidth;
|
||||||
|
@ -614,25 +620,16 @@ SetDIBits(HDC hDC,
|
||||||
dwHeight = abs(lpbmi->bmiHeader.biHeight);
|
dwHeight = abs(lpbmi->bmiHeader.biHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
LinesCopied = SetDIBitsToDevice(SavehDC,
|
LinesCopied = SetDIBitsToDevice(SavehDC, 0, 0, dwWidth, dwHeight, 0, 0, uStartScan,
|
||||||
0,
|
cScanLines, (void *) lpvBits, (LPBITMAPINFO) lpbmi, fuColorUse);
|
||||||
0,
|
|
||||||
dwWidth,
|
|
||||||
dwHeight,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
uStartScan,
|
|
||||||
cScanLines,
|
|
||||||
(void *)lpvBits,
|
|
||||||
(LPBITMAPINFO)lpbmi,
|
|
||||||
fuColorUse);
|
|
||||||
|
|
||||||
if ( hDC ) SelectPalette(SavehDC, hPal, FALSE);
|
if (hDC)
|
||||||
|
SelectPalette(SavehDC, hPal, FALSE);
|
||||||
|
|
||||||
SelectObject(SavehDC, hOldBitmap);
|
SelectObject(SavehDC, hOldBitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( newDC )
|
if (newDC)
|
||||||
DeleteDC(SavehDC);
|
DeleteDC(SavehDC);
|
||||||
else
|
else
|
||||||
RestoreDC(SavehDC, -1);
|
RestoreDC(SavehDC, -1);
|
||||||
|
@ -666,16 +663,16 @@ SetDIBitsToDevice(
|
||||||
INT LinesCopied = 0;
|
INT LinesCopied = 0;
|
||||||
UINT cjBmpScanSize = 0;
|
UINT cjBmpScanSize = 0;
|
||||||
BOOL Hit = FALSE;
|
BOOL Hit = FALSE;
|
||||||
PVOID pvSafeBits = (PVOID)Bits;
|
PVOID pvSafeBits = (PVOID) Bits;
|
||||||
|
|
||||||
if ( !ScanLines || !lpbmi || !Bits )
|
if (!ScanLines || !lpbmi || !Bits)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ( ColorUse && ColorUse != DIB_PAL_COLORS && ColorUse != DIB_PAL_COLORS+1 )
|
if (ColorUse && ColorUse != DIB_PAL_COLORS && ColorUse != DIB_PAL_COLORS + 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pConvertedInfo = ConvertBitmapInfo(lpbmi, ColorUse,
|
pConvertedInfo = ConvertBitmapInfo(lpbmi, ColorUse, &ConvertedInfoSize,
|
||||||
&ConvertedInfoSize, FALSE);
|
FALSE);
|
||||||
if (!pConvertedInfo)
|
if (!pConvertedInfo)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -723,14 +720,14 @@ SetDIBitsToDevice(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
cjBmpScanSize = DIB_BitmapMaxBitsSize((LPBITMAPINFO)lpbmi, ScanLines);
|
cjBmpScanSize = DIB_BitmapMaxBitsSize((LPBITMAPINFO) lpbmi, ScanLines);
|
||||||
|
|
||||||
pvSafeBits = RtlAllocateHeap(GetProcessHeap(), 0, cjBmpScanSize);
|
pvSafeBits = RtlAllocateHeap(GetProcessHeap(), 0, cjBmpScanSize);
|
||||||
if (pvSafeBits)
|
if (pvSafeBits)
|
||||||
{
|
{
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
RtlCopyMemory( pvSafeBits, Bits, cjBmpScanSize);
|
RtlCopyMemory(pvSafeBits, Bits, cjBmpScanSize);
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
|
@ -742,12 +739,13 @@ SetDIBitsToDevice(
|
||||||
{
|
{
|
||||||
// We don't die, we continue on with a allocated safe pointer to kernel
|
// We don't die, we continue on with a allocated safe pointer to kernel
|
||||||
// space.....
|
// space.....
|
||||||
DPRINT1("SetDIBitsToDevice fail to read BitMapInfo: %p or Bits: %p & Size: %u\n",pConvertedInfo,Bits,cjBmpScanSize);
|
DPRINT1("SetDIBitsToDevice fail to read BitMapInfo: %p or Bits: %p & Size: %u\n",
|
||||||
|
pConvertedInfo, Bits, cjBmpScanSize);
|
||||||
}
|
}
|
||||||
DPRINT("SetDIBitsToDevice Allocate Bits %u!!!\n", cjBmpScanSize);
|
DPRINT("SetDIBitsToDevice Allocate Bits %u!!!\n", cjBmpScanSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GdiGetHandleUserData(hdc, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr))
|
if (!GdiGetHandleUserData(hdc, GDI_OBJECT_TYPE_DC, (PVOID) & pDc_Attr))
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -759,24 +757,13 @@ SetDIBitsToDevice(
|
||||||
(pConvertedInfo->bmiHeader.biCompression == BI_JPEG ||
|
(pConvertedInfo->bmiHeader.biCompression == BI_JPEG ||
|
||||||
pConvertedInfo->bmiHeader.biCompression == BI_PNG )) )*/
|
pConvertedInfo->bmiHeader.biCompression == BI_PNG )) )*/
|
||||||
{
|
{
|
||||||
LinesCopied = NtGdiSetDIBitsToDeviceInternal( hdc,
|
LinesCopied = NtGdiSetDIBitsToDeviceInternal(hdc, XDest, YDest, Width, Height, XSrc, YSrc,
|
||||||
XDest,
|
StartScan, ScanLines, (LPBYTE) pvSafeBits, (LPBITMAPINFO) pConvertedInfo, ColorUse,
|
||||||
YDest,
|
cjBmpScanSize, ConvertedInfoSize,
|
||||||
Width,
|
|
||||||
Height,
|
|
||||||
XSrc,
|
|
||||||
YSrc,
|
|
||||||
StartScan,
|
|
||||||
ScanLines,
|
|
||||||
(LPBYTE)pvSafeBits,
|
|
||||||
(LPBITMAPINFO)pConvertedInfo,
|
|
||||||
ColorUse,
|
|
||||||
cjBmpScanSize,
|
|
||||||
ConvertedInfoSize,
|
|
||||||
TRUE,
|
TRUE,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
if ( Bits != pvSafeBits)
|
if (Bits != pvSafeBits)
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pvSafeBits);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, pvSafeBits);
|
||||||
if (lpbmi != pConvertedInfo)
|
if (lpbmi != pConvertedInfo)
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
||||||
|
@ -784,13 +771,13 @@ SetDIBitsToDevice(
|
||||||
return LinesCopied;
|
return LinesCopied;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
WINAPI
|
WINAPI
|
||||||
StretchDIBits(HDC hdc,
|
StretchDIBits(
|
||||||
|
HDC hdc,
|
||||||
int XDest,
|
int XDest,
|
||||||
int YDest,
|
int YDest,
|
||||||
int nDestWidth,
|
int nDestWidth,
|
||||||
|
@ -860,23 +847,23 @@ StretchDIBits(HDC hdc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
pConvertedInfo = ConvertBitmapInfo(lpBitsInfo, iUsage,
|
pConvertedInfo = ConvertBitmapInfo(lpBitsInfo, iUsage, &ConvertedInfoSize,
|
||||||
&ConvertedInfoSize, FALSE);
|
FALSE);
|
||||||
if (!pConvertedInfo)
|
if (!pConvertedInfo)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cjBmpScanSize = GdiGetBitmapBitsSize((BITMAPINFO *)pConvertedInfo);
|
cjBmpScanSize = GdiGetBitmapBitsSize((BITMAPINFO *) pConvertedInfo);
|
||||||
|
|
||||||
if ( lpBits )
|
if (lpBits)
|
||||||
{
|
{
|
||||||
pvSafeBits = RtlAllocateHeap(GetProcessHeap(), 0, cjBmpScanSize);
|
pvSafeBits = RtlAllocateHeap(GetProcessHeap(), 0, cjBmpScanSize);
|
||||||
if (pvSafeBits)
|
if (pvSafeBits)
|
||||||
{
|
{
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
RtlCopyMemory( pvSafeBits, lpBits, cjBmpScanSize );
|
RtlCopyMemory(pvSafeBits, lpBits, cjBmpScanSize);
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
|
@ -888,13 +875,14 @@ StretchDIBits(HDC hdc,
|
||||||
{
|
{
|
||||||
// We don't die, we continue on with a allocated safe pointer to kernel
|
// We don't die, we continue on with a allocated safe pointer to kernel
|
||||||
// space.....
|
// space.....
|
||||||
DPRINT1("StretchDIBits fail to read BitMapInfo: %p or Bits: %p & Size: %u\n",pConvertedInfo,lpBits,cjBmpScanSize);
|
DPRINT1("StretchDIBits fail to read BitMapInfo: %p or Bits: %p & Size: %u\n",
|
||||||
|
pConvertedInfo, lpBits, cjBmpScanSize);
|
||||||
}
|
}
|
||||||
DPRINT("StretchDIBits Allocate Bits %u!!!\n", cjBmpScanSize);
|
DPRINT("StretchDIBits Allocate Bits %u!!!\n", cjBmpScanSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GdiGetHandleUserData(hdc, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr))
|
if (!GdiGetHandleUserData(hdc, GDI_OBJECT_TYPE_DC, (PVOID) & pDc_Attr))
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -906,24 +894,12 @@ StretchDIBits(HDC hdc,
|
||||||
(pConvertedInfo->bmiHeader.biCompression == BI_JPEG ||
|
(pConvertedInfo->bmiHeader.biCompression == BI_JPEG ||
|
||||||
pConvertedInfo->bmiHeader.biCompression == BI_PNG )) )*/
|
pConvertedInfo->bmiHeader.biCompression == BI_PNG )) )*/
|
||||||
{
|
{
|
||||||
LinesCopied = NtGdiStretchDIBitsInternal( hdc,
|
LinesCopied = NtGdiStretchDIBitsInternal(hdc, XDest, YDest, nDestWidth, nDestHeight, XSrc,
|
||||||
XDest,
|
YSrc, nSrcWidth, nSrcHeight, pvSafeBits, pConvertedInfo, (DWORD) iUsage, dwRop,
|
||||||
YDest,
|
ConvertedInfoSize, cjBmpScanSize,
|
||||||
nDestWidth,
|
|
||||||
nDestHeight,
|
|
||||||
XSrc,
|
|
||||||
YSrc,
|
|
||||||
nSrcWidth,
|
|
||||||
nSrcHeight,
|
|
||||||
pvSafeBits,
|
|
||||||
pConvertedInfo,
|
|
||||||
(DWORD)iUsage,
|
|
||||||
dwRop,
|
|
||||||
ConvertedInfoSize,
|
|
||||||
cjBmpScanSize,
|
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
if ( pvSafeBits )
|
if (pvSafeBits)
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pvSafeBits);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, pvSafeBits);
|
||||||
if (lpBitsInfo != pConvertedInfo)
|
if (lpBitsInfo != pConvertedInfo)
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue