ReactOS  r75385
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 1982 of file dibobj.c.

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

1983 {
1984  unsigned int colors, size, masks = 0;
1985  unsigned int colorsize;
1986 
1987  colorsize = (coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) :
1988  (coloruse == DIB_PAL_INDICES) ? 0 :
1989  sizeof(WORD);
1990 
1991  if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
1992  {
1993  const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info;
1994  colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0;
1995  return sizeof(BITMAPCOREHEADER) + colors * colorsize;
1996  }
1997  else /* Assume BITMAPINFOHEADER */
1998  {
1999  colors = info->bmiHeader.biClrUsed;
2000  if (colors > 256) colors = 256;
2001  if (!colors && (info->bmiHeader.biBitCount <= 8))
2002  colors = 1 << info->bmiHeader.biBitCount;
2003  if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
2004  size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) );
2005  return size + colors * colorsize;
2006  }
2007 }
#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 2055 of file dibobj.c.

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

2056 {
2058  BITMAPINFO* pNewBmi ;
2059  UINT numColors = 0, ColorsSize = 0;
2060 
2061  if(pbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER)) return (BITMAPINFO*)pbmi;
2062  if(pbmi->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) return NULL;
2063 
2064  if(pbmci->bmciHeader.bcBitCount <= 8)
2065  {
2066  numColors = 1 << pbmci->bmciHeader.bcBitCount;
2067  if(Usage == DIB_PAL_COLORS)
2068  {
2069  ColorsSize = numColors * sizeof(WORD);
2070  }
2071  else
2072  {
2073  ColorsSize = numColors * sizeof(RGBQUAD);
2074  }
2075  }
2076  else if (Usage == DIB_PAL_COLORS)
2077  {
2078  /* Invalid at high-res */
2079  return NULL;
2080  }
2081 
2082  pNewBmi = ExAllocatePoolWithTag(PagedPool, sizeof(BITMAPINFOHEADER) + ColorsSize, TAG_DIB);
2083  if(!pNewBmi) return NULL;
2084 
2085  RtlZeroMemory(pNewBmi, sizeof(BITMAPINFOHEADER) + ColorsSize);
2086 
2087  pNewBmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
2088  pNewBmi->bmiHeader.biBitCount = pbmci->bmciHeader.bcBitCount;
2089  pNewBmi->bmiHeader.biWidth = pbmci->bmciHeader.bcWidth;
2090  pNewBmi->bmiHeader.biHeight = pbmci->bmciHeader.bcHeight;
2091  pNewBmi->bmiHeader.biPlanes = pbmci->bmciHeader.bcPlanes;
2092  pNewBmi->bmiHeader.biCompression = BI_RGB ;
2094  pNewBmi->bmiHeader.biHeight,
2095  pNewBmi->bmiHeader.biBitCount);
2096  pNewBmi->bmiHeader.biClrUsed = numColors;
2097 
2098  if(Usage == DIB_PAL_COLORS)
2099  {
2100  RtlCopyMemory(pNewBmi->bmiColors, pbmci->bmciColors, ColorsSize);
2101  }
2102  else
2103  {
2104  UINT i;
2105  for(i=0; i<numColors; i++)
2106  {
2107  pNewBmi->bmiColors[i].rgbRed = pbmci->bmciColors[i].rgbtRed;
2108  pNewBmi->bmiColors[i].rgbGreen = pbmci->bmciColors[i].rgbtGreen;
2109  pNewBmi->bmiColors[i].rgbBlue = pbmci->bmciColors[i].rgbtBlue;
2110  }
2111  }
2112 
2113  return pNewBmi ;
2114 }
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:513
#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:1970
#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:262
#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 1728 of file dibobj.c.

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

