ReactOS 0.4.16-dev-833-g4bc97ad
shell32_main.h File Reference
#include "shell32_version.h"
Include dependency graph for shell32_main.h:
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 SHELL32_AssocGetFolderDescription   SHELL32_AssocGetFSDirectoryDescription
 
#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
 
HRESULT HCR_GetProgIdKeyOfExtension (PCWSTR szExtension, PHKEY phKey, BOOL AllowFallback)
 
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
 
HRESULT SHELL32_AssocGetFSDirectoryDescription (PWSTR Buf, UINT cchBuf)
 
HRESULT SHELL32_AssocGetFileDescription (PCWSTR Name, PWSTR Buf, UINT cchBuf)
 
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, BOOL bExtendedObject, 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
 
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)
 
BOOL 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
 
HPROPSHEETPAGE SH_CreatePropertySheetPage (WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle)
 
HPROPSHEETPAGE SH_CreatePropertySheetPageEx (WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle, LPFNPSPCALLBACK Callback)
 
LPWSTR SH_FormatFileSizeWithBytes (PULARGE_INTEGER lpQwSize, LPWSTR pszBuf, UINT cchBuf)
 
HRESULT WINAPI DoRegisterServer (void)
 
HRESULT WINAPI DoUnregisterServer (void)
 

Variables

HMODULE huser32 DECLSPEC_HIDDEN
 
INT ShellLargeIconSize
 
INT ShellSmallIconSize
 
INT ShellIconBPP
 

Macro Definition Documentation

◆ __SHFreeAndNil

#define __SHFreeAndNil (   ptr)
Value:
{\
SHFree(*ptr); \
*ptr = NULL; \
};
#define NULL
Definition: types.h:112
static PVOID ptr
Definition: dispmode.c:27

Definition at line 154 of file shell32_main.h.

◆ ARRAY_SIZE

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

Definition at line 31 of file shell32_main.h.

◆ ASK_CANT_TRASH_ITEM

#define ASK_CANT_TRASH_ITEM   10

Definition at line 139 of file shell32_main.h.

◆ ASK_CREATE_FOLDER

#define ASK_CREATE_FOLDER   4

Definition at line 133 of file shell32_main.h.

◆ ASK_DELETE_FILE

#define ASK_DELETE_FILE   1

Definition at line 130 of file shell32_main.h.

◆ ASK_DELETE_FOLDER

#define ASK_DELETE_FOLDER   2

Definition at line 131 of file shell32_main.h.

◆ ASK_DELETE_MULTIPLE_ITEM

#define ASK_DELETE_MULTIPLE_ITEM   3

Definition at line 132 of file shell32_main.h.

◆ ASK_DELETE_SELECTED

#define ASK_DELETE_SELECTED   6

Definition at line 135 of file shell32_main.h.

◆ ASK_OVERWRITE_FILE

#define ASK_OVERWRITE_FILE   5

Definition at line 134 of file shell32_main.h.

◆ ASK_OVERWRITE_FOLDER

#define ASK_OVERWRITE_FOLDER   11

Definition at line 140 of file shell32_main.h.

◆ ASK_TRASH_FILE

#define ASK_TRASH_FILE   7

Definition at line 136 of file shell32_main.h.

◆ ASK_TRASH_FOLDER

#define ASK_TRASH_FOLDER   8

Definition at line 137 of file shell32_main.h.

◆ ASK_TRASH_MULTIPLE_ITEM

#define ASK_TRASH_MULTIPLE_ITEM   9

Definition at line 138 of file shell32_main.h.

◆ HICON_16

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

Definition at line 187 of file shell32_main.h.

◆ HICON_32

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

Definition at line 188 of file shell32_main.h.

◆ HINSTANCE_16

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

Definition at line 190 of file shell32_main.h.

◆ HINSTANCE_32

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

Definition at line 189 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;\
};
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
Definition: cvt.cpp:355
static DWORD tymed
Definition: url.c:174

Definition at line 104 of file shell32_main.h.

◆ INVALID_INDEX

#define INVALID_INDEX   -1

Definition at line 42 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:2372
#define MK_CONTROL
Definition: winuser.h:2373

Definition at line 113 of file shell32_main.h.

◆ SHELL32_AssocGetFolderDescription

#define SHELL32_AssocGetFolderDescription   SHELL32_AssocGetFSDirectoryDescription

Definition at line 75 of file shell32_main.h.

Function Documentation

◆ __SHCloneStrA()

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

Definition at line 159 of file shell32_main.h.

160{
161 *target = (char *)SHAlloc(strlen(source) + 1);
163}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
GLenum target
Definition: glext.h:7315
strcpy
Definition: string.h:131

◆ __SHCloneStrAtoW()

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

Definition at line 178 of file shell32_main.h.

179{
180 int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0);
181 *target = (WCHAR *)SHAlloc(len * sizeof(WCHAR));
183 return *target;
184}
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by BrFolder_OnSetSelectionA(), CShellLink::DoOpen(), FindExecutableA(), CDefaultContextMenu::InvokePidl(), OpenAs_RunDLLA(), PathResolveA(), SHBrowseForFolderA(), ShellExecuteExA(), and WOWShellExecute().

◆ __SHCloneStrW()

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

Definition at line 172 of file shell32_main.h.

173{
174 *target = (WCHAR *)SHAlloc((lstrlenW(source) + 1) * sizeof(WCHAR) );
176}
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750

Referenced by SHELL_execute(), and ShellExecCmdLine().

◆ __SHCloneStrWtoA()

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

Definition at line 165 of file shell32_main.h.

166{
167 int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL);
168 *target = (char *)SHAlloc(len);
170}
#define WideCharToMultiByte
Definition: compat.h:111

Referenced by ShellExecute_ContextMenuVerb().

◆ _InsertMenuItemW()

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

Definition at line 421 of file shfldr_netconnect.cpp.

