NewBitmapInfo = ConvertBitmapInfo(OldBitmapInfo, DIB_RGB_COLORS,
&NewBitmapInfoSize, FALSE); if (NewBitmapInfo) { <do something with the bitmap info> if (NewBitmapInfo != OldBitmapInfo) RtlFreeHeap(RtlGetProcessHeap(), 0, NewBitmapInfo); }
#include <precomp.h>
{
{
ClrUsed = 0;
}
else
{
BitCount = BitmapInfoHeader->biBitCount;
ClrUsed = BitmapInfoHeader->biClrUsed;
Compression = BitmapInfoHeader->biCompression;
}
switch (Compression)
{
if (BitCount != 16 && BitCount != 32)
*ColorTableSize = 0;
else
*ColorTableSize = 3;
switch (BitCount)
{
case 1:
*ColorTableSize = ClrUsed ?
min(ClrUsed, 2) : 2;
case 4:
*ColorTableSize = ClrUsed ?
min(ClrUsed, 16) : 16;
case 8:
*ColorTableSize = ClrUsed ?
min(ClrUsed, 256) : 256;
default:
if (BitCount != 16 && BitCount != 24 && BitCount != 32)
*ColorTableSize = ClrUsed;
}
if (BitCount == 4)
{
*ColorTableSize = ClrUsed ?
min(ClrUsed, 16) : 16;
}
if (BitCount == 8)
{
*ColorTableSize = ClrUsed ?
min(ClrUsed, 256) : 256;
}
*ColorTableSize = ClrUsed;
default:
}
}
{
UINT PaletteEntryCount = 0;
if ( !BitmapInfo ||
BitmapInfo->bmiHeader.biSize > sizeof(BITMAPV5HEADER))))
{
}
&PaletteEntryCount))
{
}
if (FollowedByData)
{
}
{
else
if (NewBitmapInfo ==
NULL)
{
}
if (PaletteEntryCount != 0)
{
{
{
}
}
else
{
PaletteEntryCount *
sizeof(
USHORT));
}
}
if (FollowedByData)
{
{
PaletteEntryCount);
PaletteEntryCount);
}
else
{
PaletteEntryCount *
sizeof(
USHORT);
PaletteEntryCount *
sizeof(
USHORT);
}
}
}
else
{
switch (BitmapInfo->bmiHeader.biCompression)
{
if (BitmapInfo->bmiHeader.biBitCount != 8)
if (BitmapInfo->bmiHeader.biHeight < 0)
break;
if (BitmapInfo->bmiHeader.biBitCount != 4)
if (BitmapInfo->bmiHeader.biHeight < 0)
break;
default:
break;
}
if ((BitmapInfo->bmiHeader.biCompression !=
BI_RGB) &&
{
if (BitmapInfo->bmiHeader.biSizeImage == 0)
}
}
else
return NewBitmapInfo;
}
{
#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len )
#define COPYN(f) pW->f = pA->f
#undef COPYN
#undef COPYS
}
{
#define COPYS(f,len) WideCharToMultiByte ( CP_THREAD_ACP, 0, pW->f, len, pA->f, len, NULL, NULL )
#define COPYN(f) pA->f = pW->f
#undef COPYN
#undef COPYS
}
{
}
{
{
switch (LpkFunctionID)
{
{
}
{
}
{
}
default:
}
}
else
}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
#define GetProcAddress(x, y)
#define WideCharToMultiByte
static const WCHAR fontW[]
VOID WINAPI EnumLogFontExW2A(LPENUMLOGFONTEXA fontA, CONST ENUMLOGFONTEXW *fontW)
BOOL WINAPI CalculateColorTableSize(CONST BITMAPINFOHEADER *BitmapInfoHeader, UINT *ColorSpec, UINT *ColorTableSize)
VOID NTAPI LogFontA2W(LPLOGFONTW pW, CONST LOGFONTA *pA)
BOOL(WINAPI * LPKETO)(HDC hdc, int x, int y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT uCount, const INT *lpDx, INT unknown)
LPKGCP LpkGetCharacterPlacement
VOID NTAPI LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW)
int WINAPI GdiGetBitmapBitsSize(BITMAPINFO *lpbmi)
BOOL WINAPI LoadLPK(INT LpkFunctionID)
LPBITMAPINFO WINAPI ConvertBitmapInfo(CONST BITMAPINFO *BitmapInfo, UINT ColorSpec, UINT *BitmapInfoSize, BOOL FollowedByData)
BOOL(WINAPI * LPKGTEP)(HDC hdc, LPCWSTR lpString, INT cString, INT nMaxExtent, LPINT lpnFit, LPINT lpnDx, LPSIZE lpSize, DWORD dwUnused, int unknown)
DWORD(WINAPI * LPKGCP)(HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, LPGCP_RESULTSW lpResults, DWORD dwFlags, DWORD dwUnused)
LPKGTEP LpkGetTextExtentExPoint
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
BITMAPCOREHEADER bmciHeader
BITMAPINFOHEADER bmiHeader
CHAR lfFaceName[LF_FACESIZE]
WCHAR lfFaceName[LF_FACESIZE]
#define RtlCopyMemory(Destination, Source, Length)
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
struct _BITMAPCOREINFO * LPBITMAPCOREINFO
struct tagBITMAPINFO * LPBITMAPINFO
struct tagBITMAPCOREHEADER * LPBITMAPCOREHEADER