1736 {
1737  HBITMAP res = 0;
1738  SURFACE *bmp = NULL;
1739  void *mapBits = NULL;
1740  PPALETTE ppalDIB = NULL;
1741 
1742  // Fill BITMAP32 structure with DIB data
1743  CONST BITMAPINFOHEADER *bi = &bmi->bmiHeader;
1744  INT effHeight;
1745  ULONG totalSize;
1746  BITMAP bm;
1747  //SIZEL Size;
1748  HANDLE hSecure;
1749 
1750  DPRINT("format (%ld,%ld), planes %u, bpp %u, size %lu, colors %lu (%s)\n",
1751  bi->biWidth, bi->biHeight, bi->biPlanes, bi->biBitCount,
1752  bi->biSizeImage, bi->biClrUsed, usage == DIB_PAL_COLORS? "PAL" : "RGB");
1753 
1754  /* CreateDIBSection should fail for compressed formats */
1755  if (bi->biCompression == BI_RLE4 || bi->biCompression == BI_RLE8)
1756  {
1757  DPRINT1("no compressed format allowed\n");
1758  return (HBITMAP)NULL;
1759  }
1760 
1761  effHeight = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight;
1762  bm.bmType = 0;
1763  bm.bmWidth = bi->biWidth;
1764  bm.bmHeight = effHeight;
1765  bm.bmWidthBytes = ovr_pitch ? ovr_pitch : WIDTH_BYTES_ALIGN32(bm.bmWidth, bi->biBitCount);
1766 
1767  bm.bmPlanes = bi->biPlanes;
1768  bm.bmBitsPixel = bi->biBitCount;
1769  bm.bmBits = NULL;
1770 
1771  // Get storage location for DIB bits. Only use biSizeImage if it's valid and
1772  // we're dealing with a compressed bitmap. Otherwise, use width * height.
1773  totalSize = (bi->biSizeImage && (bi->biCompression != BI_RGB) && (bi->biCompression != BI_BITFIELDS))
1774  ? bi->biSizeImage : (ULONG)(bm.bmWidthBytes * effHeight);
1775 
1776  if (section)
1777  {
1779  NTSTATUS Status;
1780  DWORD mapOffset;
1782  SIZE_T mapSize;
1783 
1785  &Sbi,
1786  sizeof Sbi,
1787  0);
1788  if (!NT_SUCCESS(Status))
1789  {
1790  DPRINT1("ZwQuerySystemInformation failed (0x%lx)\n", Status);
1791  return NULL;
1792  }
1793 
1794  mapOffset = offset - (offset % Sbi.AllocationGranularity);
1795  mapSize = totalSize + (offset - mapOffset);
1796 
1797  SectionOffset.LowPart = mapOffset;
1798  SectionOffset.HighPart = 0;
1799 
1800  Status = ZwMapViewOfSection(section,
1801  NtCurrentProcess(),
1802  &mapBits,
1803  0,
1804  0,
1805  &SectionOffset,
1806  &mapSize,
1807  ViewShare,
1808  0,
1809  PAGE_READWRITE);
1810  if (!NT_SUCCESS(Status))
1811  {
1812  DPRINT1("ZwMapViewOfSection failed (0x%lx)\n", Status);
1814  return NULL;
1815  }
1816 
1817  if (mapBits) bm.bmBits = (char *)mapBits + (offset - mapOffset);
1818  }
1819  else if (ovr_pitch && offset)
1820  bm.bmBits = (LPVOID) offset;
1821  else
1822  {
1823  offset = 0;
1824  bm.bmBits = EngAllocUserMem(totalSize, 0);
1825  if(!bm.bmBits)
1826  {
1827  DPRINT1("Failed to allocate memory\n");
1828  goto cleanup;
1829  }
1830  }
1831 
1832 // hSecure = MmSecureVirtualMemory(bm.bmBits, totalSize, PAGE_READWRITE);
1833  hSecure = (HANDLE)0x1; // HACK OF UNIMPLEMENTED KERNEL STUFF !!!!
1834 
1835 
1836  // Create Device Dependent Bitmap and add DIB pointer
1837  //Size.cx = bm.bmWidth;
1838  //Size.cy = abs(bm.bmHeight);
1839  res = GreCreateBitmapEx(bm.bmWidth,
1840  abs(bm.bmHeight),
1841  bm.bmWidthBytes,
1842  BitmapFormat(bi->biBitCount * bi->biPlanes, bi->biCompression),
1844  ((bi->biHeight < 0) ? BMF_TOPDOWN : 0),
1845  totalSize,
1846  bm.bmBits,
1847  0);
1848  if (!res)
1849  {
1850  DPRINT1("GreCreateBitmapEx failed\n");
1852  goto cleanup;
1853  }
1854  bmp = SURFACE_ShareLockSurface(res); // HACK
1855  if (NULL == bmp)
1856  {
1857  DPRINT1("SURFACE_LockSurface failed\n");
1859  goto cleanup;
1860  }
1861 
1862  /* WINE NOTE: WINE makes use of a colormap, which is a color translation
1863  table between the DIB and the X physical device. Obviously,
1864  this is left out of the ReactOS implementation. Instead,
1865  we call NtGdiSetDIBColorTable. */
1866  bmp->hDIBSection = section;
1867  bmp->hSecure = hSecure;
1868  bmp->dwOffset = offset;
1869  bmp->flags = API_BITMAP;
1870  bmp->biClrImportant = bi->biClrImportant;
1871 
1872  /* Create a palette for the DIB */
1873  ppalDIB = CreateDIBPalette(bmi, dc, usage);
1874 
1875  // Clean up in case of errors
1876 cleanup:
1877  if (!res || !bmp || !bm.bmBits || !ppalDIB)
1878  {
1879  DPRINT("Got an error res=%p, bmp=%p, bm.bmBits=%p\n", res, bmp, bm.bmBits);
1880  if (bm.bmBits)
1881  {
1882  // MmUnsecureVirtualMemory(hSecure); // FIXME: Implement this!
1883  if (section)
1884  {
1885  ZwUnmapViewOfSection(NtCurrentProcess(), mapBits);
1886  bm.bmBits = NULL;
1887  }
1888  else if (!offset)
1889  EngFreeUserMem(bm.bmBits), bm.bmBits = NULL;
1890  }
1891 
1892  if (bmp)
1893  {
1895  bmp = NULL;
1896  }
1897 
1898  if (res)
1899  {
1900  GreDeleteObject(res);
1901  res = 0;
1902  }
1903 
1904  if(ppalDIB)
1905  {
1906  PALETTE_ShareUnlockPalette(ppalDIB);
1907  }
1908  }
1909 
1910  if (bmp)
1911  {
1912  /* If we're here, everything went fine */
1913  SURFACE_vSetPalette(bmp, ppalDIB);
1914  PALETTE_ShareUnlockPalette(ppalDIB);
1916  }
1917 
1918  // Return BITMAP handle and storage location
1919  if (NULL != bm.bmBits && NULL != bits)
1920  {
1921  *bits = bm.bmBits;
1922  }
1923 
1924  return res;
1925 }
#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:57
#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:513
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 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:105
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:79
#define NT_SUCCESS(StatCode)
Definition: cmd.c:149
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 2119 of file dibobj.c.

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