429{
430 MENUITEMINFOW mii;
431 WCHAR szText[100];
432
433 ZeroMemory(&mii, sizeof(mii));
434 mii.cbSize = sizeof(mii);
435 if (fType == MFT_SEPARATOR)
436 {
437 mii.fMask = MIIM_ID | MIIM_TYPE;
438 }
439 else if (fType == MFT_STRING)
440 {
442 if ((ULONG_PTR)HIWORD((ULONG_PTR)dwTypeData) == 0)
443 {
444 if (LoadStringW(netshell_hInstance, LOWORD((ULONG_PTR)dwTypeData), szText, sizeof(szText)/sizeof(WCHAR)))
445 {
446 szText[(sizeof(szText)/sizeof(WCHAR))-1] = 0;
447 mii.dwTypeData = szText;
448 }
449 else
450 {
451 return;
452 }
453 }
454 else
455 {
456 mii.dwTypeData = (LPWSTR) dwTypeData;
457 }
458 mii.fState = fState;
459 }
460
461 mii.wID = wID;
462 mii.fType = fType;
463 InsertMenuItemW( hmenu, indexMenu, fByPosition, &mii);
464}
static HMENU hmenu
Definition: win.c:66
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
#define LOWORD(l)
Definition: pedump.c:82
LPWSTR dwTypeData
Definition: winuser.h:3272
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define HIWORD(l)
Definition: typedefs.h:247
#define ZeroMemory
Definition: winbase.h:1737
#define MIIM_ID
Definition: winuser.h:725
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MFT_SEPARATOR
Definition: winuser.h:747
#define MIIM_STATE
Definition: winuser.h:724
#define MFT_STRING
Definition: winuser.h:749
#define MIIM_TYPE
Definition: winuser.h:728
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by BrFolder_OnContextMenu(), CDesktopFolder::CallBack(), CDrivesFolder::CallBack(), CFSFolder::CallBack(), CNetFolderBackgroundMenuCB(), DrivesContextMenuCallback(), CNetConUiObject::QueryContextMenu(), CCPLItemMenu::QueryContextMenu(), CRecycleBinItemContextMenu::QueryContextMenu(), and CRecycleBin::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: atlbase.h:39

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 
)

◆ CShellDispatch_Constructor()

HRESULT WINAPI CShellDispatch_Constructor ( REFIID  riid,
LPVOID ppvOut 
)

Definition at line 585 of file CShellDispatch.cpp.

586{
587 return ShellObjectCreatorInit<CShellDispatch>(riid, ppvOut);
588}

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 52 of file changenotify.cpp.

53{
54 HWND hwndServer = GetNotificationServer(FALSE);
55 if (hwndServer)
58}
#define CN_UNREGISTER_PROCESS
static HWND GetNotificationServer(BOOL bCreate)
CRITICAL_SECTION SHELL32_ChangenotifyCS
#define FALSE
Definition: types.h:117
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ HCR_GetClassNameA()

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

Definition at line 497 of file classes.c.

