27#define INVALID_INDEX -1
50 0, 0, { (
DWORD_PTR)(__FILE__
": SHELL32_SicCS") }
74 if ((e1->
dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT))
75 return ((e1->
dwFlags & GIL_FORSHORTCUT) < (e2->dwFlags & GIL_FORSHORTCUT)) ? -1 : 1;
93 ICONINFO ShortcutIconInfo, TargetIconInfo;
95 BITMAP TargetBitmapInfo, ShortcutBitmapInfo;
99 OldTargetBitmap =
NULL;
101 static int s_imgListIdx = -1;
102 ZeroMemory(&ShortcutIconInfo,
sizeof(ShortcutIconInfo));
103 ZeroMemory(&TargetIconInfo,
sizeof(TargetIconInfo));
114 FIXME(
"1bpp icon wants its overlay!\n");
124 if (s_imgListIdx == -1)
127 if (s_imgListIdx != -1)
136 if (!ShortcutIcon || !
GetIconInfo(ShortcutIcon, &ShortcutIconInfo))
145 FIXME(
"Should draw 1bpp overlay!\n");
156 if (
NULL == ShortcutDC)
goto fail;
158 if (
NULL == OldShortcutBitmap)
goto fail;
161 if (
NULL == TargetDC)
goto fail;
163 if (
NULL == OldTargetBitmap)
goto fail;
167 if (!
BitBlt(TargetDC, 0, 0, ShortcutBitmapInfo.bmWidth, ShortcutBitmapInfo.bmHeight,
168 ShortcutDC, 0, 0,
SRCAND))
183 if(ShortcutBitmapInfo.bmBitsPixel == 32)
193 if(TargetBitmapInfo.bmBitsPixel != 32) add_alpha =
FALSE;
209 ERR(
"GetBIBits failed!\n");
217 for(
i=0;
i<TargetBitmapInfo.bmHeight;
i++)
219 for(
j=0;
j<TargetBitmapInfo.bmWidth;
j++)
221 add_alpha = (*pixel++ & 0xFF000000) != 0;
242 ERR(
"GetBIBits failed!\n");
249 for(
i=0;
i<ShortcutBitmapInfo.bmHeight;
i++)
251 for(
j=0;
j<ShortcutBitmapInfo.bmWidth;
j++)
253 if(add_alpha) *pixel++ |= 0xFF000000;
254 else *pixel++ &= 0x00FFFFFF;
275 if (!
MaskBlt(TargetDC, 0, 0, ShortcutBitmapInfo.bmWidth, ShortcutBitmapInfo.bmHeight,
276 ShortcutDC, 0, 0, ShortcutIconInfo.
hbmMask, 0, 0,
328 TRACE(
"%s %i %p %p\n",
debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon);
343 if ( -1 == indexDPA )
353 if((
index == -1) || (index1 == -1))
355 WARN(
"Something went wrong when adding the icon to the list: small - 0x%x, big - 0x%x.\n",
365 FIXME(
"iconlists out of sync 0x%x 0x%x\n",
index, index1);
396 if ( !hiconLarge || !hiconSmall)
398 WARN(
"failure loading icon %i from %s (%p %p)\n", dwSourceIndex,
debugstr_w(sSourceFile), hiconLarge, hiconSmall);
404 if (0 != (
dwFlags & GIL_FORSHORTCUT))
408 if (
NULL != hiconLargeShortcut &&
NULL != hiconSmallShortcut)
412 hiconLarge = hiconLargeShortcut;
413 hiconSmall = hiconSmallShortcut;
417 WARN(
"Failed to create shortcut overlayed icons\n");
484 INT cx_small, cy_small;
485 INT cx_large, cy_large;
491 TRACE(
"Entered SIC_Initialize\n");
495 TRACE(
"Icon cache already initialized\n");
508 ERR(
"Failed to create information context (error %d)\n",
GetLastError());
542 ERR(
"Failed to create the small icon list.\n");
553 ERR(
"Failed to create the big icon list.\n");
566 ERR(
"Failed to load small IDI_SHELL_DOCUMENT icon!\n");
578 ERR(
"Failed to load large IDI_SHELL_DOCUMENT icon!\n");
584 ERR(
"Failed to add IDI_SHELL_DOCUMENT icon to cache.\n");
589 ERR(
"Failed to add IDI_SHELL_DOCUMENT icon to cache.\n");
667 WARN(
"Failed to load icon with index %d, using default one\n", icon_idx);
685 TRACE(
"(%p,%p)\n",lpBigList,lpSmallList);
723 TRACE(
"sf=%p pidl=%p %s\n",
sh, pidl, bBigIcon?
"Big":
"Small");
739 if (0 == (
uFlags & GIL_FORSHORTCUT))
778 uGilFlags |= GIL_FORSHORTCUT;
796 int *piIndex,
int *piIndexSel)
798 FIXME(
"(%p, %p, %p, 0x%08x, %p, %p, %p, %p, %p)\n",
799 pts, psf, pidl,
flags, pfn,
pvData, pvHint, piIndex, piIndexSel);
854#if defined(__CYGWIN__) || defined (__MINGW32__) || defined(_MSC_VER)
866 TRACE(
"%s %i %p %p %i\n",
debugstr_w(lpszFile), nIconIndex, phiconLarge, phiconSmall, nIcons);
873 if (
ret == 0xFFFFFFFF)
875 WARN(
"Invalid file or couldn't be found - %s\n",
debugstr_w(lpszFile));
891 TRACE(
"%s %i %p %p %i\n", lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
945 lpiIcon = &wDummyIcon;
954 if( uRet > (
HINSTANCE)32 && tempPath[0] )
955 {
wcscpy(lpIconPath,tempPath);
997 TRACE(
"%p %s %p %p)\n",
hInst, lpIconPath, lpiIconIdx, lpiIconId);
1014 WARN(
"%s %d 0x%08x %p %p %d, semi-stub\n",
debugstr_w(pszIconFile), iIndex,
uFlags, phiconLarge, phiconSmall, nIconSize);
1018 if (
ret == 0xFFFFFFFF)
1022 *phiconLarge = hIcons[0];
1026 *phiconSmall = hIcons[1];
1044 TRACE(
"%s %d 0x%08x %p %p %d\n", pszIconFile, iIndex,
uFlags, phiconLarge, phiconSmall, nIconSize);
#define shell32_hInstance
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void shell(int argc, const char *argv[])
void pdump(LPCITEMIDLIST pidl)
INT WINAPI DPA_Search(HDPA hdpa, LPVOID pFind, INT nStart, PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions)
void WINAPI DPA_DestroyCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
LPVOID WINAPI DPA_DeletePtr(HDPA hdpa, INT i)
BOOL WINAPI DPA_Destroy(HDPA hdpa)
HDPA WINAPI DPA_Create(INT nGrow)
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
BOOL WINAPI ImageList_Remove(HIMAGELIST himl, INT i)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
HICON WINAPI ImageList_GetIcon(HIMAGELIST himl, INT i, UINT fStyle)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define MultiByteToWideChar
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
void WINAPI SHFree(LPVOID pv)
LPVOID WINAPI SHAlloc(SIZE_T len)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
WCHAR swShell32Name[MAX_PATH]
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
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
EXTERN_C HICON WINAPI ExtractAssociatedIconExA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIconIdx, LPWORD lpiIconId)
static INT CALLBACK sic_free(LPVOID ptr, LPVOID lparam)
EXTERN_C INT WINAPI SHGetIconOverlayIndexW(LPCWSTR pszIconPath, INT iIconIndex)
INT SIC_GetIconIndex(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
static INT SIC_IconAppend(LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags)
EXTERN_C HRESULT WINAPI SHMapIDListToImageListIndexAsync(IShellTaskScheduler *pts, IShellFolder *psf, LPCITEMIDLIST pidl, UINT flags, PFNASYNCICONTASKBALLBACK pfn, void *pvData, void *pvHint, int *piIndex, int *piIndexSel)
BOOL PidlToSicIndex(IShellFolder *sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int *pIndex)
INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, UINT bSimulateDoc)
static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
BOOL SIC_Initialize(void)
UINT WINAPI ExtractIconExA(LPCSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
EXTERN_C INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulateDoc)
static HIMAGELIST ShellSmallIconList
struct SIC_ENTRY * LPSIC_ENTRY
HRESULT WINAPI SHDefExtractIconA(LPCSTR pszIconFile, int iIndex, UINT uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
static INT SIC_LoadIcon(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
static HIMAGELIST ShellBigIconList
static int SIC_LoadOverlayIcon(int icon_idx)
INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc)
EXTERN_C INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc)
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon)
EXTERN_C HICON WINAPI ExtractAssociatedIconExW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIconIdx, LPWORD lpiIconId)
EXTERN_C INT WINAPI SHGetIconOverlayIndexA(LPCSTR pszIconPath, INT iIconIndex)
static INT CALLBACK SIC_CompareEntries(LPVOID p1, LPVOID p2, LPARAM lparam)
HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon)
int WINAPI SHMapPIDLToSystemImageListIndex(IShellFolder *sh, LPCITEMIDLIST pidl, int *pIndex)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
CRITICAL_SECTION SHELL32_SicCS
CRITICAL_SECTION_DEBUG critsect_debug
_Out_ PULONG _Out_ PULONG pIndex
#define ImageList_AddIcon(himl, hicon)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL SHELL_IsShortcut(LPCITEMIDLIST pidlLast)
HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex)
static __inline BOOL SHELL_OsIsUnicode(void)
HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult)
void(CALLBACK * PFNASYNCICONTASKBALLBACK)(LPCITEMIDLIST pidl, LPVOID pvData, LPVOID pvHint, INT iIconIndex, INT iOpenIconIndex)
#define IDI_SHELL_DOCUMENT
#define IDI_SHELL_SHORTCUT
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
LIST_ENTRY ProcessLocksList
BITMAPINFOHEADER bmiHeader
_In_ WDFCOLLECTION _In_ ULONG Index
DWORD WINAPI GetLastError(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_In_ ULONG _In_opt_ PVOID pvData
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
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 *)
int WINAPI SetDIBits(_In_opt_ HDC, _In_ HBITMAP, _In_ UINT, _In_ UINT, _In_ CONST VOID *, _In_ CONST BITMAPINFO *, _In_ UINT)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI MaskBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ HDC, _In_ int, _In_ int, _In_ HBITMAP, _In_ int, _In_ int, _In_ DWORD)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
struct tagBITMAPINFO BITMAPINFO
BOOL WINAPI DeleteDC(_In_ HDC)
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
UINT WINAPI PrivateExtractIconsW(_In_reads_(MAX_PATH) LPCWSTR szFileName, _In_ int nIconIndex, _In_ int cxIcon, _In_ int cyIcon, _Out_writes_opt_(nIcons) HICON *phicon, _Out_writes_opt_(nIcons) UINT *piconid, _In_ UINT nIcons, _In_ UINT flags)
#define LR_COPYFROMRESOURCE
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
#define MAKEINTRESOURCEW(i)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)
UINT WINAPI WINAPI PrivateExtractIconExW(LPCWSTR, int, HICON *, HICON *, UINT)
#define IID_NULL_PPV_ARG(Itype, ppType)