2120 {
2121  BITMAPCOREINFO* pbmci;
2122  if(converted == orig)
2123  return;
2124 
2125  if(usage == -1)
2126  {
2127  /* Caller don't want any conversion */
2128  ExFreePoolWithTag(converted, TAG_DIB);
2129  return;
2130  }
2131 
2132  /* Perform inverse conversion */
2133  pbmci = (BITMAPCOREINFO*)orig;
2134 
2135  ASSERT(pbmci->bmciHeader.bcSize == sizeof(BITMAPCOREHEADER));
2136  pbmci->bmciHeader.bcBitCount = converted->bmiHeader.biBitCount;
2137  pbmci->bmciHeader.bcWidth = converted->bmiHeader.biWidth;
2138  pbmci->bmciHeader.bcHeight = converted->bmiHeader.biHeight;
2139  pbmci->bmciHeader.bcPlanes = converted->bmiHeader.biPlanes;
2140 
2141  if(pbmci->bmciHeader.bcBitCount <= 8)
2142  {
2143  UINT numColors = converted->bmiHeader.biClrUsed;
2144  if(!numColors) numColors = 1 << pbmci->bmciHeader.bcBitCount;
2145  if(usage == DIB_PAL_COLORS)
2146  {
2147  RtlZeroMemory(pbmci->bmciColors, (1 << pbmci->bmciHeader.bcBitCount) * sizeof(WORD));
2148  RtlCopyMemory(pbmci->bmciColors, converted->bmiColors, numColors * sizeof(WORD));
2149  }
2150  else
2151  {
2152  UINT i;
2153  RtlZeroMemory(pbmci->bmciColors, (1 << pbmci->bmciHeader.bcBitCount) * sizeof(RGBTRIPLE));
2154  for(i=0; i<numColors; i++)
2155  {
2156  pbmci->bmciColors[i].rgbtRed = converted->bmiColors[i].rgbRed;
2157  pbmci->bmciColors[i].rgbtGreen = converted->bmiColors[i].rgbGreen;
2158  pbmci->bmciColors[i].rgbtBlue = converted->bmiColors[i].rgbBlue;
2159  }
2160  }
2161  }
2162  /* Now free it, it's not needed anymore */
2163  ExFreePoolWithTag(converted, TAG_DIB);
2164 }
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:262
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 1935 of file dibobj.c.

