ReactOS  r76032
dib.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DIB_PAL_BRUSHHACK   3
 

Functions

INT FASTCALL DIB_BitmapInfoSize (const BITMAPINFO *info, WORD coloruse)
 
HBITMAP APIENTRY DIB_CreateDIBSection (PDC dc, CONST BITMAPINFO *bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset, DWORD ovr_pitch)
 
int FASTCALL DIB_GetBitmapInfo (const BITMAPINFOHEADER *header, LONG *width, LONG *height, WORD *planes, WORD *bpp, DWORD *compr, DWORD *size)
 
INT APIENTRY DIB_GetDIBImageBytes (INT width, INT height, INT depth)
 
HPALETTE FASTCALL DIB_MapPaletteColors (PPALETTE ppal, CONST BITMAPINFO *lpbmi)
 
HPALETTE FASTCALL BuildDIBPalette (CONST BITMAPINFO *bmi)
 
BITMAPINFO *FASTCALL DIB_ConvertBitmapInfo (CONST BITMAPINFO *bmi, DWORD Usage)
 
VOID FASTCALL DIB_FreeConvertedBitmapInfo (BITMAPINFO *converted, BITMAPINFO *orig, DWORD Usage)
 
INT APIENTRY GreGetDIBitsInternal (HDC hDC, HBITMAP hBitmap, UINT StartScan, UINT ScanLines, LPBYTE Bits, LPBITMAPINFO Info, UINT Usage, UINT MaxBits, UINT MaxInfo)
 
HBITMAP NTAPI GreCreateDIBitmapFromPackedDIB (_In_reads_(cjPackedDIB) PVOID pvPackedDIB, _In_ UINT cjPackedDIB, _In_ ULONG uUsage)
 

Macro Definition Documentation

#define DIB_PAL_BRUSHHACK   3

Definition at line 36 of file dib.h.

Referenced by CreateDIBPalette(), and NtGdiCreateDIBBrush().

Function Documentation

HPALETTE FASTCALL BuildDIBPalette ( CONST BITMAPINFO bmi)
INT FASTCALL DIB_BitmapInfoSize ( const BITMAPINFO info,
WORD  coloruse 
)

Definition at line 1979 of file dibobj.c.

Referenced by _Success_(), GreCreateDIBitmapFromPackedDIB(), and NtGdiCreateDIBSection().

1980 {
1981  unsigned int colors, size, masks = 0;
1982  unsigned int colorsize;
1983 
1984  colorsize = (coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) :
1985  (coloruse == DIB_PAL_INDICES) ? 0 :
1986  sizeof(WORD);
1987 
1988  if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
1989  {
1990  const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info;
1991  colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0;
1992  return sizeof(BITMAPCOREHEADER) + colors * colorsize;
1993  }
1994  else /* Assume BITMAPINFOHEADER */
1995  {
1996  colors = info->bmiHeader.biClrUsed;
1997  if (colors > 256) colors = 256;
1998  if (!colors && (info->bmiHeader.biBitCount <= 8))
1999  colors = 1 << info->bmiHeader.biBitCount;
2000  if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
2001  size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) );
2002  return size + colors * colorsize;
2003  }
2004 }
#define max(a, b)
Definition: svc.c:63
unsigned short WORD
Definition: ntddk_ex.h:93
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1453
#define BI_BITFIELDS
Definition: mmreg.h:505
DWORD DWORD
Definition: winlogon.h:75
DWORD biCompression
Definition: amvideo.idl:35
if(!(yy_init))
Definition: macro.lex.yy.c:704
GLsizeiptr size
Definition: glext.h:5919
#define DIB_PAL_INDICES
#define DIB_RGB_COLORS
Definition: wingdi.h:365
static const BYTE masks[8]
Definition: dib.c:2769
BITMAPINFO* FASTCALL DIB_ConvertBitmapInfo ( CONST BITMAPINFO bmi,
DWORD  Usage 
)

Definition at line 2052 of file dibobj.c.

Referenced by GreGetDIBitsInternal(), IntSynthesizeBitmap(), and UserLoadImage().

