ReactOS  0.4.14-dev-77-gd9e7c48
iconcache.cpp File Reference
#include "precomp.h"
Include dependency graph for iconcache.cpp:

Go to the source code of this file.

Classes

struct  SIC_ENTRY
 

Namespaces

 anonymous_namespace{iconcache.cpp}
 

Macros

#define INVALID_INDEX   -1
 

Typedefs

typedef struct SIC_ENTRYLPSIC_ENTRY
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static INT CALLBACK SIC_CompareEntries (LPVOID p1, LPVOID p2, LPARAM lparam)
 
static int SIC_LoadOverlayIcon (int icon_idx)
 
static HICON SIC_OverlayShortcutImage (HICON SourceIcon, BOOL large)
 
static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags)
 
static INT SIC_LoadIcon (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
 
INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
 
BOOL SIC_Initialize (void)
 
static INT CALLBACK sic_free (LPVOID ptr, LPVOID lparam)
 
void SIC_Destroy (void)
 
BOOL WINAPI Shell_GetImageLists (HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
 
BOOL PidlToSicIndex (IShellFolder *sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int *pIndex)
 
int WINAPI SHMapPIDLToSystemImageListIndex (IShellFolder *sh, LPCITEMIDLIST pidl, int *pIndex)
 
EXTERN_C HRESULT WINAPI SHMapIDListToImageListIndexAsync (IShellTaskScheduler *pts, IShellFolder *psf, LPCITEMIDLIST pidl, UINT flags, PFNASYNCICONTASKBALLBACK pfn, void *pvData, void *pvHint, int *piIndex, int *piIndexSel)
 
INT WINAPI Shell_GetCachedImageIndexA (LPCSTR szPath, INT nIndex, UINT bSimulateDoc)
 
INT WINAPI Shell_GetCachedImageIndexW (LPCWSTR szPath, INT nIndex, UINT bSimulateDoc)
 
EXTERN_C INT WINAPI Shell_GetCachedImageIndexAW (LPCVOID szPath, INT nIndex, BOOL 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)
 
UINT WINAPI ExtractIconExA (LPCSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
 
HICON WINAPI ExtractAssociatedIconA (HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon)
 
HICON WINAPI ExtractAssociatedIconW (HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon)
 
EXTERN_C HICON WINAPI ExtractAssociatedIconExW (HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIconIdx, LPWORD lpiIconId)
 
EXTERN_C HICON WINAPI ExtractAssociatedIconExA (HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIconIdx, LPWORD lpiIconId)
 
HRESULT WINAPI SHDefExtractIconW (LPCWSTR pszIconFile, int iIndex, UINT uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
 
HRESULT WINAPI SHDefExtractIconA (LPCSTR pszIconFile, int iIndex, UINT uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
 
EXTERN_C INT WINAPI SHGetIconOverlayIndexA (LPCSTR pszIconPath, INT iIconIndex)
 
EXTERN_C INT WINAPI SHGetIconOverlayIndexW (LPCWSTR pszIconPath, INT iIconIndex)
 

Variables

static HDPA sic_hdpa = 0
 
static HIMAGELIST ShellSmallIconList
 
static HIMAGELIST ShellBigIconList
 
CRITICAL_SECTION anonymous_namespace{iconcache.cpp}::SHELL32_SicCS = { &critsect_debug, -1, 0, 0, 0, 0 }
 
CRITICAL_SECTION_DEBUG anonymous_namespace{iconcache.cpp}::critsect_debug
 

Macro Definition Documentation

◆ INVALID_INDEX

#define INVALID_INDEX   -1

Definition at line 27 of file iconcache.cpp.

Typedef Documentation

◆ LPSIC_ENTRY

Function Documentation

◆ ExtractAssociatedIconA()

HICON WINAPI ExtractAssociatedIconA ( HINSTANCE  hInst,
LPSTR  lpIconPath,
LPWORD  lpiIcon 
)

Definition at line 919 of file iconcache.cpp.

920 {
921  HICON hIcon = NULL;
922  INT len = MultiByteToWideChar(CP_ACP, 0, lpIconPath, -1, NULL, 0);
923  /* Note that we need to allocate MAX_PATH, since we are supposed to fill
924  * the correct executable if there is no icon in lpIconPath directly.
925  * lpIconPath itself is supposed to be large enough, so make sure lpIconPathW
926  * is large enough too. Yes, I am puking too.
927  */
928  LPWSTR lpIconPathW = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
929 
930  TRACE("%p %s %p\n", hInst, debugstr_a(lpIconPath), lpiIcon);
931 
932  if (lpIconPathW)
933  {
934  MultiByteToWideChar(CP_ACP, 0, lpIconPath, -1, lpIconPathW, len);
935  hIcon = ExtractAssociatedIconW(hInst, lpIconPathW, lpiIcon);
936  WideCharToMultiByte(CP_ACP, 0, lpIconPathW, -1, lpIconPath, MAX_PATH , NULL, NULL);
937  HeapFree(GetProcessHeap(), 0, lpIconPathW);
938  }
939  return hIcon;
940 }
static HICON
Definition: imagelist.c:84
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
int32_t INT
Definition: typedefs.h:56
HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon)
Definition: iconcache.cpp:948
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
#define MAX_PATH
Definition: compat.h:26
GLenum GLsizei len
Definition: glext.h:6722
HINSTANCE hInst
Definition: dxdiag.c:13
HICON hIcon
Definition: msconfig.c:44
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by test_ExtractAssociatedIcon().

◆ ExtractAssociatedIconExA()

EXTERN_C HICON WINAPI ExtractAssociatedIconExA ( HINSTANCE  hInst,
LPSTR  lpIconPath,
LPWORD  lpiIconIdx,
LPWORD  lpiIconId 
)

Definition at line 1002 of file iconcache.cpp.

1003 {
1004  HICON ret;
1005  INT len = MultiByteToWideChar( CP_ACP, 0, lpIconPath, -1, NULL, 0 );
1006  LPWSTR lpwstrFile = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
1007 
1008  TRACE("%p %s %p %p)\n", hInst, lpIconPath, lpiIconIdx, lpiIconId);
1009 
1010  MultiByteToWideChar( CP_ACP, 0, lpIconPath, -1, lpwstrFile, len );
1011  ret = ExtractAssociatedIconExW(hInst, lpwstrFile, lpiIconIdx, lpiIconId);
1012  HeapFree(GetProcessHeap(), 0, lpwstrFile);
1013  return ret;
1014 }
static HICON
Definition: imagelist.c:84
#define CP_ACP
Definition: compat.h:99
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
HINSTANCE hInst
Definition: dxdiag.c:13
#define MultiByteToWideChar
Definition: compat.h:100
EXTERN_C HICON WINAPI ExtractAssociatedIconExW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIconIdx, LPWORD lpiIconId)
Definition: iconcache.cpp:990
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ ExtractAssociatedIconExW()

EXTERN_C HICON WINAPI ExtractAssociatedIconExW ( HINSTANCE  hInst,
LPWSTR  lpIconPath,
LPWORD  lpiIconIdx,
LPWORD  lpiIconId 
)

Definition at line 990 of file iconcache.cpp.

991 {
992  FIXME("%p %s %p %p): stub\n", hInst, debugstr_w(lpIconPath), lpiIconIdx, lpiIconId);
993  return 0;
994 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
HINSTANCE hInst
Definition: dxdiag.c:13

Referenced by ExtractAssociatedIconExA().

◆ ExtractAssociatedIconW()

HICON WINAPI ExtractAssociatedIconW ( HINSTANCE  hInst,
LPWSTR  lpIconPath,
LPWORD  lpiIcon 
)

Definition at line 948 of file iconcache.cpp.

949 {
950  HICON hIcon = NULL;
951  WORD wDummyIcon = 0;
952 
953  TRACE("%p %s %p\n", hInst, debugstr_w(lpIconPath), lpiIcon);
954 
955  if(lpiIcon == NULL)
956  lpiIcon = &wDummyIcon;
957 
958  hIcon = ExtractIconW(hInst, lpIconPath, *lpiIcon);
959 
960  if( hIcon < (HICON)2 )
961  { if( hIcon == (HICON)1 ) /* no icons found in given file */
962  { WCHAR tempPath[MAX_PATH];
963  HINSTANCE uRet = FindExecutableW(lpIconPath,NULL,tempPath);
964 
965  if( uRet > (HINSTANCE)32 && tempPath[0] )
966  { wcscpy(lpIconPath,tempPath);
967  hIcon = ExtractIconW(hInst, lpIconPath, *lpiIcon);
968  if( hIcon > (HICON)2 )
969  return hIcon;
970  }
971  }
972 
973  if( hIcon == (HICON)1 )
974  *lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */
975  else
976  *lpiIcon = 6; /* generic icon - found nothing */
977 
978  if (GetModuleFileNameW(hInst, lpIconPath, MAX_PATH))
979  hIcon = LoadIconW(hInst, MAKEINTRESOURCEW(*lpiIcon));
980  }
981  return hIcon;
982 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:609
static HICON
Definition: imagelist.c:84
HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex)
Definition: shell32_main.c:878
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned short WORD
Definition: ntddk_ex.h:93
HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult)
Definition: shlexec.cpp:1212
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
HINSTANCE hInst
Definition: dxdiag.c:13
HICON hIcon
Definition: msconfig.c:44
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by ExtractAssociatedIconA().

◆ ExtractIconExA()

UINT WINAPI ExtractIconExA ( LPCSTR  lpszFile,
INT  nIconIndex,
HICON phiconLarge,
HICON phiconSmall,
UINT  nIcons 
)

Definition at line 896 of file iconcache.cpp.

897 {
898  UINT ret = 0;
899  INT len = MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, NULL, 0);
900  LPWSTR lpwstrFile = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
901 
902  TRACE("%s %i %p %p %i\n", lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
903 
904  if (lpwstrFile)
905  {
906  MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len);
907  ret = ExtractIconExW(lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
908  HeapFree(GetProcessHeap(), 0, lpwstrFile);
909  }
910  return ret;
911 }
#define CP_ACP
Definition: compat.h:99
int32_t INT
Definition: typedefs.h:56
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:873
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ ExtractIconExW()

UINT WINAPI ExtractIconExW ( LPCWSTR  lpszFile,
INT  nIconIndex,
HICON phiconLarge,
HICON phiconSmall,
UINT  nIcons 
)

Definition at line 873 of file iconcache.cpp.

874 {
875  /* get entry point of undocumented function PrivateExtractIconExW() in user32 */
876 #if defined(__CYGWIN__) || defined (__MINGW32__) || defined(_MSC_VER)
878 
879  if (!PrivateExtractIconExW) {
880  HMODULE hUser32 = GetModuleHandleA("user32");
881  PrivateExtractIconExW = (UINT(WINAPI*)(LPCWSTR,int,HICON*,HICON*,UINT)) GetProcAddress(hUser32, "PrivateExtractIconExW");
882 
884  return 0;
885  }
886 #endif
887 
888  TRACE("%s %i %p %p %i\n", debugstr_w(lpszFile), nIconIndex, phiconLarge, phiconSmall, nIcons);
889 
890  return PrivateExtractIconExW(lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
891 }
static HICON
Definition: imagelist.c:84
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI WINAPI PrivateExtractIconExW(LPCWSTR, int, HICON *, HICON *, UINT)
Definition: exticon.c:690
#define TRACE(s)
Definition: solgame.cpp:4
#define WINAPI
Definition: msvc.h:8
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
unsigned int UINT
Definition: ndis.h:50
#define GetProcAddress(x, y)
Definition: compat.h:410
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by CShellLink::CreateShortcutIcon(), DoExtractIcon(), DoLoadIcons(), extract_icon(), ExtractIconExA(), FileTypesDlg_OnItemChanging(), COpenWithList::GetIcon(), CFileDefExt::InitOpensWithField(), SetupDiGetClassImageListExW(), SetupDiLoadClassIcon(), CFileDefExt::UpdateFolderIcon(), and ViewTree_AddIcon().

◆ PidlToSicIndex()

BOOL PidlToSicIndex ( IShellFolder sh,
LPCITEMIDLIST  pidl,
BOOL  bBigIcon,
UINT  uFlags,
int pIndex 
)

Definition at line 732 of file iconcache.cpp.

738 {
740  WCHAR szIconFile[MAX_PATH]; /* file containing the icon */
741  INT iSourceIndex; /* index or resID(negated) in this file */
742  BOOL ret = FALSE;
743  UINT dwFlags = 0;
744  int iShortcutDefaultIndex = INVALID_INDEX;
745 
746  TRACE("sf=%p pidl=%p %s\n", sh, pidl, bBigIcon?"Big":"Small");
747 
748  if (!sic_hdpa)
749  SIC_Initialize();
750 
751  if (SUCCEEDED (sh->GetUIObjectOf(0, 1, &pidl, IID_NULL_PPV_ARG(IExtractIconW, &ei))))
752  {
753  if (SUCCEEDED(ei->GetIconLocation(uFlags &~ GIL_FORSHORTCUT, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags)))
754  {
755  *pIndex = SIC_GetIconIndex(szIconFile, iSourceIndex, uFlags);
756  ret = TRUE;
757  }
758  }
759 
760  if (INVALID_INDEX == *pIndex) /* default icon when failed */
761  {
762  if (0 == (uFlags & GIL_FORSHORTCUT))
763  {
764  *pIndex = 0;
765  }
766  else
767  {
768  if (INVALID_INDEX == iShortcutDefaultIndex)
769  {
770  iShortcutDefaultIndex = SIC_LoadIcon(swShell32Name, 0, GIL_FORSHORTCUT);
771  }
772  *pIndex = (INVALID_INDEX != iShortcutDefaultIndex ? iShortcutDefaultIndex : 0);
773  }
774  }
775 
776  return ret;
777 
778 }
#define TRUE
Definition: types.h:120
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
UINT uFlags
Definition: api.c:60
#define INVALID_INDEX
Definition: iconcache.cpp:27
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
static INT SIC_LoadIcon(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
Definition: iconcache.cpp:390
#define IID_NULL_PPV_ARG(Itype, ppType)
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HDPA sic_hdpa
Definition: iconcache.cpp:38
#define MAX_PATH
Definition: compat.h:26
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:484
short sh
Definition: format.c:272
_Out_ PULONG _Out_ PULONG pIndex
Definition: ndis.h:4564
unsigned int UINT
Definition: ndis.h:50
INT SIC_GetIconIndex(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
Definition: iconcache.cpp:443
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by FM_InitMenuPopup(), SHGetFileInfoW(), and SHMapPIDLToSystemImageListIndex().

◆ SHDefExtractIconA()

HRESULT WINAPI SHDefExtractIconA ( LPCSTR  pszIconFile,
int  iIndex,
UINT  uFlags,
HICON phiconLarge,
HICON phiconSmall,
UINT  nIconSize 
)

Definition at line 1048 of file iconcache.cpp.

1050 {
1051  HRESULT ret;
1052  INT len = MultiByteToWideChar(CP_ACP, 0, pszIconFile, -1, NULL, 0);
1053  LPWSTR lpwstrFile = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1054 
1055  TRACE("%s %d 0x%08x %p %p %d\n", pszIconFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
1056 
1057  MultiByteToWideChar(CP_ACP, 0, pszIconFile, -1, lpwstrFile, len);
1058  ret = SHDefExtractIconW(lpwstrFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
1059  HeapFree(GetProcessHeap(), 0, lpwstrFile);
1060  return ret;
1061 }
#define CP_ACP
Definition: compat.h:99
UINT uFlags
Definition: api.c:60
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
Definition: iconcache.cpp:1020
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ SHDefExtractIconW()

HRESULT WINAPI SHDefExtractIconW ( LPCWSTR  pszIconFile,
int  iIndex,
UINT  uFlags,
HICON phiconLarge,
HICON phiconSmall,
UINT  nIconSize 
)

Definition at line 1020 of file iconcache.cpp.

1022 {
1023  UINT ret;
1024  HICON hIcons[2];
1025  WARN("%s %d 0x%08x %p %p %d, semi-stub\n", debugstr_w(pszIconFile), iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
1026 
1027  ret = PrivateExtractIconsW(pszIconFile, iIndex, nIconSize, nIconSize, hIcons, NULL, 2, LR_DEFAULTCOLOR);
1028  /* FIXME: deal with uFlags parameter which contains GIL_ flags */
1029  if (ret == 0xFFFFFFFF)
1030  return E_FAIL;
1031  if (ret > 0) {
1032  if (phiconLarge)
1033  *phiconLarge = hIcons[0];
1034  else
1035  DestroyIcon(hIcons[0]);
1036  if (phiconSmall)
1037  *phiconSmall = hIcons[1];
1038  else
1039  DestroyIcon(hIcons[1]);
1040  return S_OK;
1041  }
1042  return S_FALSE;
1043 }
static HICON
Definition: imagelist.c:84
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define WARN(fmt,...)
Definition: debug.h:111
UINT uFlags
Definition: api.c:60
#define E_FAIL
Definition: ddrawi.h:102
#define debugstr_w
Definition: kernel32.h:32
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
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)
int ret
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077

Referenced by CNtObjectFolderExtractIcon::Extract(), CRegistryFolderExtractIcon::Extract(), CNetConUiObject::Extract(), SHDefExtractIconA(), and SHDefExtractIconWrapW().

◆ Shell_GetCachedImageIndex()

EXTERN_C INT WINAPI Shell_GetCachedImageIndex ( LPCWSTR  szPath,
INT  nIndex,
UINT  bSimulateDoc 
)

Definition at line 861 of file iconcache.cpp.

862 {
863  return Shell_GetCachedImageIndexAW(szPath, nIndex, bSimulateDoc);
864 }
EXTERN_C INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulateDoc)
Definition: iconcache.cpp:855
LPCWSTR szPath
Definition: env.c:35

Referenced by CShellMenuCallback::OnGetInfo().

◆ Shell_GetCachedImageIndexA()

INT WINAPI Shell_GetCachedImageIndexA ( LPCSTR  szPath,
INT  nIndex,
UINT  bSimulateDoc 
)

Definition at line 830 of file iconcache.cpp.

831 {
832  INT ret, len;
833  LPWSTR szTemp;
834 
835  WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_a(szPath), nIndex, bSimulateDoc);
836 
837  len = MultiByteToWideChar( CP_ACP, 0, szPath, -1, NULL, 0 );
838  szTemp = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
839  MultiByteToWideChar( CP_ACP, 0, szPath, -1, szTemp, len );
840 
841  ret = SIC_GetIconIndex( szTemp, nIndex, 0 );
842 
843  HeapFree( GetProcessHeap(), 0, szTemp );
844 
845  return ret;
846 }
#define CP_ACP
Definition: compat.h:99
#define WARN(fmt,...)
Definition: debug.h:111
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
int ret
GLenum GLsizei len
Definition: glext.h:6722
LPCWSTR szPath
Definition: env.c:35
INT SIC_GetIconIndex(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
Definition: iconcache.cpp:443
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by Shell_GetCachedImageIndexAW().

◆ Shell_GetCachedImageIndexAW()

EXTERN_C INT WINAPI Shell_GetCachedImageIndexAW ( LPCVOID  szPath,
INT  nIndex,
BOOL  bSimulateDoc 
)

Definition at line 855 of file iconcache.cpp.

856 { if( SHELL_OsIsUnicode())
857  return Shell_GetCachedImageIndexW((LPCWSTR)szPath, nIndex, bSimulateDoc);
858  return Shell_GetCachedImageIndexA((LPCSTR)szPath, nIndex, bSimulateDoc);
859 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc)
Definition: iconcache.cpp:848
const char * LPCSTR
Definition: xmlstorage.h:183
INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, UINT bSimulateDoc)
Definition: iconcache.cpp:830
LPCWSTR szPath
Definition: env.c:35

Referenced by Shell_GetCachedImageIndex().

◆ Shell_GetCachedImageIndexW()

INT WINAPI Shell_GetCachedImageIndexW ( LPCWSTR  szPath,
INT  nIndex,
UINT  bSimulateDoc 
)

Definition at line 848 of file iconcache.cpp.

849 {
850  WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_w(szPath), nIndex, bSimulateDoc);
851 
852  return SIC_GetIconIndex(szPath, nIndex, 0);
853 }
#define WARN(fmt,...)
Definition: debug.h:111
#define debugstr_w
Definition: kernel32.h:32
LPCWSTR szPath
Definition: env.c:35
INT SIC_GetIconIndex(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
Definition: iconcache.cpp:443

Referenced by Shell_GetCachedImageIndexAW().

◆ Shell_GetImageLists()

BOOL WINAPI Shell_GetImageLists ( HIMAGELIST lpBigList,
HIMAGELIST lpSmallList 
)

Definition at line 706 of file iconcache.cpp.

707 {
708  TRACE("(%p,%p)\n",lpBigList,lpSmallList);
709 
710  if (!sic_hdpa)
711  SIC_Initialize();
712 
713  if (lpBigList)
714  *lpBigList = ShellBigIconList;
715 
716  if (lpSmallList)
717  *lpSmallList = ShellSmallIconList;
718 
719  return TRUE;
720 }
#define TRUE
Definition: types.h:120
static HIMAGELIST ShellBigIconList
Definition: iconcache.cpp:41
static HIMAGELIST ShellSmallIconList
Definition: iconcache.cpp:40
#define TRACE(s)
Definition: solgame.cpp:4
static HDPA sic_hdpa
Definition: iconcache.cpp:38
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:484

Referenced by CShellBrowser::BrowseToPath(), DisplayImageList(), FileMenu_DrawItem(), InitializeTreeView(), CDefView::InitList(), CDefView::OnNotify(), SHGetFileInfoW(), SHGetImageList(), and test_SHGetImageList().

◆ SHGetIconOverlayIndexA()

EXTERN_C INT WINAPI SHGetIconOverlayIndexA ( LPCSTR  pszIconPath,
INT  iIconIndex 
)

Definition at line 1068 of file iconcache.cpp.

1069 {
1070  FIXME("%s, %d\n", debugstr_a(pszIconPath), iIconIndex);
1071 
1072  return -1;
1073 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31

◆ SHGetIconOverlayIndexW()

EXTERN_C INT WINAPI SHGetIconOverlayIndexW ( LPCWSTR  pszIconPath,
INT  iIconIndex 
)

Definition at line 1080 of file iconcache.cpp.

1081 {
1082  FIXME("%s, %d\n", debugstr_w(pszIconPath), iIconIndex);
1083 
1084  return -1;
1085 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110

◆ SHMapIDListToImageListIndexAsync()

EXTERN_C HRESULT WINAPI SHMapIDListToImageListIndexAsync ( IShellTaskScheduler pts,
IShellFolder psf,
LPCITEMIDLIST  pidl,
UINT  flags,
PFNASYNCICONTASKBALLBACK  pfn,
void pvData,
void pvHint,
int piIndex,
int piIndexSel 
)

Definition at line 816 of file iconcache.cpp.

820 {
821  FIXME("(%p, %p, %p, 0x%08x, %p, %p, %p, %p, %p)\n",
822  pts, psf, pidl, flags, pfn, pvData, pvHint, piIndex, piIndexSel);
823  return E_FAIL;
824 }
#define E_FAIL
Definition: ddrawi.h:102
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
GLbitfield flags
Definition: glext.h:7161

◆ SHMapPIDLToSystemImageListIndex()

int WINAPI SHMapPIDLToSystemImageListIndex ( IShellFolder sh,
LPCITEMIDLIST  pidl,
int pIndex 
)

Definition at line 789 of file iconcache.cpp.

793 {
794  int Index;
795  UINT uGilFlags = 0;
796 
797  TRACE("(SF=%p,pidl=%p,%p)\n",sh,pidl,pIndex);
798  pdump(pidl);
799 
800  if (SHELL_IsShortcut(pidl))
801  uGilFlags |= GIL_FORSHORTCUT;
802 
803  if (pIndex)
804  if (!PidlToSicIndex ( sh, pidl, 1, uGilFlags, pIndex))
805  *pIndex = -1;
806 
807  if (!PidlToSicIndex ( sh, pidl, 0, uGilFlags, &Index))
808  return -1;
809 
810  return Index;
811 }
BOOL SHELL_IsShortcut(LPCITEMIDLIST pidlLast)
Definition: shell32_main.c:378
#define TRACE(s)
Definition: solgame.cpp:4
static const UCHAR Index[8]
Definition: usbohci.c:18
short sh
Definition: format.c:272
_Out_ PULONG _Out_ PULONG pIndex
Definition: ndis.h:4564
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
unsigned int UINT
Definition: ndis.h:50
BOOL PidlToSicIndex(IShellFolder *sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int *pIndex)
Definition: iconcache.cpp:732

Referenced by CAddressEditBox::AddComboBoxItem(), CShellBrowser::BrowseToPath(), CISFBand::CreateSimpleToolbar(), CMenuSFToolbar::FillToolbar(), CExplorerBand::InsertItem(), CAddressEditBox::Invoke(), CDefView::LV_ProdItem(), CDefView::LV_RenameItem(), and CDefView::OnNotify().

◆ SIC_CompareEntries()

static INT CALLBACK SIC_CompareEntries ( LPVOID  p1,
LPVOID  p2,
LPARAM  lparam 
)
static

Definition at line 61 of file iconcache.cpp.

62 { LPSIC_ENTRY e1 = (LPSIC_ENTRY)p1, e2 = (LPSIC_ENTRY)p2;
63 
64  TRACE("%p %p %8lx\n", p1, p2, lparam);
65 
66  /* Icons in the cache are keyed by the name of the file they are
67  * loaded from, their resource index and the fact if they have a shortcut
68  * icon overlay or not.
69  */
70  /* first the faster one */
71  if (e1->dwSourceIndex != e2->dwSourceIndex)
72  return (e1->dwSourceIndex < e2->dwSourceIndex) ? -1 : 1;
73 
74  if ((e1->dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT))
75  return ((e1->dwFlags & GIL_FORSHORTCUT) < (e2->dwFlags & GIL_FORSHORTCUT)) ? -1 : 1;
76 
77  return wcsicmp(e1->sSourceFile,e2->sSourceFile);
78 }
LPWSTR sSourceFile
Definition: iconcache.cpp:31
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwFlags
Definition: iconcache.cpp:34
Definition: iconcache.cpp:29
DWORD dwSourceIndex
Definition: iconcache.cpp:32
#define wcsicmp
Definition: string.h:1152
struct SIC_ENTRY * LPSIC_ENTRY

Referenced by SIC_GetIconIndex(), and SIC_IconAppend().

◆ SIC_Destroy()

void SIC_Destroy ( void  )

Definition at line 632 of file iconcache.cpp.

633 {
634  TRACE("\n");
635 
637 
639 
640  sic_hdpa = NULL;
642  ShellSmallIconList = 0;
644  ShellBigIconList = 0;
645 
647  //DeleteCriticalSection(&SHELL32_SicCS); //static
648 }
void WINAPI DPA_DestroyCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:1003
static HIMAGELIST ShellBigIconList
Definition: iconcache.cpp:41
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
static HIMAGELIST ShellSmallIconList
Definition: iconcache.cpp:40
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static HDPA sic_hdpa
Definition: iconcache.cpp:38
static INT CALLBACK sic_free(LPVOID ptr, LPVOID lparam)
Definition: iconcache.cpp:625
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ sic_free()

static INT CALLBACK sic_free ( LPVOID  ptr,
LPVOID  lparam 
)
static

Definition at line 625 of file iconcache.cpp.

626 {
627  HeapFree(GetProcessHeap(), 0, ((LPSIC_ENTRY)ptr)->sSourceFile);
628  SHFree(ptr);
629  return TRUE;
630 }
#define TRUE
Definition: types.h:120
static PVOID ptr
Definition: dispmode.c:27
#define GetProcessHeap()
Definition: compat.h:395
Definition: iconcache.cpp:29
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by SIC_Destroy().

◆ SIC_GetIconIndex()

INT SIC_GetIconIndex ( LPCWSTR  sSourceFile,
INT  dwSourceIndex,
DWORD  dwFlags 
)

Definition at line 443 of file iconcache.cpp.

444 {
445  SIC_ENTRY sice;
448 
449  TRACE("%s %i\n", debugstr_w(sSourceFile), dwSourceIndex);
450 
451  GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
452  sice.sSourceFile = path;
453  sice.dwSourceIndex = dwSourceIndex;
454  sice.dwFlags = dwFlags;
455 
456  if (!sic_hdpa)
457  SIC_Initialize();
458 
460 
461  if (NULL != DPA_GetPtr (sic_hdpa, 0))
462  {
463  /* search linear from position 0*/
465  }
466 
467  if ( INVALID_INDEX == index )
468  {
469  ret = SIC_LoadIcon (sSourceFile, dwSourceIndex, dwFlags);
470  }
471  else
472  {
473  TRACE("-- found\n");
474  ret = ((LPSIC_ENTRY)DPA_GetPtr(sic_hdpa, index))->dwListIndex;
475  }
476 
478  return ret;
479 }
#define DPAS_SORTED
Definition: commctrl.h:4833
GLsizei const GLchar ** path
Definition: glext.h:7234
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
LPWSTR sSourceFile
Definition: iconcache.cpp:31
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define INVALID_INDEX
Definition: iconcache.cpp:27
int32_t INT
Definition: typedefs.h:56
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
static INT SIC_LoadIcon(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
Definition: iconcache.cpp:390
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwFlags
Definition: iconcache.cpp:34
__wchar_t WCHAR
Definition: xmlstorage.h:180
static INT CALLBACK SIC_CompareEntries(LPVOID p1, LPVOID p2, LPARAM lparam)
Definition: iconcache.cpp:61
static HDPA sic_hdpa
Definition: iconcache.cpp:38
#define MAX_PATH
Definition: compat.h:26
Definition: iconcache.cpp:29
DWORD dwSourceIndex
Definition: iconcache.cpp:32
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:484
#define DPA_GetPtr
Definition: commctrl.h:5
Definition: services.c:325
struct SIC_ENTRY * LPSIC_ENTRY
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
INT WINAPI DPA_Search(HDPA hdpa, LPVOID pFind, INT nStart, PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions)
Definition: dpa.c:845

Referenced by PidlToSicIndex(), Shell_GetCachedImageIndexA(), Shell_GetCachedImageIndexW(), and SHGetFileInfoW().

◆ SIC_IconAppend()

static INT SIC_IconAppend ( LPCWSTR  sSourceFile,
INT  dwSourceIndex,
HICON  hSmallIcon,
HICON  hBigIcon,
DWORD  dwFlags 
)
static

Definition at line 326 of file iconcache.cpp.

327 {
328  LPSIC_ENTRY lpsice;
329  INT ret, index, index1, indexDPA;
331  TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon);
332 
333  lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY));
334 
335  GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
336  lpsice->sSourceFile = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, (wcslen(path)+1)*sizeof(WCHAR) );
337  wcscpy( lpsice->sSourceFile, path );
338 
339  lpsice->dwSourceIndex = dwSourceIndex;
340  lpsice->dwFlags = dwFlags;
341 
343 
345  indexDPA = DPA_InsertPtr(sic_hdpa, indexDPA, lpsice);
346  if ( -1 == indexDPA )
347  {
348  ret = INVALID_INDEX;
349  goto leave;
350  }
351 
353  index1= ImageList_AddIcon (ShellBigIconList, hBigIcon);
354 
355  /* Something went wrong when allocating a new image in the list. Abort. */
356  if((index == -1) || (index1 == -1))
357  {
358  WARN("Something went wrong when adding the icon to the list: small - 0x%x, big - 0x%x.\n",
359  index, index1);
361  if(index1 != -1) ImageList_Remove(ShellBigIconList, index1);
362  ret = INVALID_INDEX;
363  goto leave;
364  }
365 
366  if (index!=index1)
367  {
368  FIXME("iconlists out of sync 0x%x 0x%x\n", index, index1);
369  /* What to do ???? */
370  }
371  lpsice->dwListIndex = index;
372  ret = lpsice->dwListIndex;
373 
374 leave:
375  if(ret == INVALID_INDEX)
376  {
377  if(indexDPA != -1) DPA_DeletePtr(sic_hdpa, indexDPA);
378  HeapFree(GetProcessHeap(), 0, lpsice->sSourceFile);
379  SHFree(lpsice);
380  }
382  return ret;
383 }
static HIMAGELIST ShellBigIconList
Definition: iconcache.cpp:41
#define DPAS_SORTED
Definition: commctrl.h:4833
#define DPAS_INSERTAFTER
Definition: commctrl.h:4835
#define WARN(fmt,...)
Definition: debug.h:111
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
LPWSTR sSourceFile
Definition: iconcache.cpp:31
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define INVALID_INDEX
Definition: iconcache.cpp:27
int32_t INT
Definition: typedefs.h:56
static HIMAGELIST ShellSmallIconList
Definition: iconcache.cpp:40
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwFlags
Definition: iconcache.cpp:34
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static INT CALLBACK SIC_CompareEntries(LPVOID p1, LPVOID p2, LPARAM lparam)
Definition: iconcache.cpp:61
static HDPA sic_hdpa
Definition: iconcache.cpp:38
#define MAX_PATH
Definition: compat.h:26
Definition: iconcache.cpp:29
DWORD dwListIndex
Definition: iconcache.cpp:33
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
DWORD dwSourceIndex
Definition: iconcache.cpp:32
int ret
BOOL WINAPI ImageList_Remove(HIMAGELIST himl, INT i)
Definition: imagelist.c:2568
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define index(s, c)
Definition: various.h:29
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
Definition: dpa.c:591
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
Definition: services.c:325
struct SIC_ENTRY * LPSIC_ENTRY
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
LPVOID WINAPI DPA_DeletePtr(HDPA hdpa, INT i)
Definition: dpa.c:677
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
INT WINAPI DPA_Search(HDPA hdpa, LPVOID pFind, INT nStart, PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions)
Definition: dpa.c:845
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by SIC_Initialize(), and SIC_LoadIcon().

◆ SIC_Initialize()

BOOL SIC_Initialize ( void  )

Definition at line 484 of file iconcache.cpp.

485 {
486  HICON hSm = NULL, hLg = NULL;
487  INT cx_small, cy_small;
488  INT cx_large, cy_large;
489  HDC hDC;
490  INT bpp;
491  DWORD ilMask;
492  BOOL result = FALSE;
493 
494  TRACE("Entered SIC_Initialize\n");
495 
496  if (sic_hdpa)
497  {
498  TRACE("Icon cache already initialized\n");
499  return TRUE;
500  }
501 
502  sic_hdpa = DPA_Create(16);
503  if (!sic_hdpa)
504  {
505  return FALSE;
506  }
507 
508  hDC = CreateICW(L"DISPLAY", NULL, NULL, NULL);
509  if (!hDC)
510  {
511  ERR("Failed to create information context (error %d)\n", GetLastError());
512  goto end;
513  }
514 
516  DeleteDC(hDC);
517 
518  if (bpp <= 4)
519  ilMask = ILC_COLOR4;
520  else if (bpp <= 8)
521  ilMask = ILC_COLOR8;
522  else if (bpp <= 16)
523  ilMask = ILC_COLOR16;
524  else if (bpp <= 24)
525  ilMask = ILC_COLOR24;
526  else if (bpp <= 32)
527  ilMask = ILC_COLOR32;
528  else
529  ilMask = ILC_COLOR;
530 
531  ilMask |= ILC_MASK;
532 
533  cx_small = GetSystemMetrics(SM_CXSMICON);
534  cy_small = GetSystemMetrics(SM_CYSMICON);
535  cx_large = GetSystemMetrics(SM_CXICON);
536  cy_large = GetSystemMetrics(SM_CYICON);
537 
539  cy_small,
540  ilMask,
541  100,
542  100);
543  if (!ShellSmallIconList)
544  {
545  ERR("Failed to create the small icon list.\n");
546  goto end;
547  }
548 
550  cy_large,
551  ilMask,
552  100,
553  100);
554  if (!ShellBigIconList)
555  {
556  ERR("Failed to create the big icon list.\n");
557  goto end;
558  }
559 
560  /* Load the document icon, which is used as the default if an icon isn't found. */
563  IMAGE_ICON,
564  cx_small,
565  cy_small,
567  if (!hSm)
568  {
569  ERR("Failed to load small IDI_SHELL_DOCUMENT icon!\n");
570  goto end;
571  }
572 
575  IMAGE_ICON,
576  cx_large,
577  cy_large,
579  if (!hLg)
580  {
581  ERR("Failed to load large IDI_SHELL_DOCUMENT icon!\n");
582  goto end;
583  }
584 
586  {
587  ERR("Failed to add IDI_SHELL_DOCUMENT icon to cache.\n");
588  goto end;
589  }
591  {
592  ERR("Failed to add IDI_SHELL_DOCUMENT icon to cache.\n");
593  goto end;
594  }
595 
596  /* Everything went fine */
597  result = TRUE;
598 
599 end:
600  /* The image list keeps a copy of the icons, we must destroy them */
601  if(hSm) DestroyIcon(hSm);
602  if(hLg) DestroyIcon(hLg);
603 
604  /* Clean everything if something went wrong */
605  if(!result)
606  {
610  sic_hdpa = NULL;
613  }
614 
615  TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);
616 
617  return result;
618 }
#define ILC_COLOR16
Definition: commctrl.h:341
#define BITSPIXEL
Definition: wingdi.h:719
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
static HIMAGELIST ShellBigIconList
Definition: iconcache.cpp:41
#define LR_SHARED
Definition: winuser.h:1090
HDPA WINAPI DPA_Create(INT nGrow)
Definition: dpa.c:950
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI DPA_Destroy(HDPA hdpa)
Definition: dpa.c:396
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
static HDC
Definition: imagelist.c:92
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SM_CYSMICON
Definition: winuser.h:1003
GLuint GLuint end
Definition: gl.h:1545
#define INVALID_INDEX
Definition: iconcache.cpp:27
int32_t INT
Definition: typedefs.h:56
static INT SIC_IconAppend(LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags)
Definition: iconcache.cpp:326
#define ILC_COLOR4
Definition: commctrl.h:339
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define ILC_COLOR32
Definition: commctrl.h:343
static HIMAGELIST ShellSmallIconList
Definition: iconcache.cpp:40
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define ILC_COLOR
Definition: commctrl.h:337
#define SM_CXICON
Definition: winuser.h:962
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static HDPA sic_hdpa
Definition: iconcache.cpp:38
#define ILC_COLOR24
Definition: commctrl.h:342
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SM_CXSMICON
Definition: winuser.h:1002
#define SM_CYICON
Definition: winuser.h:963
static const WCHAR L[]
Definition: oid.c:1250
#define IDI_SHELL_DOCUMENT
Definition: shresdef.h:464
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define ILC_MASK
Definition: commctrl.h:336
#define ERR(fmt,...)
Definition: debug.h:109
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI DeleteDC(_In_ HDC)
HDC WINAPI CreateICW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ const DEVMODEW *)
#define ILC_COLOR8
Definition: commctrl.h:340
DWORD bpp
Definition: surface.c:181
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
GLuint64EXT * result
Definition: glext.h:11304

Referenced by FileIconInit(), PidlToSicIndex(), Shell_GetImageLists(), SIC_GetIconIndex(), and SIC_LoadOverlayIcon().

◆ SIC_LoadIcon()

static INT SIC_LoadIcon ( LPCWSTR  sSourceFile,
INT  dwSourceIndex,
DWORD  dwFlags 
)
static

Definition at line 390 of file iconcache.cpp.

391 {
392  HICON hiconLarge=0;
393  HICON hiconSmall=0;
394  UINT ret;
395 
396  PrivateExtractIconsW(sSourceFile, dwSourceIndex, 32, 32, &hiconLarge, NULL, 1, LR_COPYFROMRESOURCE);
397  PrivateExtractIconsW(sSourceFile, dwSourceIndex, 16, 16, &hiconSmall, NULL, 1, LR_COPYFROMRESOURCE);
398 
399  if ( !hiconLarge || !hiconSmall)
400  {
401  WARN("failure loading icon %i from %s (%p %p)\n", dwSourceIndex, debugstr_w(sSourceFile), hiconLarge, hiconSmall);
402  if(hiconLarge) DestroyIcon(hiconLarge);
403  if(hiconSmall) DestroyIcon(hiconSmall);
404  return INVALID_INDEX;
405  }
406 
407  if (0 != (dwFlags & GIL_FORSHORTCUT))
408  {
409  HICON hiconLargeShortcut = SIC_OverlayShortcutImage(hiconLarge, TRUE);
410  HICON hiconSmallShortcut = SIC_OverlayShortcutImage(hiconSmall, FALSE);
411  if (NULL != hiconLargeShortcut && NULL != hiconSmallShortcut)
412  {
413  DestroyIcon(hiconLarge);
414  DestroyIcon(hiconSmall);
415  hiconLarge = hiconLargeShortcut;
416  hiconSmall = hiconSmallShortcut;
417  }
418  else
419  {
420  WARN("Failed to create shortcut overlayed icons\n");
421  if (NULL != hiconLargeShortcut) DestroyIcon(hiconLargeShortcut);
422  if (NULL != hiconSmallShortcut) DestroyIcon(hiconSmallShortcut);
423  dwFlags &= ~ GIL_FORSHORTCUT;
424  }
425  }
426 
427  ret = SIC_IconAppend (sSourceFile, dwSourceIndex, hiconSmall, hiconLarge, dwFlags);
428  DestroyIcon(hiconLarge);
429  DestroyIcon(hiconSmall);
430  return ret;
431 }
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define WARN(fmt,...)
Definition: debug.h:111
#define INVALID_INDEX
Definition: iconcache.cpp:27
static INT SIC_IconAppend(LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags)
Definition: iconcache.cpp:326
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
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)
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
Definition: iconcache.cpp:91
#define LR_COPYFROMRESOURCE
Definition: winuser.h:1089
unsigned int UINT
Definition: ndis.h:50