Referenced by GreGetDIBitsInternal().

1937 {
1938  if (header->biSize == sizeof(BITMAPCOREHEADER))
1939  {
1940  const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)header;
1941  *width = core->bcWidth;
1942  *height = core->bcHeight;
1943  *planes = core->bcPlanes;
1944  *bpp = core->bcBitCount;
1945  *compr = BI_RGB;
1946  *size = 0;
1947  return 0;
1948  }
1949  if (header->biSize >= sizeof(BITMAPINFOHEADER)) /* Assume BITMAPINFOHEADER */
1950  {
1951  *width = header->biWidth;
1952  *height = header->biHeight;
1953  *planes = header->biPlanes;
1954  *bpp = header->biBitCount;
1955  *compr = header->biCompression;
1956  *size = header->biSizeImage;
1957  return 1;
1958  }
1959  DPRINT1("(%u): unknown/wrong size for header\n", header->biSize );
1960  return -1;
1961 }
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 1970 of file dibobj.c.

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

1971 {
1972  return WIDTH_BYTES_ALIGN32(width, depth) * (height < 0 ? -height : height);
1973 }
#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 2011 of file dibobj.c.

2012 {
2013  PPALETTE ppalNew;
2014  ULONG nNumColors,i;
2015  USHORT *lpIndex;
2016  HPALETTE hpal;
2017 
2018  if (!(ppalDc->flFlags & PAL_INDEXED))
2019  {
2020  return NULL;
2021  }
2022 
2023  nNumColors = 1 << lpbmi->bmiHeader.biBitCount;
2024  if (lpbmi->bmiHeader.biClrUsed)
2025  {
2026  nNumColors = min(nNumColors, lpbmi->bmiHeader.biClrUsed);
2027  }
2028 
2029  ppalNew = PALETTE_AllocPalWithHandle(PAL_INDEXED, nNumColors, NULL, 0, 0, 0);
2030  if (ppalNew == NULL)
2031  {
2032  DPRINT1("Could not allocate palette\n");
2033  return NULL;
2034  }
2035 
2036  lpIndex = (USHORT *)((PBYTE)lpbmi + lpbmi->bmiHeader.biSize);
2037 
2038  for (i = 0; i < nNumColors; i++)
2039  {
2040  ULONG iColorIndex = *lpIndex % ppalDc->NumColors;
2041  ppalNew->IndexedColors[i] = ppalDc->IndexedColors[iColorIndex];
2042  lpIndex++;
2043  }
2044 
2045  hpal = ppalNew->BaseObject.hHmgr;
2046  PALETTE_UnlockPalette(ppalNew);
2047 
2048  return hpal;
2049 }
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:513
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 1610 of file dibobj.c.