2053 {
2055  BITMAPINFO* pNewBmi ;
2056  UINT numColors = 0, ColorsSize = 0;
2057 
2058  if(pbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER)) return (BITMAPINFO*)pbmi;
2059  if(pbmi->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) return NULL;
2060 
2061  if(pbmci->bmciHeader.bcBitCount <= 8)
2062  {
2063  numColors = 1 << pbmci->bmciHeader.bcBitCount;
2064  if(Usage == DIB_PAL_COLORS)
2065  {
2066  ColorsSize = numColors * sizeof(WORD);
2067  }
2068  else
2069  {
2070  ColorsSize = numColors * sizeof(RGBQUAD);
2071  }
2072  }
2073  else if (Usage == DIB_PAL_COLORS)
2074  {
2075  /* Invalid at high-res */
2076  return NULL;
2077  }
2078 
2079  pNewBmi = ExAllocatePoolWithTag(PagedPool, sizeof(BITMAPINFOHEADER) + ColorsSize, TAG_DIB);
2080  if(!pNewBmi) return NULL;
2081 
2082  RtlZeroMemory(pNewBmi, sizeof(BITMAPINFOHEADER) + ColorsSize);
2083 
2084  pNewBmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
2085  pNewBmi->bmiHeader.biBitCount = pbmci->bmciHeader.bcBitCount;
2086  pNewBmi->bmiHeader.biWidth = pbmci->bmciHeader.bcWidth;
2087  pNewBmi->bmiHeader.biHeight = pbmci->bmciHeader.bcHeight;
2088  pNewBmi->bmiHeader.biPlanes = pbmci->bmciHeader.bcPlanes;
2089  pNewBmi->bmiHeader.biCompression = BI_RGB ;
2091  pNewBmi->bmiHeader.biHeight,
2092  pNewBmi->bmiHeader.biBitCount);
2093  pNewBmi->bmiHeader.biClrUsed = numColors;
2094 
2095  if(Usage == DIB_PAL_COLORS)
2096  {
2097  RtlCopyMemory(pNewBmi->bmiColors, pbmci->bmciColors, ColorsSize);
2098  }
2099  else
2100  {
2101  UINT i;
2102  for(i=0; i<numColors; i++)
2103  {
2104  pNewBmi->bmiColors[i].rgbRed = pbmci->bmciColors[i].rgbtRed;
2105  pNewBmi->bmiColors[i].rgbGreen = pbmci->bmciColors[i].rgbtGreen;
2106  pNewBmi->bmiColors[i].rgbBlue = pbmci->bmciColors[i].rgbtBlue;
2107  }
2108  }
2109 
2110  return pNewBmi ;
2111 }
unsigned short WORD
Definition: ntddk_ex.h:93
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1453
#define DIB_PAL_COLORS
Definition: wingdi.h:364
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
Definition: ntgdi.h:2780
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:382
UCHAR rgbBlue
Definition: inbv.c:96
UCHAR rgbGreen
Definition: inbv.c:97
UCHAR rgbRed
Definition: inbv.c:98
GLenum GLclampf GLint i
Definition: glfuncs.h:14
DWORD biCompression
Definition: amvideo.idl:35
smooth NULL
Definition: ftsmooth.c:557
#define CONST
Definition: compiler.h:170
struct tagRGBQUAD RGBQUAD
RGBQUAD bmiColors[1]
Definition: wingdi.h:1454
DWORD biSizeImage
Definition: amvideo.idl:36
INT APIENTRY DIB_GetDIBImageBytes(INT width, INT height, INT depth)
Definition: dibobj.c:1967
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
unsigned int UINT
Definition: ndis.h:50
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define BI_RGB
Definition: precomp.h:35
#define TAG_DIB
Definition: tags.h:17
HBITMAP APIENTRY DIB_CreateDIBSection ( PDC  dc,
CONST BITMAPINFO bmi,
UINT  usage,
LPVOID bits,
HANDLE  section,
DWORD  offset,
DWORD  ovr_pitch 
)

Definition at line 1725 of file dibobj.c.

Referenced by GreGetDIBitsInternal(), IntCreateCompatibleBitmap(), and NtGdiCreateDIBSection().

