47#define PNG_CHECK_SIG_SIZE 8
67 ERR(
"png read error\n");
68 png_error(
png_ptr,
"read error in ReadMemoryPng");
79 static BOOL bLibPngFound = -1;
80 if (bLibPngFound == -1)
83 bLibPngFound = !!hLibPng;
98 TRACE(
"pngBits %p fileSize %d\n", pngBits, fileSize);
102 ERR(
"No libpng.dll\n");
112 ERR(
"png_create_read_struct error\n");
119 ERR(
"png_create_info_struct error\n");
135 png_set_palette_to_rgb(
png_ptr);
145 TRACE(
"width %d, height %d, bitDepth %d, colorType %d\n",
157 ERR(
"png_malloc failed\n");
164 rows[
i] = png_malloc(
png_ptr, rowbytes);
167 ERR(
"png_malloc failed\n");
188 PBYTE pb = imageBytes;
212 ERR(
"HeapAlloc failed\n");
245 ERR(
"HeapAlloc failed\n");
251 PBYTE pb = pbBmpIcon;
265#undef MAKEINTRESOURCE
266#define MAKEINTRESOURCE MAKEINTRESOURCEW
272 if (!
gpsi->hIconSmWindows)
274 ERR(
"Loading System Cursors\n");
298 ULONG ArgumentLength)
300 BOOL *DefaultCursor = (
BOOL*)Arguments;
374 if ((
rgb->rgbtRed == 0) && (
rgb->rgbtGreen == 0) && (
rgb->rgbtBlue == 0))
379 return ((
rgb->rgbtRed == 0xff) && (
rgb->rgbtGreen == 0xff)
380 && (
rgb->rgbtBlue == 0xff));
388 if (
info->bmiHeader.biBitCount != 1)
return FALSE;
391 if ((
rgb->rgbRed == 0) && (
rgb->rgbGreen == 0) &&
392 (
rgb->rgbBlue == 0) && (
rgb->rgbReserved == 0))
397 return ((
rgb->rgbRed == 0xff) && (
rgb->rgbGreen == 0xff)
398 && (
rgb->rgbBlue == 0xff) && (
rgb->rgbReserved == 0));
419 colors =
info->bmiHeader.biClrUsed;
422 if (!colors && (
info->bmiHeader.biBitCount <= 8))
423 colors = 1 <<
info->bmiHeader.biBitCount;
435 (
info->bmiHeader.biBitCount == 16 ||
info->bmiHeader.biBitCount == 32))
449 #define HighBitDetect 0x89
463 header->biSize ==
sizeof(BITMAPV5HEADER))
473 TRACE(
"We have a PNG icon\n");
478 ERR(
"Unknown/wrong size for header of 0x%x\n",
header->biSize );
502 info->bmiHeader.biWidth = bm.bmWidth;
503 info->bmiHeader.biHeight = bm.bmHeight;
508 info->bmiHeader.biXPelsPerMeter = 0;
509 info->bmiHeader.biYPelsPerMeter = 0;
510 info->bmiHeader.biClrUsed = 0;
511 info->bmiHeader.biClrImportant = 0;
522 StretchBlt( hdc_dst, 0, 0, dst_width, dst_height,
hdc, 0, 0, bm.bmWidth, bm.bmHeight,
SRCCOPY );
536 const unsigned char *
ptr =
bits;
538 if (
info->bmiHeader.biBitCount != 32)
return FALSE;
539 for (
i = 0;
i <
info->bmiHeader.biWidth *
abs(
info->bmiHeader.biHeight);
i++,
ptr += 4)
540 if ((has_alpha = (
ptr[3] != 0)))
break;
579 TRACE(
"Creating alpha bitmap from existing bitmap.\n");
583 if (bm.bmBitsPixel != 32)
592 info->bmiHeader.biWidth = bm.bmWidth;
593 info->bmiHeader.biHeight = -bm.bmHeight;
594 info->bmiHeader.biPlanes = 1;
595 info->bmiHeader.biBitCount = 32;
598 info->bmiHeader.biXPelsPerMeter = 0;
599 info->bmiHeader.biYPelsPerMeter = 0;
600 info->bmiHeader.biClrUsed = 0;
601 info->bmiHeader.biClrImportant = 0;
638 LONG orig_width, orig_height;
640 TRACE(
"Creating alpha bitmap from bitmap info.\n");
672 src_info->bmiHeader.biWidth =
width;
673 src_info->bmiHeader.biHeight =
height;
685 src_info->bmiHeader.biWidth = orig_width;
686 src_info->bmiHeader.biHeight = orig_height;
698 0, 0, orig_width, orig_height,
757 for(
i = 0;
i<
dir->idCount;
i++)
765 ERR(
"Corrupted icon file?.\n");
799 WARN(
"Unable to get a fit entry index.\n");
804 return &
dir->idEntries[
i-1];
824 ptHotSpot->x =
entry->xHotspot;
825 ptHotSpot->y =
entry->yHotspot;
829 return entry->dwDIBOffset;
853 const VOID *pvColor, *pvMask;
904 pvColor = (
const char*)
pbmi + ubmiSize;
905 pvMask = (
const char*)pvColor +
952 rgb[0].rgbBlue =
rgb[0].rgbGreen =
rgb[0].rgbRed = 0x00;
953 rgb[1].rgbBlue =
rgb[1].rgbGreen =
rgb[1].rgbRed = 0xff;
954 rgb[0].rgbReserved =
rgb[1].rgbReserved = 0;
962 rgb[1].rgbtBlue =
rgb[1].rgbtGreen =
rgb[1].rgbtRed = 0xff;
995 ZeroMemory(pCursorData,
sizeof(*pCursorData));
996 if(pIconInfo->hbmColor)
1003 if (!
GetObject(pIconInfo->hbmMask,
sizeof(bm), &bm))
1016 if (!pCursorData->hbmColor)
1033 if(!pCursorData->hbmMask)
1038 if(pCursorData->hbmColor)
1040 GetObject(pCursorData->hbmColor,
sizeof(bm), &bm);
1041 pCursorData->bpp = bm.bmBitsPixel;
1042 pCursorData->cx = bm.bmWidth;
1043 pCursorData->cy = bm.bmHeight;
1044 if(pCursorData->bpp == 32)
1049 GetObject(pCursorData->hbmMask,
sizeof(bm), &bm);
1050 pCursorData->bpp = 1;
1051 pCursorData->cx = bm.bmWidth;
1052 pCursorData->cy = bm.bmHeight/2;
1055 if(pIconInfo->fIcon)
1057 pCursorData->xHotspot = pCursorData->cx/2;
1058 pCursorData->yHotspot = pCursorData->cy/2;
1062 pCursorData->xHotspot = pIconInfo->xHotspot;
1063 pCursorData->yHotspot = pIconInfo->yHotspot;
1070#define RIFF_FOURCC( c0, c1, c2, c3 ) \
1071 ( (DWORD)(BYTE)(c0) | ( (DWORD)(BYTE)(c1) << 8 ) | \
1072 ( (DWORD)(BYTE)(c2) << 16 ) | ( (DWORD)(BYTE)(c3) << 24 ) )
1074#define ANI_RIFF_ID RIFF_FOURCC('R', 'I', 'F', 'F')
1075#define ANI_LIST_ID RIFF_FOURCC('L', 'I', 'S', 'T')
1076#define ANI_ACON_ID RIFF_FOURCC('A', 'C', 'O', 'N')
1077#define ANI_anih_ID RIFF_FOURCC('a', 'n', 'i', 'h')
1078#define ANI_seq__ID RIFF_FOURCC('s', 'e', 'q', ' ')
1079#define ANI_fram_ID RIFF_FOURCC('f', 'r', 'a', 'm')
1080#define ANI_rate_ID RIFF_FOURCC('r', 'a', 't', 'e')
1082#define ANI_FLAG_ICON 0x1
1083#define ANI_FLAG_SEQUENCE 0x2
1085#include <pshpack1.h>
1113 TRACE(
" display rate: %d\n",
header->display_rate);
1120 const unsigned char *
ptr = parent_chunk->
data;
1127 if ((!chunk_type && *(
const DWORD *)
ptr == chunk_id )
1128 || (chunk_type && *(
const DWORD *)
ptr == chunk_type && *((
const DWORD *)
ptr + 2) == chunk_id ))
1160 const unsigned char *icon_chunk;
1161 const unsigned char *icon_data;
1165 if (!ACON_chunk.
data)
1167 ERR(
"Failed to get root chunk.\n");
1173 if (!ACON_chunk.
data)
1175 ERR(
"Failed to get header chunk.\n");
1183 pCurData->cpcur =
pHeader->num_frames;
1184 pCurData->cicur =
pHeader->num_steps;
1185 pCurData->iicur =
pHeader->display_rate;
1191 if (!seq_chunk.
data)
1193 ERR(
"No sequence data although the flag is set!\n");
1200 if (rate_chunk.
data)
1201 pCurData->ajifRate = (
INT*)rate_chunk.
data;
1205 if (!fram_chunk.
data)
1207 ERR(
"Failed to get icon list.\n");
1210 icon_chunk = fram_chunk.
data;
1211 icon_data = fram_chunk.
data + (2 *
sizeof(
DWORD));
1218 if(!pCurData->aspcur)
1223 pCurData->aicur = (
DWORD*)(pCurData->aspcur +
pHeader->num_frames);
1224 pCurData->ajifRate = (
INT*)(pCurData->aicur +
pHeader->num_steps);
1230 const DWORD chunk_size = *(
const DWORD *)(icon_chunk +
sizeof(
DWORD));
1234 pFrameData = &pCurData->
aspcur[
i];
1236 pFrameData = pCurData;
1238 pFrameData->
rt = pCurData->rt;
1252 ERR(
"Unable to find the right file entry for frame %d.\n",
i);
1259 pFrameData->
cx = pDirEntry->
bWidth;
1286 icon_chunk += chunk_size + (2 *
sizeof(
DWORD));
1287 icon_data = icon_chunk + (2 *
sizeof(
DWORD));
1298 pCurData->ajifRate[
i] =
pHeader->display_rate;
1308 pCurData->aicur[
i] =
i;
1354 if (pbmfh->
bfType != 0x4d42 )
1356 WARN(
"Invalid/unsupported bitmap format!\n");
1389 WARN(
"Possibly bad resource size provided\n");
1402 cyDesired = -cyDesired;
1415 TRACE(
"Size Image %d, Size Header %d, ResSize %d\n",
1426 pvBits = (
char*)pvBits - 12;
1427 WARN(
"Found GCC Resource Compiled 16-bpp or 32-bpp error\n");
1436 COLORREF crWindow, cr3DShadow, cr3DFace, cr3DLight;
1443 numColors = 1 <<
bpp;
1453 if(numColors > 256) numColors = 256;
1454 if (!numColors && (
bpp <= 8)) numColors = 1 <<
bpp;
1473 case 1: pixel >>= 7;
break;
1474 case 4: pixel >>= 4;
break;
1477 FIXME(
"Unhandled bit depth %d.\n",
bpp);
1481 if(pixel >= numColors)
1483 ERR(
"Wrong pixel passed in.\n");
1499 for(
i = 0;
i<numColors;
i++)
1502 if((
ptr->rgbtBlue ==
ptr->rgbtRed) && (
ptr->rgbtBlue ==
ptr->rgbtGreen))
1504 if(
ptr->rgbtBlue == 128)
1510 if(
ptr->rgbtBlue == 192)
1516 if(
ptr->rgbtBlue == 223)
1552 if(cyDesired < 0) cyDesired = -cyDesired;
1583 ERR(
"StretchDIBits failed!.\n");
1622 DWORD filesize = 0, BmpIconSize;
1646 if(!cxDesired) cxDesired =
entry->bWidth;
1647 if(!cyDesired) cyDesired =
entry->bHeight;
1676 ERR(
"Failing file: '%S'.\n", lpszName);
1680 TRACE(
"Processing PNG/Vista icon: '%S'\n", lpszName);
1760 LPCWSTR fakeNameFmt =
sizeof(
void*) > 4 ?
L"\x01%016IX" :
L"\x01%08IX";
1809 TRACE(
"Checking for an LR_SHARED cursor/icon.\n");
1811 param.bIcon = bIcon;
1812 param.cx = cxDesired;
1813 param.cy = cyDesired;
1818 TRACE(
"MATCH! %p\n",hCurIcon);
1869 if(
dir->idType == 2)
1877 cursorData.
cx = cxDesired;
1878 cursorData.
cy = cyDesired;
1942 if (!objSize)
return 0;
1943 if ((desiredx < 0) || (desiredy < 0))
return 0;
1947 FIXME(
"The flag LR_COPYFROMRESOURCE is not implemented for bitmaps\n");
1952 FIXME(
"The flag LR_COPYRETURNORG is not implemented for bitmaps\n");
1955 if (desiredx == 0) desiredx =
ds.dsBm.bmWidth;
1956 if (desiredy == 0) desiredy =
ds.dsBm.bmHeight;
2008 if (!monochrome &&
ds.dsBm.bmBitsPixel == 1)
2032 else if (!monochrome)
2034 monochrome =
ds.dsBm.bmBitsPixel == 1;
2057 copyContents =
TRUE;
2065 copyContents = (
ds.dsBm.bmBitsPixel == 1 ||
ds.dsBm.bmBitsPixel == screen_depth);
2098 0, 0,
ds.dsBm.bmWidth,
ds.dsBm.bmHeight,
2142 if (!NtUserGetIconInfo(hicon,
NULL, &ustrModule, &ustrRsrc,
NULL,
FALSE))
2165 if (!NtUserGetIconInfo(hicon,
NULL, &ustrModule, &ustrRsrc,
NULL,
FALSE))
2178 TRACE(
"Got module %wZ, resource %p (%S).\n", &ustrModule,
2215 FIXME(
"Unimplemented flags: 0x%08x\n", fuFlags);
2219 ERR(
"GetIconInfo failed.\n");
2269#define COPYIMAGE_VALID_FLAGS ( \
2270 LR_SHARED | LR_COPYFROMRESOURCE | LR_CREATEDIBSECTION | LR_LOADMAP3DCOLORS | 0x800 | \
2271 LR_VGACOLOR | LR_LOADREALSIZE | LR_DEFAULTSIZE | LR_LOADTRANSPARENT | LR_LOADFROMFILE | \
2272 LR_COPYDELETEORG | LR_COPYRETURNORG | LR_COLOR | LR_MONOCHROME \
2283 TRACE(
"hImage=%p, uType=%u, cxDesired=%d, cyDesired=%d, fuFlags=%x\n",
2284 hImage, uType, cxDesired, cyDesired, fuFlags);
2320 ERR(
"GetIconInfo Failed. hImage %p\n", hImage);
2325 ERR(
"GetObject Failed. iconinfo %p\n", iconinfo);
2333 if (cxDesired == bm.bmWidth && cyDesired == bm.bmHeight)
2373 _In_opt_ HBRUSH hbrFlickerFreeDraw,
2378 istepIfAniCur, hbrFlickerFreeDraw, diFlags,
2549 TRACE(
"hinst 0x%p, name %s, uType 0x%08x, cxDesired %d, cyDesired %d, fuLoad 0x%08x.\n",
2587 int i, numMatch = 0, iIndex = -1;
2590 ULONG bestScore = 0xFFFFFFFF, score;
2592 TRACE(
"%p, %x, %i, %i, %x.\n", presbits, fIcon, cxDesired, cyDesired,
Flags);
2594 if(!(
dir && !
dir->idReserved && (
dir->idType & 3)))
2596 WARN(
"Invalid resource.\n");
2619 for(
i = 0;
i <
dir->idCount;
i++)
2622 width = fIcon ?
entry->ResInfo.icon.bWidth :
entry->ResInfo.cursor.wWidth;
2624 height = fIcon ?
entry->ResInfo.icon.bHeight :
entry->ResInfo.cursor.wHeight/2;
2630 if( score > bestScore)
2633 if(
width > cxDesired)
2634 score -=
width - cxDesired;
2636 score -=
height - cyDesired;
2637 if(score > bestScore)
2639 if(score == bestScore)
2641 if(
entry->wBitCount > BitCount)
2642 BitCount =
entry->wBitCount;
2649 BitCount =
entry->wBitCount;
2655 return dir->idEntries[iIndex].wResId;
2659 if (bppDesired > 8 && BitCount > 8)
2665 for(
i = 0;
i <
dir->idCount;
i++)
2668 width = fIcon ?
entry->ResInfo.icon.bWidth :
entry->ResInfo.cursor.wWidth;
2669 height = fIcon ?
entry->ResInfo.icon.bHeight :
entry->ResInfo.cursor.wHeight/2;
2675 if(
width > cxDesired)
2676 score -=
width - cxDesired;
2678 score -=
height - cyDesired;
2679 if(score != bestScore)
2682 if(
entry->wBitCount == bppDesired)
2683 return entry->wResId;
2685 if((
entry->wBitCount > BitCount) && (
entry->wBitCount < bppDesired))
2688 if ((
entry->wBitCount <= 8) && notPaletted)
2691 BitCount =
entry->wBitCount;
2696 return dir->idEntries[iIndex].wResId;
2701 for(
i = 0;
i <
dir->idCount;
i++)
2704 width = fIcon ?
entry->ResInfo.icon.bWidth :
entry->ResInfo.cursor.wWidth;
2705 height = fIcon ?
entry->ResInfo.icon.bHeight :
entry->ResInfo.cursor.wHeight/2;
2711 if(
width > cxDesired)
2712 score -=
width - cxDesired;
2714 score -=
height - cyDesired;
2715 if(score != bestScore)
2718 if(
entry->wBitCount < BitCount)
2720 if((
entry->wBitCount <= 8) && notPaletted)
2723 BitCount =
entry->wBitCount;
2727 return dir->idEntries[iIndex].wResId;
2745 TRACE_(icon)(
"%dx%d, planes %d, bpp %d, xor %p, and %p\n",
2746 nWidth, nHeight, cPlanes, cBitsPixel, lpbXORbits, lpbANDbits);
2751 if (cPlanes * cBitsPixel > 1)
2796 TRACE(
"%p, %lu, %lu, %lu, %i, %i, %lu.\n", pbIconBits, cbIconBits, fIcon,
dwVersion, cxDesired, cyDesired,
uFlags);
2798 if (!pbIconBits || cbIconBits < 2 *
sizeof(
DWORD))
2800 ERR(
"Invalid IconBits array\n");
2811 cursorData.
cx = cxDesired;
2812 cursorData.
cy = cyDesired;
2816 if(!
memcmp(pbIconBits,
"RIFF", 4))
2820 ERR(
"Could not get cursor data from .ani.\n");
2840 TRACE(
"Pointer points to a directory structure.\n");
2843 if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
2851 if((fIcon && pCurIconDir->
idType == 2) || (!fIcon && pCurIconDir->
idType == 1))
2853 WARN(
"Got a %s directory pointer, but called for a %s\n", fIcon ?
"cursor" :
"icon", fIcon ?
"icon" :
"cursor");
2905 ERR(
"Couldn't get cursor/icon data\n");
2920 ERR(
"NtUserSetCursorIconData failed.\n");
2951 TRACE(
"%p.\n", piconinfo);
2968 TRACE(
"Returning 0x%08x.\n", hiconRet);
2995 nWidth, nHeight, xHotSpot, yHotSpot, pvXORPlane, pvANDPlane);
2998 info.xHotspot = xHotSpot;
2999 info.yHotspot = yHotSpot;
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INVALID_PARAMETER
#define INVALID_HANDLE_VALUE
#define CreateFileMappingW(a, b, c, d, e, f)
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
#define WINE_DECLARE_DEBUG_CHANNEL(x)
#define MultiByteToWideChar
static const BYTE png_sig_pattern[]
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
BOOL WINAPI FreeResource(HGLOBAL handle)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLsizei GLsizei GLsizei depth
GLclampf GLclampf GLclampf alpha
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLuint GLsizei GLsizei * length
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
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 GLint GLint j
FxContextHeader * pHeader
#define CURSORF_FROMRESOURCE
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
#define CURSORF_ACONFRAME
#define RtlFillMemory(Dest, Length, Fill)
#define LDR_IS_RESOURCE(handle)
#define memcpy(s1, s2, n)
#define FILE_FLAG_RANDOM_ACCESS
static const BYTE masks[8]
#define PNG_COLOR_TYPE_GRAY_ALPHA
#define PNG_COLOR_TYPE_GRAY
#define PNG_COLOR_TYPE_PALETTE
static PROTOCOLDATA * pdata
static HBITMAP create_bitmap(void)
#define ANI_FLAG_SEQUENCE
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_In_ DWORD _In_ DWORD dwOffset
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
EXTINLINE BOOL NtUserxSetCursorPos(INT x, INT y)
EXTINLINE BOOL NtUserxGetCursorPos(POINT *lpPoint)
EXTINLINE HICON NtUserxCreateEmptyCurObject(DWORD_PTR Param)
EXTINLINE INT NtUserxShowCursor(BOOL bShow)
png_voidp PNGAPI png_get_io_ptr(png_const_structrp png_ptr)
#define png_check_sig(sig, n)
#define PNG_LIBPNG_VER_STRING
png_const_structrp png_const_inforp info_ptr
union CURSORICONDIRENTRY::@5280 ResInfo
CURSORICONDIRENTRY idEntries[1]
CURSORICONFILEDIRENTRY idEntries[1]
CURSORICONFILEDIRENTRY idEntries[1]
const unsigned char * data
BITMAPINFOHEADER bmiHeader
struct tagCURSORDATA * aspcur
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
static int __cdecl compr(const void *a, const void *b)
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
struct _COPYIMAGE_CALLBACK_ARGUMENTS * PCOPYIMAGE_CALLBACK_ARGUMENTS
BOOL APIENTRY NtUserDrawIconEx(HDC hdc, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags, BOOL bMetaHDC, PVOID pDIXData)
BOOL APIENTRY NtUserGetIconSize(HANDLE hCurIcon, UINT istepIfAniCur, PLONG plcx, PLONG plcy)
HICON NTAPI NtUserFindExistingCursorIcon(_In_ PUNICODE_STRING pustrModule, _In_ PUNICODE_STRING pustrRsrc, _In_ FINDEXISTINGCURICONPARAM *param)
BOOL APIENTRY NtUserDestroyCursor(_In_ HANDLE hCurIcon, _In_ BOOL bForce)
__kernel_entry BOOL APIENTRY NtUserSetCursorIconData(_In_ HCURSOR hcursor, _In_opt_ PUNICODE_STRING pustrModule, _In_opt_ PUNICODE_STRING pustrRsrc, _In_ const CURSORDATA *pCursorData)
BOOL APIENTRY NtUserSetSystemCursor(HCURSOR hcur, DWORD id)
HCURSOR NTAPI NtUserGetCursorFrameInfo(HCURSOR hCursor, DWORD istep, INT *rate_jiffies, DWORD *num_steps)
static int bitmap_info_size(const BITMAPINFO *info, WORD coloruse)
HCURSOR WINAPI CreateCursor(_In_opt_ HINSTANCE hInst, _In_ int xHotSpot, _In_ int yHotSpot, _In_ int nWidth, _In_ int nHeight, _In_ const VOID *pvANDPlane, _In_ const VOID *pvXORPlane)
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpBitmapName)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hinst, _In_ LPCWSTR lpszName, _In_ UINT uType, _In_ int cxDesired, _In_ int cyDesired, _In_ UINT fuLoad)
HCURSOR WINAPI LoadCursorFromFileW(_In_ LPCWSTR lpFileName)
static BOOL CURSORICON_GetCursorDataFromIconInfo(_Out_ CURSORDATA *pCursorData, _In_ ICONINFO *pIconInfo)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT lpPoint)
static BOOL CURSORICON_GetCursorDataFromBMI(_Inout_ CURSORDATA *pdata, _In_ const BITMAPINFO *pbmi)
static void * map_fileW(LPCWSTR name, LPDWORD filesize)
BOOL WINAPI SetSystemCursor(_In_ HCURSOR hcur, _In_ DWORD id)
BOOL get_icon_size(HICON hIcon, SIZE *size)
static void riff_find_chunk(DWORD chunk_id, DWORD chunk_type, const riff_chunk_t *parent_chunk, riff_chunk_t *chunk)
HCURSOR WINAPI LoadCursorFromFileA(_In_ LPCSTR lpFileName)
HCURSOR CursorIconToCursor(HICON hIcon, BOOL SemiTransparent)
NTSTATUS WINAPI User32SetupDefaultCursors(PVOID Arguments, ULONG ArgumentLength)
DWORD get_best_icon_file_offset(_In_ const LPBYTE dir, _In_ DWORD dwFileSize, _In_ int cxDesired, _In_ int cyDesired, _In_ BOOL bIcon, _In_ DWORD fuLoad, _Out_ POINT *ptHotSpot)
static int get_dib_image_size(int width, int height, int depth)
int WINAPI LookupIconIdFromDirectory(_In_ PBYTE presbits, _In_ BOOL fIcon)
#define COPYIMAGE_VALID_FLAGS
static BOOL bmi_has_alpha(const BITMAPINFO *info, const void *bits)
HICON WINAPI CreateIconFromResourceEx(_In_ PBYTE pbIconBits, _In_ DWORD cbIconBits, _In_ BOOL fIcon, _In_ DWORD dwVersion, _In_ int cxDesired, _In_ int cyDesired, _In_ UINT uFlags)
static BOOL CURSORICON_GetCursorDataFromANI(_Inout_ CURSORDATA *pCurData, _In_ const BYTE *pData, _In_ DWORD dwDataSize, _In_ DWORD fuLoad)
#define PNG_CHECK_SIG_SIZE
BOOL WINAPI SetCursorPos(_In_ int X, _In_ int Y)
static void stretch_blt_icon(HDC hdc_dst, int dst_width, int dst_height, HBITMAP src)
static HANDLE CURSORICON_LoadImageW(_In_opt_ HINSTANCE hinst, _In_ LPCWSTR lpszName, _In_ int cxDesired, _In_ int cyDesired, _In_ UINT fuLoad, _In_ BOOL bIcon)
static HBITMAP BITMAP_LoadImageW(_In_opt_ HINSTANCE hinst, _In_ LPCWSTR lpszName, _In_ int cxDesired, _In_ int cyDesired, _In_ UINT fuLoad)
static HBITMAP create_alpha_bitmap(_In_opt_ HBITMAP color, _In_opt_ BITMAPINFO *src_info, _In_opt_ const void *color_bits, _In_ LONG width, _In_ LONG height)
static PBYTE CURSORICON_ConvertPngToBmpIcon(_In_ PBYTE pngBits, _In_ DWORD fileSize, _Out_ PDWORD pBmpIconSize)
static BOOL is_dib_monochrome(const BITMAPINFO *info)
const CURSORICONFILEDIRENTRY * get_best_icon_file_entry(_In_ const CURSORICONFILEDIR *dir, _In_ DWORD dwFileSize, _In_ int cxDesired, _In_ int cyDesired, _In_ BOOL bIcon, _In_ DWORD fuLoad)
static BOOL LibPngExists(VOID)
static HBITMAP BITMAP_CopyImage(_In_ HBITMAP hnd, _In_ int desiredx, _In_ int desiredy, _In_ UINT flags)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpCursorName)
static HANDLE CURSORICON_LoadFromFileW(_In_ LPCWSTR lpszName, _In_ int cxDesired, _In_ int cyDesired, _In_ UINT fuLoad, _In_ BOOL bIcon)
HCURSOR WINAPI GetCursorFrameInfo(HCURSOR hCursor, DWORD reserved, DWORD istep, PINT rate_jiffies, DWORD *num_steps)
static int DIB_GetBitmapInfo(const BITMAPINFOHEADER *header, LONG *width, LONG *height, WORD *bpp, DWORD *compr)
HBITMAP WINAPI LoadBitmapA(_In_opt_ HINSTANCE hInstance, _In_ LPCSTR lpBitmapName)
int WINAPI LookupIconIdFromDirectoryEx(_In_ PBYTE presbits, _In_ BOOL fIcon, _In_ int cxDesired, _In_ int cyDesired, _In_ UINT Flags)
NTSTATUS WINAPI User32CallCopyImageFromKernel(PVOID Arguments, ULONG ArgumentLength)
static VOID ReadMemoryPng(_Inout_ png_structp png_ptr, _Out_ png_bytep data, _In_ size_t length)
struct _PNG_READER_STATE PNG_READER_STATE
VOID LoadSystemCursors(VOID)
static void dump_ani_header(const ani_header *header)
static const WCHAR DISPLAYW[]
HICON WINAPI CopyIcon(_In_ HICON hIcon)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
static HICON CURSORICON_CopyImage(_In_ HICON hicon, _In_ BOOL bIcon, _In_ int cxDesired, _In_ int cyDesired, _In_ UINT fuFlags)
DWORD WINAPI GetLastError(void)
#define LOAD_LIBRARY_AS_DATAFILE
DWORD WINAPI GetCurrentProcessId(void)
_In_ ULONG _In_ ULONG rgb
#define ERROR_INVALID_CURSOR_HANDLE
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
struct tagBITMAPFILEHEADER BITMAPFILEHEADER
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)
HDC WINAPI CreateICW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ const DEVMODEW *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HCURSOR WINAPI GetCursor(void)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI DeleteDC(_In_ HDC)
HBITMAP WINAPI CreateDIBitmap(_In_ HDC hdc, _In_opt_ const BITMAPINFOHEADER *pbmih, _In_ DWORD fdwInit, _In_opt_ const VOID *pvInit, _In_opt_ const BITMAPINFO *pbmi, _In_ UINT uUsage)
int WINAPI StretchDIBits(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ const VOID *, _In_ const BITMAPINFO *, _In_ UINT, _In_ DWORD)
HDC WINAPI CreateDCW(_In_opt_ LPCWSTR pszDriver, _In_opt_ LPCWSTR pszDevice, _In_opt_ LPCWSTR psz, _In_opt_ const DEVMODEW *pdmInit)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HICON WINAPI CreateIconFromResource(_In_reads_bytes_(dwResSize) PBYTE presbits, _In_ DWORD dwResSize, _In_ BOOL fIcon, _In_ DWORD dwVer)
DWORD WINAPI GetSysColor(_In_ int)
#define LR_LOADTRANSPARENT
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
HICON WINAPI CreateIcon(_In_opt_ HINSTANCE, _In_ int, _In_ int, _In_ BYTE, _In_ BYTE, _In_ const BYTE *, _In_ const BYTE *)
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define LR_COPYFROMRESOURCE
#define LR_CREATEDIBSECTION
BOOL WINAPI DrawIcon(_In_ HDC, _In_ int, _In_ int, _In_ HICON)
#define IS_INTRESOURCE(i)
int WINAPI ShowCursor(_In_ BOOL)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE hInstance, _In_ LPCSTR lpIconName)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
HDC WINAPI GetDC(_In_opt_ HWND)
HANDLE WINAPI LoadImageA(_In_opt_ HINSTANCE hInst, _In_ LPCSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
#define MAKEINTRESOURCEW(i)
#define LR_LOADMAP3DCOLORS
int WINAPI GetSystemMetrics(_In_ int)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
BOOL WINAPI DestroyIcon(_In_ HICON)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Must_inspect_result_ _In_ ULONG Flags