ReactOS  0.4.13-dev-259-g5ca9c9c
shell32_main.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ARRAY_SIZE(a)   (sizeof(a) / sizeof(*(a)))
 
#define INVALID_INDEX   -1
 
#define InitFormatEtc(fe, cf, med)
 
#define KeyStateToDropEffect(kst)
 
#define ASK_DELETE_FILE   1
 
#define ASK_DELETE_FOLDER   2
 
#define ASK_DELETE_MULTIPLE_ITEM   3
 
#define ASK_CREATE_FOLDER   4
 
#define ASK_OVERWRITE_FILE   5
 
#define ASK_DELETE_SELECTED   6
 
#define ASK_TRASH_FILE   7
 
#define ASK_TRASH_FOLDER   8
 
#define ASK_TRASH_MULTIPLE_ITEM   9
 
#define ASK_CANT_TRASH_ITEM   10
 
#define ASK_OVERWRITE_FOLDER   11
 
#define __SHFreeAndNil(ptr)
 
#define HICON_16(h32)   (LOWORD(h32))
 
#define HICON_32(h16)   ((HICON)(ULONG_PTR)(h16))
 
#define HINSTANCE_32(h16)   ((HINSTANCE)(ULONG_PTR)(h16))
 
#define HINSTANCE_16(h32)   (LOWORD(h32))
 

Functions

BOOL WINAPI Shell_GetImageLists (HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
 
BOOL SIC_Initialize (void)
 
void SIC_Destroy (void) DECLSPEC_HIDDEN
 
BOOL PidlToSicIndex (IShellFolder *sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int *pIndex) DECLSPEC_HIDDEN
 
INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags) DECLSPEC_HIDDEN
 