1733 {
1734  HBITMAP res = 0;
1735  SURFACE *bmp = NULL;
1736  void *mapBits = NULL;
1737  PPALETTE ppalDIB = NULL;
1738 
1739  // Fill BITMAP32 structure with DIB data
1740  CONST BITMAPINFOHEADER *bi = &bmi->bmiHeader;
1741  INT effHeight;
1742  ULONG totalSize;
1743  BITMAP bm;
1744  //SIZEL Size;
1745  HANDLE hSecure;
1746 
1747  DPRINT("format (%ld,%ld), planes %u, bpp %u, size %lu, colors %lu (%s)\n",
1748  bi->biWidth, bi->biHeight, bi->biPlanes, bi->biBitCount,
1749  bi->biSizeImage, bi->biClrUsed, usage == DIB_PAL_COLORS? "PAL" : "RGB");
1750 
1751  /* CreateDIBSection should fail for compressed formats */
1752  if (bi->biCompression == BI_RLE4 || bi->biCompression == BI_RLE8)
1753  {
1754  DPRINT1("no compressed format allowed\n");
1755  return (HBITMAP)NULL;
1756  }
1757 
1758  effHeight = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight;
1759  bm.bmType = 0;
1760  bm.bmWidth = bi->biWidth;
1761  bm.bmHeight = effHeight;
1762  bm.bmWidthBytes = ovr_pitch ? ovr_pitch : WIDTH_BYTES_ALIGN32(bm.bmWidth, bi->biBitCount);
1763 
1764  bm.bmPlanes = bi->biPlanes;
1765  bm.bmBitsPixel = bi->biBitCount;
1766  bm.bmBits = NULL;
1767 
1768  // Get storage location for DIB bits. Only use biSizeImage if it's valid and
1769  // we're dealing with a compressed bitmap. Otherwise, use width * height.
1770  totalSize = (bi->biSizeImage && (bi->biCompression != BI_RGB) && (bi->biCompression != BI_BITFIELDS))
1771  ? bi->biSizeImage : (ULONG)(bm.bmWidthBytes * effHeight);
1772 
1773  if (section)
1774  {
1776  NTSTATUS Status;
1777  DWORD mapOffset;
1779  SIZE_T mapSize;
1780 
1782  &Sbi,
1783  sizeof Sbi,
1784  0);
1785  if (!NT_SUCCESS(Status))
1786  {
1787  DPRINT1("ZwQuerySystemInformation failed (0x%lx)\n", Status);
1788  return NULL;
1789  }
1790 
1791  mapOffset = offset - (offset % Sbi.AllocationGranularity);
1792  mapSize = totalSize + (offset - mapOffset);
1793 
1794  SectionOffset.LowPart = mapOffset;
1795  SectionOffset.HighPart = 0;
1796 
1797  Status = ZwMapViewOfSection(section,
1798  NtCurrentProcess(),
1799  &mapBits,
1800  0,
1801  0,
1802  &SectionOffset,
1803  &mapSize,
1804  ViewShare,
1805  0,
1806  PAGE_READWRITE);
1807  if (!NT_SUCCESS(Status))
1808  {
1809  DPRINT1("ZwMapViewOfSection failed (0x%lx)\n", Status);
1811  return NULL;
1812  }
1813 
1814  if (mapBits) bm.bmBits = (char *)mapBits + (offset - mapOffset);
1815  }
1816  else if (ovr_pitch && offset)
1817  bm.bmBits = (LPVOID) offset;
1818  else
1819  {
1820  offset = 0;
1821  bm.bmBits = EngAllocUserMem(totalSize, 0);
1822  if(!bm.bmBits)
1823  {
1824  DPRINT1("Failed to allocate memory\n");
1825  goto cleanup;
1826  }
1827  }
1828 
1829 // hSecure = MmSecureVirtualMemory(bm.bmBits, totalSize, PAGE_READWRITE);
1830  hSecure = (HANDLE)0x1; // HACK OF UNIMPLEMENTED KERNEL STUFF !!!!
1831 
1832 
1833  // Create Device Dependent Bitmap and add DIB pointer
1834  //Size.cx = bm.bmWidth;
1835  //Size.cy = abs(bm.bmHeight);
1836  res = GreCreateBitmapEx(bm.bmWidth,
1837  abs(bm.bmHeight),
1838  bm.bmWidthBytes,
1839  BitmapFormat(bi->biBitCount * bi->biPlanes, bi->biCompression),
1841  ((bi->biHeight < 0) ? BMF_TOPDOWN : 0),
1842  totalSize,
1843  bm.bmBits,
1844  0);
1845  if (!res)
1846  {
1847  DPRINT1("GreCreateBitmapEx failed\n");
1849  goto cleanup;
1850  }
1851  bmp = SURFACE_ShareLockSurface(res); // HACK
1852  if (NULL == bmp)
1853  {
1854  DPRINT1("SURFACE_LockSurface failed\n");
1856  goto cleanup;
1857  }
1858 
1859  /* WINE NOTE: WINE makes use of a colormap, which is a color translation
1860  table between the DIB and the X physical device. Obviously,
1861  this is left out of the ReactOS implementation. Instead,
1862  we call NtGdiSetDIBColorTable. */
1863  bmp->hDIBSection = section;
1864  bmp->hSecure = hSecure;
1865  bmp->dwOffset = offset;
1866  bmp->flags = API_BITMAP;
1867  bmp->biClrImportant = bi->biClrImportant;
1868 
1869  /* Create a palette for the DIB */
1870  ppalDIB = CreateDIBPalette(bmi, dc, usage);
1871 
1872  // Clean up in case of errors
1873 cleanup:
1874  if (!res || !bmp || !bm.bmBits || !ppalDIB)
1875  {
1876  DPRINT("Got an error res=%p, bmp=%p, bm.bmBits=%p\n", res, bmp, bm.bmBits);
1877  if (bm.bmBits)
1878  {
1879  // MmUnsecureVirtualMemory(hSecure); // FIXME: Implement this!
1880  if (section)
1881  {
1882  ZwUnmapViewOfSection(NtCurrentProcess(), mapBits);
1883  bm.bmBits = NULL;
1884  }
1885  else if (!offset)
1886  EngFreeUserMem(bm.bmBits), bm.bmBits = NULL;
1887  }
1888 
1889  if (bmp)
1890  {
1892  bmp = NULL;
1893  }
1894 
1895  if (res)
1896  {
1897  GreDeleteObject(res);
1898  res = 0;
1899  }
1900 
1901  if(ppalDIB)
1902  {
1903  PALETTE_ShareUnlockPalette(ppalDIB);
1904  }
1905  }
1906 
1907  if (bmp)
1908  {
1909  /* If we're here, everything went fine */
1910  SURFACE_vSetPalette(bmp, ppalDIB);
1911  PALETTE_ShareUnlockPalette(ppalDIB);
1913  }
1914 
1915  // Return BITMAP handle and storage location
1916  if (NULL != bm.bmBits && NULL != bits)
1917  {
1918  *bits = bm.bmBits;
1919  }
1920 
1921  return res;
1922 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define abs(i)
Definition: fconv.c:206
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1153
#define HBITMAP
Definition: msvc.h:28
#define WIDTH_BYTES_ALIGN32(cx, bpp)
Definition: swimpl.c:26
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:95
#define DIB_PAL_COLORS
Definition: wingdi.h:364
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define BMF_TOPDOWN
Definition: winddi.h:1180
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
Definition: parser.c:55
PPALETTE NTAPI CreateDIBPalette(_In_ const BITMAPINFO *pbmi, _In_ PDC pdc, _In_ ULONG iUsage)
Definition: dibobj.c:41
int32_t INT
Definition: typedefs.h:56
#define BI_BITFIELDS
Definition: mmreg.h:505
#define ERROR_NO_SYSTEM_RESOURCES
Definition: winerror.h:931
DWORD DWORD
Definition: winlogon.h:75
NTSYSAPI NTSTATUS NTAPI ZwQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
#define BMF_DONTCACHE
Definition: winddi.h:1182
smooth NULL
Definition: ftsmooth.c:557
ENGAPI VOID APIENTRY EngFreeUserMem(_Pre_notnull_ __drv_freesMem(UserMem) PVOID pv)
void DPRINT(...)
Definition: polytest.cpp:61
ULONG FASTCALL BitmapFormat(ULONG cBits, ULONG iCompression)
Definition: surface.c:39
#define CONST
Definition: compiler.h:170
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER SectionOffset
Definition: mmfuncs.h:404
#define NtCurrentProcess()
Definition: nt_native.h:1657
#define BMF_USERMEM
Definition: winddi.h:1183
const char * section
Definition: parser.c:190
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define BMF_NOZEROINIT
Definition: winddi.h:1181
#define LPVOID
Definition: nt_native.h:45
BITMAP bmp
Definition: alphablend.c:62
FORCEINLINE VOID SURFACE_vSetPalette(_Inout_ PSURFACE psurf, _In_ PPALETTE ppal)
Definition: surface.h:129
HANDLE hSecure
Definition: surface.h:32
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
ULONG LowPart
Definition: typedefs.h:104
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
DWORD *typedef HANDLE
Definition: winlogon.h:52
LONG NTSTATUS
Definition: DriverTester.h:11
DWORD dwOffset
Definition: surface.h:33
FLONG flags
Definition: surface.h:10
Definition: bl.h:1253
#define SystemBasicInformation
Definition: xboxvmp.h:35
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59
HANDLE hDIBSection
Definition: surface.h:31
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)
Definition: bitmaps.c:87
#define BI_RLE4
Definition: precomp.h:36
#define DPRINT1
Definition: precomp.h:8
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1
char * cleanup(char *str)
Definition: wpickclick.c:99
#define BI_RLE8
Definition: wingdi.h:35
#define BI_RGB
Definition: precomp.h:35
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
DWORD biClrImportant
Definition: surface.h:37
GLintptr offset
Definition: glext.h:5920
#define PAGE_READWRITE
Definition: nt_native.h:1304
VOID FASTCALL DIB_FreeConvertedBitmapInfo ( BITMAPINFO converted,
BITMAPINFO orig,
DWORD  Usage 
)