Referenced by NtGdiCreateDIBBrush().

1614 {
1615  PBITMAPINFO pbmi;
1616  PBYTE pjBits;
1617  UINT cjInfo, cjBits;
1618  HBITMAP hbm;
1619 
1620  /* We only support BITMAPINFOHEADER, make sure the size is ok */
1621  if (cjPackedDIB < sizeof(BITMAPINFOHEADER))
1622  {
1623  return NULL;
1624  }
1625 
1626  /* The packed DIB starts with the BITMAPINFOHEADER */
1627  pbmi = pvPackedDIB;
1628 
1629  if (cjPackedDIB < pbmi->bmiHeader.biSize)
1630  {
1631  return NULL;
1632  }
1633 
1634  /* Calculate the info size and make sure the packed DIB is large enough */
1635  cjInfo = DIB_BitmapInfoSize(pbmi, uUsage);
1636  if (cjPackedDIB <= cjInfo)
1637  {
1638  return NULL;
1639  }
1640 
1641  /* The bitmap bits start after the header */
1642  pjBits = (PBYTE)pvPackedDIB + cjInfo;
1643  cjBits = cjPackedDIB - cjInfo;
1644 
1646  pbmi->bmiHeader.biWidth,
1647  abs(pbmi->bmiHeader.biHeight),
1649  pjBits,
1650  pbmi,
1651  uUsage,
1652  0,
1653  cjBits,
1654  NULL);
1655 
1656  return hbm;
1657 }
#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:1534
#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:1982
#define CBM_INIT
Definition: wingdi.h:363
smooth NULL
Definition: ftsmooth.c:513
_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 674 of file dibobj.c.

Referenced by _Success_(), and IntSynthesizeDib().