498{ HKEY hkey;
499 BOOL ret = FALSE;
500 DWORD buflen = len;
501#ifdef __REACTOS__
502 CHAR szName[100];
503 LPOLESTR pStr;
504#endif
505
506 szDest[0] = 0;
507
508#ifdef __REACTOS__
509 if (StringFromCLSID(riid, &pStr) == S_OK)
510 {
511 DWORD dwLen = buflen * sizeof(CHAR);
512 sprintf(szName, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%S", pStr);
514 {
515 ret = TRUE;
516 }
517 CoTaskMemFree(pStr);
518 }
519 if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
520#else
521 if (HCR_RegOpenClassIDKey(riid, &hkey))
522#endif
523 {
524 if (!RegLoadMUIStringA(hkey,"LocalizedString",szDest,len,NULL,0,NULL) ||
525 !RegQueryValueExA(hkey,"",0,NULL,(LPBYTE)szDest,&len))
526 {
527 ret = TRUE;
528 }
529 RegCloseKey(hkey);
530 }
531
532 if (!ret || !szDest[0])
533 {
534 if(IsEqualIID(riid, &CLSID_ShellDesktop))
535 {
536 if (LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
537 ret = TRUE;
538 }
539 else if (IsEqualIID(riid, &CLSID_MyComputer))
540 {
541 if(LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
542 ret = TRUE;
543 }
544#ifdef __REACTOS__
545 else if (IsEqualIID(riid, &CLSID_MyDocuments))
546 {
547 if(LoadStringA(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
548 ret = TRUE;
549 }
550 else if (IsEqualIID(riid, &CLSID_RecycleBin))
551 {
553 ret = TRUE;
554 }
555 else if (IsEqualIID(riid, &CLSID_ControlPanel))
556 {
558 ret = TRUE;
559 }
561 {
563 ret = TRUE;
564 }
565#endif
566 }
567
568 TRACE("-- (%s)\n", szDest);
569
570 return ret;
571}
#define shell32_hInstance
#define CHAR(Char)
#define RegCloseKey(hKey)
Definition: registry.h:49
#define TRUE
Definition: types.h:120
#define IDS_PERSONAL
Definition: desktop.c:27
LSTATUS WINAPI RegGetValueA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:2037
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:4009
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)
Definition: reg.c:5268
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
#define RRF_RT_REG_SZ
Definition: driver.c:575
const GUID CLSID_AdminFolderShortcut
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define S_OK
Definition: intsafe.h:52
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static LPOLESTR
Definition: stg_prop.c:27
static const WCHAR szName[]
Definition: powrprof.c:45
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
Definition: classes.c:253
#define IDS_DESKTOP
Definition: shresdef.h:71
#define IDS_MYCOMPUTER
Definition: shresdef.h:279
#define IDS_CONTROLPANEL
Definition: shresdef.h:139
#define IDS_ADMINISTRATIVETOOLS
Definition: shresdef.h:274
#define IDS_RECYCLEBIN_FOLDER_NAME
Definition: shresdef.h:268
#define TRACE(s)
Definition: solgame.cpp:4
unsigned char * LPBYTE
Definition: typedefs.h:53
int ret
#define HKEY_CURRENT_USER
Definition: winreg.h:11
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
char CHAR
Definition: xmlstorage.h:175

Referenced by shdebugstr_guid().

◆ HCR_GetClassNameW()

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

Definition at line 422 of file classes.c.

423{
424 HKEY hkey;
425 BOOL ret = FALSE;
426 DWORD buflen = len;
427#ifdef __REACTOS__
428 WCHAR 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(WCHAR);
438 swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);
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 (!RegLoadMUIStringW(hkey, L"LocalizedString", szDest, len, NULL, 0, NULL) ||
451 !RegQueryValueExW(hkey, L"", 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 (LoadStringW(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
463 ret = TRUE;
464 }
465 else if (IsEqualIID(riid, &CLSID_MyComputer))
466 {
467 if(LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
468 ret = TRUE;
469 }
470#ifdef __REACTOS__
471 else if (IsEqualIID(riid, &CLSID_MyDocuments))
472 {
473 if(LoadStringW(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 {
484 ret = TRUE;
485 }
487 {
489 ret = TRUE;
490 }
491#endif
492 }
493 TRACE("-- %s\n", debugstr_w(szDest));
494 return ret;
495}
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
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define swprintf
Definition: precomp.h:40
#define debugstr_w
Definition: kernel32.h:32
#define L(x)
Definition: ntvdm.h:50

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

◆ HCR_GetDefaultVerbW()

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

Definition at line 152 of file classes.c.

153{
154 WCHAR sTemp[MAX_PATH], verbs[MAX_PATH];
155 LONG size;
156 HKEY hkey;
157
158 TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest);
159
160 if (szVerb && *szVerb)
161 {
162 lstrcpynW(szDest, szVerb, len);
163 return TRUE;
164 }
165
166 /* MSDN says to first try the default verb */
167 size = _countof(verbs);
168 if (!RegQueryValueW(hkeyClass, L"shell", verbs, &size) && *verbs)
169 {
170 for (UINT i = 0;; ++i)
171 {
172 if (FAILED(SHELL32_EnumDefaultVerbList(verbs, i, szDest, len)))
173 break;
174 if (FAILED(StringCchPrintfW(sTemp, _countof(sTemp), L"shell\\%s\\command", szDest)))
175 break;
176 if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
177 {
178 RegCloseKey(hkey);
179 TRACE("default verb=%s\n", debugstr_w(szDest));
180 return TRUE;
181 }
182 }
183 }
184 *szDest = UNICODE_NULL;
185
186 /* then fallback to 'open' */
187 lstrcpyW(sTemp, L"shell\\open\\command");
188 if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
189 {
190 RegCloseKey(hkey);
191 lstrcpynW(szDest, L"open", len);
192 TRACE("default verb=open\n");
193 return TRUE;
194 }
195
196 /* and then just use the first verb on Windows >= 2000 */
197#ifdef __REACTOS__
198 if (!RegOpenKeyExW(hkeyClass, L"shell", 0, KEY_READ, &hkey))
199 {
200 if (!RegEnumKeyW(hkey, 0, szDest, len) && *szDest)
201 {
202 TRACE("default verb=first verb=%s\n", debugstr_w(szDest));
203 RegCloseKey(hkey);
204 return TRUE;
205 }
206 RegCloseKey(hkey);
207 }
208#else
209 if (!RegEnumKeyW(hkeyClass, 0, szDest, len) && *szDest)
210 {
211 TRACE("default verb=first verb=%s\n", debugstr_w(szDest));
212 return TRUE;
213 }
214#endif
215
216 TRACE("no default verb!\n");
217 return FALSE;
218}
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4241
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2393
#define MAX_PATH
Definition: compat.h:34
#define lstrcpynW
Definition: compat.h:738
GLsizeiptr size
Definition: glext.h:5919
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
#define FAILED(hr)
Definition: intsafe.h:51
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define UNICODE_NULL
long LONG
Definition: pedump.c:60
EXTERN_C HRESULT SHELL32_EnumDefaultVerbList(LPCWSTR List, UINT Index, LPWSTR Verb, SIZE_T cchMax)
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530

Referenced by HCR_GetExecuteCommandW(), COpenWithList::SetDefaultHandler(), and SHELL_FindExecutableByVerb().

◆ HCR_GetExecuteCommandW()

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

Definition at line 220 of file classes.c.

221{
222 WCHAR sTempVerb[MAX_PATH];
223 BOOL ret;
224
225 TRACE("%p %s %s %p\n", hkeyClass, debugstr_w(szClass), debugstr_w(szVerb), szDest);
226
227 if (szClass)
228 RegOpenKeyExW(HKEY_CLASSES_ROOT, szClass, 0, KEY_READ, &hkeyClass);
229 if (!hkeyClass)
230 return FALSE;
231 ret = FALSE;
232
233 if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)/sizeof(sTempVerb[0])))
234 {
235 WCHAR sTemp[MAX_PATH];
236 lstrcpyW(sTemp, L"shell\\");
237 lstrcatW(sTemp, sTempVerb);
238 lstrcatW(sTemp, L"\\command");
239 ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len));
240 }
241 if (szClass)
242 RegCloseKey(hkeyClass);
243
244 TRACE("-- %s\n", debugstr_w(szDest) );
245 return ret;
246}
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
BOOL HCR_GetDefaultVerbW(HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len)
Definition: classes.c:152
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by SHELL_execute_class(), and SHELL_translate_idlist().

◆ HCR_GetFolderAttributes()

BOOL HCR_GetFolderAttributes ( LPCITEMIDLIST  pidlFolder,
LPDWORD  dwAttributes 
)

Definition at line 590 of file classes.c.

591{
592 HKEY hSFKey;
593 LPOLESTR pwszCLSID;
594 LONG lResult;
595 DWORD dwTemp, dwLen;
596 WCHAR wszShellFolderKey[] = L"CLSID\\{00021400-0000-0000-C000-000000000046}\\ShellFolder";
597
598 TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes);
599
600 if (!_ILIsPidlSimple(pidlFolder)) {
601 static BOOL firstHit = TRUE;
602 if (firstHit) {
603 ERR("should be called for simple PIDL's only!\n");
604 firstHit = FALSE;
605 }
606 return FALSE;
607 }
608
609 if (!_ILIsDesktop(pidlFolder)) {
610 if (FAILED(StringFromCLSID(_ILGetGUIDPointer(pidlFolder), &pwszCLSID))) return FALSE;
611 memcpy(&wszShellFolderKey[6], pwszCLSID, 38 * sizeof(WCHAR));
612 CoTaskMemFree(pwszCLSID);
613 }
614
615 lResult = RegOpenKeyExW(HKEY_CLASSES_ROOT, wszShellFolderKey, 0, KEY_READ, &hSFKey);
616#ifdef __REACTOS__
617 if (lResult != ERROR_SUCCESS)
618 {
619 ERR("Cannot open key: %ls\n", wszShellFolderKey);
620 return FALSE;
621 }
622#else
623 if (lResult != ERROR_SUCCESS) return FALSE;
624#endif
625
626 dwLen = sizeof(DWORD);
627 lResult = RegQueryValueExW(hSFKey, L"CallForAttributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
628 if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) {
629 LPSHELLFOLDER psfDesktop, psfFolder;
630 HRESULT hr;
631
632 RegCloseKey(hSFKey);
633 hr = SHGetDesktopFolder(&psfDesktop);
634 if (SUCCEEDED(hr)) {
635 hr = IShellFolder_BindToObject(psfDesktop, pidlFolder, NULL, &IID_IShellFolder,
636 (LPVOID*)&psfFolder);
637 if (SUCCEEDED(hr)) {
638 hr = IShellFolder_GetAttributesOf(psfFolder, 0, NULL, pdwAttributes);
639 IShellFolder_Release(psfFolder);
640 }
641 IShellFolder_Release(psfDesktop);
642 }
643 if (FAILED(hr)) return FALSE;
644 } else {
645 lResult = RegQueryValueExW(hSFKey, L"Attributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
646 RegCloseKey(hSFKey);
647 if (lResult == ERROR_SUCCESS) {
648 *pdwAttributes &= dwTemp;
649 } else {
650 return FALSE;
651 }
652 }
653
654 TRACE("-- *pdwAttributes == 0x%08x\n", *pdwAttributes);
655
656 return TRUE;
657}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define DWORD
Definition: nt_native.h:44
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2392
HRESULT hr
Definition: shlfolder.c:183

Referenced by CRegFolder::GetGuidItemAttributes().

◆ HCR_GetIconA()

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

Definition at line 339 of file classes.c.

340{
341 HKEY hkey;
342 char sTemp[MAX_PATH];
343 BOOL ret = FALSE;
344
345 TRACE("%s\n",szClass );
346
347 sprintf(sTemp, "%s\\DefaultIcon",szClass);
348
349 if (!RegOpenKeyExA(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
350 {
351 ret = HCR_RegGetIconA(hkey, szDest, szName, len, picon_idx);
352 RegCloseKey(hkey);
353 }
354
355 if (ret)
356 TRACE("-- %s %i\n", szDest, *picon_idx);
357 else
358 TRACE("-- not found\n");
359
360 return ret;
361}
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:290

◆ HCR_GetIconW()

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

Definition at line 314 of file classes.c.

315{
316 HKEY hkey;
317 WCHAR sTemp[MAX_PATH];
318 BOOL ret = FALSE;
319
320 TRACE("%s\n",debugstr_w(szClass) );
321
322 lstrcpynW(sTemp, szClass, MAX_PATH);
323 lstrcatW(sTemp, L"\\DefaultIcon");
324
325 if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
326 {
327 ret = HCR_RegGetIconW(hkey, szDest, szName, len, picon_idx);
328 RegCloseKey(hkey);
329 }
330
331 if(ret)
332 TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx);
333 else
334 TRACE("-- not found\n");
335
336 return ret;
337}
static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:266

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

◆ HCR_GetProgIdKeyOfExtension()

HRESULT HCR_GetProgIdKeyOfExtension ( PCWSTR  szExtension,
PHKEY  phKey,
BOOL  AllowFallback 
)

Definition at line 55 of file classes.c.

56{
57 LONG err;
60 if (szExtension[0] != '.')
61 {
62 ext[0] = '.';
63 lstrcpynW(ext + 1, szExtension, _countof(ext) - 1);
64 szExtension = ext;
65 }
67 if (!err && progid[0] != UNICODE_NULL)
68 {
70 if (!err)
71 return err; /* A real ProgId key, return S_OK */
72 }
73 if (AllowFallback)
74 {
75 err = RegOpenKeyExW(HKEY_CLASSES_ROOT, szExtension, 0, KEY_READ, phKey);
76 if (!err)
77 return S_FALSE;
78 }
79 return HRESULT_FROM_WIN32(err);
80}
static const WCHAR *const ext[]
Definition: module.c:53
#define progid(str)
Definition: exdisp.idl:31
#define err(...)
#define MAX_EXTENSION_LENGTH
Definition: classes.c:47
static LONG GetRegString(HKEY hKey, PCWSTR SubKey, PCWSTR Name, PWSTR Buffer, UINT cchBuf)
Definition: classes.c:49
#define max(a, b)
Definition: svc.c:63
#define S_FALSE
Definition: winerror.h:2357
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

Referenced by SHELL32_AssocGetExtensionDescription(), and SHELL_IsShortcut().

◆ HCR_MapTypeToValueA()

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

Definition at line 116 of file classes.c.

117{
118 HKEY hkey;
119 char szTemp[MAX_EXTENSION_LENGTH + 2];
120
121 TRACE("%s %p\n", szExtension, szFileType);
122
123 /* added because we do not want to have double dots */
124 if (szExtension[0] == '.')
125 bPrependDot = FALSE;
126
127 if (bPrependDot)
128 szTemp[0] = '.';
129
130 lstrcpynA(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
131
132 if (RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
133 {
134 return FALSE;
135 }
136
137 if (RegQueryValueA(hkey, NULL, szFileType, &len))
138 {
139 RegCloseKey(hkey);
140 return FALSE;
141 }
142
143 RegCloseKey(hkey);
144
145 TRACE("--UE;\n} %s\n", szFileType);
146
147 return TRUE;
148}
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
Definition: reg.c:4212
#define lstrcpynA
Definition: compat.h:751

◆ HCR_MapTypeToValueW()

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

Definition at line 82 of file classes.c.

83{
84 HKEY hkey;
85 WCHAR szTemp[MAX_EXTENSION_LENGTH + 2];
86
87 TRACE("%s %p\n", debugstr_w(szExtension), szFileType);
88
89 /* added because we do not want to have double dots */
90 if (szExtension[0] == '.')
91 bPrependDot = FALSE;
92
93 if (bPrependDot)
94 szTemp[0] = '.';
95
96 lstrcpynW(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
97
98 if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
99 {
100 return FALSE;
101 }
102
103 if (RegQueryValueW(hkey, NULL, szFileType, &len))
104 {
105 RegCloseKey(hkey);
106 return FALSE;
107 }
108
109 RegCloseKey(hkey);
110
111 TRACE("--UE;\n} %s\n", debugstr_w(szFileType));
112
113 return TRUE;
114}

Referenced by SHGetFileInfoW().

◆ IClassFactory_Constructor()

LPCLASSFACTORY IClassFactory_Constructor ( REFCLSID  )

◆ IDataObject_Constructor()

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

◆ IEnumFORMATETC_Constructor()

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

Definition at line 121 of file CIDLDataObj.cpp.

122{
123 return ShellObjectCreatorInit<IEnumFORMATETCImpl>(cfmt, afmt, IID_PPV_ARG(IEnumFORMATETC, ppFormat));
124}
#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}
T * Detach()
Definition: atlcomcli.h:186
#define E_INVALIDARG
Definition: ddrawi.h:101
#define STGM_CREATE
Definition: objbase.h:926
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67

Referenced by _ILParsePathW().

◆ INewItem_Constructor()

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

◆ InitChangeNotifications()

void InitChangeNotifications ( void  )

Definition at line 46 of file changenotify.cpp.

47{
49}
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751

Referenced by if().

◆ IShellLink_ConstructFromFile()

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

Definition at line 3212 of file CShellLink.cpp.

3213{
3215 if (!ILGetDisplayNameExW(psf, pidl, path, 0))
3216 return E_FAIL;
3217
3219}
#define E_FAIL
Definition: ddrawi.h:102
REFIID LPVOID * ppv
Definition: atlbase.h:39
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:100

◆ IShellLink_ConstructFromPath()

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

Definition at line 3198 of file CShellLink.cpp.

3199{
3201 HRESULT hr = CShellLink::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IPersistFile, &ppf));
3202 if (FAILED(hr))
3203 return hr;
3204
3205 hr = ppf->Load(path, 0);
3206 if (FAILED(hr))
3207 return hr;
3208
3209 return ppf->QueryInterface(riid, ppv);
3210}

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 83 of file shellord.c.

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

Referenced by HCR_RegGetIconA(), and ParseFieldAW().

◆ ParseFieldW()

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

Definition at line 117 of file shellord.c.

118{
119 WARN("(%s,0x%08x,%p,%d) semi-stub.\n", debugstr_w(src), nField, dst, len);
120
121 if (!src || !src[0] || !dst || !len)
122 return 0;
123
124 /* skip n fields delimited by ',' */
125 while (nField > 1)
126 {
127 if (*src == 0x0) return FALSE;
128 if (*src++ == ',') nField--;
129 }
130
131 /* copy part till the next ',' to dst */
132 while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++) = *(src++);
133
134 /* finalize the string */
135 *dst = 0x0;
136
137 return TRUE;
138}

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

◆ PidlToSicIndex()

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

Definition at line 715 of file iconcache.cpp.

721{
723 WCHAR szIconFile[MAX_PATH]; /* file containing the icon */
724 INT iSourceIndex; /* index or resID(negated) in this file */
725 BOOL ret = FALSE;
726 UINT dwFlags = 0;
727 int iShortcutDefaultIndex = INVALID_INDEX;
728
729 TRACE("sf=%p pidl=%p %s\n", sh, pidl, bBigIcon?"Big":"Small");
730
731 if (!sic_hdpa)
733
734 if (SUCCEEDED (sh->GetUIObjectOf(0, 1, &pidl, IID_NULL_PPV_ARG(IExtractIconW, &ei))))
735 {
736 if (SUCCEEDED(ei->GetIconLocation(uFlags &~ GIL_FORSHORTCUT, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags)))
737 {
738 *pIndex = SIC_GetIconIndex(szIconFile, iSourceIndex, uFlags);
739 ret = TRUE;
740 }
741 }
742
743 if (INVALID_INDEX == *pIndex) /* default icon when failed */
744 {
745 if (0 == (uFlags & GIL_FORSHORTCUT))
746 {
747 *pIndex = 0;
748 }
749 else
750 {
751 if (INVALID_INDEX == iShortcutDefaultIndex)
752 {
753 iShortcutDefaultIndex = SIC_LoadIcon(swShell32Name, 0, GIL_FORSHORTCUT);
754 }
755 *pIndex = (INVALID_INDEX != iShortcutDefaultIndex ? iShortcutDefaultIndex : 0);
756 }
757 }
758
759 return ret;
760
761}
UINT uFlags
Definition: api.c:59
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
INT SIC_GetIconIndex(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
Definition: iconcache.cpp:474
static HDPA sic_hdpa
Definition: iconcache.cpp:26
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:515
static INT SIC_LoadIcon(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
Definition: iconcache.cpp:420
#define INVALID_INDEX
Definition: iconcache.cpp:15
_Out_ PULONG _Out_ PULONG pIndex
Definition: ndis.h:4565
short sh
Definition: format.c:272
int32_t INT
Definition: typedefs.h:58
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define IID_NULL_PPV_ARG(Itype, ppType)

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

◆ RenderFILENAMEA()

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

Definition at line 190 of file clipboard.c.

191{
192 int size = 0;
193 char szTemp[MAX_PATH], *szFileName;
194 LPITEMIDLIST pidl;
195 HGLOBAL hGlobal;
197
198 TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
199
200 /* get path of combined pidl */
201 pidl = ILCombine(pidlRoot, apidl[0]);
202 if (!pidl)
203 return 0;
204
205 bSuccess = SHGetPathFromIDListA(pidl, szTemp);
206 SHFree(pidl);
207 if (!bSuccess)
208 return 0;
209
210 size = strlen(szTemp) + 1;
211
212 /* fill the structure */
213 hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
214 if(!hGlobal) return hGlobal;
215 szFileName = GlobalLock(hGlobal);
216 memcpy(szFileName, szTemp, size);
217 GlobalUnlock(hGlobal);
218
219 return hGlobal;
220}
static BOOLEAN bSuccess
Definition: drive.cpp:355
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:816
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
Definition: pidl.c:1392
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define GHND
Definition: winbase.h:323
#define GMEM_SHARE
Definition: winbase.h:331

Referenced by CIDLDataObj::Initialize().

◆ RenderFILENAMEW()

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

Definition at line 222 of file clipboard.c.

223{
224 int size = 0;
225 WCHAR szTemp[MAX_PATH], *szFileName;
226 LPITEMIDLIST pidl;
227 HGLOBAL hGlobal;
229
230 TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
231
232 /* get path of combined pidl */
233 pidl = ILCombine(pidlRoot, apidl[0]);
234 if (!pidl)
235 return 0;
236
237 bSuccess = SHGetPathFromIDListW(pidl, szTemp);
238 SHFree(pidl);
239 if (!bSuccess)
240 return 0;
241
242 size = (strlenW(szTemp)+1) * sizeof(WCHAR);
243
244 /* fill the structure */
245 hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
246 if(!hGlobal) return hGlobal;
247 szFileName = GlobalLock(hGlobal);
248 memcpy(szFileName, szTemp, size);
249 GlobalUnlock(hGlobal);
250
251 return hGlobal;
252}
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1454
#define strlenW(s)
Definition: unicode.h:34

Referenced by CIDLDataObj::Initialize().

◆ RenderHDROP()

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

Definition at line 56 of file clipboard.c.

57{
58 UINT i;
59#ifdef __REACTOS__
60 int size = 0;
61#else
62 int rootlen = 0,size = 0;
63 WCHAR wszRootPath[MAX_PATH];
64#endif
66 HGLOBAL hGlobal = NULL;
67 DROPFILES *pDropFiles;
68 int offset;
69#ifdef __REACTOS__
70 LPITEMIDLIST *pidls;
71#endif
72
73 TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
74
75#ifdef __REACTOS__
76 pidls = (LPITEMIDLIST *)HeapAlloc(GetProcessHeap(), 0, cidl * sizeof(*pidls));
77 if (!pidls)
78 goto cleanup;
79#endif
80
81 /* get the size needed */
82 size = sizeof(DROPFILES);
83
84#ifndef __REACTOS__
85 SHGetPathFromIDListW(pidlRoot, wszRootPath);
86 PathAddBackslashW(wszRootPath);
87 rootlen = strlenW(wszRootPath);
88#endif
89
90 for (i=0; i<cidl;i++)
91 {
92#ifdef __REACTOS__
93 pidls[i] = ILCombine(pidlRoot, apidl[i]);
95 size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
96#else
98 size += (rootlen + strlenW(wszFileName) + 1) * sizeof(WCHAR);
99#endif
100 }
101
102 size += sizeof(WCHAR);
103
104 /* Fill the structure */
105 hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
106#ifdef __REACTOS__
107 if(!hGlobal) goto cleanup;
108#else
109 if(!hGlobal) return hGlobal;
110#endif
111
112 pDropFiles = GlobalLock(hGlobal);
113 offset = (sizeof(DROPFILES) + sizeof(WCHAR) - 1) / sizeof(WCHAR);
114 pDropFiles->pFiles = offset * sizeof(WCHAR);
115 pDropFiles->fWide = TRUE;
116
117#ifndef __REACTOS__
118 strcpyW(wszFileName, wszRootPath);
119#endif
120
121 for (i=0; i<cidl;i++)
122 {
123
124#ifdef __REACTOS__
126 wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
127 offset += wcslen(wszFileName) + 1;
128 ILFree(pidls[i]);
129#else
130 _ILSimpleGetTextW(apidl[i], wszFileName + rootlen, MAX_PATH - rootlen);
131 strcpyW(((WCHAR*)pDropFiles)+offset, wszFileName);
132 offset += strlenW(wszFileName) + 1;
133#endif
134 }
135
136 ((WCHAR*)pDropFiles)[offset] = 0;
137 GlobalUnlock(hGlobal);
138
139#ifdef __REACTOS__
140cleanup:
141 if(pidls)
142 HeapFree(GetProcessHeap(), 0, pidls);
143#endif
144
145 return hGlobal;
146}
static WCHAR wszFileName[MAX_PATH]
Definition: wordpad.c:71
wcscpy
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static void cleanup(void)
Definition: main.c:1335
GLintptr offset
Definition: glext.h:5920
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define PathAddBackslashW
Definition: pathcch.h:301
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1044
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2174
#define strcpyW(d, s)
Definition: unicode.h:35
struct _DROPFILES DROPFILES
DWORD pFiles
Definition: shlobj.h:2307
BOOL fWide
Definition: shlobj.h:2310

Referenced by CIDLDataObj::Initialize().

◆ RenderSHELLIDLIST()

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

Definition at line 148 of file clipboard.c.

149{
150 UINT i;
151 int offset = 0, sizePidl, size;
152 HGLOBAL hGlobal;
153 LPIDA pcida;
154
155 TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
156
157 /* get the size needed */
158 size = sizeof(CIDA) + sizeof (UINT)*(cidl); /* header */
159 size += ILGetSize (pidlRoot); /* root pidl */
160 for(i=0; i<cidl; i++)
161 {
162 size += ILGetSize(apidl[i]); /* child pidls */
163 }
164
165 /* fill the structure */
166 hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
167 if(!hGlobal) return hGlobal;
168 pcida = GlobalLock (hGlobal);
169 pcida->cidl = cidl;
170
171 /* root pidl */
172 offset = sizeof(CIDA) + sizeof (UINT)*(cidl);
173 pcida->aoffset[0] = offset; /* first element */
174 sizePidl = ILGetSize (pidlRoot);
175 memcpy(((LPBYTE)pcida)+offset, pidlRoot, sizePidl);
176 offset += sizePidl;
177
178 for(i=0; i<cidl; i++) /* child pidls */
179 {
180 pcida->aoffset[i+1] = offset;
181 sizePidl = ILGetSize(apidl[i]);
182 memcpy(((LPBYTE)pcida)+offset, apidl[i], sizePidl);
183 offset += sizePidl;
184 }
185
186 GlobalUnlock(hGlobal);
187 return hGlobal;
188}
#define ILGetSize
Definition: shellclasses.h:638
Definition: shlobj.h:572
UINT aoffset[1]
Definition: shlobj.h:573
UINT cidl
Definition: shlobj.h:572

Referenced by CIDLDataObj::Initialize().

◆ SH_CreatePropertySheetPage()

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

Definition at line 243 of file propsheet.cpp.

244{
245 return SH_CreatePropertySheetPageEx(wDialogId, pfnDlgProc, lParam, pwszTitle, NULL);
246}
LPARAM lParam
Definition: combotst.c:139
HPROPSHEETPAGE SH_CreatePropertySheetPageEx(WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle, LPFNPSPCALLBACK Callback)
Definition: propsheet.cpp:223

Referenced by CDrvDefExt::AddPages(), CFileDefExt::AddPages(), CFolderOptions::AddPages(), RecycleBin_AddPropSheetPages(), and ShowFolderOptionsDialogThreadProc().

◆ SH_CreatePropertySheetPageEx()

HPROPSHEETPAGE SH_CreatePropertySheetPageEx ( WORD  wDialogId,
DLGPROC  pfnDlgProc,
LPARAM  lParam,
LPCWSTR  pwszTitle,
LPFNPSPCALLBACK  Callback 
)

Definition at line 223 of file propsheet.cpp.

225{
227 Page.pszTemplate = MAKEINTRESOURCEW(wDialogId);
228 Page.pfnDlgProc = pfnDlgProc;
229 Page.lParam = lParam;
230 Page.pszTitle = pwszTitle;
231 Page.pfnCallback = Callback;
232
233 if (pwszTitle)
234 Page.dwFlags |= PSP_USETITLE;
235
236 if (Callback)
237 Page.dwFlags |= PSP_USECALLBACK;
238
240}
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3086
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
Definition: mm.h:1313
#define PSP_USETITLE
Definition: prsht.h:26
#define PSP_DEFAULT
Definition: prsht.h:22
#define PSP_USECALLBACK
Definition: prsht.h:30
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CShellLink::AddPages(), CDrvDefExt::AddPages(), CFileDefExt::AddPages(), CFolderOptions::AddPages(), and SH_CreatePropertySheetPage().

◆ SH_FormatFileSizeWithBytes()

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

Definition at line 266 of file filedefext.cpp.

267{
268 /* Format bytes in KBs, MBs etc */
269 if (StrFormatByteSizeW(lpQwSize->QuadPart, pwszResult, cchResultMax) == NULL)
270 return NULL;
271
272 /* If there is less bytes than 1KB, we have nothing to do */
273 if (lpQwSize->QuadPart < 1024)
274 return pwszResult;
275
276 /* Concatenate " (" */
277 UINT cchWritten = wcslen(pwszResult);
278 LPWSTR pwszEnd = pwszResult + cchWritten;
279 size_t cchRemaining = cchResultMax - cchWritten;
280 StringCchCopyExW(pwszEnd, cchRemaining, L" (", &pwszEnd, &cchRemaining, 0);
281
282 /* Write formated bytes count */
283 cchWritten = SH_FormatByteSize(lpQwSize->QuadPart, pwszEnd, cchRemaining);
284 pwszEnd += cchWritten;
285 cchRemaining -= cchWritten;
286
287 /* Copy ")" to the buffer */
288 StringCchCopyW(pwszEnd, cchRemaining, L")");
289
290 return pwszResult;
291}
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2394
UINT SH_FormatByteSize(LONGLONG cbSize, LPWSTR pwszResult, UINT cchResultMax)
Definition: filedefext.cpp:236
STRSAFEAPI StringCchCopyExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags)
Definition: strsafe.h:184
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185

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

◆ SHELL32_AssocGetFileDescription()

HRESULT SHELL32_AssocGetFileDescription ( PCWSTR  Name,
PWSTR  Buf,
UINT  cchBuf 
)

Definition at line 70 of file CQueryAssociations.cpp.

71{
73}
static HRESULT SHELL32_AssocGetExtensionDescription(PCWSTR DotExt, PWSTR Buf, UINT cchBuf)
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447

Referenced by GetItemDescription(), and SHGetFileInfoW().

◆ SHELL32_AssocGetFSDirectoryDescription()

HRESULT SHELL32_AssocGetFSDirectoryDescription ( PWSTR  Buf,
UINT  cchBuf 
)

Definition at line 25 of file CQueryAssociations.cpp.

26{
27 static WCHAR cache[33] = {};
28 if (!*cache)
30 return StringCchCopyW(Buf, cchBuf, cache);
31}
#define IDS_DIRECTORY
Definition: shresdef.h:158
Definition: cache.c:49

Referenced by GetItemDescription(), and SHGetFileInfoW().

◆ SHELL_ConfirmYesNoW()

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

Definition at line 334 of file shlfileop.cpp.

335{
336 return SHELL_ConfirmDialogW(hWnd, nKindOfDialog, szDir, NULL);
337}
HWND hWnd
Definition: settings.c:17
static BOOL SHELL_ConfirmDialogW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir, FILE_OPERATION *op)
Definition: shlfileop.cpp:296

Referenced by ConfirmDelete().

◆ SHELL_DeleteDirectoryW()

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

◆ Shell_GetImageLists()

BOOL WINAPI Shell_GetImageLists ( HIMAGELIST lpBigList,
HIMAGELIST lpSmallList 
)

Definition at line 689 of file iconcache.cpp.

690{
691 TRACE("(%p,%p)\n",lpBigList,lpSmallList);
692
693 if (!sic_hdpa)
695
696 if (lpBigList)
697 *lpBigList = ShellBigIconList;
698
699 if (lpSmallList)
700 *lpSmallList = ShellSmallIconList;
701
702 return TRUE;
703}
static HIMAGELIST ShellSmallIconList
Definition: iconcache.cpp:28
static HIMAGELIST ShellBigIconList
Definition: iconcache.cpp:29

◆ SHELL_IsShortcut()

BOOL SHELL_IsShortcut ( LPCITEMIDLIST  pidlLast)

Definition at line 404 of file shell32_main.c.

405{
406 WCHAR szTemp[MAX_PATH];
407 HKEY keyCls;
408 BOOL ret = FALSE;
409
410 if (_ILGetExtension(pidlLast, szTemp, _countof(szTemp)) &&
412 {
413 ret = RegQueryValueExW(keyCls, L"IsShortcut", NULL, NULL, NULL, NULL) == ERROR_SUCCESS;
414 RegCloseKey(keyCls);
415 }
416 return ret;
417}
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
Definition: pidl.c:2516
HRESULT HCR_GetProgIdKeyOfExtension(PCWSTR szExtension, PHKEY phKey, BOOL AllowFallback)
Definition: classes.c:55

Referenced by SHGetFileInfoW(), and SHMapPIDLToSystemImageListIndex().

◆ SHELL_OsIsUnicode()

◆ SHELL_RegisterShellFolders()

HRESULT SHELL_RegisterShellFolders ( void  )

Definition at line 3064 of file shellpath.c.

3065{
3066 HRESULT hr;
3067
3069 if (SUCCEEDED(hr))
3071 if (SUCCEEDED(hr))
3073 return hr;
3074}
static HRESULT _SHRegisterUserShellFolders(BOOL bDefault)
Definition: shellpath.c:2968
static HRESULT _SHRegisterCommonShellFolders(void)
Definition: shellpath.c:3036

Referenced by DllRegisterServer().

◆ SIC_Destroy()

void SIC_Destroy ( void  )

Definition at line 635 of file iconcache.cpp.

636{
637 TRACE("\n");
638
640
642
643 sic_hdpa = NULL;
648
650 //DeleteCriticalSection(&SHELL32_SicCS); //static
651}
void WINAPI DPA_DestroyCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:1003
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
static INT CALLBACK sic_free(LPVOID ptr, LPVOID lparam)
Definition: iconcache.cpp:628
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

◆ SIC_GetIconIndex()

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

Definition at line 474 of file iconcache.cpp.

475{
476 SIC_ENTRY sice;
479
480 TRACE("%s %i\n", debugstr_w(sSourceFile), dwSourceIndex);
481
482 GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
483 sice.sSourceFile = path;
484 sice.dwSourceIndex = dwSourceIndex;
485 sice.dwFlags = dwFlags;
486
487 if (!sic_hdpa)
489
491
492 if (NULL != DPA_GetPtr (sic_hdpa, 0))
493 {
494 /* search linear from position 0*/
496 }
497
498 if ( INVALID_INDEX == index )
499 {
500 ret = SIC_LoadIcon (sSourceFile, dwSourceIndex, dwFlags);
501 }
502 else
503 {
504 TRACE("-- found\n");
505 ret = ((LPSIC_ENTRY)DPA_GetPtr(sic_hdpa, index))->dwListIndex;
506 }
507
509 return ret;
510}
INT WINAPI DPA_Search(HDPA hdpa, LPVOID pFind, INT nStart, PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions)
Definition: dpa.c:845
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
GLuint index
Definition: glext.h:6031
struct SIC_ENTRY * LPSIC_ENTRY
static INT CALLBACK SIC_CompareEntries(LPVOID p1, LPVOID p2, LPARAM lparam)
Definition: iconcache.cpp:94
#define DPAS_SORTED
Definition: commctrl.h:4867
#define DPA_GetPtr
Definition: commctrl.h:5
Definition: iconcache.cpp:18
DWORD dwFlags
Definition: iconcache.cpp:22
DWORD dwSourceIndex
Definition: iconcache.cpp:20
LPWSTR sSourceFile
Definition: iconcache.cpp:19

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

◆ SIC_Initialize()

BOOL SIC_Initialize ( void  )

Definition at line 515 of file iconcache.cpp.

516{
517 HICON hSm = NULL, hLg = NULL;
518 INT bpp;
519 DWORD ilMask;
520 BOOL result = FALSE;
521
522 TRACE("Entered SIC_Initialize\n");
523
524 if (sic_hdpa)
525 {
526 TRACE("Icon cache already initialized\n");
527 return TRUE;
528 }
529
530 sic_hdpa = DPA_Create(16);
531 if (!sic_hdpa)
532 {
533 return FALSE;
534 }
535
538
539 bpp = ShellIconBPP = SIC_GetIconBPP(); // Bits Per Pixel
540 if (bpp <= 4)
541 ilMask = ILC_COLOR4;
542 else if (bpp <= 8)
543 ilMask = ILC_COLOR8;
544 else if (bpp <= 16)
545 ilMask = ILC_COLOR16;
546 else if (bpp <= 24)
547 ilMask = ILC_COLOR24;
548 else if (bpp <= 32)
549 ilMask = ILC_COLOR32;
550 else
551 ilMask = ILC_COLOR;
552
553 ilMask |= ILC_MASK;
554
557 {
558 ERR("Failed to create the small icon list.\n");
559 goto end;
560 }
561
563 if (!ShellBigIconList)
564 {
565 ERR("Failed to create the big icon list.\n");
566 goto end;
567 }
568
569 /* Load the document icon, which is used as the default if an icon isn't found. */
573 if (!hSm)
574 {
575 ERR("Failed to load small IDI_SHELL_DOCUMENT icon!\n");
576 goto end;
577 }
578
582 if (!hLg)
583 {
584 ERR("Failed to load large IDI_SHELL_DOCUMENT icon!\n");
585 goto end;
586 }
587
589 {
590 ERR("Failed to add IDI_SHELL_DOCUMENT icon to cache.\n");
591 goto end;
592 }
594 {
595 ERR("Failed to add IDI_SHELL_DOCUMENT icon to cache.\n");
596 goto end;
597 }
598
599 /* Everything went fine */
600 result = TRUE;
601
602end:
603 /* The image list keeps a copy of the icons, we must destroy them */
604 if(hSm) DestroyIcon(hSm);
605 if(hLg) DestroyIcon(hLg);
606
607 /* Clean everything if something went wrong */
608 if(!result)
609 {
613 sic_hdpa = NULL;
616 }
617
618 TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);
619
620 return result;
621}
DWORD bpp
Definition: surface.c:185
BOOL WINAPI DPA_Destroy(HDPA hdpa)
Definition: dpa.c:396
HDPA WINAPI DPA_Create(INT nGrow)
Definition: dpa.c:950
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
GLuint GLuint end
Definition: gl.h:1545
GLuint64EXT * result
Definition: glext.h:11304
INT ShellSmallIconSize
Definition: iconcache.cpp:30
static INT SIC_GetLargeIconSize(VOID)
Definition: iconcache.cpp:63
static INT SIC_IconAppend(LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags)
Definition: iconcache.cpp:356
INT ShellIconBPP
Definition: iconcache.cpp:32
static INT SIC_GetIconBPP(VOID)
Definition: iconcache.cpp:81
static INT SIC_GetSmallIconSize(VOID)
Definition: iconcache.cpp:72
INT ShellLargeIconSize
Definition: iconcache.cpp:31
static HICON
Definition: imagelist.c:80
#define ILC_COLOR4
Definition: commctrl.h:354
#define ILC_COLOR16
Definition: commctrl.h:356
#define ILC_COLOR8
Definition: commctrl.h:355
#define ILC_COLOR32
Definition: commctrl.h:358
#define ILC_MASK
Definition: commctrl.h:351
#define ILC_COLOR24
Definition: commctrl.h:357
#define ILC_COLOR
Definition: commctrl.h:352
#define IDI_SHELL_DOCUMENT
Definition: shresdef.h:557
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2289
#define LR_SHARED
Definition: winuser.h:1103
#define LR_DEFAULTCOLOR
Definition: winuser.h:1090
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2139

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
extern

Definition at line 37 of file shell32_main.h.

◆ ShellIconBPP

INT ShellIconBPP
extern

Definition at line 32 of file iconcache.cpp.

Referenced by SIC_Initialize().

◆ ShellLargeIconSize

INT ShellLargeIconSize
extern

Definition at line 31 of file iconcache.cpp.

Referenced by SHGetFileInfoW(), SIC_Initialize(), and SIC_LoadIcon().

◆ ShellSmallIconSize

INT ShellSmallIconSize
extern

Definition at line 30 of file iconcache.cpp.

Referenced by SHGetFileInfoW(), SIC_Initialize(), and SIC_LoadIcon().