Definition at line 2116 of file dibobj.c.

Referenced by GreGetDIBitsInternal(), IntSynthesizeBitmap(), and UserLoadImage().

2117 {
2118  BITMAPCOREINFO* pbmci;
2119  if(converted == orig)
2120  return;
2121 
2122  if(usage == -1)
2123  {
2124  /* Caller don't want any conversion */
2125  ExFreePoolWithTag(converted, TAG_DIB);
2126  return;
2127  }
2128 
2129  /* Perform inverse conversion */
2130  pbmci = (BITMAPCOREINFO*)orig;
2131 
2132  ASSERT(pbmci->bmciHeader.bcSize == sizeof(BITMAPCOREHEADER));
2133  pbmci->bmciHeader.bcBitCount = converted->bmiHeader.biBitCount;
2134  pbmci->bmciHeader.bcWidth = converted->bmiHeader.biWidth;
2135  pbmci->bmciHeader.bcHeight = converted->bmiHeader.biHeight;
2136  pbmci->bmciHeader.bcPlanes = converted->bmiHeader.biPlanes;
2137 
2138  if(pbmci->bmciHeader.bcBitCount <= 8)
2139  {
2140  UINT numColors = converted->bmiHeader.biClrUsed;
2141  if(!numColors) numColors = 1 << pbmci->bmciHeader.bcBitCount;
2142  if(usage == DIB_PAL_COLORS)
2143  {
2144  RtlZeroMemory(pbmci->bmciColors, (1 << pbmci->bmciHeader.bcBitCount) * sizeof(WORD));
2145  RtlCopyMemory(pbmci->bmciColors, converted->bmiColors, numColors * sizeof(WORD));
2146  }
2147  else
2148  {
2149  UINT i;
2150  RtlZeroMemory(pbmci->bmciColors, (1 << pbmci->bmciHeader.bcBitCount) * sizeof(RGBTRIPLE));
2151  for(i=0; i<numColors; i++)
2152  {
2153  pbmci->bmciColors[i].rgbtRed = converted->bmiColors[i].rgbRed;
2154  pbmci->bmciColors[i].rgbtGreen = converted->bmiColors[i].rgbGreen;
2155  pbmci->bmciColors[i].rgbtBlue = converted->bmiColors[i].rgbBlue;
2156  }
2157  }
2158  }
2159  /* Now free it, it's not needed anymore */
2160  ExFreePoolWithTag(converted, TAG_DIB);
2161 }
BYTE rgbtBlue
Definition: wingdi.h:1415
unsigned short WORD
Definition: ntddk_ex.h:93
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1453
#define DIB_PAL_COLORS
Definition: wingdi.h:364
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
UCHAR rgbBlue
Definition: inbv.c:96
UCHAR rgbGreen
Definition: inbv.c:97
UCHAR rgbRed
Definition: inbv.c:98
BITMAPCOREHEADER bmciHeader
Definition: wingdi.h:1430
GLenum GLclampf GLint i
Definition: glfuncs.h:14
RGBTRIPLE bmciColors[1]
Definition: wingdi.h:1431
RGBQUAD bmiColors[1]
Definition: wingdi.h:1454
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
BYTE rgbtRed
Definition: wingdi.h:1417
unsigned int UINT
Definition: ndis.h:50
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
BYTE rgbtGreen
Definition: wingdi.h:1416
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1097
#define TAG_DIB
Definition: tags.h:17
int FASTCALL DIB_GetBitmapInfo ( const BITMAPINFOHEADER header,
LONG width,
LONG height,
WORD planes,
WORD bpp,
DWORD compr,
DWORD size 
)

Definition at line 1932 of file dibobj.c.

Referenced by GreGetDIBitsInternal().

1934 {
1935  if (header->biSize == sizeof(BITMAPCOREHEADER))
1936  {
1937  const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)header;
1938  *width = core->bcWidth;
1939  *height = core->bcHeight;
1940  *planes = core->bcPlanes;
1941  *bpp = core->bcBitCount;
1942  *compr = BI_RGB;
1943  *size = 0;
1944  return 0;
1945  }
1946  if (header->biSize >= sizeof(BITMAPINFOHEADER)) /* Assume BITMAPINFOHEADER */
1947  {
1948  *width = header->biWidth;
1949  *height = header->biHeight;
1950  *planes = header->biPlanes;
1951  *bpp = header->biBitCount;
1952  *compr = header->biCompression;
1953  *size = header->biSizeImage;
1954  return 1;
1955  }
1956  DPRINT1("(%u): unknown/wrong size for header\n", header->biSize );
1957  return -1;
1958 }
DWORD biCompression
Definition: amvideo.idl:35
GLint GLint GLsizei width
Definition: gl.h:1546
static int compr(const void *a, const void *b)
Definition: bidi.c:675
DWORD biSizeImage
Definition: amvideo.idl:36
GLsizeiptr size
Definition: glext.h:5919
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define DPRINT1
Definition: precomp.h:8
DWORD bpp
Definition: surface.c:174
#define BI_RGB
Definition: precomp.h:35
INT APIENTRY DIB_GetDIBImageBytes ( INT  width,
INT  height,
INT  depth 
)

