17 { 0x00, 0x00, 0x00, 0x00 },
18 { 0x00, 0x00, 0x80, 0x00 },
19 { 0x00, 0x80, 0x00, 0x00 },
20 { 0x00, 0x80, 0x80, 0x00 },
21 { 0x80, 0x00, 0x00, 0x00 },
22 { 0x80, 0x00, 0x80, 0x00 },
23 { 0x80, 0x80, 0x00, 0x00 },
24 { 0xc0, 0xc0, 0xc0, 0x00 },
25 { 0xc0, 0xdc, 0xc0, 0x00 },
26 { 0xf0, 0xca, 0xa6, 0x00 },
27 { 0xf0, 0xfb, 0xff, 0x00 },
28 { 0xa4, 0xa0, 0xa0, 0x00 },
29 { 0x80, 0x80, 0x80, 0x00 },
30 { 0x00, 0x00, 0xff, 0x00 },
31 { 0x00, 0xff, 0x00, 0x00 },
32 { 0x00, 0xff, 0xff, 0x00 },
33 { 0xff, 0x00, 0x00, 0x00 },
34 { 0xff, 0x00, 0xff, 0x00 },
35 { 0xff, 0xff, 0x00, 0x00 },
36 { 0xff, 0xff, 0xff, 0x00 }
47 ULONG i, cBitsPixel, cColors;
63 cColors = 1 << cBitsPixel;
74 DPRINT1(
"Failed to allocate palette.\n");
98 for (
i = 0;
i < cColors;
i++)
115 for (
i = 0;
i < cColors;
i++)
150 for (
i = 0;
i < cColors; ++
i)
153 COLORREF crColor =
RGB(colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue);
165 for (
i = 0;
i < cColors;
i++)
179 ULONG flRedMask, flGreenMask, flBlueMask;
198 flRedMask = pdwColors[0];
199 flGreenMask = pdwColors[1];
200 flBlueMask = pdwColors[2];
207 if (cBitsPixel == 16)
211 flGreenMask = 0x03E0;
217 flRedMask = 0xFF0000;
218 flGreenMask = 0x00FF00;
219 flBlueMask = 0x0000FF;
258 if (!bmi || !Bits)
return 0;
261 if ((bmi->bmiHeader.biCompression ==
BI_RGB) ||
267 bmi->bmiHeader.biBitCount);
270 else if (bmi->bmiHeader.biSizeImage != 0)
273 cjSizeImage = bmi->bmiHeader.biSizeImage;
278 DPRINT1(
"Compressed format without a size\n");
283 if ((cjSizeImage >
cjMaxBits) || (cjSizeImage == 0))
285 DPRINT1(
"Invalid bitmap size! cjSizeImage = %lu, cjMaxBits = %lu\n",
294 bmi->bmiHeader.biCompression),
301 DPRINT1(
"Error: Could not create a bitmap.\n");
309 if(!(psurfSrc && psurfDst))
311 DPRINT1(
"Error: Could not lock surfaces\n");
327 RGB(0xff, 0xff, 0xff),
328 RGB(0xff, 0xff, 0xff),
331 rcDst.
top = StartScan;
398 if ((
x + NumPixels) >
Width)
425 if (
i >= (BitsSize - 1))
445 ToSkip = (NumPixels / 2) + (NumPixels & 1);
447 if ((
i + ToSkip) > BitsSize)
449 ToSkip = (ToSkip + 1) & ~1;
451 if ((
x + NumPixels) >
Width)
485 IN BOOL bTransformCoordinates,
505 if (!pbmiSafe)
return 0;
521 DPRINT(
"StartScan %d ScanLines %d Bits %p bmi %p ColorUse %d\n"
522 " Height %d Width %d SizeImage %d\n"
523 " biHeight %d biWidth %d biBitCount %d\n"
524 " XSrc %d YSrc %d xDext %d yDest %d\n",
525 StartScan, ScanLines, Bits, bmi, ColorUse,
527 bmi->bmiHeader.biHeight, bmi->bmiHeader.biWidth,
528 bmi->bmiHeader.biBitCount,
529 XSrc, YSrc, XDest, YDest);
539 ScanLines =
min(ScanLines,
abs(bmi->bmiHeader.biHeight) - StartScan);
565 if (bTransformCoordinates)
569 rcDest.
left += pDC->ptlDCOrig.x;
570 rcDest.
top += pDC->ptlDCOrig.y;
573 rcDest.
top += StartScan;
583 SourceSize.
cx = bmi->bmiHeader.biWidth;
584 SourceSize.
cy = ScanLines;
585 if (YDest >= 0 && YSrc > 0)
596 bmi->bmiHeader.biCompression),
598 bmi->bmiHeader.biSizeImage,
617 if ((bmi->bmiHeader.biCompression ==
BI_RLE8) || (bmi->bmiHeader.biCompression ==
BI_RLE4))
621 bmi->bmiHeader.biCompression,
649 pSurf = pDC->dclevel.pSurface;
663 RGB(0xff, 0xff, 0xff),
664 pDC->pdcattr->crBackgroundClr,
665 pDC->pdcattr->crForegroundClr);
670 DPRINT(
"BitsToDev with rcDest=(%d|%d) (%d|%d), ptSource=(%d|%d) w=%d h=%d\n",
672 ptSource.
x, ptSource.
y, SourceSize.
cx, SourceSize.
cy);
678 ptSource.
y -= SourceSize.
cy;
688 pMaskSurf ? &ptSource :
NULL,
699 ret = bResult ? ScanLines : 0;
739 DPRINT(
"Entered GreGetDIBitsInternal()\n");
769 if(bitmap_type == -1)
771 DPRINT1(
"Wrong bitmap format\n");
776 else if(bitmap_type == 0)
786 DPRINT1(
"Error, could not convert the BITMAPCOREINFO!\n");
790 rgbQuads =
Info->bmiColors;
797 if (
width < 0 || (
bpp == 0 && Bits))
812 Info->bmiHeader.biClrUsed = 0;
813 Info->bmiHeader.biClrImportant = 0;
823 Info->bmiHeader.biPlanes = 1;
826 Info->bmiHeader.biHeight,
827 Info->bmiHeader.biBitCount);
828 Info->bmiHeader.biCompression = (
Info->bmiHeader.biBitCount == 16 ||
Info->bmiHeader.biBitCount == 32) ?
830 Info->bmiHeader.biXPelsPerMeter = 0;
831 Info->bmiHeader.biYPelsPerMeter = 0;
833 if (
Info->bmiHeader.biBitCount <= 8 &&
Info->bmiHeader.biClrUsed == 0)
834 Info->bmiHeader.biClrUsed = 1 <<
Info->bmiHeader.biBitCount;
842 Info->bmiHeader.biClrUsed = 1 <<
bpp;
852 if(colors != 256)
Info->bmiHeader.biClrUsed = colors;
853 for(
i = 0;
i < colors;
i++)
855 rgbQuads[
i].rgbRed = psurf->
ppal->IndexedColors[
i].peRed;
856 rgbQuads[
i].rgbGreen = psurf->
ppal->IndexedColors[
i].peGreen;
857 rgbQuads[
i].rgbBlue = psurf->
ppal->IndexedColors[
i].peBlue;
858 rgbQuads[
i].rgbReserved = 0;
863 for(
i = 0;
i < 256;
i++)
871 for(
i = 0;
i < 256;
i++)
892 rgbQuads[
i].rgbReserved = 0;
901 rgbQuads[0].rgbRed = rgbQuads[0].rgbGreen = rgbQuads[0].rgbBlue = 0;
902 rgbQuads[0].rgbReserved = 0;
903 rgbQuads[1].rgbRed = rgbQuads[1].rgbGreen = rgbQuads[1].rgbBlue = 0xff;
904 rgbQuads[1].rgbReserved = 0;
923 for (
i = 10;
i < 246;
i++)
925 rgbQuads[
i].rgbRed = (
i & 0x07) << 5;
926 rgbQuads[
i].rgbGreen = (
i & 0x38) << 2;
927 rgbQuads[
i].rgbBlue =
i & 0xc0;
928 rgbQuads[
i].rgbReserved = 0;
988 Info->bmiHeader.biPlanes = 1;
990 if(Bits && ScanLines)
1002 if (StartScan >=
abs(
Info->bmiHeader.biHeight))
1009 ScanLines =
min(ScanLines,
abs(
Info->bmiHeader.biHeight) - StartScan);
1018 -(
LONG)ScanLines : ScanLines;
1026 DPRINT1(
"Unable to create a DIB Section!\n");
1083 ScanLines = (
UINT)newLines;
1112NtGdiGetDIBitsInternal(
1129 if (
iUsage > 2)
return 0;
1142 cjAlloc =
sizeof(BITMAPV5HEADER) + 256 *
sizeof(
RGBQUAD);
1245 PSURFACE psurfTmp = 0, psurfDst = 0;
1254 HPALETTE hPal =
NULL;
1255 ULONG BmpFormat = 0;
1256 INT LinesCopied = 0;
1259 if (dwUsage > 2)
return 0;
1264 DPRINT1(
"Error, Invalid Parameter.\n");
1280 cjAlloc =
sizeof(BITMAPV5HEADER) + 256 *
sizeof(
RGBQUAD);
1319 if (!pdc->dclevel.pSurface)
1363 DPRINT1(
"NtGdiCreateCompatibleDC failed to create hdc.\n");
1373 DPRINT1(
"NtGdiCreateCompatibleBitmap failed to create bitmap.\n");
1400 if (cxSrc == cxDst && cySrc == cyDst)
1410 cxSrc, cySrc, dwRop, 0);
1429 DPRINT1(
"Could not lock dc\n");
1484 psurfDst = pdc->dclevel.pSurface;
1490 RGB(0xff, 0xff, 0xff),
1491 pdc->pdcattr->crBackgroundClr,
1492 pdc->pdcattr->crForegroundClr);
1504 &pdc->eboFill.BrushObject,
1555 ULONG BmpFormat = 0;
1571 if (col ==
RGB(0, 0, 0))
1577 fColor = (col !=
RGB(0xff,0xff,0xff));
1594 DPRINT1(
"IntCreateCompatibleBitmap() failed!\n");
1602 if (Palette ==
NULL)
1695 DPRINT1(
"Got an exception! pjInit = %p\n", pjInit);
1742 DPRINT1(
"NtGdiCreateCompatibleDC failed\n");
1754 DPRINT1(
"Failed to lock hdcDest %p\n", hdcDest);
1782 Bmp =
IntCreateDIBitmap(Dc,
cx,
cy, planes,
bpp,
compression, fInit, pjInit,
cjMaxBits,
pbmi,
iUsage);
1801 UINT cjInfo, cjBits;
1813 if (cjPackedDIB < pbmi->bmiHeader.biSize)
1820 if (cjPackedDIB <= cjInfo)
1826 pjBits = (
PBYTE)pvPackedDIB + cjInfo;
1827 cjBits = cjPackedDIB - cjInfo;
1923 void *mapBits =
NULL;
1934 DPRINT(
"format (%ld,%ld), planes %u, bpp %u, size %lu, colors %lu (%s)\n",
1935 bi->biWidth, bi->biHeight, bi->biPlanes, bi->biBitCount,
1939 if (bi->biCompression ==
BI_RLE4 || bi->biCompression ==
BI_RLE8)
1941 DPRINT1(
"no compressed format allowed\n");
1945 effHeight = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight;
1947 bm.bmWidth = bi->biWidth;
1948 bm.bmHeight = effHeight;
1949 bm.bmWidthBytes = ovr_pitch ? ovr_pitch :
WIDTH_BYTES_ALIGN32(bm.bmWidth, bi->biBitCount);
1951 bm.bmPlanes = bi->biPlanes;
1952 bm.bmBitsPixel = bi->biBitCount;
1957 totalSize = (bi->biSizeImage && (bi->biCompression !=
BI_RGB) && (bi->biCompression !=
BI_BITFIELDS))
1958 ? bi->biSizeImage : (
ULONG)(bm.bmWidthBytes * effHeight);
1974 DPRINT1(
"ZwQuerySystemInformation failed (0x%lx)\n",
Status);
1979 mapSize = totalSize + (
offset - mapOffset);
2001 if (mapBits) bm.bmBits = (
char *)mapBits + (
offset - mapOffset);
2003 else if (ovr_pitch &&
offset)
2008 bm.bmBits = EngAllocUserMem(totalSize, 0);
2011 DPRINT1(
"Failed to allocate memory\n");
2025 BitmapFormat(bi->biBitCount * bi->biPlanes, bi->biCompression),
2033 DPRINT1(
"GreCreateBitmapEx failed\n");
2040 DPRINT1(
"SURFACE_LockSurface failed\n");
2050 bmp->hSecure = hSecure;
2053 bmp->biClrImportant = bi->biClrImportant;
2060 if (!
res || !
bmp || !bm.bmBits || !ppalDIB)
2062 DPRINT(
"Got an error res=%p, bmp=%p, bm.bmBits=%p\n",
res,
bmp, bm.bmBits);
2136 *planes =
header->biPlanes;
2142 DPRINT1(
"(%u): unknown/wrong size for header\n",
header->biSize );
2168 unsigned int colorsize;
2182 colors =
info->bmiHeader.biClrUsed;
2183 if (colors > 256) colors = 256;
2184 if (!colors && (
info->bmiHeader.biBitCount <= 8))
2185 colors = 1 <<
info->bmiHeader.biBitCount;
2188 return size + colors * colorsize;
2206 nNumColors = 1 << lpbmi->bmiHeader.biBitCount;
2207 if (lpbmi->bmiHeader.biClrUsed)
2209 nNumColors =
min(nNumColors, lpbmi->bmiHeader.biClrUsed);
2213 if (ppalNew ==
NULL)
2215 DPRINT1(
"Could not allocate palette\n");
2219 lpIndex = (
USHORT *)((
PBYTE)lpbmi + lpbmi->bmiHeader.biSize);
2221 for (
i = 0;
i < nNumColors;
i++)
2242 UINT numColors = 0, ColorsSize = 0;
2247 if(pbmci->bmciHeader.bcBitCount <= 8)
2249 numColors = 1 << pbmci->bmciHeader.bcBitCount;
2252 ColorsSize = numColors *
sizeof(
WORD);
2256 ColorsSize = numColors *
sizeof(
RGBQUAD);
2266 if(!pNewBmi)
return NULL;
2288 for(
i=0;
i<numColors;
i++)
2305 if(converted == orig)
2337 for(
i=0;
i<numColors;
i++)
#define R3_OPINDEX_SRCCOPY
BOOL APIENTRY IntEngCopyBits(SURFOBJ *psoTrg, SURFOBJ *psoSrc, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc)
HBITMAP FASTCALL IntCreateCompatibleBitmap(PDC Dc, INT Width, INT Height, UINT Planes, UINT Bpp)
HBITMAP NTAPI GreCreateBitmapEx(_In_ ULONG nWidth, _In_ ULONG nHeight, _In_ ULONG cjWidthBytes, _In_ ULONG iFormat, _In_ USHORT fjBitmap, _In_ ULONG cjSizeImage, _In_opt_ PVOID pvBits, _In_ FLONG flags)
HBITMAP NTAPI GreCreateBitmap(_In_ ULONG nWidth, _In_ ULONG nHeight, _In_ ULONG cPlanes, _In_ ULONG cBitsPixel, _In_opt_ PVOID pvBits)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
static BOOLEAN IntLPtoDP(DC *pdc, PPOINTL ppt, UINT count)
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
HPALETTE NTAPI GdiSelectPalette(_In_ HDC hDC, _In_ HPALETTE hpal, _In_ BOOL ForceBackground)
FORCEINLINE PDC DC_LockDc(HDC hdc)
#define ERROR_NOT_ENOUGH_MEMORY
HBITMAP NTAPI GreCreateDIBitmapFromPackedDIB(_In_reads_(cjPackedDIB) PVOID pvPackedDIB, _In_ UINT cjPackedDIB, _In_ ULONG uUsage)
static const RGBQUAD DefLogPaletteQuads[20]
BITMAPINFO *FASTCALL DIB_ConvertBitmapInfo(CONST BITMAPINFO *pbmi, DWORD Usage)
int FASTCALL DIB_GetBitmapInfo(const BITMAPINFOHEADER *header, LONG *width, LONG *height, WORD *planes, WORD *bpp, DWORD *compr, DWORD *size)
VOID FASTCALL DIB_FreeConvertedBitmapInfo(BITMAPINFO *converted, BITMAPINFO *orig, DWORD usage)
static INT FASTCALL IntSetDIBits(PDC DC, HBITMAP hBitmap, UINT StartScan, UINT ScanLines, CONST VOID *Bits, ULONG cjMaxBits, CONST BITMAPINFO *bmi, UINT ColorUse)
INT FASTCALL DIB_BitmapInfoSize(const BITMAPINFO *info, WORD coloruse)
W32KAPI INT APIENTRY NtGdiSetDIBitsToDeviceInternal(IN HDC hDC, IN INT XDest, IN INT YDest, IN DWORD Width, IN DWORD Height, IN INT XSrc, IN INT YSrc, IN DWORD StartScan, IN DWORD ScanLines, IN LPBYTE Bits, IN LPBITMAPINFO bmi, IN DWORD ColorUse, IN UINT cjMaxBits, IN UINT cjMaxInfo, IN BOOL bTransformCoordinates, IN OPTIONAL HANDLE hcmXform)
HBITMAP NTAPI GreCreateDIBitmapInternal(IN HDC hDc, IN INT cx, IN INT cy, IN DWORD fInit, IN OPTIONAL LPBYTE pjInit, IN OPTIONAL PBITMAPINFO pbmi, IN DWORD iUsage, IN FLONG fl, IN UINT cjMaxBits, IN HANDLE hcmXform)
HBITMAP APIENTRY NtGdiCreateDIBSection(IN HDC hDC, IN OPTIONAL HANDLE hSection, IN DWORD dwOffset, IN BITMAPINFO *bmi, IN DWORD Usage, IN UINT cjHeader, IN FLONG fl, IN ULONG_PTR dwColorSpace, OUT PVOID *Bits)
HPALETTE FASTCALL DIB_MapPaletteColors(PPALETTE ppalDc, CONST BITMAPINFO *lpbmi)
static HBITMAP IntGdiCreateMaskFromRLE(DWORD Width, DWORD Height, ULONG Compression, const BYTE *Bits, DWORD BitsSize)
INT APIENTRY DIB_GetDIBImageBytes(INT width, INT height, INT depth)
W32KAPI INT APIENTRY NtGdiStretchDIBitsInternal(IN HDC hdc, IN INT xDst, IN INT yDst, IN INT cxDst, IN INT cyDst, IN INT xSrc, IN INT ySrc, IN INT cxSrc, IN INT cySrc, IN OPTIONAL LPBYTE pjInit, IN LPBITMAPINFO pbmi, IN DWORD dwUsage, IN DWORD dwRop, IN UINT cjMaxInfo, IN UINT cjMaxBits, IN HANDLE hcmXform)
PPALETTE NTAPI CreateDIBPalette(_In_ const BITMAPINFO *pbmi, _In_ PDC pdc, _In_ ULONG iUsage)
INT APIENTRY GreGetDIBitsInternal(HDC hDC, HBITMAP hBitmap, UINT StartScan, UINT ScanLines, LPBYTE Bits, LPBITMAPINFO Info, UINT Usage, UINT MaxBits, UINT MaxInfo)
HBITMAP APIENTRY NtGdiCreateDIBitmapInternal(IN HDC hDc, IN INT cx, IN INT cy, IN DWORD fInit, IN OPTIONAL LPBYTE pjInit, IN OPTIONAL LPBITMAPINFO pbmi, IN DWORD iUsage, IN UINT cjMaxInitInfo, IN UINT cjMaxBits, IN FLONG fl, IN HANDLE hcmXform)
HBITMAP APIENTRY DIB_CreateDIBSection(PDC dc, CONST BITMAPINFO *bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset, DWORD ovr_pitch)
HBITMAP FASTCALL IntCreateDIBitmap(PDC Dc, INT width, INT height, UINT planes, UINT bpp, ULONG compression, DWORD init, LPBYTE bits, ULONG cjMaxBits, PBITMAPINFO data, DWORD coloruse)
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define ERROR_INVALID_HANDLE
static void cleanup(void)
#define ExAllocatePoolWithTag(hernya, size, tag)
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
NTSYSAPI NTSTATUS NTAPI ZwQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
#define GDI_OBJECT_TYPE_PALETTE
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLsizeiptr const GLvoid GLenum usage
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
#define EXCEPTION_EXECUTE_HANDLER
#define ROP4_FROM_INDEX(index)
BOOL APIENTRY IntEngStretchBlt(SURFOBJ *DestObj, SURFOBJ *SourceObj, SURFOBJ *Mask, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, COLORADJUSTMENT *pca, RECTL *DestRect, RECTL *SourceRect, POINTL *pMaskOrigin, BRUSHOBJ *Brush, POINTL *BrushOrigin, ULONG Mode)
#define WIN32_ROP3_TO_ENG_ROP4(dwRop4)
#define memcpy(s1, s2, n)
#define ExFreePoolWithTag(_P, _T)
static const BYTE masks[8]
#define _Out_writes_bytes_opt_(size)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER SectionOffset
#define NtCurrentProcess()
__kernel_entry W32KAPI HBITMAP APIENTRY NtGdiCreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO _In_ UINT _In_ UINT _In_ UINT cjMaxInfo
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO _In_ UINT _In_ UINT cjMaxBits
__kernel_entry W32KAPI HDC APIENTRY NtGdiCreateCompatibleDC(_In_opt_ HDC hdc)
_In_ DWORD _In_ DWORD dwOffset
__kernel_entry W32KAPI BOOL APIENTRY NtGdiBitBlt(_In_ HDC hdcDst, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ DWORD rop4, _In_ DWORD crBackColor, _In_ FLONG fl)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiStretchBlt(_In_ HDC hdcDst, _In_ INT xDst, _In_ INT yDst, _In_ INT cxDst, _In_ INT cyDst, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ DWORD dwRop, _In_ DWORD dwBackColor)
_In_ HBITMAP _In_ UINT _In_ UINT cScans
__kernel_entry W32KAPI HBITMAP APIENTRY NtGdiSelectBitmap(_In_ HDC hdc, _In_ HBITMAP hbm)
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
__kernel_entry W32KAPI HANDLE APIENTRY NtGdiGetDCObject(_In_ HDC hdc, _In_ INT itype)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteObjectApp(_In_ HANDLE hobj)
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO _In_ UINT iUsage
_In_ HBITMAP _In_ UINT iStartScan
_Out_opt_ int _Out_opt_ int * cy
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
PULONG MinorVersion OPTIONAL
BITMAPCOREHEADER bmciHeader
PALETTEENTRY * IndexedColors
struct _PALETTE *const ppal
BITMAPINFOHEADER bmiHeader
#define WIDTH_BYTES_ALIGN32(cx, bpp)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
static int __cdecl compr(const void *a, const void *b)
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
VOID DIB_1BPP_HLine(SURFOBJ *, LONG, LONG, LONG, ULONG)
BOOL APIENTRY IntEngBitBlt(SURFOBJ *psoTrg, SURFOBJ *psoSrc, SURFOBJ *psoMask, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc, POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *pptlBrush, ROP4 Rop4)
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
ULONG FASTCALL BitmapFormat(ULONG cBits, ULONG iCompression)
#define SURFACE_ShareUnlockSurface(pBMObj)
FORCEINLINE VOID SURFACE_vSetPalette(_Inout_ PSURFACE psurf, _In_ PPALETTE ppal)
#define SURFACE_ShareLockSurface(hBMObj)
#define BitsPerFormat(Format)
#define DIB_PAL_BRUSHHACK
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
PPALETTE NTAPI PALETTE_AllocPalWithHandle(_In_ ULONG iMode, _In_ ULONG cColors, _In_opt_ const PALETTEENTRY *pEntries, _In_ FLONG flRed, _In_ FLONG flGreen, _In_ FLONG flBlue)
PPALETTE NTAPI PALETTE_AllocPalette(_In_ ULONG iMode, _In_ ULONG cColors, _In_opt_ const PALETTEENTRY *pEntries, _In_ FLONG flRed, _In_ FLONG flGreen, _In_ FLONG flBlue)
#define PALETTE_UnlockPalette(pPalette)
FORCEINLINE VOID PALETTE_vSetRGBColorForIndex(PPALETTE ppal, ULONG ulIndex, COLORREF crColor)
#define PALETTE_ShareLockPalette(hpal)
#define PALETTE_ShareUnlockPalette(ppal)
FORCEINLINE ULONG PALETTE_ulGetRGBColorFromIndex(PPALETTE ppal, ULONG ulIndex)
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
FORCEINLINE VOID RECTL_vSetRect(_Out_ RECTL *prcl, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
FORCEINLINE VOID RECTL_vOffsetRect(_Inout_ RECTL *prcl, _In_ INT cx, _In_ INT cy)
ENGAPI BOOL APIENTRY EngDeleteSurface(_In_ _Post_ptr_invalid_ HSURF hsurf)
ENGAPI SURFOBJ *APIENTRY EngLockSurface(_In_ HSURF hsurf)
_In_ ULONG _In_ ULONG rgb
ENGAPI VOID APIENTRY EngFreeUserMem(_Pre_notnull_ __drv_freesMem(UserMem) PVOID pv)
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
ENGAPI HANDLE APIENTRY EngSecureMem(_In_reads_bytes_(cjLength) PVOID Address, _In_ ULONG cjLength)
ENGAPI VOID APIENTRY EngUnsecureMem(_In_ HANDLE hSecure)
ENGAPI VOID APIENTRY EngUnlockSurface(_In_ _Post_ptr_invalid_ SURFOBJ *pso)
#define ERROR_NO_SYSTEM_RESOURCES
_In_ const BITMAPINFO _In_ UINT _In_opt_ HANDLE hSection
struct _BITMAPCOREINFO * PBITMAPCOREINFO
struct BITMAPV4HEADER * PBITMAPV4HEADER
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)