Referenced by PidlToSicIndex(), SIC_GetIconIndex(), and SIC_LoadOverlayIcon().

◆ SIC_LoadOverlayIcon()

static int SIC_LoadOverlayIcon ( int  icon_idx)
static

Definition at line 655 of file iconcache.cpp.

656 {
657  WCHAR buffer[1024], wszIdx[8];
658  HKEY hKeyShellIcons;
659  LPCWSTR iconPath;
660  int iconIdx;
661 
662  static const WCHAR wszShellIcons[] = {
663  'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
664  'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
665  'E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','I','c','o','n','s',0
666  };
667  static const WCHAR wszNumFmt[] = {'%','d',0};
668 
669  iconPath = swShell32Name; /* default: load icon from shell32.dll */
670  iconIdx = icon_idx;
671 
672  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszShellIcons, 0, KEY_READ, &hKeyShellIcons) == ERROR_SUCCESS)
673  {
674  DWORD count = sizeof(buffer);
675 
676  swprintf(wszIdx, wszNumFmt, icon_idx);
677 
678  /* read icon path and index */
679  if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS)
680  {
681  LPWSTR p = wcschr(buffer, ',');
682 
683  if (p)
684  *p++ = 0;
685 
686  iconPath = buffer;
687  iconIdx = _wtoi(p);
688  }
689 
690  RegCloseKey(hKeyShellIcons);
691  }
692 
693  if (!sic_hdpa)
694  SIC_Initialize();
695 
696  return SIC_LoadIcon(iconPath, iconIdx, 0);
697 }
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define KEY_READ
Definition: nt_native.h:1023
GLuint GLuint GLsizei count
Definition: gl.h:1545
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
GLuint buffer
Definition: glext.h:5915
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
static INT SIC_LoadIcon(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
Definition: iconcache.cpp:390
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HDPA sic_hdpa
Definition: iconcache.cpp:38
#define swprintf(buf, format,...)
Definition: sprintf.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:484
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by SIC_OverlayShortcutImage().

◆ SIC_OverlayShortcutImage()

static HICON SIC_OverlayShortcutImage ( HICON  SourceIcon,
BOOL  large 
)
static

Definition at line 91 of file iconcache.cpp.

92 {
93  ICONINFO ShortcutIconInfo, TargetIconInfo;
94  HICON ShortcutIcon = NULL, TargetIcon;
95  BITMAP TargetBitmapInfo, ShortcutBitmapInfo;
96  HDC ShortcutDC = NULL,
97  TargetDC = NULL;
98  HBITMAP OldShortcutBitmap = NULL,
99  OldTargetBitmap = NULL;
100 
101  static int s_imgListIdx = -1;
102  ZeroMemory(&ShortcutIconInfo, sizeof(ShortcutIconInfo));
103  ZeroMemory(&TargetIconInfo, sizeof(TargetIconInfo));
104 
105  /* Get information about the source icon and shortcut overlay.
106  * We will write over the source bitmaps to get the final ones */
107  if (! GetIconInfo(SourceIcon, &TargetIconInfo))
108  return NULL;
109 
110  /* Is it possible with the ImageList implementation? */
111  if(!TargetIconInfo.hbmColor)
112  {
113  /* Maybe we'll support this at some point */
114  FIXME("1bpp icon wants its overlay!\n");
115  goto fail;
116  }
117 
118  if(!GetObjectW(TargetIconInfo.hbmColor, sizeof(BITMAP), &TargetBitmapInfo))
119  {
120  goto fail;
121  }
122 
123  /* search for the shortcut icon only once */
124  if (s_imgListIdx == -1)
125  s_imgListIdx = SIC_LoadOverlayIcon(- IDI_SHELL_SHORTCUT);
126  /* FIXME should use icon index 29 instead of the
127  resource id, but not all icons are present yet
128  so we can't use icon indices */
129 
130  if (s_imgListIdx != -1)
131  {
132  if (large)
133  ShortcutIcon = ImageList_GetIcon(ShellBigIconList, s_imgListIdx, ILD_TRANSPARENT);
134  else
135  ShortcutIcon = ImageList_GetIcon(ShellSmallIconList, s_imgListIdx, ILD_TRANSPARENT);
136  } else
137  ShortcutIcon = NULL;
138 
139  if (!ShortcutIcon || !GetIconInfo(ShortcutIcon, &ShortcutIconInfo))
140  {
141  goto fail;
142  }
143 
144  /* Is it possible with the ImageLists ? */
145  if(!ShortcutIconInfo.hbmColor)
146  {
147  /* Maybe we'll support this at some point */
148  FIXME("Should draw 1bpp overlay!\n");
149  goto fail;
150  }
151 
152  if(!GetObjectW(ShortcutIconInfo.hbmColor, sizeof(BITMAP), &ShortcutBitmapInfo))
153  {
154  goto fail;
155  }
156 
157  /* Setup the masks */
158  ShortcutDC = CreateCompatibleDC(NULL);
159  if (NULL == ShortcutDC) goto fail;
160  OldShortcutBitmap = (HBITMAP)SelectObject(ShortcutDC, ShortcutIconInfo.hbmMask);
161  if (NULL == OldShortcutBitmap) goto fail;
162 
163  TargetDC = CreateCompatibleDC(NULL);
164  if (NULL == TargetDC) goto fail;
165  OldTargetBitmap = (HBITMAP)SelectObject(TargetDC, TargetIconInfo.hbmMask);
166  if (NULL == OldTargetBitmap) goto fail;
167 
168  /* Create the complete mask by ANDing the source and shortcut masks.
169  * NOTE: in an ImageList, all icons have the same dimensions */
170  if (!BitBlt(TargetDC, 0, 0, ShortcutBitmapInfo.bmWidth, ShortcutBitmapInfo.bmHeight,
171  ShortcutDC, 0, 0, SRCAND))
172  {
173  goto fail;
174  }
175 
176  /*
177  * We must remove or add the alpha component to the shortcut overlay:
178  * If we don't, SRCCOPY will copy it to our resulting icon, resulting in a
179  * partially transparent icons where it shouldn't be, and to an invisible icon
180  * if the underlying icon don't have any alpha channel information. (16bpp only icon for instance).
181  * But if the underlying icon has alpha channel information, then we must mark the overlay information
182  * as opaque.
183  * NOTE: This code sucks(tm) and should belong to the ImageList implementation.
184  * NOTE2: there are better ways to do this.
185  */
186  if(ShortcutBitmapInfo.bmBitsPixel == 32)
187  {
188  BOOL add_alpha;
189  BYTE buffer[sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD)];
190  BITMAPINFO* lpbmi = (BITMAPINFO*)buffer;
191  PVOID bits;
192  PULONG pixel;
193  INT i, j;
194 
195  /* Find if the source bitmap has an alpha channel */
196  if(TargetBitmapInfo.bmBitsPixel != 32) add_alpha = FALSE;
197  else
198  {
199  ZeroMemory(buffer, sizeof(buffer));
200  lpbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
201  lpbmi->bmiHeader.biWidth = TargetBitmapInfo.bmWidth;
202  lpbmi->bmiHeader.biHeight = TargetBitmapInfo.bmHeight;
203  lpbmi->bmiHeader.biPlanes = 1;
204  lpbmi->bmiHeader.biBitCount = 32;
205 
206  bits = HeapAlloc(GetProcessHeap(), 0, TargetBitmapInfo.bmHeight * TargetBitmapInfo.bmWidthBytes);
207 
208  if(!bits) goto fail;
209 
210  if(!GetDIBits(TargetDC, TargetIconInfo.hbmColor, 0, TargetBitmapInfo.bmHeight, bits, lpbmi, DIB_RGB_COLORS))
211  {
212  ERR("GetBIBits failed!\n");
214  goto fail;
215  }
216 
217  i = j = 0;
218  pixel = (PULONG)bits;
219 
220  for(i=0; i<TargetBitmapInfo.bmHeight; i++)
221  {
222  for(j=0; j<TargetBitmapInfo.bmWidth; j++)
223  {
224  add_alpha = (*pixel++ & 0xFF000000) != 0;
225  if(add_alpha) break;
226  }
227  if(add_alpha) break;
228  }
230  }
231 
232  /* Allocate the bits */
233  bits = HeapAlloc(GetProcessHeap(), 0, ShortcutBitmapInfo.bmHeight*ShortcutBitmapInfo.bmWidthBytes);
234  if(!bits) goto fail;
235 
236  ZeroMemory(buffer, sizeof(buffer));
237  lpbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
238  lpbmi->bmiHeader.biWidth = ShortcutBitmapInfo.bmWidth;
239  lpbmi->bmiHeader.biHeight = ShortcutBitmapInfo.bmHeight;
240  lpbmi->bmiHeader.biPlanes = 1;
241  lpbmi->bmiHeader.biBitCount = 32;
242 
243  if(!GetDIBits(TargetDC, ShortcutIconInfo.hbmColor, 0, ShortcutBitmapInfo.bmHeight, bits, lpbmi, DIB_RGB_COLORS))
244  {
245  ERR("GetBIBits failed!\n");
247  goto fail;
248  }
249 
250  pixel = (PULONG)bits;
251  /* Remove alpha channel component or make it totally opaque */
252  for(i=0; i<ShortcutBitmapInfo.bmHeight; i++)
253  {
254  for(j=0; j<ShortcutBitmapInfo.bmWidth; j++)
255  {
256  if(add_alpha) *pixel++ |= 0xFF000000;
257  else *pixel++ &= 0x00FFFFFF;
258  }
259  }
260 
261  /* GetDIBits return BI_BITFIELDS with masks set to 0, and SetDIBits fails when masks are 0. The irony... */
262  lpbmi->bmiHeader.biCompression = BI_RGB;
263 
264  /* Set the bits again */
265  if(!SetDIBits(TargetDC, ShortcutIconInfo.hbmColor, 0, ShortcutBitmapInfo.bmHeight, bits, lpbmi, DIB_RGB_COLORS))
266  {
267  ERR("SetBIBits failed!, %lu\n", GetLastError());
269  goto fail;
270  }
272  }
273 
274  /* Now do the copy. We overwrite the original icon data */
275  if (NULL == SelectObject(ShortcutDC, ShortcutIconInfo.hbmColor) ||
276  NULL == SelectObject(TargetDC, TargetIconInfo.hbmColor))
277  goto fail;
278  if (!MaskBlt(TargetDC, 0, 0, ShortcutBitmapInfo.bmWidth, ShortcutBitmapInfo.bmHeight,
279  ShortcutDC, 0, 0, ShortcutIconInfo.hbmMask, 0, 0,
280  MAKEROP4(0xAA0000, SRCCOPY)))
281  {
282  goto fail;
283  }
284 
285  /* Clean up, we're not goto'ing to 'fail' after this so we can be lazy and not set
286  handles to NULL */
287  SelectObject(TargetDC, OldTargetBitmap);
288  DeleteDC(TargetDC);
289  SelectObject(ShortcutDC, OldShortcutBitmap);
290  DeleteDC(ShortcutDC);
291 
292  /* Create the icon using the bitmaps prepared earlier */
293  TargetIcon = CreateIconIndirect(&TargetIconInfo);
294 
295  /* CreateIconIndirect copies the bitmaps, so we can release our bitmaps now */
296  DeleteObject(TargetIconInfo.hbmColor);
297  DeleteObject(TargetIconInfo.hbmMask);
298  /* Delete what GetIconInfo gave us */
299  DeleteObject(ShortcutIconInfo.hbmColor);
300  DeleteObject(ShortcutIconInfo.hbmMask);
301  DestroyIcon(ShortcutIcon);
302 
303  return TargetIcon;
304 
305 fail:
306  /* Clean up scratch resources we created */
307  if (NULL != OldTargetBitmap) SelectObject(TargetDC, OldTargetBitmap);
308  if (NULL != TargetDC) DeleteDC(TargetDC);
309  if (NULL != OldShortcutBitmap) SelectObject(ShortcutDC, OldShortcutBitmap);
310  if (NULL != ShortcutDC) DeleteDC(ShortcutDC);
311  if (NULL != TargetIconInfo.hbmColor) DeleteObject(TargetIconInfo.hbmColor);
312  if (NULL != TargetIconInfo.hbmMask) DeleteObject(TargetIconInfo.hbmMask);
313  if (NULL != ShortcutIconInfo.hbmColor) DeleteObject(ShortcutIconInfo.hbmColor);
314  if (NULL != ShortcutIconInfo.hbmMask) DeleteObject(ShortcutIconInfo.hbmMask);
315  if (NULL != ShortcutIcon) DestroyIcon(ShortcutIcon);
316 
317  return NULL;
318 }
static HICON
Definition: imagelist.c:84
static HIMAGELIST ShellBigIconList
Definition: iconcache.cpp:41
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1471
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLuint buffer
Definition: glext.h:5915
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static int SIC_LoadOverlayIcon(int icon_idx)
Definition: iconcache.cpp:655
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
int32_t INT
Definition: typedefs.h:56
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2014
static HIMAGELIST ShellSmallIconList
Definition: iconcache.cpp:40
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
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
HBITMAP hbmMask
Definition: winuser.h:3100
#define FIXME(fmt,...)
Definition: debug.h:110
DWORD biCompression
Definition: amvideo.idl:35
smooth NULL
Definition: ftsmooth.c:416
HBITMAP hbmColor
Definition: winuser.h:3101
#define MAKEROP4(f, b)
Definition: wingdi.h:2941
#define IDI_SHELL_SHORTCUT
Definition: shresdef.h:493
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
Definition: glfuncs.h:250
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HICON WINAPI ImageList_GetIcon(HIMAGELIST himl, INT i, UINT fStyle)
Definition: imagelist.c:1963
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition: cursoricon.c:2546
unsigned char BYTE
Definition: mem.h:68
#define ERR(fmt,...)
Definition: debug.h:109
#define ILD_TRANSPARENT
Definition: commctrl.h:403
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI DeleteDC(_In_ HDC)
Definition: bl.h:1331
unsigned int * PULONG
Definition: retypes.h:1
#define SRCAND
Definition: wingdi.h:329
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)
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)
static HBITMAP
Definition: button.c:44
#define DIB_RGB_COLORS
Definition: wingdi.h:366
int WINAPI SetDIBits(_In_opt_ HDC, _In_ HBITMAP, _In_ UINT, _In_ UINT, _In_ CONST VOID *, _In_ CONST BITMAPINFO *, _In_ UINT)
#define BI_RGB
Definition: precomp.h:34
#define HeapFree(x, y, z)
Definition: compat.h:394
#define SRCCOPY
Definition: wingdi.h:332
struct tagBITMAPINFO BITMAPINFO

Referenced by SIC_LoadIcon().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ ShellBigIconList

HIMAGELIST ShellBigIconList
static

◆ ShellSmallIconList

HIMAGELIST ShellSmallIconList
static

◆ sic_hdpa