Definition at line 1967 of file dibobj.c.

Referenced by DIB_ConvertBitmapInfo(), GreGetDIBitsInternal(), and IntSetDIBits().

1968 {
1969  return WIDTH_BYTES_ALIGN32(width, depth) * (height < 0 ? -height : height);
1970 }
#define WIDTH_BYTES_ALIGN32(cx, bpp)
Definition: swimpl.c:26
GLint GLint GLsizei width
Definition: gl.h:1546
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
HPALETTE FASTCALL DIB_MapPaletteColors ( PPALETTE  ppal,
CONST BITMAPINFO lpbmi 
)

Definition at line 2008 of file dibobj.c.

2009 {
2010  PPALETTE ppalNew;
2011  ULONG nNumColors,i;
2012  USHORT *lpIndex;
2013  HPALETTE hpal;
2014 
2015  if (!(ppalDc->flFlags & PAL_INDEXED))
2016  {
2017  return NULL;
2018  }
2019 
2020  nNumColors = 1 << lpbmi->bmiHeader.biBitCount;
2021  if (lpbmi->bmiHeader.biClrUsed)
2022  {
2023  nNumColors = min(nNumColors, lpbmi->bmiHeader.biClrUsed);
2024  }
2025 
2026  ppalNew = PALETTE_AllocPalWithHandle(PAL_INDEXED, nNumColors, NULL, 0, 0, 0);
2027  if (ppalNew == NULL)
2028  {
2029  DPRINT1("Could not allocate palette\n");
2030  return NULL;
2031  }
2032 
2033  lpIndex = (USHORT *)((PBYTE)lpbmi + lpbmi->bmiHeader.biSize);
2034 
2035  for (i = 0; i < nNumColors; i++)
2036  {
2037  ULONG iColorIndex = *lpIndex % ppalDc->NumColors;
2038  ppalNew->IndexedColors[i] = ppalDc->IndexedColors[iColorIndex];
2039  lpIndex++;
2040  }
2041 
2042  hpal = ppalNew->BaseObject.hHmgr;
2043  PALETTE_UnlockPalette(ppalNew);
2044 
2045  return hpal;
2046 }
PALETTEENTRY * IndexedColors
Definition: palette.h:42
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define PALETTE_UnlockPalette(pPalette)
Definition: palette.h:56
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
smooth NULL
Definition: ftsmooth.c:557
PPALETTE NTAPI PALETTE_AllocPalWithHandle(_In_ ULONG iMode, _In_ ULONG cColors, _In_opt_ const PALETTEENTRY *pEntries, _In_ FLONG flRed, _In_ FLONG flGreen, _In_ FLONG flBlue)
Definition: palette.c:206
BASEOBJECT BaseObject
Definition: palette.h:36
unsigned short USHORT
Definition: pedump.c:61
#define min(a, b)
Definition: monoChain.cc:55
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
BYTE * PBYTE
Definition: pedump.c:66
HBITMAP NTAPI GreCreateDIBitmapFromPackedDIB ( _In_reads_(cjPackedDIB) PVOID  pvPackedDIB,
_In_ UINT  cjPackedDIB,
_In_ ULONG  uUsage 
)

Definition at line 1607 of file dibobj.c.

Referenced by NtGdiCreateDIBBrush().

1611 {
1612  PBITMAPINFO pbmi;
1613  PBYTE pjBits;
1614  UINT cjInfo, cjBits;
1615  HBITMAP hbm;
1616 
1617  /* We only support BITMAPINFOHEADER, make sure the size is ok */
1618  if (cjPackedDIB < sizeof(BITMAPINFOHEADER))
1619  {
1620  return NULL;
1621  }
1622 
1623  /* The packed DIB starts with the BITMAPINFOHEADER */
1624  pbmi = pvPackedDIB;
1625 
1626  if (cjPackedDIB < pbmi->bmiHeader.biSize)
1627  {
1628  return NULL;
1629  }
1630 
1631  /* Calculate the info size and make sure the packed DIB is large enough */
1632  cjInfo = DIB_BitmapInfoSize(pbmi, uUsage);
1633  if (cjPackedDIB <= cjInfo)
1634  {
1635  return NULL;
1636  }
1637 
1638  /* The bitmap bits start after the header */
1639  pjBits = (PBYTE)pvPackedDIB + cjInfo;
1640  cjBits = cjPackedDIB - cjInfo;
1641 
1643  pbmi->bmiHeader.biWidth,
1644  abs(pbmi->bmiHeader.biHeight),
1646  pjBits,
1647  pbmi,
1648  uUsage,
1649  0,
1650  cjBits,
1651  NULL);
1652 
1653  return hbm;
1654 }
#define abs(i)
Definition: fconv.c:206
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)
Definition: dibobj.c:1531
#define HBITMAP
Definition: msvc.h:28
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1453
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
Definition: ntgdi.h:2780
INT FASTCALL DIB_BitmapInfoSize(const BITMAPINFO *info, WORD coloruse)
Definition: dibobj.c:1979
#define CBM_INIT
Definition: wingdi.h:363
smooth NULL
Definition: ftsmooth.c:557
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
unsigned int UINT
Definition: ndis.h:50
#define CBM_CREATDIB
BYTE * PBYTE
Definition: pedump.c:66
INT APIENTRY GreGetDIBitsInternal ( HDC  hDC,
HBITMAP  hBitmap,
UINT  StartScan,
UINT  ScanLines,
LPBYTE  Bits,
LPBITMAPINFO  Info,
UINT  Usage,
UINT  MaxBits,
UINT  MaxInfo 
)

Definition at line 671 of file dibobj.c.

Referenced by _Success_(), and IntSynthesizeDib().