684 {
685  BITMAPCOREINFO* pbmci = NULL;
686  PSURFACE psurf = NULL;
687  PDC pDC;
688  LONG width, height;
689  WORD planes, bpp;
690  DWORD compr, size ;
691  USHORT i;
692  int bitmap_type;
693  RGBQUAD* rgbQuads;
694  VOID* colorPtr;
695 
696  DPRINT("Entered GreGetDIBitsInternal()\n");
697 
698  if ((Usage && Usage != DIB_PAL_COLORS) || !Info || !hBitmap)
699  return 0;
700 
701  pDC = DC_LockDc(hDC);
702  if (pDC == NULL || pDC->dctype == DC_TYPE_INFO)
703  {
704  ScanLines = 0;
705  goto done;
706  }
707 
708  /* Get a pointer to the source bitmap object */
710  if (psurf == NULL)
711  {
712  ScanLines = 0;
713  goto done;
714  }
715 
716  colorPtr = (LPBYTE)Info + Info->bmiHeader.biSize;
717  rgbQuads = colorPtr;
718 
719  bitmap_type = DIB_GetBitmapInfo(&Info->bmiHeader,
720  &width,
721  &height,
722  &planes,
723  &bpp,
724  &compr,
725  &size);
726  if(bitmap_type == -1)
727  {
728  DPRINT("Wrong bitmap format\n");
730  ScanLines = 0;
731  goto done;
732  }
733  else if(bitmap_type == 0)
734  {
735  /* We need a BITMAPINFO to create a DIB, but we have to fill
736  * the BITMAPCOREINFO we're provided */
737  pbmci = (BITMAPCOREINFO*)Info;
738  /* fill in the the bit count, so we can calculate the right ColorsSize during the conversion */
740  Info = DIB_ConvertBitmapInfo((BITMAPINFO*)pbmci, Usage);
741  if(Info == NULL)
742  {
743  DPRINT1("Error, could not convert the BITMAPCOREINFO!\n");
744  ScanLines = 0;
745  goto done;
746  }
747  rgbQuads = Info->bmiColors;
748  }
749 
750  /* Validate input:
751  - negative width is always an invalid value
752  - non-null Bits and zero bpp is an invalid combination
753  - only check the rest of the input params if either bpp is non-zero or Bits are set */
754  if (width < 0 || (bpp == 0 && Bits))
755  {
756  ScanLines = 0;
757  goto done;
758  }
759 
760  if (Bits || bpp)
761  {
762  if ((height == 0 || width == 0) || (compr && compr != BI_BITFIELDS && compr != BI_RGB))
763  {
764  ScanLines = 0;
765  goto done;
766  }
767  }
768 
769  Info->bmiHeader.biClrUsed = 0;
770  Info->bmiHeader.biClrImportant = 0;
771 
772  /* Fill in the structure */
773  switch(bpp)
774  {
775  case 0: /* Only info */
776  Info->bmiHeader.biWidth = psurf->SurfObj.sizlBitmap.cx;
777  Info->bmiHeader.biHeight = (psurf->SurfObj.fjBitmap & BMF_TOPDOWN) ?
778  -psurf->SurfObj.sizlBitmap.cy :
779  psurf->SurfObj.sizlBitmap.cy;
780  Info->bmiHeader.biPlanes = 1;
783  Info->bmiHeader.biHeight,
784  Info->bmiHeader.biBitCount);
785  Info->bmiHeader.biCompression = (Info->bmiHeader.biBitCount == 16 || Info->bmiHeader.biBitCount == 32) ?
787  Info->bmiHeader.biXPelsPerMeter = 0;
788  Info->bmiHeader.biYPelsPerMeter = 0;
789 
790  if (Info->bmiHeader.biBitCount <= 8 && Info->bmiHeader.biClrUsed == 0)
791  Info->bmiHeader.biClrUsed = 1 << Info->bmiHeader.biBitCount;
792 
793  ScanLines = 1;
794  goto done;
795 
796  case 1:
797  case 4:
798  case 8:
799  Info->bmiHeader.biClrUsed = 1 << bpp;
800 
801  /* If the bitmap is a DIB section and has the same format as what
802  * is requested, go ahead! */
803  if((psurf->hSecure) &&
804  (BitsPerFormat(psurf->SurfObj.iBitmapFormat) == bpp))
805  {
806  if(Usage == DIB_RGB_COLORS)
807  {
808  ULONG colors = min(psurf->ppal->NumColors, 256);
809  if(colors != 256) Info->bmiHeader.biClrUsed = colors;
810  for(i = 0; i < colors; i++)
811  {
812  rgbQuads[i].rgbRed = psurf->ppal->IndexedColors[i].peRed;
813  rgbQuads[i].rgbGreen = psurf->ppal->IndexedColors[i].peGreen;
814  rgbQuads[i].rgbBlue = psurf->ppal->IndexedColors[i].peBlue;
815  rgbQuads[i].rgbReserved = 0;
816  }
817  }
818  else
819  {
820  for(i = 0; i < 256; i++)
821  ((WORD*)rgbQuads)[i] = i;
822  }
823  }
824  else
825  {
826  if(Usage == DIB_PAL_COLORS)
827  {
828  for(i = 0; i < 256; i++)
829  {
830  ((WORD*)rgbQuads)[i] = i;
831  }
832  }
833  else if(bpp > 1 && bpp == BitsPerFormat(psurf->SurfObj.iBitmapFormat))
834  {
835  /* For color DDBs in native depth (mono DDBs always have
836  a black/white palette):
837  Generate the color map from the selected palette */
838  PPALETTE pDcPal = PALETTE_ShareLockPalette(pDC->dclevel.hpal);
839  if(!pDcPal)
840  {
841  ScanLines = 0 ;
842  goto done ;
843  }
844  for (i = 0; i < pDcPal->NumColors; i++)
845  {
846  rgbQuads[i].rgbRed = pDcPal->IndexedColors[i].peRed;
847  rgbQuads[i].rgbGreen = pDcPal->IndexedColors[i].peGreen;
848  rgbQuads[i].rgbBlue = pDcPal->IndexedColors[i].peBlue;
849  rgbQuads[i].rgbReserved = 0;
850  }
852  }
853  else
854  {
855  switch (bpp)
856  {
857  case 1:
858  rgbQuads[0].rgbRed = rgbQuads[0].rgbGreen = rgbQuads[0].rgbBlue = 0;
859  rgbQuads[0].rgbReserved = 0;
860  rgbQuads[1].rgbRed = rgbQuads[1].rgbGreen = rgbQuads[1].rgbBlue = 0xff;
861  rgbQuads[1].rgbReserved = 0;
862  break;
863 
864  case 4:
865  /* The EGA palette is the first and last 8 colours of the default palette
866  with the innermost pair swapped */
867  RtlCopyMemory(rgbQuads, DefLogPaletteQuads, 7 * sizeof(RGBQUAD));
868  RtlCopyMemory(rgbQuads + 7, DefLogPaletteQuads + 12, 1 * sizeof(RGBQUAD));
869  RtlCopyMemory(rgbQuads + 8, DefLogPaletteQuads + 7, 1 * sizeof(RGBQUAD));
870  RtlCopyMemory(rgbQuads + 9, DefLogPaletteQuads + 13, 7 * sizeof(RGBQUAD));
871  break;
872 
873  case 8:
874  {
875  INT i;
876 
877  memcpy(rgbQuads, DefLogPaletteQuads, 10 * sizeof(RGBQUAD));
878  memcpy(rgbQuads + 246, DefLogPaletteQuads + 10, 10 * sizeof(RGBQUAD));
879 
880  for (i = 10; i < 246; i++)
881  {
882  rgbQuads[i].rgbRed = (i & 0x07) << 5;
883  rgbQuads[i].rgbGreen = (i & 0x38) << 2;
884  rgbQuads[i].rgbBlue = i & 0xc0;
885  rgbQuads[i].rgbReserved = 0;
886  }
887  }
888  }
889  }
890  }
891  break;
892 
893  case 15:
894  if (Info->bmiHeader.biCompression == BI_BITFIELDS)
895  {
896  ((PDWORD)Info->bmiColors)[0] = 0x7c00;
897  ((PDWORD)Info->bmiColors)[1] = 0x03e0;
898  ((PDWORD)Info->bmiColors)[2] = 0x001f;
899  }
900  break;
901 
902  case 16:
903  if (Info->bmiHeader.biCompression == BI_BITFIELDS)
904  {
905  if (psurf->hSecure)
906  {
907  ((PDWORD)Info->bmiColors)[0] = psurf->ppal->RedMask;
908  ((PDWORD)Info->bmiColors)[1] = psurf->ppal->GreenMask;
909  ((PDWORD)Info->bmiColors)[2] = psurf->ppal->BlueMask;
910  }
911  else
912  {
913  ((PDWORD)Info->bmiColors)[0] = 0xf800;
914  ((PDWORD)Info->bmiColors)[1] = 0x07e0;
915  ((PDWORD)Info->bmiColors)[2] = 0x001f;
916  }
917  }
918  break;
919 
920  case 24:
921  case 32:
922  if (Info->bmiHeader.biCompression == BI_BITFIELDS)
923  {
924  if (psurf->hSecure)
925  {
926  ((PDWORD)Info->bmiColors)[0] = psurf->ppal->RedMask;
927  ((PDWORD)Info->bmiColors)[1] = psurf->ppal->GreenMask;
928  ((PDWORD)Info->bmiColors)[2] = psurf->ppal->BlueMask;
929  }
930  else
931  {
932  ((PDWORD)Info->bmiColors)[0] = 0xff0000;
933  ((PDWORD)Info->bmiColors)[1] = 0x00ff00;
934  ((PDWORD)Info->bmiColors)[2] = 0x0000ff;
935  }
936  }
937  break;
938 
939  default:
940  ScanLines = 0;
941  goto done;
942  }
943 
944  Info->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(width, height, bpp);
945  Info->bmiHeader.biPlanes = 1;
946 
947  if(Bits && ScanLines)
948  {
949  /* Create a DIBSECTION, blt it, profit */
950  PVOID pDIBits ;
951  HBITMAP hBmpDest;
952  PSURFACE psurfDest;
953  EXLATEOBJ exlo;
954  RECT rcDest;
955  POINTL srcPoint;
956  BOOL ret ;
957 
958  if (StartScan > (ULONG)psurf->SurfObj.sizlBitmap.cy)
959  {
960  ScanLines = 0;
961  goto done;
962  }
963  else
964  {
965  ScanLines = min(ScanLines, psurf->SurfObj.sizlBitmap.cy - StartScan);
966  }
967 
968  /* Fixup values */
969  Info->bmiHeader.biWidth = psurf->SurfObj.sizlBitmap.cx;
970  Info->bmiHeader.biHeight = (height < 0) ?
971  -(LONG)ScanLines : ScanLines;
972  /* Create the DIB */
973  hBmpDest = DIB_CreateDIBSection(pDC, Info, Usage, &pDIBits, NULL, 0, 0);
974  /* Restore them */
975  Info->bmiHeader.biWidth = width;
976  Info->bmiHeader.biHeight = height;
977 
978  if(!hBmpDest)
979  {
980  DPRINT1("Unable to create a DIB Section!\n");
982  ScanLines = 0;
983  goto done ;
984  }
985 
986  psurfDest = SURFACE_ShareLockSurface(hBmpDest);
987 
988  RECTL_vSetRect(&rcDest, 0, 0, psurf->SurfObj.sizlBitmap.cx, ScanLines);
989 
990  srcPoint.x = 0;
991 
992  if(height < 0)
993  {
994  srcPoint.y = 0;
995 
996  if(ScanLines <= StartScan)
997  {
998  ScanLines = 1;
999  SURFACE_ShareUnlockSurface(psurfDest);
1000  GreDeleteObject(hBmpDest);
1001  goto done;
1002  }
1003 
1004  ScanLines -= StartScan;
1005  }
1006  else
1007  {
1008  srcPoint.y = StartScan;
1009  }
1010 
1011  EXLATEOBJ_vInitialize(&exlo, psurf->ppal, psurfDest->ppal, 0xffffff, 0xffffff, 0);
1012 
1013  ret = IntEngCopyBits(&psurfDest->SurfObj,
1014  &psurf->SurfObj,
1015  NULL,
1016  &exlo.xlo,
1017  &rcDest,
1018  &srcPoint);
1019 
1020  SURFACE_ShareUnlockSurface(psurfDest);
1021 
1022  if(!ret)
1023  ScanLines = 0;
1024  else
1025  {
1026  RtlCopyMemory(Bits, pDIBits, DIB_GetDIBImageBytes (width, ScanLines, bpp));
1027  }
1028 
1029  GreDeleteObject(hBmpDest);
1030  EXLATEOBJ_vCleanup(&exlo);
1031  }
1032  else
1033  {
1034  /* Signals success and not the actual number of scan lines*/
1035  ScanLines = 1;
1036  }
1037 
1038 done:
1039 
1040  if (pbmci)
1042 
1043  if (psurf)
1045 
1046  if (pDC)
1047  DC_UnlockDc(pDC);
1048 
1049  return ScanLines;
1050 }
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:1728
#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:53
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:57
#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:2055
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:1935
SURFOBJ SurfObj
Definition: surface.h:8
DWORD biCompression
Definition: amvideo.idl:35
smooth NULL
Definition: ftsmooth.c:513
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:1970
int ret
HANDLE hSecure
Definition: surface.h:32
VOID FASTCALL DIB_FreeConvertedBitmapInfo(BITMAPINFO *converted, BITMAPINFO *orig, DWORD usage)
Definition: dibobj.c:2119
#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