BOOL HCR_MapTypeToValueW (LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN
 
BOOL HCR_GetDefaultVerbW (HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len) DECLSPEC_HIDDEN
 
BOOL HCR_GetExecuteCommandW (HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len) DECLSPEC_HIDDEN
 
BOOL HCR_GetIconW (LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
 
BOOL HCR_GetClassNameW (REFIID riid, LPWSTR szDest, DWORD len) DECLSPEC_HIDDEN
 
BOOL HCR_MapTypeToValueA (LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN
 
BOOL HCR_GetIconA (LPCSTR szClass, LPSTR szDest, LPCSTR sName, DWORD len, int *picon_idx)
 
BOOL HCR_GetClassNameA (REFIID riid, LPSTR szDest, DWORD len) DECLSPEC_HIDDEN
 
BOOL HCR_GetFolderAttributes (LPCITEMIDLIST pidlFolder, LPDWORD dwAttributes) DECLSPEC_HIDDEN
 
DWORD WINAPI ParseFieldA (LPCSTR src, DWORD nField, LPSTR dst, DWORD len) DECLSPEC_HIDDEN
 
DWORD WINAPI ParseFieldW (LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) DECLSPEC_HIDDEN
 
HRESULT IDataObject_Constructor (HWND hwndOwner, LPCITEMIDLIST pMyPidl, PCUITEMID_CHILD_ARRAY apidl, UINT cidl, IDataObject **dataObject)
 
HRESULT IEnumFORMATETC_Constructor (UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **enumerator)
 
LPCLASSFACTORY IClassFactory_Constructor (REFCLSID)
 
IContextMenu2ISvItemCm_Constructor (LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *aPidls, UINT uItemCount)
 
HRESULT WINAPI INewItem_Constructor (IUnknown *pUnkOuter, REFIID riif, LPVOID *ppv)
 
IContextMenu2ISvStaticItemCm_Constructor (LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *apidl, UINT cidl, HKEY hKey)
 
IContextMenu2ISvBgCm_Constructor (LPSHELLFOLDER pSFParent, BOOL bDesktop)
 
HRESULT WINAPI CDefViewDual_Constructor (REFIID riid, LPVOID *ppvOut)
 
HRESULT WINAPI CShellDispatch_Constructor (REFIID riid, LPVOID *ppvOut)
 
HRESULT WINAPI IShellLink_ConstructFromPath (WCHAR *path, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI IShellLink_ConstructFromFile (IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI IFileSystemBindData_Constructor (const WIN32_FIND_DATAW *pfd, LPBC *ppV)
 
HRESULT WINAPI CPanel_ExtractIconA (LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN
 
HRESULT WINAPI CPanel_ExtractIconW (LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN
 
HRESULT CRegFolder_CreateInstance (const GUID *pGuid, LPCITEMIDLIST pidlRoot, LPCWSTR lpszPath, LPCWSTR lpszEnumKeyName, REFIID riid, void **ppv)
 
HGLOBAL RenderHDROP (LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
 
HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
 
HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
 
HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
 
void InitChangeNotifications (void) DECLSPEC_HIDDEN
 
void FreeChangeNotifications (void) DECLSPEC_HIDDEN
 
BOOL SHELL_DeleteDirectoryW (HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI)
 
BOOL SHELL_ConfirmYesNoW (HWND hWnd, int nKindOfDialog, LPCWSTR szDir)
 
void WINAPI _InsertMenuItemW (HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
 
static __inline BOOL SHELL_OsIsUnicode (void)
 
static __inline void __SHCloneStrA (char **target, const char *source)
 
static __inline void __SHCloneStrWtoA (char **target, const WCHAR *source)
 
static __inline void __SHCloneStrW (WCHAR **target, const WCHAR *source)
 
static __inline LPWSTR __SHCloneStrAtoW (WCHAR **target, const char *source)
 
BOOL UNIXFS_is_rooted_at_desktop (void) DECLSPEC_HIDDEN
 
HRESULT SHELL_RegisterShellFolders (void) DECLSPEC_HIDDEN
 
BOOL SHELL_IsShortcut (LPCITEMIDLIST) DECLSPEC_HIDDEN
 
INT_PTR CALLBACK SH_FileGeneralDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK SH_FileVersionDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HPROPSHEETPAGE SH_CreatePropertySheetPage (WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle)
 
HRESULT SH_ShowDriveProperties (WCHAR *drive, LPCITEMIDLIST pidlFolder, PCUITEMID_CHILD_ARRAY apidl)
 
BOOL SH_ShowRecycleBinProperties (WCHAR sDrive)
 
BOOL SH_ShowPropertiesDialog (LPCWSTR pwszPath, LPCITEMIDLIST pidlFolder, PCUITEMID_CHILD_ARRAY apidl)
 
LPWSTR SH_FormatFileSizeWithBytes (PULARGE_INTEGER lpQwSize, LPWSTR pszBuf, UINT cchBuf)
 
HRESULT WINAPI DoRegisterServer (void)
 
HRESULT WINAPI DoUnregisterServer (void)
 

Variables

HMODULE huser32 DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ __SHFreeAndNil

#define __SHFreeAndNil (   ptr)
Value:
{\
SHFree(*ptr); \
*ptr = NULL; \
};
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416

Definition at line 136 of file shell32_main.h.

◆ ARRAY_SIZE

#define ARRAY_SIZE (   a)    (sizeof(a) / sizeof(*(a)))

Definition at line 29 of file shell32_main.h.

◆ ASK_CANT_TRASH_ITEM

#define ASK_CANT_TRASH_ITEM   10

Definition at line 121 of file shell32_main.h.

◆ ASK_CREATE_FOLDER

#define ASK_CREATE_FOLDER   4

Definition at line 115 of file shell32_main.h.

◆ ASK_DELETE_FILE

#define ASK_DELETE_FILE   1

Definition at line 112 of file shell32_main.h.

◆ ASK_DELETE_FOLDER

#define ASK_DELETE_FOLDER   2

Definition at line 113 of file shell32_main.h.

◆ ASK_DELETE_MULTIPLE_ITEM

#define ASK_DELETE_MULTIPLE_ITEM   3

Definition at line 114 of file shell32_main.h.

◆ ASK_DELETE_SELECTED

#define ASK_DELETE_SELECTED   6

Definition at line 117 of file shell32_main.h.

◆ ASK_OVERWRITE_FILE

#define ASK_OVERWRITE_FILE   5

Definition at line 116 of file shell32_main.h.

◆ ASK_OVERWRITE_FOLDER

#define ASK_OVERWRITE_FOLDER   11

Definition at line 122 of file shell32_main.h.

◆ ASK_TRASH_FILE

#define ASK_TRASH_FILE   7

Definition at line 118 of file shell32_main.h.

◆ ASK_TRASH_FOLDER

#define ASK_TRASH_FOLDER   8

Definition at line 119 of file shell32_main.h.

◆ ASK_TRASH_MULTIPLE_ITEM

#define ASK_TRASH_MULTIPLE_ITEM   9

Definition at line 120 of file shell32_main.h.

◆ HICON_16

#define HICON_16 (   h32)    (LOWORD(h32))

Definition at line 169 of file shell32_main.h.

◆ HICON_32

#define HICON_32 (   h16)    ((HICON)(ULONG_PTR)(h16))

Definition at line 170 of file shell32_main.h.

◆ HINSTANCE_16

#define HINSTANCE_16 (   h32)    (LOWORD(h32))

Definition at line 172 of file shell32_main.h.

◆ HINSTANCE_32

#define HINSTANCE_32 (   h16)    ((HINSTANCE)(ULONG_PTR)(h16))

Definition at line 171 of file shell32_main.h.

◆ InitFormatEtc

#define InitFormatEtc (   fe,
  cf,
  med 
)
Value:
{\
(fe).cfFormat=cf;\
(fe).dwAspect=DVASPECT_CONTENT;\
(fe).ptd=NULL;\
(fe).tymed=med;\
(fe).lindex=-1;\
};
smooth NULL
Definition: ftsmooth.c:416
static DWORD tymed
Definition: url.c:173

Definition at line 86 of file shell32_main.h.

◆ INVALID_INDEX

#define INVALID_INDEX   -1

Definition at line 40 of file shell32_main.h.

◆ KeyStateToDropEffect

#define KeyStateToDropEffect (   kst)
Value:
((((kst)&(MK_CONTROL|MK_SHIFT))==(MK_CONTROL|MK_SHIFT)) ? DROPEFFECT_LINK :\
(((kst)&(MK_CONTROL)) ? DROPEFFECT_COPY :\
(((kst)&(MK_SHIFT)) ? DROPEFFECT_MOVE :\
DROPEFFECT_NONE)))
#define MK_SHIFT
Definition: winuser.h:2323
#define MK_CONTROL
Definition: winuser.h:2324

Definition at line 95 of file shell32_main.h.

Function Documentation

◆ __SHCloneStrA()

static __inline void __SHCloneStrA ( char **  target,
const char source 
)
static

Definition at line 141 of file shell32_main.h.

142 {
143  *target = (char *)SHAlloc(strlen(source) + 1);
144  strcpy(*target, source);
145 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
GLenum target
Definition: glext.h:7315
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

◆ __SHCloneStrAtoW()

static __inline LPWSTR __SHCloneStrAtoW ( WCHAR **  target,
const char source 
)
static

Definition at line 160 of file shell32_main.h.

161 {
162  int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0);
163  *target = (WCHAR *)SHAlloc(len * sizeof(WCHAR));
165  return *target;
166 }
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
GLenum target
Definition: glext.h:7315
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

Referenced by FindExecutableA(), OpenAs_RunDLLA(), ShellExecuteExA(), and WOWShellExecute().

◆ __SHCloneStrW()

static __inline void __SHCloneStrW ( WCHAR **  target,
const WCHAR source 
)
static

Definition at line 154 of file shell32_main.h.

155 {
156  *target = (WCHAR *)SHAlloc((lstrlenW(source) + 1) * sizeof(WCHAR) );
158 }
#define lstrlenW
Definition: compat.h:407
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define lstrcpyW
Definition: compat.h:406
GLenum target
Definition: glext.h:7315
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

Referenced by ShellExecCmdLine().

◆ __SHCloneStrWtoA()

static __inline void __SHCloneStrWtoA ( char **  target,
const WCHAR source 
)
static

Definition at line 147 of file shell32_main.h.

148 {
149  int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL);
150  *target = (char *)SHAlloc(len);
152 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
GLenum GLsizei len
Definition: glext.h:6722
GLenum target
Definition: glext.h:7315
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

◆ _InsertMenuItemW()

void WINAPI _InsertMenuItemW ( HMENU  hmenu,
UINT  indexMenu,
BOOL  fByPosition,
UINT  wID,
UINT  fType,
LPCWSTR  dwTypeData,
UINT  fState 
)

Definition at line 418 of file shfldr_netconnect.cpp.

426 {
427  MENUITEMINFOW mii;
428  WCHAR szText[100];
429 
430  ZeroMemory(&mii, sizeof(mii));
431  mii.cbSize = sizeof(mii);
432  if (fType == MFT_SEPARATOR)
433  {
434  mii.fMask = MIIM_ID | MIIM_TYPE;
435  }
436  else if (fType == MFT_STRING)
437  {
438  mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE;
439  if ((ULONG_PTR)HIWORD((ULONG_PTR)dwTypeData) == 0)
440  {
441  if (LoadStringW(netshell_hInstance, LOWORD((ULONG_PTR)dwTypeData), szText, sizeof(szText)/sizeof(WCHAR)))
442  {
443  szText[(sizeof(szText)/sizeof(WCHAR))-1] = 0;
444  mii.dwTypeData = szText;
445  }
446  else
447  {
448  return;
449  }
450  }
451  else
452  {
453  mii.dwTypeData = (LPWSTR) dwTypeData;
454  }
455  mii.fState = fState;
456  }
457 
458  mii.wID = wID;
459  mii.fType = fType;
460  InsertMenuItemW( hmenu, indexMenu, fByPosition, &mii);
461 }
#define MFT_STRING
Definition: winuser.h:741
static HMENU hmenu
Definition: win.c:66
#define ZeroMemory
Definition: winbase.h:1635
LPWSTR dwTypeData
Definition: winuser.h:3211
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
uint32_t ULONG_PTR
Definition: typedefs.h:63
static const WCHAR szText[]
Definition: dialog.c:139
#define MIIM_STATE
Definition: winuser.h:716
#define MIIM_ID
Definition: winuser.h:717
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MFT_SEPARATOR
Definition: winuser.h:739
#define MIIM_TYPE
Definition: winuser.h:720
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
#define HIWORD(l)
Definition: typedefs.h:246
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LOWORD(l)
Definition: pedump.c:82

Referenced by CDrivesFolder::CallBack(), CDesktopFolder::CallBack(), CFSFolder::CallBack(), DrivesContextMenuCallback(), CCPLItemMenu::QueryContextMenu(), CNetConUiObject::QueryContextMenu(), and CRecycleBinItemContextMenu::QueryContextMenu().

◆ CDefViewDual_Constructor()

HRESULT WINAPI CDefViewDual_Constructor ( REFIID  riid,
LPVOID ppvOut 
)

Definition at line 139 of file CDefViewDual.cpp.

140 {
141  return ShellObjectCreatorInit<CDefViewDual>(riid, ppvOut);
142 }
REFIID riid
Definition: precomp.h:44

Referenced by CDefView::GetItemObject().

◆ CPanel_ExtractIconA()

HRESULT WINAPI CPanel_ExtractIconA ( LPITEMIDLIST  pidl,
LPCSTR  pszFile,
UINT  nIconIndex,
HICON phiconLarge,
HICON phiconSmall,
UINT  nIconSize 
)

◆ CPanel_ExtractIconW()

HRESULT WINAPI CPanel_ExtractIconW ( LPITEMIDLIST  pidl,
LPCWSTR  pszFile,
UINT  nIconIndex,
HICON phiconLarge,
HICON phiconSmall,
UINT  nIconSize 
)

◆ CRegFolder_CreateInstance()

HRESULT CRegFolder_CreateInstance ( const GUID pGuid,
LPCITEMIDLIST  pidlRoot,
LPCWSTR  lpszPath,
LPCWSTR  lpszEnumKeyName,
REFIID  riid,
void **  ppv 
)

Definition at line 759 of file CRegFolder.cpp.

760 {
761  return ShellObjectCreatorInit<CRegFolder>(pGuid, pidlRoot, lpszPath, lpszEnumKeyName, riid, ppv);
762 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by CDrivesFolder::FinalConstruct(), CDesktopFolder::FinalConstruct(), and CControlPanelFolder::Initialize().

◆ CShellDispatch_Constructor()

HRESULT WINAPI CShellDispatch_Constructor ( REFIID  riid,
LPVOID ppvOut 
)

Definition at line 422 of file CShellDispatch.cpp.

423 {
424  return ShellObjectCreatorInit<CShellDispatch>(riid, ppvOut);
425 }
REFIID riid
Definition: precomp.h:44

Referenced by CDefViewDual::get_Application(), and CFolder::Initialize().

◆ DoRegisterServer()

HRESULT WINAPI DoRegisterServer ( void  )

◆ DoUnregisterServer()

HRESULT WINAPI DoUnregisterServer ( void  )

◆ FreeChangeNotifications()

void FreeChangeNotifications ( void  )

Definition at line 190 of file changenotify.c.

191 {
193 
194  TRACE("\n");
195 
197 
199  DeleteNode( ptr );
200 
202 
203 #ifdef __REACTOS__
204  QueueUserAPC(_RequestAllTermination, m_hThread, (ULONG_PTR) NULL );
205 #endif
206 
208 }
static struct list notifications
Definition: changenotify.c:90
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
uint32_t ULONG_PTR
Definition: typedefs.h:63
DWORD WINAPI QueueUserAPC(IN PAPCFUNC pfnAPC, IN HANDLE hThread, IN ULONG_PTR dwData)
Definition: thread.c:909
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
static void DeleteNode(LPNOTIFICATIONLIST item)
Definition: changenotify.c:157
#define TRACE(s)
Definition: solgame.cpp:4
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
uint32_t entry
Definition: isohybrid.c:63
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
static CRITICAL_SECTION SHELL32_ChangenotifyCS
Definition: changenotify.c:43
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ HCR_GetClassNameA()

BOOL HCR_GetClassNameA ( REFIID  riid,
LPSTR  szDest,
DWORD  len 
)

Definition at line 423 of file classes.c.

424 { HKEY hkey;
425  BOOL ret = FALSE;
426  DWORD buflen = len;
427 #ifdef __REACTOS__
428  CHAR szName[100];
429  LPOLESTR pStr;
430 #endif
431 
432  szDest[0] = 0;
433 
434 #ifdef __REACTOS__
435  if (StringFromCLSID(riid, &pStr) == S_OK)
436  {
437  DWORD dwLen = buflen * sizeof(CHAR);
438  sprintf(szName, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%S", pStr);
439  if (!RegGetValueA(HKEY_CURRENT_USER, szName, NULL, RRF_RT_REG_SZ, NULL, (PVOID)szDest, &dwLen))
440  {
441  ret = TRUE;
442  }
443  CoTaskMemFree(pStr);
444  }
445  if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
446 #else
447  if (HCR_RegOpenClassIDKey(riid, &hkey))
448 #endif
449  {
450  if (!RegLoadMUIStringA(hkey,"LocalizedString",szDest,len,NULL,0,NULL) ||
451  !RegQueryValueExA(hkey,"",0,NULL,(LPBYTE)szDest,&len))
452  {
453  ret = TRUE;
454  }
455  RegCloseKey(hkey);
456  }
457 
458  if (!ret || !szDest[0])
459  {
460  if(IsEqualIID(riid, &CLSID_ShellDesktop))
461  {
462  if (LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
463  ret = TRUE;
464  }
465  else if (IsEqualIID(riid, &CLSID_MyComputer))
466  {
467  if(LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
468  ret = TRUE;
469  }
470 #ifdef __REACTOS__
471  else if (IsEqualIID(riid, &CLSID_MyDocuments))
472  {
473  if(LoadStringA(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
474  ret = TRUE;
475  }
476  else if (IsEqualIID(riid, &CLSID_RecycleBin))
477  {
479  ret = TRUE;
480  }
481  else if (IsEqualIID(riid, &CLSID_ControlPanel))
482  {
483  if(LoadStringA(shell32_hInstance, IDS_CONTROLPANEL, szDest, buflen))
484  ret = TRUE;
485  }
487  {
489  ret = TRUE;
490  }
491 #endif
492  }
493 
494  TRACE("-- (%s)\n", szDest);
495 
496  return ret;
497 }
const GUID CLSID_AdminFolderShortcut
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4041
#define IDS_CONTROLPANEL
Definition: shresdef.h:131
#define TRUE
Definition: types.h:120
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
REFIID riid
Definition: precomp.h:44
#define HKEY_CURRENT_USER
Definition: winreg.h:11
char CHAR
Definition: xmlstorage.h:175
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
#define IDS_RECYCLEBIN_FOLDER_NAME
Definition: shresdef.h:232
#define IDS_PERSONAL
Definition: shresdef.h:242
#define IDS_ADMINISTRATIVETOOLS
Definition: shresdef.h:237
#define RRF_RT_REG_SZ
Definition: driver.c:575
static LPOLESTR
Definition: stg_prop.c:27
#define sprintf(buf, format,...)
Definition: sprintf.c:55
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDS_MYCOMPUTER
Definition: shresdef.h:241
smooth NULL
Definition: ftsmooth.c:416
LSTATUS WINAPI RegGetValueA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:2081
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
Definition: classes.c:233
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
#define IDS_DESKTOP
Definition: shresdef.h:65
static const WCHAR szName[]
Definition: msipriv.h:1194
#define CHAR(Char)
LONG WINAPI RegLoadMUIStringA(IN HKEY hKey, IN LPCSTR pszValue OPTIONAL, OUT LPSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCSTR pszDirectory OPTIONAL)
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321

Referenced by _ILSimpleGetText(), and shdebugstr_guid().

◆ HCR_GetClassNameW()

BOOL HCR_GetClassNameW ( REFIID  riid,
LPWSTR  szDest,
DWORD  len 
)

Definition at line 346 of file classes.c.

347 {
348  HKEY hkey;
349  BOOL ret = FALSE;
350  DWORD buflen = len;
351 #ifdef __REACTOS__
352  WCHAR szName[100];
353  LPOLESTR pStr;
354 #endif
355 
356  szDest[0] = 0;
357 
358 #ifdef __REACTOS__
359  if (StringFromCLSID(riid, &pStr) == S_OK)
360  {
361  DWORD dwLen = buflen * sizeof(WCHAR);
362  swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);
363  if (!RegGetValueW(HKEY_CURRENT_USER, szName, NULL, RRF_RT_REG_SZ, NULL, (PVOID)szDest, &dwLen))
364  {
365  ret = TRUE;
366  }
367  CoTaskMemFree(pStr);
368  }
369  if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
370 #else
371  if (HCR_RegOpenClassIDKey(riid, &hkey))
372 #endif
373  {
374  static const WCHAR wszLocalizedString[] =
375  { 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 };
376  if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) ||
377  !RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len))
378  {
379  ret = TRUE;
380  }
381  RegCloseKey(hkey);
382  }
383 
384  if (!ret || !szDest[0])
385  {
386  if(IsEqualIID(riid, &CLSID_ShellDesktop))
387  {
388  if (LoadStringW(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
389  ret = TRUE;
390  }
391  else if (IsEqualIID(riid, &CLSID_MyComputer))
392  {
393  if(LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
394  ret = TRUE;
395  }
396 #ifdef __REACTOS__
397  else if (IsEqualIID(riid, &CLSID_MyDocuments))
398  {
399  if(LoadStringW(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
400  ret = TRUE;
401  }
402  else if (IsEqualIID(riid, &CLSID_RecycleBin))
403  {
405  ret = TRUE;
406  }
407  else if (IsEqualIID(riid, &CLSID_ControlPanel))
408  {
409  if(LoadStringW(shell32_hInstance, IDS_CONTROLPANEL, szDest, buflen))
410  ret = TRUE;
411  }
413  {
415  ret = TRUE;
416  }
417 #endif
418  }
419  TRACE("-- %s\n", debugstr_w(szDest));
420  return ret;
421 }
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1975
const GUID CLSID_AdminFolderShortcut
#define IDS_CONTROLPANEL
Definition: shresdef.h:131
#define TRUE
Definition: types.h:120
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
REFIID riid
Definition: precomp.h:44
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define IDS_RECYCLEBIN_FOLDER_NAME
Definition: shresdef.h:232
#define IDS_PERSONAL
Definition: shresdef.h:242
#define IDS_ADMINISTRATIVETOOLS
Definition: shresdef.h:237
#define RRF_RT_REG_SZ
Definition: driver.c:575
static LPOLESTR
Definition: stg_prop.c:27
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDS_MYCOMPUTER
Definition: shresdef.h:241
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
Definition: classes.c:233
#define TRACE(s)
Definition: solgame.cpp:4
LONG RegLoadMUIStringW(IN HKEY hKey, IN LPCWSTR pszValue OPTIONAL, OUT LPWSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCWSTR pszDirectory OPTIONAL)
Definition: muireg.c:53
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define swprintf(buf, format,...)
Definition: sprintf.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR swEmpty[]
Definition: classes.c:344
int ret
static const WCHAR L[]
Definition: oid.c:1250
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
#define IDS_DESKTOP
Definition: shresdef.h:65
static const WCHAR szName[]
Definition: msipriv.h:1194
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321

Referenced by _ILSimpleGetTextW(), and CRegFolder::GetDisplayNameOf().

◆ HCR_GetDefaultVerbW()

BOOL HCR_GetDefaultVerbW ( HKEY  hkeyClass,
LPCWSTR  szVerb,
LPWSTR  szDest,
DWORD  len 
)

Definition at line 134 of file classes.c.

135 {
136  WCHAR sTemp[MAX_PATH];
137  LONG size;
138  HKEY hkey;
139 
140  TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest);
141 
142  if (szVerb && *szVerb)
143  {
144  lstrcpynW(szDest, szVerb, len);
145  return TRUE;
146  }
147 
148  size=len;
149  *szDest='\0';
150  if (!RegQueryValueW(hkeyClass, swShell, szDest, &size) && *szDest)
151  {
152  /* The MSDN says to first try the default verb */
153  lstrcpyW(sTemp, swShell);
154  lstrcatW(sTemp, szDest);
155  lstrcatW(sTemp, swCommand);
156  if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
157  {
158  RegCloseKey(hkey);
159  TRACE("default verb=%s\n", debugstr_w(szDest));
160  return TRUE;
161  }
162  }
163 
164  /* then fallback to 'open' */
165  lstrcpyW(sTemp, swShell);
166  lstrcatW(sTemp, swOpen);
167  lstrcatW(sTemp, swCommand);
168  if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
169  {
170  RegCloseKey(hkey);
171  lstrcpynW(szDest, swOpen, len);
172  TRACE("default verb=open\n");
173  return TRUE;
174  }
175 
176  /* and then just use the first verb on Windows >= 2000 */
177 #ifdef __REACTOS__
178  if (!RegOpenKeyExW(hkeyClass, L"shell", 0, KEY_READ, &hkey))
179  {
180  if (!RegEnumKeyW(hkey, 0, szDest, len) && *szDest)
181  {
182  TRACE("default verb=first verb=%s\n", debugstr_w(szDest));
183  RegCloseKey(hkey);
184  return TRUE;
185  }
186  RegCloseKey(hkey);
187  }
188 #else
189  if (!RegEnumKeyW(hkeyClass, 0, szDest, len) && *szDest)
190  {
191  TRACE("default verb=first verb=%s\n", debugstr_w(szDest));
192  return TRUE;
193  }
194 #endif
195 
196  TRACE("no default verb!\n");
197  return FALSE;
198 }
#define TRUE
Definition: types.h:120
static const WCHAR swCommand[]
Definition: classes.c:132
#define KEY_READ
Definition: nt_native.h:1023
#define lstrcpynW
Definition: compat.h:397
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4272
#define MAX_PATH
Definition: compat.h:26
static const WCHAR L[]
Definition: oid.c:1250
GLenum GLsizei len
Definition: glext.h:6722
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2430
static const WCHAR swShell[]
Definition: classes.c:130
#define lstrcpyW
Definition: compat.h:406
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static const WCHAR swOpen[]
Definition: classes.c:131

Referenced by HCR_GetExecuteCommandW(), and SHELL_FindExecutableByVerb().

◆ HCR_GetExecuteCommandW()

BOOL HCR_GetExecuteCommandW ( HKEY  hkeyClass,
LPCWSTR  szClass,
LPCWSTR  szVerb,
LPWSTR  szDest,
DWORD  len 
)

Definition at line 200 of file classes.c.

201 {
202  WCHAR sTempVerb[MAX_PATH];
203  BOOL ret;
204 
205  TRACE("%p %s %s %p\n", hkeyClass, debugstr_w(szClass), debugstr_w(szVerb), szDest);
206 
207  if (szClass)
208  RegOpenKeyExW(HKEY_CLASSES_ROOT, szClass, 0, KEY_READ, &hkeyClass);
209  if (!hkeyClass)
210  return FALSE;
211  ret = FALSE;
212 
213  if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)/sizeof(sTempVerb[0])))
214  {
215  WCHAR sTemp[MAX_PATH];
216  lstrcpyW(sTemp, swShell);
217  lstrcatW(sTemp, sTempVerb);
218  lstrcatW(sTemp, swCommand);
219  ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len));
220  }
221  if (szClass)
222  RegCloseKey(hkeyClass);
223 
224  TRACE("-- %s\n", debugstr_w(szDest) );
225  return ret;
226 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static const WCHAR swCommand[]
Definition: classes.c:132
#define KEY_READ
Definition: nt_native.h:1023
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
#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
int ret
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
GLenum GLsizei len
Definition: glext.h:6722
static const WCHAR swShell[]
Definition: classes.c:130
#define lstrcpyW
Definition: compat.h:406
BOOL HCR_GetDefaultVerbW(HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len)
Definition: classes.c:134
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274

Referenced by SHELL_execute_class(), and SHELL_translate_idlist().

◆ HCR_GetFolderAttributes()

BOOL HCR_GetFolderAttributes ( LPCITEMIDLIST  pidlFolder,
LPDWORD  dwAttributes 
)

Definition at line 516 of file classes.c.

517 {
518  HKEY hSFKey;
519  LPOLESTR pwszCLSID;
520  LONG lResult;
521  DWORD dwTemp, dwLen;
522  static const WCHAR wszAttributes[] = { 'A','t','t','r','i','b','u','t','e','s',0 };
523  static const WCHAR wszCallForAttributes[] = {
524  'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0 };
525  WCHAR wszShellFolderKey[] = { 'C','L','S','I','D','\\','{','0','0','0','2','1','4','0','0','-',
526  '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-','0','0','0','0','0','0','0',
527  '0','0','0','4','6','}','\\','S','h','e','l','l','F','o','l','d','e','r',0 };
528 
529  TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes);
530 
531  if (!_ILIsPidlSimple(pidlFolder)) {
532  static BOOL firstHit = TRUE;
533  if (firstHit) {
534  ERR("should be called for simple PIDL's only!\n");
535  firstHit = FALSE;
536  }
537  return FALSE;
538  }
539 
540  if (!_ILIsDesktop(pidlFolder)) {
541  if (FAILED(StringFromCLSID(_ILGetGUIDPointer(pidlFolder), &pwszCLSID))) return FALSE;
542  memcpy(&wszShellFolderKey[6], pwszCLSID, 38 * sizeof(WCHAR));
543  CoTaskMemFree(pwszCLSID);
544  }
545 
546  lResult = RegOpenKeyExW(HKEY_CLASSES_ROOT, wszShellFolderKey, 0, KEY_READ, &hSFKey);
547 #ifdef __REACTOS__
548  if (lResult != ERROR_SUCCESS)
549  {
550  ERR("Cannot open key: %ls\n", wszShellFolderKey);
551  return FALSE;
552  }
553 #else
554  if (lResult != ERROR_SUCCESS) return FALSE;
555 #endif
556 
557  dwLen = sizeof(DWORD);
558  lResult = RegQueryValueExW(hSFKey, wszCallForAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen);
559  if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) {
560  LPSHELLFOLDER psfDesktop, psfFolder;
561  HRESULT hr;
562 
563  RegCloseKey(hSFKey);
564  hr = SHGetDesktopFolder(&psfDesktop);
565  if (SUCCEEDED(hr)) {
566  hr = IShellFolder_BindToObject(psfDesktop, pidlFolder, NULL, &IID_IShellFolder,
567  (LPVOID*)&psfFolder);
568  if (SUCCEEDED(hr)) {
569  hr = IShellFolder_GetAttributesOf(psfFolder, 0, NULL, pdwAttributes);
570  IShellFolder_Release(psfFolder);
571  }
572  IShellFolder_Release(psfDesktop);
573  }
574  if (FAILED(hr)) return FALSE;
575  } else {
576  lResult = RegQueryValueExW(hSFKey, wszAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen);
577  RegCloseKey(hSFKey);
578  if (lResult == ERROR_SUCCESS) {
579  *pdwAttributes &= dwTemp;
580  } else {
581  return FALSE;
582  }
583  }
584 
585  TRACE("-- *pdwAttributes == 0x%08x\n", *pdwAttributes);
586 
587  return TRUE;
588 }
#define TRUE
Definition: types.h:120
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define KEY_READ
Definition: nt_native.h:1023
static LPOLESTR
Definition: stg_prop.c:27
#define DWORD
Definition: nt_native.h:44
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2300
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERR(fmt,...)
Definition: debug.h:109
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321

Referenced by CRegFolder::GetGuidItemAttributes().

◆ HCR_GetIconA()

BOOL HCR_GetIconA ( LPCSTR  szClass,
LPSTR  szDest,
LPCSTR  sName,
DWORD  len,
int picon_idx 
)

Definition at line 320 of file classes.c.

321 {
322  HKEY hkey;
323  char sTemp[MAX_PATH];
324  BOOL ret = FALSE;
325 
326  TRACE("%s\n",szClass );
327 
328  sprintf(sTemp, "%s\\DefaultIcon",szClass);
329 
330  if (!RegOpenKeyExA(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
331  {
332  ret = HCR_RegGetIconA(hkey, szDest, szName, len, picon_idx);
333  RegCloseKey(hkey);
334  }
335  TRACE("-- %s %i\n", szDest, *picon_idx);
336  return ret;
337 }
#define KEY_READ
Definition: nt_native.h:1023
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3346
#define sprintf(buf, format,...)
Definition: sprintf.c:55
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
#define MAX_PATH
Definition: compat.h:26
int ret
GLenum GLsizei len
Definition: glext.h:6722
static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:270
static const WCHAR szName[]
Definition: msipriv.h:1194
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

◆ HCR_GetIconW()

BOOL HCR_GetIconW ( LPCWSTR  szClass,
LPWSTR  szDest,
LPCWSTR  szName,
DWORD  len,
int picon_idx 
)

Definition at line 294 of file classes.c.

295 {
296  static const WCHAR swDefaultIcon[] = {'\\','D','e','f','a','u','l','t','I','c','o','n',0};
297  HKEY hkey;
298  WCHAR sTemp[MAX_PATH];
299  BOOL ret = FALSE;
300 
301  TRACE("%s\n",debugstr_w(szClass) );
302 
303  lstrcpynW(sTemp, szClass, MAX_PATH);
304  lstrcatW(sTemp, swDefaultIcon);
305 
306  if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
307  {
308  ret = HCR_RegGetIconW(hkey, szDest, szName, len, picon_idx);
309  RegCloseKey(hkey);
310  }
311 
312  if(ret)
313  TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx);
314  else
315  TRACE("-- not found\n");
316 
317  return ret;
318 }
static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:246
#define KEY_READ
Definition: nt_native.h:1023
#define lstrcpynW
Definition: compat.h:397
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
int ret
GLenum GLsizei len
Definition: glext.h:6722
static const WCHAR szName[]
Definition: msipriv.h:1194
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274

Referenced by CDrivesExtractIcon_CreateInstance(), CGuidItemExtractIcon_CreateInstance(), getDefaultIconLocation(), getIconLocationForFolder(), and SHGetFileInfoW().

◆ HCR_MapTypeToValueA()

BOOL HCR_MapTypeToValueA ( LPCSTR  szExtension,
LPSTR  szFileType,
LONG  len,
BOOL  bPrependDot 
)

Definition at line 88 of file classes.c.

89 {
90  HKEY hkey;
91  char szTemp[MAX_EXTENSION_LENGTH + 2];
92 
93  TRACE("%s %p\n", szExtension, szFileType);
94 
95  /* added because we do not want to have double dots */
96  if (szExtension[0] == '.')
97  bPrependDot = FALSE;
98 
99  if (bPrependDot)
100  szTemp[0] = '.';
101 
102  lstrcpynA(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
103 
104  if (RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
105  {
106  return FALSE;
107  }
108 
109 #ifdef __REACTOS__
110  if (!RegLoadMUIStringA(hkey, "FriendlyTypeName", szFileType, len, NULL, 0, NULL))
111  {
112  RegCloseKey(hkey);
113  return TRUE;
114  }
115 #endif
116 
117  if (RegQueryValueA(hkey, NULL, szFileType, &len))
118  {
119  RegCloseKey(hkey);
120  return FALSE;
121  }
122 
123  RegCloseKey(hkey);
124 
125  TRACE("--UE;\n} %s\n", szFileType);
126 
127  return TRUE;
128 }
#define TRUE
Definition: types.h:120
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
Definition: reg.c:4243
#define KEY_READ
Definition: nt_native.h:1023
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3346
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define MAX_EXTENSION_LENGTH
Definition: classes.c:44
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLsizei len
Definition: glext.h:6722
#define lstrcpynA
Definition: compat.h:408
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
LONG WINAPI RegLoadMUIStringA(IN HKEY hKey, IN LPCSTR pszValue OPTIONAL, OUT LPSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCSTR pszDirectory OPTIONAL)

Referenced by _ILGetFileType(), and SHELL_IsShortcut().

◆ HCR_MapTypeToValueW()

BOOL HCR_MapTypeToValueW ( LPCWSTR  szExtension,
LPWSTR  szFileType,
LONG  len,
BOOL  bPrependDot 
)

Definition at line 46 of file classes.c.

47 {
48  HKEY hkey;
49  WCHAR szTemp[MAX_EXTENSION_LENGTH + 2];
50 
51  TRACE("%s %p\n", debugstr_w(szExtension), szFileType);
52 
53  /* added because we do not want to have double dots */
54  if (szExtension[0] == '.')
55  bPrependDot = FALSE;
56 
57  if (bPrependDot)
58  szTemp[0] = '.';
59 
60  lstrcpynW(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
61 
62  if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
63  {
64  return FALSE;
65  }
66 
67 #ifdef __REACTOS__
68  if (!RegLoadMUIStringW(hkey, L"FriendlyTypeName", szFileType, len, NULL, 0, NULL))
69  {
70  RegCloseKey(hkey);
71  return TRUE;
72  }
73 #endif
74 
75  if (RegQueryValueW(hkey, NULL, szFileType, &len))
76  {
77  RegCloseKey(hkey);
78  return FALSE;
79  }
80 
81  RegCloseKey(hkey);
82 
83  TRACE("--UE;\n} %s\n", debugstr_w(szFileType));
84 
85  return TRUE;
86 }
#define TRUE
Definition: types.h:120
#define KEY_READ
Definition: nt_native.h:1023
#define lstrcpynW
Definition: compat.h:397
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define debugstr_w
Definition: kernel32.h:32
#define MAX_EXTENSION_LENGTH
Definition: classes.c:44
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG RegLoadMUIStringW(IN HKEY hKey, IN LPCWSTR pszValue OPTIONAL, OUT LPWSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCWSTR pszDirectory OPTIONAL)
Definition: muireg.c:53
__wchar_t WCHAR
Definition: xmlstorage.h:180
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4272
static const WCHAR L[]
Definition: oid.c:1250
GLenum GLsizei len
Definition: glext.h:6722
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by CRecycleBin::GetDetailsOf(), and SHGetFileInfoW().

◆ IClassFactory_Constructor()

LPCLASSFACTORY IClassFactory_Constructor ( REFCLSID  )

◆ IDataObject_Constructor()

HRESULT IDataObject_Constructor ( HWND  hwndOwner,
LPCITEMIDLIST  pMyPidl,
PCUITEMID_CHILD_ARRAY  apidl,
UINT  cidl,
IDataObject **  dataObject 
)

◆ IEnumFORMATETC_Constructor()

HRESULT IEnumFORMATETC_Constructor ( UINT  cfmt,
const FORMATETC  afmt[],
IEnumFORMATETC **  enumerator 
)

Definition at line 130 of file CIDLDataObj.cpp.

131 {
132  return ShellObjectCreatorInit<IEnumFORMATETCImpl>(cfmt, afmt, IID_PPV_ARG(IEnumFORMATETC, ppFormat));
133 }
#define IID_PPV_ARG(Itype, ppType)

Referenced by IEnumFORMATETCImpl::Clone(), CIDLDataObj::EnumFormatEtc(), and SHCreateStdEnumFmtEtc().

◆ IFileSystemBindData_Constructor()

HRESULT WINAPI IFileSystemBindData_Constructor ( const WIN32_FIND_DATAW pfd,
LPBC ppV 
)

Definition at line 52 of file CFileSysBindData.cpp.

53 {
54  CComPtr<IFileSystemBindData> fileSystemBindData;
55  CComPtr<IBindCtx> bindContext;
56  BIND_OPTS bindOpts;
57  HRESULT hResult;
58 
59  TRACE("%p, %p\n", pfd, ppV);
60 
61  if (ppV == NULL)
62  return E_INVALIDARG;
63 
64  *ppV = NULL;
65 
66  hResult = CFileSysBindData::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IFileSystemBindData, &fileSystemBindData));
67  if (FAILED(hResult))
68  return hResult;
69  hResult = fileSystemBindData->SetFindData(pfd);
70  if (FAILED(hResult))
71  return hResult;
72 
73  hResult = CreateBindCtx(0, &bindContext);
74  if (FAILED(hResult))
75  return hResult;
76  bindOpts.cbStruct = sizeof(BIND_OPTS);
77  bindOpts.grfFlags = 0;
78  bindOpts.grfMode = STGM_CREATE;
79  bindOpts.dwTickCountDeadline = 0;
80  hResult = bindContext->SetBindOptions(&bindOpts);
81  if (FAILED(hResult))
82  return hResult;
83  hResult = bindContext->RegisterObjectParam((LPOLESTR)STR_FILE_SYS_BIND_DATA, fileSystemBindData);
84  if (FAILED(hResult))
85  return hResult;
86 
87  *ppV = bindContext.Detach();
88 
89  return S_OK;
90 }
#define STGM_CREATE
Definition: objbase.h:925
static LPOLESTR
Definition: stg_prop.c:27
#define IID_PPV_ARG(Itype, ppType)
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
LONG HRESULT
Definition: typedefs.h:77
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
#define S_OK
Definition: intsafe.h:59
T * Detach()
Definition: atlcomcli.h:156

Referenced by _ILParsePathW().

◆ INewItem_Constructor()

HRESULT WINAPI INewItem_Constructor ( IUnknown pUnkOuter,
REFIID  riif,
LPVOID ppv 
)

◆ InitChangeNotifications()

void InitChangeNotifications ( void  )

Definition at line 183 of file changenotify.c.

184 {
185 #ifdef __REACTOS__
186  m_hThread = NULL;
187 #endif
188 }
smooth NULL
Definition: ftsmooth.c:416

Referenced by if().

◆ IShellLink_ConstructFromFile()

HRESULT WINAPI IShellLink_ConstructFromFile ( IShellFolder psf,
LPCITEMIDLIST  pidl,
REFIID  riid,
LPVOID ppv 
)

Definition at line 3138 of file CShellLink.cpp.

3139 {
3140  WCHAR path[MAX_PATH];
3141  if (!ILGetDisplayNameExW(psf, pidl, path, 0))
3142  return E_FAIL;
3143 
3145 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_FAIL
Definition: ddrawi.h:102
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:91
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
Definition: services.c:325

◆ IShellLink_ConstructFromPath()

HRESULT WINAPI IShellLink_ConstructFromPath ( WCHAR path,
REFIID  riid,
LPVOID ppv 
)

Definition at line 3124 of file CShellLink.cpp.

3125 {
3127  HRESULT hr = CShellLink::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IPersistFile, &ppf));
3128  if (FAILED(hr))
3129  return hr;
3130 
3131  hr = ppf->Load(path, 0);
3132  if (FAILED(hr))
3133  return hr;
3134 
3135  return ppf->QueryInterface(riid, ppv);
3136 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define IID_PPV_ARG(Itype, ppType)
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
Definition: services.c:325

Referenced by CFSDropTarget::_DoDrop(), IShellLink_ConstructFromFile(), and SHAddToRecentDocs().

◆ ISvBgCm_Constructor()

IContextMenu2* ISvBgCm_Constructor ( LPSHELLFOLDER  pSFParent,
BOOL  bDesktop 
)

◆ ISvItemCm_Constructor()

IContextMenu2* ISvItemCm_Constructor ( LPSHELLFOLDER  pSFParent,
LPCITEMIDLIST  pidl,
const LPCITEMIDLIST aPidls,
UINT  uItemCount 
)

◆ ISvStaticItemCm_Constructor()

IContextMenu2* ISvStaticItemCm_Constructor ( LPSHELLFOLDER  pSFParent,
LPCITEMIDLIST  pidl,
LPCITEMIDLIST apidl,
UINT  cidl,
HKEY  hKey 
)

◆ ParseFieldA()

DWORD WINAPI ParseFieldA ( LPCSTR  src,
DWORD  nField,
LPSTR  dst,
DWORD  len 
)

Definition at line 79 of file shellord.c.

84 {
85  WARN("(%s,0x%08x,%p,%d) semi-stub.\n",debugstr_a(src),nField,dst,len);
86 
87  if (!src || !src[0] || !dst || !len)
88  return 0;
89 
90  /* skip n fields delimited by ',' */
91  while (nField > 1)
92  {
93  if (*src=='\0') return FALSE;
94  if (*(src++)==',') nField--;
95  }
96 
97  /* copy part till the next ',' to dst */
98  while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
99 
100  /* finalize the string */
101  *dst=0x0;
102 
103  return TRUE;
104 }
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:111
#define debugstr_a
Definition: kernel32.h:31
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340

Referenced by HCR_RegGetIconA(), and ParseFieldAW().

◆ ParseFieldW()

DWORD WINAPI ParseFieldW ( LPCWSTR  src,
DWORD  nField,
LPWSTR  dst,
DWORD  len 
)

Definition at line 113 of file shellord.c.

114 {
115  WARN("(%s,0x%08x,%p,%d) semi-stub.\n", debugstr_w(src), nField, dst, len);
116 
117  if (!src || !src[0] || !dst || !len)
118  return 0;
119 
120  /* skip n fields delimited by ',' */
121  while (nField > 1)
122  {
123  if (*src == 0x0) return FALSE;
124  if (*src++ == ',') nField--;
125  }
126 
127  /* copy part till the next ',' to dst */
128  while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++) = *(src++);
129 
130  /* finalize the string */
131  *dst = 0x0;
132 
133  return TRUE;
134 }
#define TRUE
Definition: types.h:120
GLint x0
Definition: linetemp.h:95
#define WARN(fmt,...)
Definition: debug.h:111
#define debugstr_w
Definition: kernel32.h:32
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340

Referenced by CFSExtractIcon_CreateInstance(), HCR_RegGetIconW(), and ParseFieldAW().

◆ 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().

◆ RenderFILENAMEA()

HGLOBAL RenderFILENAMEA ( LPITEMIDLIST  pidlRoot,
LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 188 of file clipboard.c.

189 {
190  int size = 0;
191  char szTemp[MAX_PATH], *szFileName;
192  LPITEMIDLIST pidl;
193  HGLOBAL hGlobal;
194  BOOL bSuccess;
195 
196  TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
197 
198  /* get path of combined pidl */
199  pidl = ILCombine(pidlRoot, apidl[0]);
200  if (!pidl)
201  return 0;
202 
203  bSuccess = SHGetPathFromIDListA(pidl, szTemp);
204  SHFree(pidl);
205  if (!bSuccess)
206  return 0;
207 
208  size = strlen(szTemp) + 1;
209 
210  /* fill the structure */
211  hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
212  if(!hGlobal) return hGlobal;
213  szFileName = GlobalLock(hGlobal);
214  memcpy(szFileName, szTemp, size);
215  GlobalUnlock(hGlobal);
216 
217  return hGlobal;
218 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
Definition: pidl.c:1264
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
#define GMEM_SHARE
Definition: winbase.h:302
static BOOLEAN bSuccess
Definition: drive.cpp:417
#define GHND
Definition: winbase.h:294
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define MAX_PATH
Definition: compat.h:26
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by CIDLDataObj::GetData().

◆ RenderFILENAMEW()

HGLOBAL RenderFILENAMEW ( LPITEMIDLIST  pidlRoot,
LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 220 of file clipboard.c.

221 {
222  int size = 0;
223  WCHAR szTemp[MAX_PATH], *szFileName;
224  LPITEMIDLIST pidl;
225  HGLOBAL hGlobal;
226  BOOL bSuccess;
227 
228  TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
229 
230  /* get path of combined pidl */
231  pidl = ILCombine(pidlRoot, apidl[0]);
232  if (!pidl)
233  return 0;
234 
235  bSuccess = SHGetPathFromIDListW(pidl, szTemp);
236  SHFree(pidl);
237  if (!bSuccess)
238  return 0;
239 
240  size = (strlenW(szTemp)+1) * sizeof(WCHAR);
241 
242  /* fill the structure */
243  hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
244  if(!hGlobal) return hGlobal;
245  szFileName = GlobalLock(hGlobal);
246  memcpy(szFileName, szTemp, size);
247  GlobalUnlock(hGlobal);
248 
249  return hGlobal;
250 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1280
#define GMEM_SHARE
Definition: winbase.h:302
static BOOLEAN bSuccess
Definition: drive.cpp:417
#define GHND
Definition: winbase.h:294
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by CIDLDataObj::GetData().

◆ RenderHDROP()

HGLOBAL RenderHDROP ( LPITEMIDLIST  pidlRoot,
LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 54 of file clipboard.c.

55 {
56  UINT i;
57 #ifdef __REACTOS__
58  int size = 0;
59 #else
60  int rootlen = 0,size = 0;
61  WCHAR wszRootPath[MAX_PATH];
62 #endif
64  HGLOBAL hGlobal = NULL;
65  DROPFILES *pDropFiles;
66  int offset;
67 #ifdef __REACTOS__
69 #endif
70 
71  TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
72 
73 #ifdef __REACTOS__
74  pidls = (LPITEMIDLIST *)HeapAlloc(GetProcessHeap(), 0, cidl * sizeof(*pidls));
75  if (!pidls)
76  goto cleanup;
77 #endif
78 
79  /* get the size needed */
80  size = sizeof(DROPFILES);
81 
82 #ifndef __REACTOS__
83  SHGetPathFromIDListW(pidlRoot, wszRootPath);
84  PathAddBackslashW(wszRootPath);
85  rootlen = strlenW(wszRootPath);
86 #endif
87 
88  for (i=0; i<cidl;i++)
89  {
90 #ifdef __REACTOS__
91  pidls[i] = ILCombine(pidlRoot, apidl[i]);
93  size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
94 #else
96  size += (rootlen + strlenW(wszFileName) + 1) * sizeof(WCHAR);
97 #endif
98  }
99 
100  size += sizeof(WCHAR);
101 
102  /* Fill the structure */
103  hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
104 #ifdef __REACTOS__
105  if(!hGlobal) goto cleanup;
106 #else
107  if(!hGlobal) return hGlobal;
108 #endif
109 
110  pDropFiles = GlobalLock(hGlobal);
111  offset = (sizeof(DROPFILES) + sizeof(WCHAR) - 1) / sizeof(WCHAR);
112  pDropFiles->pFiles = offset * sizeof(WCHAR);
113  pDropFiles->fWide = TRUE;
114 
115 #ifndef __REACTOS__
116  strcpyW(wszFileName, wszRootPath);
117 #endif
118 
119  for (i=0; i<cidl;i++)
120  {
121 
122 #ifdef __REACTOS__
124  wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
125  offset += wcslen(wszFileName) + 1;
126  ILFree(pidls[i]);
127 #else
128  _ILSimpleGetTextW(apidl[i], wszFileName + rootlen, MAX_PATH - rootlen);
129  strcpyW(((WCHAR*)pDropFiles)+offset, wszFileName);
130  offset += strlenW(wszFileName) + 1;
131 #endif
132  }
133 
134  ((WCHAR*)pDropFiles)[offset] = 0;
135  GlobalUnlock(hGlobal);
136 
137 #ifdef __REACTOS__
138 cleanup:
139  if(pidls)
141 #endif
142 
143  return hGlobal;
144 }
static WCHAR wszFileName[MAX_PATH]
Definition: wordpad.c:70
#define TRUE
Definition: types.h:120
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1280
GLintptr offset
Definition: glext.h:5920
#define GMEM_SHARE
Definition: winbase.h:302
#define GHND
Definition: winbase.h:294
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
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
smooth NULL
Definition: ftsmooth.c:416
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2082
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
BOOL fWide
Definition: shlobj.h:2118
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
unsigned int UINT
Definition: ndis.h:50
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
char * cleanup(char *str)
Definition: wpickclick.c:99
struct _DROPFILES DROPFILES
DWORD pFiles
Definition: shlobj.h:2115
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by CIDLDataObj::GetData().

◆ RenderSHELLIDLIST()

HGLOBAL RenderSHELLIDLIST ( LPITEMIDLIST  pidlRoot,
LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 146 of file clipboard.c.

147 {
148  UINT i;
149  int offset = 0, sizePidl, size;
150  HGLOBAL hGlobal;
151  LPIDA pcida;
152 
153  TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
154 
155  /* get the size needed */
156  size = sizeof(CIDA) + sizeof (UINT)*(cidl); /* header */
157  size += ILGetSize (pidlRoot); /* root pidl */
158  for(i=0; i<cidl; i++)
159  {
160  size += ILGetSize(apidl[i]); /* child pidls */
161  }
162 
163  /* fill the structure */
164  hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
165  if(!hGlobal) return hGlobal;
166  pcida = GlobalLock (hGlobal);
167  pcida->cidl = cidl;
168 
169  /* root pidl */
170  offset = sizeof(CIDA) + sizeof (UINT)*(cidl);
171  pcida->aoffset[0] = offset; /* first element */
172  sizePidl = ILGetSize (pidlRoot);
173  memcpy(((LPBYTE)pcida)+offset, pidlRoot, sizePidl);
174  offset += sizePidl;
175 
176  for(i=0; i<cidl; i++) /* child pidls */
177  {
178  pcida->aoffset[i+1] = offset;
179  sizePidl = ILGetSize(apidl[i]);
180  memcpy(((LPBYTE)pcida)+offset, apidl[i], sizePidl);
181  offset += sizePidl;
182  }
183 
184  GlobalUnlock(hGlobal);
185  return hGlobal;
186 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
GLintptr offset
Definition: glext.h:5920
#define GMEM_SHARE
Definition: winbase.h:302
#define GHND
Definition: winbase.h:294
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 char * LPBYTE
Definition: typedefs.h:52
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
UINT cidl
Definition: shlobj.h:491
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
UINT aoffset[1]
Definition: shlobj.h:492
unsigned int UINT
Definition: ndis.h:50
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define ILGetSize
Definition: shellclasses.h:638
Definition: shlobj.h:490

Referenced by CIDLDataObj::GetData().

◆ SH_CreatePropertySheetPage()

HPROPSHEETPAGE SH_CreatePropertySheetPage ( WORD  wDialogId,
DLGPROC  pfnDlgProc,
LPARAM  lParam,
LPCWSTR  pwszTitle 
)

Definition at line 248 of file filedefext.cpp.

249 {
250  PROPSHEETPAGEW Page;
251 
252  memset(&Page, 0x0, sizeof(PROPSHEETPAGEW));
253  Page.dwSize = sizeof(PROPSHEETPAGEW);
254  Page.dwFlags = PSP_DEFAULT;
256  Page.pszTemplate = MAKEINTRESOURCE(wDialogId);
257  Page.pfnDlgProc = pfnDlgProc;
258  Page.lParam = lParam;
259  Page.pszTitle = pwszTitle;
260 
261  if (pwszTitle)
262  Page.dwFlags |= PSP_USETITLE;
263 
264  return CreatePropertySheetPageW(&Page);
265 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
LPCWSTR pszTemplate
Definition: prsht.h:209
GLint x0
Definition: linetemp.h:95
DWORD dwSize
Definition: prsht.h:205
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
DLGPROC pfnDlgProc
Definition: prsht.h:217
struct _PROPSHEETPAGEW PROPSHEETPAGEW
LPCWSTR pszTitle
Definition: prsht.h:216
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3066
#define PSP_DEFAULT
Definition: prsht.h:22
LPARAM lParam
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:207
#define PSP_USETITLE
Definition: prsht.h:26
#define memset(x, y, z)
Definition: compat.h:39
LPARAM lParam
Definition: combotst.c:139
DWORD dwFlags
Definition: prsht.h:206

Referenced by CFileDefExt::AddPages().

◆ SH_FileGeneralDlgProc()

INT_PTR CALLBACK SH_FileGeneralDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

◆ SH_FileVersionDlgProc()

INT_PTR CALLBACK SH_FileVersionDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

◆ SH_FormatFileSizeWithBytes()

LPWSTR SH_FormatFileSizeWithBytes ( PULARGE_INTEGER  lpQwSize,
LPWSTR  pszBuf,
UINT  cchBuf 
)

Definition at line 212 of file filedefext.cpp.

213 {
214  /* Format bytes in KBs, MBs etc */
215  if (StrFormatByteSizeW(lpQwSize->QuadPart, pwszResult, cchResultMax) == NULL)
216  return NULL;
217 
218  /* If there is less bytes than 1KB, we have nothing to do */
219  if (lpQwSize->QuadPart < 1024)
220  return pwszResult;
221 
222  /* Concatenate " (" */
223  UINT cchWritten = wcslen(pwszResult);
224  LPWSTR pwszEnd = pwszResult + cchWritten;
225  size_t cchRemaining = cchResultMax - cchWritten;
226  StringCchCopyExW(pwszEnd, cchRemaining, L" (", &pwszEnd, &cchRemaining, 0);
227 
228  /* Write formated bytes count */
229  cchWritten = SH_FormatByteSize(lpQwSize->QuadPart, pwszEnd, cchRemaining);
230  pwszEnd += cchWritten;
231  cchRemaining -= cchWritten;
232 
233  /* Copy ")" to the buffer */
234  StringCchCopyW(pwszEnd, cchRemaining, L")");
235 
236  return pwszResult;
237 }
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2376
UINT SH_FormatByteSize(LONGLONG cbSize, LPWSTR pwszResult, UINT cchResultMax)
Definition: filedefext.cpp:182
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR L[]
Definition: oid.c:1250
STRSAFEAPI StringCchCopyExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags)
Definition: strsafe.h:184
unsigned int UINT
Definition: ndis.h:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by CFileDefExt::CountFolderAndFiles(), and CFileDefExt::InitFileAttr().

◆ SH_ShowDriveProperties()

HRESULT SH_ShowDriveProperties ( WCHAR drive,
LPCITEMIDLIST  pidlFolder,
PCUITEMID_CHILD_ARRAY  apidl 
)

Definition at line 118 of file drive.cpp.

119 {
120  HPSXA hpsx = NULL;
122  PROPSHEETHEADERW psh;
123  CComObject<CDrvDefExt> *pDrvDefExt = NULL;
124  WCHAR wszName[256];
125 
126  ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
127  psh.dwSize = sizeof(PROPSHEETHEADERW);
128  psh.dwFlags = 0; // FIXME: make it modeless
129  psh.hwndParent = NULL;
130  psh.nStartPage = 0;
131  psh.phpage = hpsp;
132 
133  LPITEMIDLIST completePidl = ILCombine(pidlFolder, apidl[0]);
134  if (!completePidl)
135  return E_OUTOFMEMORY;
136 
137  if (ILGetDisplayNameExW(NULL, completePidl, wszName, ILGDN_NORMAL))
138  {
139  psh.pszCaption = wszName;
140  psh.dwFlags |= PSH_PROPTITLE;
141  }
142 
143  ILFree(completePidl);
144 
145  CComPtr<IDataObject> pDataObj;
146  HRESULT hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj));
147 
148  if (SUCCEEDED(hr))
149  {
150  hr = CComObject<CDrvDefExt>::CreateInstance(&pDrvDefExt);
151  if (SUCCEEDED(hr))
152  {
153  pDrvDefExt->AddRef(); // CreateInstance returns object with 0 ref count
154  hr = pDrvDefExt->Initialize(pidlFolder, pDataObj, NULL);
155  if (SUCCEEDED(hr))
156  {
157  hr = pDrvDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&psh);
158  if (FAILED(hr))
159  ERR("AddPages failed\n");
160  } else
161  ERR("Initialize failed\n");
162  }
163 
165  if (hpsx)
167  }
168 
169  // NOTE: Currently property sheet is modal. If we make it modeless, then it returns HWND.
170  INT_PTR ret = PropertySheetW(&psh);
171 
172  if (hpsx)
174  if (pDrvDefExt)
175  pDrvDefExt->Release();
176 
177  if (ret > 0)
178  return S_OK;
179  if (ret == 0)
180  return S_FALSE;
181  return E_FAIL;
182 }
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:1755
HWND hwndParent
Definition: prsht.h:277
BOOL CALLBACK AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
Definition: precomp.h:112
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI SHCreateDataObject(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pdtInner, REFIID riid, void **ppv)
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:1577
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
#define ZeroMemory
Definition: winbase.h:1635
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:309
struct _PROPSHEETHEADERW PROPSHEETHEADERW
int32_t INT_PTR
Definition: typedefs.h:62
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPCWSTR pszCaption
Definition: prsht.h:283
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define ILGDN_NORMAL
Definition: undocshell.h:69
LONG_PTR LPARAM
Definition: windef.h:208
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2896
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:91
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSH_PROPTITLE
Definition: prsht.h:40
LONG HRESULT
Definition: typedefs.h:77
DWORD dwSize
Definition: prsht.h:275
DWORD dwFlags
Definition: prsht.h:276
int ret
static const WCHAR L[]
Definition: oid.c:1250
HPROPSHEETPAGE * phpage
Definition: prsht.h:291
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj)
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define MAX_PROPERTY_SHEET_PAGE
#define SUCCEEDED(hr)
Definition: intsafe.h:57
UINT nStartPage
Definition: prsht.h:286

Referenced by DrivesContextMenuCallback(), and SH_ShowPropertiesDialog().

◆ SH_ShowPropertiesDialog()

BOOL SH_ShowPropertiesDialog ( LPCWSTR  pwszPath,
LPCITEMIDLIST  pidlFolder,
PCUITEMID_CHILD_ARRAY  apidl 
)

Definition at line 94 of file fprop.cpp.

95 {
96  HPSXA hpsxa[3] = {NULL, NULL, NULL};
97  CComObject<CFileDefExt> *pFileDefExt = NULL;
98 
99  TRACE("SH_ShowPropertiesDialog entered filename %s\n", debugstr_w(pwszPath));
100 
101  if (pwszPath == NULL || !wcslen(pwszPath))
102  return FALSE;
103 
105  memset(hppages, 0x0, sizeof(HPROPSHEETPAGE) * MAX_PROPERTY_SHEET_PAGE);
106 
107  /* Make a copy of path */
108  WCHAR wszPath[MAX_PATH];
109  StringCbCopyW(wszPath, sizeof(wszPath), pwszPath);
110 
111  /* remove trailing \\ at the end of path */
112  PathRemoveBackslashW(wszPath);
113 
114  /* Handle drives */
115  if (PathIsRootW(wszPath))
116  return SUCCEEDED(SH_ShowDriveProperties(wszPath, pidlFolder, apidl));
117 
121  if (!stub.Create(NULL, NULL, NULL, style, exstyle))
122  {
123  ERR("StubWindow32 creation failed\n");
124  return FALSE;
125  }
126 
127  /* Handle files and folders */
129  memset(&Header, 0x0, sizeof(PROPSHEETHEADERW));
130  Header.dwSize = sizeof(PROPSHEETHEADERW);
131  Header.hwndParent = stub;
132  Header.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE;
133  Header.phpage = hppages;
134  Header.pszCaption = PathFindFileNameW(wszPath);
135 
136  CComPtr<IDataObject> pDataObj;
137  HRESULT hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj));
138 
139  if (SUCCEEDED(hr))
140  {
141  hr = CComObject<CFileDefExt>::CreateInstance(&pFileDefExt);
142  if (SUCCEEDED(hr))
143  {
144  pFileDefExt->AddRef(); // CreateInstance returns object with 0 ref count
145  hr = pFileDefExt->Initialize(pidlFolder, pDataObj, NULL);
146  if (SUCCEEDED(hr))
147  {
148  hr = pFileDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&Header);
149  if (FAILED(hr))
150  ERR("AddPages failed\n");
151  } else
152  ERR("Initialize failed\n");
153  }
154 
155  LoadPropSheetHandlers(wszPath, &Header, MAX_PROPERTY_SHEET_PAGE - 1, hpsxa, pDataObj);
156  }
157 
159 
160  for (UINT i = 0; i < 3; ++i)
161  if (hpsxa[i])
163  if (pFileDefExt)
164  pFileDefExt->Release();
165 
166  stub.DestroyWindow();
167 
168  return (Result != -1);
169 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:1755
#define WS_DISABLED
Definition: pedump.c:621
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
BOOL CALLBACK AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
Definition: precomp.h:112
HRESULT hr
Definition: shlfolder.c:183
GLint x0
Definition: linetemp.h:95
HRESULT WINAPI SHCreateDataObject(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pdtInner, REFIID riid, void **ppv)
static UINT LoadPropSheetHandlers(LPCWSTR pwszPath, PROPSHEETHEADERW *pHeader, UINT cMaxPages, HPSXA *phpsxa, IDataObject *pDataObj)
Definition: fprop.cpp:30
Definition: stubgen.c:11
struct _PROPSHEETHEADERW PROPSHEETHEADERW
int32_t INT_PTR
Definition: typedefs.h:62
#define IID_PPV_ARG(Itype, ppType)
struct _stub stub
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
Definition: Header.h:8
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
_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
Definition: wsk.h:426
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:389
LONG_PTR LPARAM
Definition: windef.h:208
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2896
#define WS_CAPTION
Definition: pedump.c:624
BOOL WINAPI PathIsRootW(LPCWSTR lpszPath)
Definition: path.c:1621
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSH_PROPTITLE
Definition: prsht.h:40
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
LPWSTR WINAPI PathRemoveBackslashW(LPWSTR lpszPath)
Definition: path.c:862
#define ERR(fmt,...)
Definition: debug.h:109
HRESULT SH_ShowDriveProperties(WCHAR *pwszDrive, LPCITEMIDLIST pidlFolder, PCUITEMID_CHILD_ARRAY apidl)
Definition: drive.cpp:118
unsigned int UINT
Definition: ndis.h:50
#define WS_EX_APPWINDOW
Definition: winuser.h:383
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
Arabic default style
Definition: afstyles.h:93
#define memset(x, y, z)
Definition: compat.h:39
#define MAX_PROPERTY_SHEET_PAGE
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CFSFolder::CallBack(), and Shell_DefaultContextMenuCallBack().

◆ SH_ShowRecycleBinProperties()

BOOL SH_ShowRecycleBinProperties ( WCHAR  sDrive)

Definition at line 381 of file recycler_prop.cpp.

382 {
383  HPROPSHEETPAGE hpsp[1];
384  PROPSHEETHEADERW psh;
385  HPROPSHEETPAGE hprop;
386 
387  BOOL ret;
388 
389 
390  ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
391  psh.dwSize = sizeof(PROPSHEETHEADERW);
394  psh.hwndParent = NULL;
395  psh.phpage = hpsp;
397 
399  if (!hprop)
400  {
401  ERR("Failed to create property sheet\n");
402  return FALSE;
403  }
404  hpsp[psh.nPages] = hprop;
405  psh.nPages++;
406 
407 
408  ret = PropertySheetW(&psh);
409  if (ret < 0)
410  return FALSE;
411  else
412  return TRUE;
413 }
HWND hwndParent
Definition: prsht.h:277
#define TRUE
Definition: types.h:120
#define IDS_RECYCLEBIN_FOLDER_NAME
Definition: shresdef.h:232
#define ZeroMemory
Definition: winbase.h:1635
struct _PROPSHEETHEADERW PROPSHEETHEADERW
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
LPCWSTR pszCaption
Definition: prsht.h:283
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2896
#define IDD_RECYCLE_BIN_PROPERTIES
Definition: shresdef.h:325
#define PSP_DEFAULT
Definition: prsht.h:22
#define PSH_PROPTITLE
Definition: prsht.h:40
HINSTANCE hInstance
Definition: prsht.h:278
DWORD dwSize
Definition: prsht.h:275
DWORD dwFlags
Definition: prsht.h:276
int ret
HPROPSHEETPAGE * phpage
Definition: prsht.h:291
#define ERR(fmt,...)
Definition: debug.h:109
static INT_PTR CALLBACK RecycleBinDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HPROPSHEETPAGE SH_CreatePropertySheetPage(LPCSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)

Referenced by RegFolderContextMenuCallback().

◆ SHELL_ConfirmYesNoW()

BOOL SHELL_ConfirmYesNoW ( HWND  hWnd,
int  nKindOfDialog,
LPCWSTR  szDir 
)

Definition at line 336 of file shlfileop.cpp.

337 {
338  return SHELL_ConfirmDialogW(hWnd, nKindOfDialog, szDir, NULL);
339 }
HWND hWnd
Definition: settings.c:17
smooth NULL
Definition: ftsmooth.c:416
static BOOL SHELL_ConfirmDialogW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir, FILE_OPERATION *op)
Definition: shlfileop.cpp:298

◆ SHELL_DeleteDirectoryW()

BOOL SHELL_DeleteDirectoryW ( HWND  hwnd,
LPCWSTR  pwszDir,
BOOL  bShowUI 
)

◆ 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

◆ SHELL_IsShortcut()

BOOL SHELL_IsShortcut ( LPCITEMIDLIST  )

Definition at line 378 of file shell32_main.c.

379 {
380  char szTemp[MAX_PATH];
381  HKEY keyCls;
382  BOOL ret = FALSE;
383 
384  if (_ILGetExtension(pidlLast, szTemp, MAX_PATH) &&
385  HCR_MapTypeToValueA(szTemp, szTemp, MAX_PATH, TRUE))
386  {
387  if (ERROR_SUCCESS == RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_QUERY_VALUE, &keyCls))
388  {
389  if (ERROR_SUCCESS == RegQueryValueExA(keyCls, "IsShortcut", NULL, NULL, NULL, NULL))
390  ret = TRUE;
391 
392  RegCloseKey(keyCls);
393  }
394  }
395 
396  return ret;
397 }
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4041
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3346
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2462
#define MAX_PATH
Definition: compat.h:26
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:88
int ret
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by SHGetFileInfoW(), and SHMapPIDLToSystemImageListIndex().

◆ SHELL_OsIsUnicode()

◆ SHELL_RegisterShellFolders()

HRESULT SHELL_RegisterShellFolders ( void  )

Definition at line 2538 of file shellpath.c.

2539 {
2540  HRESULT hr;
2541 
2543  if (SUCCEEDED(hr))
2545  if (SUCCEEDED(hr))
2547  return hr;
2548 }
static HRESULT _SHRegisterCommonShellFolders(void)
Definition: shellpath.c:2510
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
static HRESULT _SHRegisterUserShellFolders(BOOL bDefault)
Definition: shellpath.c:2442
LONG HRESULT
Definition: typedefs.h:77
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by DllRegisterServer().

◆ 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:893
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_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_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:893
#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:769
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().

◆ UNIXFS_is_rooted_at_desktop()

BOOL UNIXFS_is_rooted_at_desktop ( void  )

Variable Documentation

◆ DECLSPEC_HIDDEN

const GUID CLSID_UnixDosFolder DECLSPEC_HIDDEN

Definition at line 35 of file shell32_main.h.