681 {
682  BITMAPCOREINFO* pbmci = NULL;
683  PSURFACE psurf = NULL;
684  PDC pDC;
685  LONG width, height;
686  WORD planes, bpp;
687  DWORD compr, size ;
688  USHORT i;
689  int bitmap_type;
690  RGBQUAD* rgbQuads;
691  VOID* colorPtr;
692 
693  DPRINT("Entered GreGetDIBitsInternal()\n");
694 
695  if ((Usage && Usage != DIB_PAL_COLORS) || !Info || !hBitmap)
696  return 0;
697 
698  pDC = DC_LockDc(hDC);
699  if (pDC == NULL || pDC->dctype == DC_TYPE_INFO)
700  {
701  ScanLines = 0;
702  goto done;
703  }
704 
705  /* Get a pointer to the source bitmap object */
707  if (psurf == NULL)
708  {
709  ScanLines = 0;
710  goto done;
711  }
712 
713  colorPtr = (LPBYTE)Info + Info->bmiHeader.biSize;
714  rgbQuads = colorPtr;
715 
716  bitmap_type = DIB_GetBitmapInfo(&Info->bmiHeader,
717  &width,
718  &height,
719  &planes,
720  &bpp,
721  &compr,
722  &size);
723  if(bitmap_type == -1)
724  {
725  DPRINT("Wrong bitmap format\n");
727  ScanLines = 0;
728  goto done;
729  }
730  else if(bitmap_type == 0)
731  {
732  /* We need a BITMAPINFO to create a DIB, but we have to fill
733  * the BITMAPCOREINFO we're provided */
734  pbmci = (BITMAPCOREINFO*)Info;
735  /* fill in the the bit count, so we can calculate the right ColorsSize during the conversion */
737  Info = DIB_ConvertBitmapInfo((BITMAPINFO*)pbmci, Usage);
738  if(Info == NULL)
739  {
740  DPRINT1("Error, could not convert the BITMAPCOREINFO!\n");
741  ScanLines = 0;
742  goto done;
743  }
744  rgbQuads = Info->bmiColors;
745  }
746 
747  /* Validate input:
748  - negative width is always an invalid value
749  - non-null Bits and zero bpp is an invalid combination
750  - only check the rest of the input params if either bpp is non-zero or Bits are set */
751  if (width < 0 || (bpp == 0 && Bits))
752  {
753  ScanLines = 0;
754  goto done;
755  }
756 
757  if (Bits || bpp)
758  {
759  if ((height == 0 || width == 0) || (compr && compr != BI_BITFIELDS && compr != BI_RGB))
760  {
761  ScanLines = 0;
762  goto done;
763  }
764  }
765 
766  Info->bmiHeader.biClrUsed = 0;
767  Info->bmiHeader.biClrImportant = 0;
768 
769  /* Fill in the structure */
770  switch(bpp)
771  {
772  case 0: /* Only info */
773  Info->bmiHeader.biWidth = psurf->SurfObj.sizlBitmap.cx;
774  Info->bmiHeader.biHeight = (psurf->SurfObj.fjBitmap & BMF_TOPDOWN) ?
775  -psurf->SurfObj.sizlBitmap.cy :
776  psurf->SurfObj.sizlBitmap.cy;
777  Info->bmiHeader.biPlanes = 1;
780  Info->bmiHeader.biHeight,
781  Info->bmiHeader.biBitCount);
782  Info->bmiHeader.biCompression = (Info->bmiHeader.biBitCount == 16 || Info->bmiHeader.biBitCount == 32) ?
784  Info->bmiHeader.biXPelsPerMeter = 0;
785  Info->bmiHeader.biYPelsPerMeter = 0;
786 
787  if (Info->bmiHeader.biBitCount <= 8 && Info->bmiHeader.biClrUsed == 0)
788  Info->bmiHeader.biClrUsed = 1 << Info->bmiHeader.biBitCount;
789 
790  ScanLines = 1;
791  goto done;
792 
793  case 1:
794  case 4:
795  case 8:
796  Info->bmiHeader.biClrUsed = 1 << bpp;
797 
798  /* If the bitmap is a DIB section and has the same format as what
799  * is requested, go ahead! */
800  if((psurf->hSecure) &&
801  (BitsPerFormat(psurf->SurfObj.iBitmapFormat) == bpp))
802  {
803  if(Usage == DIB_RGB_COLORS)
804  {
805  ULONG colors = min(psurf->ppal->NumColors, 256);
806  if(colors != 256) Info->bmiHeader.biClrUsed = colors;
807  for(i = 0; i < colors; i++)
808  {
809  rgbQuads[i].rgbRed = psurf->ppal->IndexedColors[i].peRed;
810  rgbQuads[i].rgbGreen = psurf->ppal->IndexedColors[i].peGreen;
811  rgbQuads[i].rgbBlue = psurf->ppal->IndexedColors[i].peBlue;
812  rgbQuads[i].rgbReserved = 0;
813  }
814  }
815  else
816  {
817  for(i = 0; i < 256; i++)
818  ((WORD*)rgbQuads)[i] = i;
819  }
820  }
821  else
822  {
823  if(Usage == DIB_PAL_COLORS)
824  {
825  for(i = 0; i < 256; i++)
826  {
827  ((WORD*)rgbQuads)[i] = i;
828  }
829  }
830  else if(bpp > 1 && bpp == BitsPerFormat(psurf->SurfObj.iBitmapFormat))
831  {
832  /* For color DDBs in native depth (mono DDBs always have
833  a black/white palette):
834  Generate the color map from the selected palette */
835  PPALETTE pDcPal = PALETTE_ShareLockPalette(pDC->dclevel.hpal);
836  if(!pDcPal)
837  {
838  ScanLines = 0 ;
839  goto done ;
840  }
841  for (i = 0; i < pDcPal->NumColors; i++)
842  {
843  rgbQuads[i].rgbRed = pDcPal->IndexedColors[i].peRed;
844  rgbQuads[i].rgbGreen = pDcPal->IndexedColors[i].peGreen;
845  rgbQuads[i].rgbBlue = pDcPal->IndexedColors[i].peBlue;
846  rgbQuads[i].rgbReserved = 0;
847  }
849  }
850  else
851  {
852  switch (bpp)
853  {
854  case 1:
855  rgbQuads[0].rgbRed = rgbQuads[0].rgbGreen = rgbQuads[0].rgbBlue = 0;
856  rgbQuads[0].rgbReserved = 0;
857  rgbQuads[1].rgbRed = rgbQuads[1].rgbGreen = rgbQuads[1].rgbBlue = 0xff;
858  rgbQuads[1].rgbReserved = 0;
859  break;
860 
861  case 4:
862  /* The EGA palette is the first and last 8 colours of the default palette
863  with the innermost pair swapped */
864  RtlCopyMemory(rgbQuads, DefLogPaletteQuads, 7 * sizeof(RGBQUAD));
865  RtlCopyMemory(rgbQuads + 7, DefLogPaletteQuads + 12, 1 * sizeof(RGBQUAD));
866  RtlCopyMemory(rgbQuads + 8, DefLogPaletteQuads + 7, 1 * sizeof(RGBQUAD));
867  RtlCopyMemory(rgbQuads + 9, DefLogPaletteQuads + 13, 7 * sizeof(RGBQUAD));
868  break;
869 
870  case 8:
871  {
872  INT i;
873 
874  memcpy(rgbQuads, DefLogPaletteQuads, 10 * sizeof(RGBQUAD));
875  memcpy(rgbQuads + 246, DefLogPaletteQuads + 10, 10 * sizeof(RGBQUAD));
876 
877  for (i = 10; i < 246; i++)
878  {
879  rgbQuads[i].rgbRed = (i & 0x07) << 5;
880  rgbQuads[i].rgbGreen = (i & 0x38) << 2;
881  rgbQuads[i].rgbBlue = i & 0xc0;
882  rgbQuads[i].rgbReserved = 0;
883  }
884  }
885  }
886  }
887  }
888  break;
889 
890  case 15:
891  if (Info->bmiHeader.biCompression == BI_BITFIELDS)
892  {
893  ((PDWORD)Info->bmiColors)[0] = 0x7c00;
894  ((PDWORD)Info->bmiColors)[1] = 0x03e0;
895  ((PDWORD)Info->bmiColors)[2] = 0x001f;
896  }
897  break;
898 
899  case 16:
900  if (Info->bmiHeader.biCompression == BI_BITFIELDS)
901  {
902  if (psurf->hSecure)
903  {
904  ((PDWORD)Info->bmiColors)[0] = psurf->ppal->RedMask;
905  ((PDWORD)Info->bmiColors)[1] = psurf->ppal->GreenMask;
906  ((PDWORD)Info->bmiColors)[2] = psurf->ppal->BlueMask;
907  }
908  else
909  {
910  ((PDWORD)Info->bmiColors)[0] = 0xf800;
911  ((PDWORD)Info->bmiColors)[1] = 0x07e0;
912  ((PDWORD)Info->bmiColors)[2] = 0x001f;
913  }
914  }
915  break;
916 
917  case 24:
918  case 32:
919  if (Info->bmiHeader.biCompression == BI_BITFIELDS)
920  {
921  if (psurf->hSecure)
922  {
923  ((PDWORD)Info->bmiColors)[0] = psurf->ppal->RedMask;
924  ((PDWORD)Info->bmiColors)[1] = psurf->ppal->GreenMask;
925  ((PDWORD)Info->bmiColors)[2] = psurf->ppal->BlueMask;
926  }
927  else
928  {
929  ((PDWORD)Info->bmiColors)[0] = 0xff0000;
930  ((PDWORD)Info->bmiColors)[1] = 0x00ff00;
931  ((PDWORD)Info->bmiColors)[2] = 0x0000ff;
932  }
933  }
934  break;
935 
936  default:
937  ScanLines = 0;
938  goto done;
939  }
940 
941  Info->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(width, height, bpp);
942  Info->bmiHeader.biPlanes = 1;
943 
944  if(Bits && ScanLines)
945  {
946  /* Create a DIBSECTION, blt it, profit */
947  PVOID pDIBits ;
948  HBITMAP hBmpDest;
949  PSURFACE psurfDest;
950  EXLATEOBJ exlo;
951  RECT rcDest;
952  POINTL srcPoint;
953  BOOL ret ;
954 
955  if (StartScan > (ULONG)psurf->SurfObj.sizlBitmap.cy)
956  {
957  ScanLines = 0;
958  goto done;
959  }
960  else
961  {
962  ScanLines = min(ScanLines, psurf->SurfObj.sizlBitmap.cy - StartScan);
963  }
964 
965  /* Fixup values */
966  Info->bmiHeader.biWidth = psurf->SurfObj.sizlBitmap.cx;
967  Info->bmiHeader.biHeight = (height < 0) ?
968  -(LONG)ScanLines : ScanLines;
969  /* Create the DIB */
970  hBmpDest = DIB_CreateDIBSection(pDC, Info, Usage, &pDIBits, NULL, 0, 0);
971  /* Restore them */
972  Info->bmiHeader.biWidth = width;
973  Info->bmiHeader.biHeight = height;
974 
975  if(!hBmpDest)
976  {
977  DPRINT1("Unable to create a DIB Section!\n");
979  ScanLines = 0;
980  goto done ;
981  }
982 
983  psurfDest = SURFACE_ShareLockSurface(hBmpDest);
984 
985  RECTL_vSetRect(&rcDest, 0, 0, psurf->SurfObj.sizlBitmap.cx, ScanLines);
986 
987  srcPoint.x = 0;
988 
989  if(height < 0)
990  {
991  srcPoint.y = 0;
992 
993  if(ScanLines <= StartScan)
994  {
995  ScanLines = 1;
996  SURFACE_ShareUnlockSurface(psurfDest);
997  GreDeleteObject(hBmpDest);
998  goto done;
999  }
1000 
1001  ScanLines -= StartScan;
1002  }
1003  else
1004  {
1005  srcPoint.y = StartScan;
1006  }
1007 
1008  EXLATEOBJ_vInitialize(&exlo, psurf->ppal, psurfDest->ppal, 0xffffff, 0xffffff, 0);
1009 
1010  ret = IntEngCopyBits(&psurfDest->SurfObj,
1011  &psurf->SurfObj,
1012  NULL,
1013  &exlo.xlo,
1014  &rcDest,
1015  &srcPoint);
1016 
1017  SURFACE_ShareUnlockSurface(psurfDest);
1018 
1019  if(!ret)
1020  ScanLines = 0;
1021  else
1022  {
1023  RtlCopyMemory(Bits, pDIBits, DIB_GetDIBImageBytes (width, ScanLines, bpp));
1024  }
1025 
1026  GreDeleteObject(hBmpDest);
1027  EXLATEOBJ_vCleanup(&exlo);
1028  }
1029  else
1030  {
1031  /* Signals success and not the actual number of scan lines*/
1032  ScanLines = 1;
1033  }
1034 
1035 done:
1036 
1037  if (pbmci)
1039 
1040  if (psurf)
1042 
1043  if (pDC)
1044  DC_UnlockDc(pDC);
1045 
1046  return ScanLines;
1047 }
DWORD *typedef PVOID
Definition: winlogon.h:52
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
unsigned short WORD
Definition: ntddk_ex.h:93
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1153
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
SIZEL sizlBitmap
Definition: winddi.h:1209
#define HBITMAP
Definition: msvc.h:28
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1453
DWORD biClrImportant
Definition: amvideo.idl:40
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:95
#define DIB_PAL_COLORS
Definition: wingdi.h:364
HBITMAP APIENTRY DIB_CreateDIBSection(PDC dc, CONST BITMAPINFO *bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset, DWORD ovr_pitch)
Definition: dibobj.c:1725
#define BitsPerFormat(Format)
Definition: surface.h:102
LONG biXPelsPerMeter
Definition: amvideo.idl:37
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:382
unsigned char * LPBYTE
Definition: typedefs.h:52
static const RGBQUAD DefLogPaletteQuads[20]
Definition: dibobj.c:14
PALETTEENTRY * IndexedColors
Definition: palette.h:42
struct _PALETTE *const ppal
Definition: surface.h:11
#define BMF_TOPDOWN
Definition: winddi.h:1180
ULONG iBitmapFormat
Definition: winddi.h:1215
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
LONG biYPelsPerMeter
Definition: amvideo.idl:38
int32_t INT
Definition: typedefs.h:56
#define BI_BITFIELDS
Definition: mmreg.h:505
DWORD DWORD
Definition: winlogon.h:75
UCHAR rgbBlue
Definition: inbv.c:96
LONG y
Definition: windef.h:343
UCHAR rgbGreen
Definition: inbv.c:97
UCHAR rgbRed
Definition: inbv.c:98
BITMAPCOREHEADER bmciHeader
Definition: wingdi.h:1430
XLATEOBJ xlo
Definition: xlateobj.h:21
BITMAPINFO *FASTCALL DIB_ConvertBitmapInfo(CONST BITMAPINFO *pbmi, DWORD Usage)
Definition: dibobj.c:2052
GLenum GLclampf GLint i
Definition: glfuncs.h:14
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
Definition: xlateobj.c:358
long LONG
Definition: pedump.c:60
int FASTCALL DIB_GetBitmapInfo(const BITMAPINFOHEADER *header, LONG *width, LONG *height, WORD *planes, WORD *bpp, DWORD *compr, DWORD *size)
Definition: dibobj.c:1932
SURFOBJ SurfObj
Definition: surface.h:8
DWORD biCompression
Definition: amvideo.idl:35
smooth NULL
Definition: ftsmooth.c:557
LONG cx
Definition: windef.h:347
void DPRINT(...)
Definition: polytest.cpp:61
BOOL APIENTRY IntEngCopyBits(SURFOBJ *psoTrg, SURFOBJ *psoSrc, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc)
Definition: bitblt_new.c:677
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
#define PALETTE_ShareLockPalette(hpal)
Definition: palette.h:57
HDC hDC
Definition: wglext.h:521
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLsizei width
Definition: gl.h:1546
RGBQUAD bmiColors[1]
Definition: wingdi.h:1454
static int compr(const void *a, const void *b)
Definition: bidi.c:675
LONG x
Definition: windef.h:342
DWORD biSizeImage
Definition: amvideo.idl:36
INT APIENTRY DIB_GetDIBImageBytes(INT width, INT height, INT depth)
Definition: dibobj.c:1967
int ret
HANDLE hSecure
Definition: surface.h:32
VOID FASTCALL DIB_FreeConvertedBitmapInfo(BITMAPINFO *converted, BITMAPINFO *orig, DWORD usage)
Definition: dibobj.c:2116
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ULONG NumColors
Definition: palette.h:41
USHORT fjBitmap
Definition: winddi.h:1217
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DC_TYPE_INFO
Definition: ntgdihdl.h:125
unsigned short USHORT
Definition: pedump.c:61
GLsizeiptr size
Definition: glext.h:5919
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59
#define min(a, b)
Definition: monoChain.cc:55
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
DWORD * PDWORD
Definition: pedump.c:68
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
DWORD bpp
Definition: surface.c:174
UCHAR rgbReserved
Definition: inbv.c:99
#define DIB_RGB_COLORS
Definition: wingdi.h:365
FORCEINLINE VOID RECTL_vSetRect(_Out_ RECTL *prcl, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
Definition: rect.h:5
LONG cy
Definition: windef.h:348
#define BI_RGB
Definition: precomp.h:35
static HBITMAP hBitmap
Definition: timezone.c:34
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27