ReactOS 0.4.15-dev-7788-g1ad9096
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 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, 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
 
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)
 
BOOL SH_ShowDriveProperties (WCHAR *drive, IDataObject *pDataObj)
 
BOOL SH_ShowRecycleBinProperties (WCHAR sDrive)
 
BOOL SH_ShowPropertiesDialog (LPCWSTR pwszPath, IDataObject *pDataObj)
 
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; \
};
#define NULL
Definition: types.h:112
static PVOID ptr
Definition: dispmode.c:27

Definition at line 146 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 131 of file shell32_main.h.

◆ ASK_CREATE_FOLDER

#define ASK_CREATE_FOLDER   4

Definition at line 125 of file shell32_main.h.

◆ ASK_DELETE_FILE

#define ASK_DELETE_FILE   1

Definition at line 122 of file shell32_main.h.

◆ ASK_DELETE_FOLDER

#define ASK_DELETE_FOLDER   2

Definition at line 123 of file shell32_main.h.

◆ ASK_DELETE_MULTIPLE_ITEM

#define ASK_DELETE_MULTIPLE_ITEM   3

Definition at line 124 of file shell32_main.h.

◆ ASK_DELETE_SELECTED

#define ASK_DELETE_SELECTED   6

Definition at line 127 of file shell32_main.h.

◆ ASK_OVERWRITE_FILE

#define ASK_OVERWRITE_FILE   5

Definition at line 126 of file shell32_main.h.

◆ ASK_OVERWRITE_FOLDER

#define ASK_OVERWRITE_FOLDER   11

Definition at line 132 of file shell32_main.h.

◆ ASK_TRASH_FILE

#define ASK_TRASH_FILE   7

Definition at line 128 of file shell32_main.h.

◆ ASK_TRASH_FOLDER

#define ASK_TRASH_FOLDER   8

Definition at line 129 of file shell32_main.h.

◆ ASK_TRASH_MULTIPLE_ITEM

#define ASK_TRASH_MULTIPLE_ITEM   9

Definition at line 130 of file shell32_main.h.

◆ HICON_16

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

Definition at line 179 of file shell32_main.h.

◆ HICON_32

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

Definition at line 180 of file shell32_main.h.

◆ HINSTANCE_16

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

Definition at line 182 of file shell32_main.h.

◆ HINSTANCE_32

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

Definition at line 181 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;\
};
static DWORD tymed
Definition: url.c:174

Definition at line 96 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:2369
#define MK_CONTROL
Definition: winuser.h:2370

Definition at line 105 of file shell32_main.h.

Function Documentation

◆ __SHCloneStrA()

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

Definition at line 151 of file shell32_main.h.

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

◆ __SHCloneStrAtoW()

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

Definition at line 170 of file shell32_main.h.

171{
172 int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0);
173 *target = (WCHAR *)SHAlloc(len * sizeof(WCHAR));
175 return *target;
176}
#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 FindExecutableA(), OpenAs_RunDLLA(), PathResolveA(), ShellExecuteExA(), and WOWShellExecute().

◆ __SHCloneStrW()

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

Definition at line 164 of file shell32_main.h.

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

Referenced by ShellExecCmdLine().

◆ __SHCloneStrWtoA()

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

Definition at line 157 of file shell32_main.h.

158{
159 int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL);
160 *target = (char *)SHAlloc(len);
162}
#define WideCharToMultiByte
Definition: compat.h:111

Referenced by ShellExecute_ContextMenuVerb().

◆ _InsertMenuItemW()

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

Definition at line 398 of file shfldr_netconnect.cpp.

406{
407 MENUITEMINFOW mii;
408 WCHAR szText[100];
409
410 ZeroMemory(&mii, sizeof(mii));
411 mii.cbSize = sizeof(mii);
412 if (fType == MFT_SEPARATOR)
413 {
414 mii.fMask = MIIM_ID | MIIM_TYPE;
415 }
416 else if (fType == MFT_STRING)
417 {
419 if ((ULONG_PTR)HIWORD((ULONG_PTR)dwTypeData) == 0)
420 {
421 if (LoadStringW(netshell_hInstance, LOWORD((ULONG_PTR)dwTypeData), szText, sizeof(szText)/sizeof(WCHAR)))
422 {
423 szText[(sizeof(szText)/sizeof(WCHAR))-1] = 0;
424 mii.dwTypeData = szText;
425 }
426 else
427 {
428 return;
429 }
430 }
431 else
432 {
433 mii.dwTypeData = (LPWSTR) dwTypeData;
434 }
435 mii.fState = fState;
436 }
437
438 mii.wID = wID;
439 mii.fType = fType;
440 InsertMenuItemW( hmenu, indexMenu, fByPosition, &mii);
441}
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
#define LOWORD(l)
Definition: pedump.c:82
LPWSTR dwTypeData
Definition: winuser.h:3269
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define HIWORD(l)
Definition: typedefs.h:247
static HMENU hmenu
Definition: win.c:66
#define ZeroMemory
Definition: winbase.h:1712
#define MIIM_ID
Definition: winuser.h:722
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:744
#define MIIM_STATE
Definition: winuser.h:721
#define MFT_STRING
Definition: winuser.h:746
#define MIIM_TYPE
Definition: winuser.h:725
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CDesktopFolder::CallBack(), CDrivesFolder::CallBack(), CFSFolder::CallBack(), DrivesContextMenuCallback(), CNetConUiObject::QueryContextMenu(), CCPLItemMenu::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: 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 
)

◆ CRegFolder_CreateInstance()

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

Definition at line 834 of file CRegFolder.cpp.

835{
836 return ShellObjectCreatorInit<CRegFolder>(pGuid, pidlRoot, lpszPath, lpszEnumKeyName, riid, ppv);
837}
REFIID LPVOID * ppv
Definition: atlbase.h:39

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

◆ CShellDispatch_Constructor()

HRESULT WINAPI CShellDispatch_Constructor ( REFIID  riid,
LPVOID ppvOut 
)

Definition at line 421 of file CShellDispatch.cpp.

422{
423 return ShellObjectCreatorInit<CShellDispatch>(riid, ppvOut);
424}

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 474 of file classes.c.

475{ HKEY hkey;
476 BOOL ret = FALSE;
477 DWORD buflen = len;
478#ifdef __REACTOS__
479 CHAR szName[100];
480 LPOLESTR pStr;
481#endif
482
483 szDest[0] = 0;
484
485#ifdef __REACTOS__
486 if (StringFromCLSID(riid, &pStr) == S_OK)
487 {
488 DWORD dwLen = buflen * sizeof(CHAR);
489 sprintf(szName, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%S", pStr);
491 {
492 ret = TRUE;
493 }
494 CoTaskMemFree(pStr);
495 }
496 if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
497#else
498 if (HCR_RegOpenClassIDKey(riid, &hkey))
499#endif
500 {
501 if (!RegLoadMUIStringA(hkey,"LocalizedString",szDest,len,NULL,0,NULL) ||
502 !RegQueryValueExA(hkey,"",0,NULL,(LPBYTE)szDest,&len))
503 {
504 ret = TRUE;
505 }
506 RegCloseKey(hkey);
507 }
508
509 if (!ret || !szDest[0])
510 {
511 if(IsEqualIID(riid, &CLSID_ShellDesktop))
512 {
513 if (LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
514 ret = TRUE;
515 }
516 else if (IsEqualIID(riid, &CLSID_MyComputer))
517 {
518 if(LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
519 ret = TRUE;
520 }
521#ifdef __REACTOS__
522 else if (IsEqualIID(riid, &CLSID_MyDocuments))
523 {
524 if(LoadStringA(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
525 ret = TRUE;
526 }
527 else if (IsEqualIID(riid, &CLSID_RecycleBin))
528 {
530 ret = TRUE;
531 }
532 else if (IsEqualIID(riid, &CLSID_ControlPanel))
533 {
535 ret = TRUE;
536 }
538 {
540 ret = TRUE;
541 }
542#endif
543 }
544
545 TRACE("-- (%s)\n", szDest);
546
547 return ret;
548}
#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:2075
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:4038
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:5297
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:230
#define IDS_DESKTOP
Definition: shresdef.h:73
#define IDS_MYCOMPUTER
Definition: shresdef.h:276
#define IDS_CONTROLPANEL
Definition: shresdef.h:141
#define IDS_ADMINISTRATIVETOOLS
Definition: shresdef.h:272
#define IDS_RECYCLEBIN_FOLDER_NAME
Definition: shresdef.h:267
#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 _ILSimpleGetText(), and shdebugstr_guid().

◆ HCR_GetClassNameW()

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

Definition at line 399 of file classes.c.

400{
401 HKEY hkey;
402 BOOL ret = FALSE;
403 DWORD buflen = len;
404#ifdef __REACTOS__
405 WCHAR szName[100];
406 LPOLESTR pStr;
407#endif
408
409 szDest[0] = 0;
410
411#ifdef __REACTOS__
412 if (StringFromCLSID(riid, &pStr) == S_OK)
413 {
414 DWORD dwLen = buflen * sizeof(WCHAR);
415 swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);
417 {
418 ret = TRUE;
419 }
420 CoTaskMemFree(pStr);
421 }
422 if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
423#else
424 if (HCR_RegOpenClassIDKey(riid, &hkey))
425#endif
426 {
427 if (!RegLoadMUIStringW(hkey, L"LocalizedString", szDest, len, NULL, 0, NULL) ||
428 !RegQueryValueExW(hkey, L"", 0, NULL, (LPBYTE)szDest, &len))
429 {
430 ret = TRUE;
431 }
432 RegCloseKey(hkey);
433 }
434
435 if (!ret || !szDest[0])
436 {
437 if(IsEqualIID(riid, &CLSID_ShellDesktop))
438 {
439 if (LoadStringW(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
440 ret = TRUE;
441 }
442 else if (IsEqualIID(riid, &CLSID_MyComputer))
443 {
444 if(LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
445 ret = TRUE;
446 }
447#ifdef __REACTOS__
448 else if (IsEqualIID(riid, &CLSID_MyDocuments))
449 {
450 if(LoadStringW(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
451 ret = TRUE;
452 }
453 else if (IsEqualIID(riid, &CLSID_RecycleBin))
454 {
456 ret = TRUE;
457 }
458 else if (IsEqualIID(riid, &CLSID_ControlPanel))
459 {
461 ret = TRUE;
462 }
464 {
466 ret = TRUE;
467 }
468#endif
469 }
470 TRACE("-- %s\n", debugstr_w(szDest));
471 return ret;
472}
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:1969
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4132
#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 133 of file classes.c.

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

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 197 of file classes.c.

198{
199 WCHAR sTempVerb[MAX_PATH];
200 BOOL ret;
201
202 TRACE("%p %s %s %p\n", hkeyClass, debugstr_w(szClass), debugstr_w(szVerb), szDest);
203
204 if (szClass)
205 RegOpenKeyExW(HKEY_CLASSES_ROOT, szClass, 0, KEY_READ, &hkeyClass);
206 if (!hkeyClass)
207 return FALSE;
208 ret = FALSE;
209
210 if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)/sizeof(sTempVerb[0])))
211 {
212 WCHAR sTemp[MAX_PATH];
213 lstrcpyW(sTemp, L"shell\\");
214 lstrcatW(sTemp, sTempVerb);
215 lstrcatW(sTemp, L"\\command");
216 ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len));
217 }
218 if (szClass)
219 RegCloseKey(hkeyClass);
220
221 TRACE("-- %s\n", debugstr_w(szDest) );
222 return ret;
223}
#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
BOOL HCR_GetDefaultVerbW(HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len)
Definition: classes.c:133
#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 567 of file classes.c.

568{
569 HKEY hSFKey;
570 LPOLESTR pwszCLSID;
571 LONG lResult;
572 DWORD dwTemp, dwLen;
573 WCHAR wszShellFolderKey[] = L"CLSID\\{00021400-0000-0000-C000-000000000046}\\ShellFolder";
574
575 TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes);
576
577 if (!_ILIsPidlSimple(pidlFolder)) {
578 static BOOL firstHit = TRUE;
579 if (firstHit) {
580 ERR("should be called for simple PIDL's only!\n");
581 firstHit = FALSE;
582 }
583 return FALSE;
584 }
585
586 if (!_ILIsDesktop(pidlFolder)) {
587 if (FAILED(StringFromCLSID(_ILGetGUIDPointer(pidlFolder), &pwszCLSID))) return FALSE;
588 memcpy(&wszShellFolderKey[6], pwszCLSID, 38 * sizeof(WCHAR));
589 CoTaskMemFree(pwszCLSID);
590 }
591
592 lResult = RegOpenKeyExW(HKEY_CLASSES_ROOT, wszShellFolderKey, 0, KEY_READ, &hSFKey);
593#ifdef __REACTOS__
594 if (lResult != ERROR_SUCCESS)
595 {
596 ERR("Cannot open key: %ls\n", wszShellFolderKey);
597 return FALSE;
598 }
599#else
600 if (lResult != ERROR_SUCCESS) return FALSE;
601#endif
602
603 dwLen = sizeof(DWORD);
604 lResult = RegQueryValueExW(hSFKey, L"CallForAttributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
605 if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) {
606 LPSHELLFOLDER psfDesktop, psfFolder;
607 HRESULT hr;
608
609 RegCloseKey(hSFKey);
610 hr = SHGetDesktopFolder(&psfDesktop);
611 if (SUCCEEDED(hr)) {
612 hr = IShellFolder_BindToObject(psfDesktop, pidlFolder, NULL, &IID_IShellFolder,
613 (LPVOID*)&psfFolder);
614 if (SUCCEEDED(hr)) {
615 hr = IShellFolder_GetAttributesOf(psfFolder, 0, NULL, pdwAttributes);
616 IShellFolder_Release(psfFolder);
617 }
618 IShellFolder_Release(psfDesktop);
619 }
620 if (FAILED(hr)) return FALSE;
621 } else {
622 lResult = RegQueryValueExW(hSFKey, L"Attributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
623 RegCloseKey(hSFKey);
624 if (lResult == ERROR_SUCCESS) {
625 *pdwAttributes &= dwTemp;
626 } else {
627 return FALSE;
628 }
629 }
630
631 TRACE("-- *pdwAttributes == 0x%08x\n", *pdwAttributes);
632
633 return TRUE;
634}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define ERR(fmt,...)
Definition: debug.h:110
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define DWORD
Definition: nt_native.h:44
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2340
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 316 of file classes.c.

317{
318 HKEY hkey;
319 char sTemp[MAX_PATH];
320 BOOL ret = FALSE;
321
322 TRACE("%s\n",szClass );
323
324 sprintf(sTemp, "%s\\DefaultIcon",szClass);
325
326 if (!RegOpenKeyExA(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
327 {
328 ret = HCR_RegGetIconA(hkey, szDest, szName, len, picon_idx);
329 RegCloseKey(hkey);
330 }
331
332 if (ret)
333 TRACE("-- %s %i\n", szDest, *picon_idx);
334 else
335 TRACE("-- not found\n");
336
337 return ret;
338}
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3327
static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:267

◆ HCR_GetIconW()

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

Definition at line 291 of file classes.c.

292{
293 HKEY hkey;
294 WCHAR sTemp[MAX_PATH];
295 BOOL ret = FALSE;
296
297 TRACE("%s\n",debugstr_w(szClass) );
298
299 lstrcpynW(sTemp, szClass, MAX_PATH);
300 lstrcatW(sTemp, L"\\DefaultIcon");
301
302 if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
303 {
304 ret = HCR_RegGetIconW(hkey, szDest, szName, len, picon_idx);
305 RegCloseKey(hkey);
306 }
307
308 if(ret)
309 TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx);
310 else
311 TRACE("-- not found\n");
312
313 return ret;
314}
static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:243

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 91 of file classes.c.

92{
93 HKEY hkey;
94 char szTemp[MAX_EXTENSION_LENGTH + 2];
95
96 TRACE("%s %p\n", szExtension, szFileType);
97
98 /* added because we do not want to have double dots */
99 if (szExtension[0] == '.')
100 bPrependDot = FALSE;
101
102 if (bPrependDot)
103 szTemp[0] = '.';
104
105 lstrcpynA(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
106
107 if (RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
108 {
109 return FALSE;
110 }
111
112#ifdef __REACTOS__
113 if (!RegLoadMUIStringA(hkey, "FriendlyTypeName", szFileType, len, NULL, 0, NULL))
114 {
115 RegCloseKey(hkey);
116 return TRUE;
117 }
118#endif
119
120 if (RegQueryValueA(hkey, NULL, szFileType, &len))
121 {
122 RegCloseKey(hkey);
123 return FALSE;
124 }
125
126 RegCloseKey(hkey);
127
128 TRACE("--UE;\n} %s\n", szFileType);
129
130 return TRUE;
131}
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
Definition: reg.c:4241
#define lstrcpynA
Definition: compat.h:751
#define MAX_EXTENSION_LENGTH
Definition: classes.c:47

Referenced by _ILGetFileType(), and SHELL_IsShortcut().

◆ HCR_MapTypeToValueW()

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

Definition at line 49 of file classes.c.

50{
51 HKEY hkey;
52 WCHAR szTemp[MAX_EXTENSION_LENGTH + 2];
53
54 TRACE("%s %p\n", debugstr_w(szExtension), szFileType);
55
56 /* added because we do not want to have double dots */
57 if (szExtension[0] == '.')
58 bPrependDot = FALSE;
59
60 if (bPrependDot)
61 szTemp[0] = '.';
62
63 lstrcpynW(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
64
65 if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
66 {
67 return FALSE;
68 }
69
70#ifdef __REACTOS__
71 if (!RegLoadMUIStringW(hkey, L"FriendlyTypeName", szFileType, len, NULL, 0, NULL))
72 {
73 RegCloseKey(hkey);
74 return TRUE;
75 }
76#endif
77
78 if (RegQueryValueW(hkey, NULL, szFileType, &len))
79 {
80 RegCloseKey(hkey);
81 return FALSE;
82 }
83
84 RegCloseKey(hkey);
85
86 TRACE("--UE;\n} %s\n", debugstr_w(szFileType));
87
88 return TRUE;
89}

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 3145 of file CShellLink.cpp.

3146{
3148 if (!ILGetDisplayNameExW(psf, pidl, path, 0))
3149 return E_FAIL;
3150
3152}
#define E_FAIL
Definition: ddrawi.h:102
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:91

◆ IShellLink_ConstructFromPath()

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

Definition at line 3131 of file CShellLink.cpp.

3132{
3134 HRESULT hr = CShellLink::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IPersistFile, &ppf));
3135 if (FAILED(hr))
3136 return hr;
3137
3138 hr = ppf->Load(path, 0);
3139 if (FAILED(hr))
3140 return hr;
3141
3142 return ppf->QueryInterface(riid, ppv);
3143}

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: debug.h:112
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 709 of file iconcache.cpp.

715{
717 WCHAR szIconFile[MAX_PATH]; /* file containing the icon */
718 INT iSourceIndex; /* index or resID(negated) in this file */
719 BOOL ret = FALSE;
720 UINT dwFlags = 0;
721 int iShortcutDefaultIndex = INVALID_INDEX;
722
723 TRACE("sf=%p pidl=%p %s\n", sh, pidl, bBigIcon?"Big":"Small");
724
725 if (!sic_hdpa)
727
728 if (SUCCEEDED (sh->GetUIObjectOf(0, 1, &pidl, IID_NULL_PPV_ARG(IExtractIconW, &ei))))
729 {
730 if (SUCCEEDED(ei->GetIconLocation(uFlags &~ GIL_FORSHORTCUT, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags)))
731 {
732 *pIndex = SIC_GetIconIndex(szIconFile, iSourceIndex, uFlags);
733 ret = TRUE;
734 }
735 }
736
737 if (INVALID_INDEX == *pIndex) /* default icon when failed */
738 {
739 if (0 == (uFlags & GIL_FORSHORTCUT))
740 {
741 *pIndex = 0;
742 }
743 else
744 {
745 if (INVALID_INDEX == iShortcutDefaultIndex)
746 {
747 iShortcutDefaultIndex = SIC_LoadIcon(swShell32Name, 0, GIL_FORSHORTCUT);
748 }
749 *pIndex = (INVALID_INDEX != iShortcutDefaultIndex ? iShortcutDefaultIndex : 0);
750 }
751 }
752
753 return ret;
754
755}
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:440
static HDPA sic_hdpa
Definition: iconcache.cpp:38
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:481
static INT SIC_LoadIcon(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
Definition: iconcache.cpp:387
#define INVALID_INDEX
Definition: iconcache.cpp:27
_Out_ PULONG _Out_ PULONG pIndex
Definition: ndis.h:4565
unsigned int UINT
Definition: ndis.h:50
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}
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
static BOOLEAN bSuccess
Definition: drive.cpp:433
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:703
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
Definition: pidl.c:1282
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define GHND
Definition: winbase.h:297
#define GMEM_SHARE
Definition: winbase.h:305

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:1344
#define strlenW(s)
Definition: unicode.h:28

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
#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
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
_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:929
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2122
#define strcpyW(d, s)
Definition: unicode.h:29
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
struct _DROPFILES DROPFILES
DWORD pFiles
Definition: shlobj.h:2292
BOOL fWide
Definition: shlobj.h:2295

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:565
UINT aoffset[1]
Definition: shlobj.h:566
UINT cidl
Definition: shlobj.h:565

Referenced by CIDLDataObj::Initialize().

◆ SH_CreatePropertySheetPage()

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

Definition at line 302 of file filedefext.cpp.

303{
305
306 memset(&Page, 0x0, sizeof(PROPSHEETPAGEW));
307 Page.dwSize = sizeof(PROPSHEETPAGEW);
308 Page.dwFlags = PSP_DEFAULT;
309 Page.hInstance = shell32_hInstance;
310 Page.pszTemplate = MAKEINTRESOURCE(wDialogId);
311 Page.pfnDlgProc = pfnDlgProc;
312 Page.lParam = lParam;
313 Page.pszTitle = pwszTitle;
314
315 if (pwszTitle)
316 Page.dwFlags |= PSP_USETITLE;
317
319}
LPARAM lParam
Definition: combotst.c:139
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3083
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
Definition: mm.h:1306
#define PSP_USETITLE
Definition: prsht.h:26
#define PSP_DEFAULT
Definition: prsht.h:22
struct _PROPSHEETPAGEW PROPSHEETPAGEW
#define memset(x, y, z)
Definition: compat.h:39
#define MAKEINTRESOURCE
Definition: winuser.h:591

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

◆ SH_ShowDriveProperties()

BOOL SH_ShowDriveProperties ( WCHAR drive,
IDataObject pDataObj 
)

Definition at line 170 of file drive.cpp.

171{
172 HPSXA hpsx = NULL;
174 CComObject<CDrvDefExt> *pDrvDefExt = NULL;
175
176 CDataObjectHIDA cida(pDataObj);
177 if (FAILED_UNEXPECTEDLY(cida.hr()))
178 return FAILED(cida.hr());
179
180 RECT rcPosition = {CW_USEDEFAULT, CW_USEDEFAULT, 0, 0};
181 POINT pt;
182 if (SUCCEEDED(DataObject_GetOffset(pDataObj, &pt)))
183 {
184 rcPosition.left = pt.x;
185 rcPosition.top = pt.y;
186 }
187
191 if (!stub.Create(NULL, rcPosition, NULL, style, exstyle))
192 {
193 ERR("StubWindow32 creation failed\n");
194 return FALSE;
195 }
196
197 PROPSHEETHEADERW psh = {sizeof(PROPSHEETHEADERW)};
199 psh.pszCaption = pwszDrive;
200 psh.hwndParent = stub;
201 psh.nStartPage = 0;
202 psh.phpage = hpsp;
203
204 HRESULT hr = CComObject<CDrvDefExt>::CreateInstance(&pDrvDefExt);
205 if (SUCCEEDED(hr))
206 {
207 pDrvDefExt->AddRef(); // CreateInstance returns object with 0 ref count
208 hr = pDrvDefExt->Initialize(HIDA_GetPIDLFolder(cida), pDataObj, NULL);
209 if (SUCCEEDED(hr))
210 {
211 hr = pDrvDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&psh);
212 if (FAILED(hr))
213 ERR("AddPages failed\n");
214 }
215 else
216 {
217 ERR("Initialize failed\n");
218 }
219 }
220
222 if (hpsx)
224
225 INT_PTR ret = PropertySheetW(&psh);
226
227 if (hpsx)
229 if (pDrvDefExt)
230 pDrvDefExt->Release();
231
232 stub.DestroyWindow();
233
234 return ret != -1;
235}
Arabic default style
Definition: afstyles.h:94
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2913
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
BOOL CALLBACK AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
Definition: precomp.h:129
#define pt(x, y)
Definition: drawing.c:79
EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj)
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define WS_CAPTION
Definition: pedump.c:624
#define WS_DISABLED
Definition: pedump.c:621
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define PSH_PROPTITLE
Definition: prsht.h:40
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:327
struct _PROPSHEETHEADERW PROPSHEETHEADERW
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:2183
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:2006
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: shellutils.h:576
#define MAX_PROPERTY_SHEET_PAGE
DWORD dwFlags
Definition: prsht.h:294
HWND hwndParent
Definition: prsht.h:295
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
UINT nStartPage
Definition: prsht.h:304
LPCWSTR pszCaption
Definition: prsht.h:301
Definition: stubgen.c:11
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
struct _stub stub
int32_t INT_PTR
Definition: typedefs.h:64
LONG_PTR LPARAM
Definition: windef.h:208
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define CW_USEDEFAULT
Definition: winuser.h:225

Referenced by DrivesContextMenuCallback(), and SH_ShowPropertiesDialog().

◆ SH_ShowPropertiesDialog()

BOOL SH_ShowPropertiesDialog ( LPCWSTR  pwszPath,
IDataObject pDataObj 
)

Definition at line 83 of file fprop.cpp.

84{
85 HPSXA hpsxa[3] = {NULL, NULL, NULL};
86 CComObject<CFileDefExt> *pFileDefExt = NULL;
87
88 TRACE("SH_ShowPropertiesDialog entered filename %s\n", debugstr_w(pwszPath));
89
90 if (pwszPath == NULL || !wcslen(pwszPath))
91 return FALSE;
92
94 memset(hppages, 0x0, sizeof(HPROPSHEETPAGE) * MAX_PROPERTY_SHEET_PAGE);
95
96 /* Make a copy of path */
97 WCHAR wszPath[MAX_PATH];
98 StringCbCopyW(wszPath, sizeof(wszPath), pwszPath);
99
100 /* remove trailing \\ at the end of path */
101 PathRemoveBackslashW(wszPath);
102
103 CDataObjectHIDA cida(pDataObj);
104 if (FAILED_UNEXPECTEDLY(cida.hr()))
105 return FALSE;
106
107 if (cida->cidl == 0)
108 {
109 ERR("Empty HIDA\n");
110 return FALSE;
111 }
112
113 /* Handle drives */
114 if (_ILIsDrive(HIDA_GetPIDLItem(cida, 0)))
115 return SH_ShowDriveProperties(wszPath, pDataObj);
116
117
118 RECT rcPosition = {CW_USEDEFAULT, CW_USEDEFAULT, 0, 0};
119 POINT pt;
120 if (SUCCEEDED(DataObject_GetOffset(pDataObj, &pt)))
121 {
122 rcPosition.left = pt.x;
123 rcPosition.top = pt.y;
124 }
125
129 if (!stub.Create(NULL, rcPosition, NULL, style, exstyle))
130 {
131 ERR("StubWindow32 creation failed\n");
132 return FALSE;
133 }
134
135 /* Handle files and folders */
137 memset(&Header, 0x0, sizeof(PROPSHEETHEADERW));
138 Header.dwSize = sizeof(PROPSHEETHEADERW);
139 Header.hwndParent = stub;
140 Header.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE;
141 Header.phpage = hppages;
142 Header.pszCaption = PathFindFileNameW(wszPath);
143
144 HRESULT hr = CComObject<CFileDefExt>::CreateInstance(&pFileDefExt);
145 if (SUCCEEDED(hr))
146 {
147 pFileDefExt->AddRef(); // CreateInstance returns object with 0 ref count
148 hr = pFileDefExt->Initialize(HIDA_GetPIDLFolder(cida), pDataObj, NULL);
150 {
151 hr = pFileDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&Header);
153 {
154 ERR("AddPages failed\n");
155 return FALSE;
156 }
157 }
158 else
159 {
160 ERR("Initialize failed\n");
161 return FALSE;
162 }
163 }
164
165 LoadPropSheetHandlers(wszPath, &Header, MAX_PROPERTY_SHEET_PAGE - 1, hpsxa, pDataObj);
166
168
169 for (UINT i = 0; i < 3; ++i)
170 if (hpsxa[i])
172 if (pFileDefExt)
173 pFileDefExt->Release();
174
175 stub.DestroyWindow();
176
177 return (Result != -1);
178}
Definition: Header.h:9
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
LPWSTR WINAPI PathRemoveBackslashW(LPWSTR lpszPath)
Definition: path.c:867
BOOL SH_ShowDriveProperties(WCHAR *pwszDrive, IDataObject *pDataObj)
Definition: drive.cpp:170
static UINT LoadPropSheetHandlers(LPCWSTR pwszPath, PROPSHEETHEADERW *pHeader, UINT cMaxPages, HPSXA *phpsxa, IDataObject *pDataObj)
Definition: fprop.cpp:30
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1979
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:581
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
_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:409

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

◆ SH_ShowRecycleBinProperties()

BOOL SH_ShowRecycleBinProperties ( WCHAR  sDrive)

Definition at line 399 of file recycler_prop.cpp.

400{
401 HPROPSHEETPAGE hpsp[1];
403 HPROPSHEETPAGE hprop;
404 INT_PTR ret;
405
406 ZeroMemory(&psh, sizeof(psh));
407 psh.dwSize = sizeof(psh);
410 psh.hwndParent = NULL;
411 psh.phpage = hpsp;
413
415 if (!hprop)
416 {
417 ERR("Failed to create property sheet\n");
418 return FALSE;
419 }
420 hpsp[psh.nPages] = hprop;
421 psh.nPages++;
422
423 ret = PropertySheetW(&psh);
424 return (ret >= 0);
425}
HPROPSHEETPAGE SH_CreatePropertySheetPage(LPCSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
static INT_PTR CALLBACK RecycleBinDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define IDD_RECYCLE_BIN_PROPERTIES
Definition: shresdef.h:396
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by RegFolderContextMenuCallback().

◆ SHELL_ConfirmYesNoW()

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

Definition at line 331 of file shlfileop.cpp.

332{
333 return SHELL_ConfirmDialogW(hWnd, nKindOfDialog, szDir, NULL);
334}
HWND hWnd
Definition: settings.c:17
static BOOL SHELL_ConfirmDialogW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir, FILE_OPERATION *op)
Definition: shlfileop.cpp:293

◆ SHELL_DeleteDirectoryW()

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

◆ Shell_GetImageLists()

BOOL WINAPI Shell_GetImageLists ( HIMAGELIST lpBigList,
HIMAGELIST lpSmallList 
)

Definition at line 683 of file iconcache.cpp.

684{
685 TRACE("(%p,%p)\n",lpBigList,lpSmallList);
686
687 if (!sic_hdpa)
689
690 if (lpBigList)
691 *lpBigList = ShellBigIconList;
692
693 if (lpSmallList)
694 *lpSmallList = ShellSmallIconList;
695
696 return TRUE;
697}
static HIMAGELIST ShellSmallIconList
Definition: iconcache.cpp:40
static HIMAGELIST ShellBigIconList
Definition: iconcache.cpp:41

◆ SHELL_IsShortcut()

BOOL SHELL_IsShortcut ( LPCITEMIDLIST  pidlLast)

Definition at line 383 of file shell32_main.c.

384{
385 char szTemp[MAX_PATH];
386 HKEY keyCls;
387 BOOL ret = FALSE;
388
389 if (_ILGetExtension(pidlLast, szTemp, MAX_PATH) &&
390 HCR_MapTypeToValueA(szTemp, szTemp, MAX_PATH, TRUE))
391 {
393 {
394 if (ERROR_SUCCESS == RegQueryValueExA(keyCls, "IsShortcut", NULL, NULL, NULL, NULL))
395 ret = TRUE;
396
397 RegCloseKey(keyCls);
398 }
399 }
400
401 return ret;
402}
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2502
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:91

Referenced by SHGetFileInfoW(), and SHMapPIDLToSystemImageListIndex().

◆ SHELL_OsIsUnicode()

◆ SHELL_RegisterShellFolders()

HRESULT SHELL_RegisterShellFolders ( void  )

Definition at line 3033 of file shellpath.c.

3034{
3035 HRESULT hr;
3036
3038 if (SUCCEEDED(hr))
3040 if (SUCCEEDED(hr))
3042 return hr;
3043}
static HRESULT _SHRegisterUserShellFolders(BOOL bDefault)
Definition: shellpath.c:2937
static HRESULT _SHRegisterCommonShellFolders(void)
Definition: shellpath.c:3005

Referenced by DllRegisterServer().

◆ SIC_Destroy()

void SIC_Destroy ( void  )

Definition at line 629 of file iconcache.cpp.

630{
631 TRACE("\n");
632
634
636
637 sic_hdpa = NULL;
642
644 //DeleteCriticalSection(&SHELL32_SicCS); //static
645}
void WINAPI DPA_DestroyCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:1003
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
static INT CALLBACK sic_free(LPVOID ptr, LPVOID lparam)
Definition: iconcache.cpp:622
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

◆ SIC_GetIconIndex()

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

Definition at line 440 of file iconcache.cpp.

441{
442 SIC_ENTRY sice;
445
446 TRACE("%s %i\n", debugstr_w(sSourceFile), dwSourceIndex);
447
448 GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
449 sice.sSourceFile = path;
450 sice.dwSourceIndex = dwSourceIndex;
451 sice.dwFlags = dwFlags;
452
453 if (!sic_hdpa)
455
457
458 if (NULL != DPA_GetPtr (sic_hdpa, 0))
459 {
460 /* search linear from position 0*/
462 }
463
464 if ( INVALID_INDEX == index )
465 {
466 ret = SIC_LoadIcon (sSourceFile, dwSourceIndex, dwFlags);
467 }
468 else
469 {
470 TRACE("-- found\n");
471 ret = ((LPSIC_ENTRY)DPA_GetPtr(sic_hdpa, index))->dwListIndex;
472 }
473
475 return ret;
476}
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:61
#define DPAS_SORTED
Definition: commctrl.h:4862
#define DPA_GetPtr
Definition: commctrl.h:5
Definition: iconcache.cpp:30
DWORD dwFlags
Definition: iconcache.cpp:34
DWORD dwSourceIndex
Definition: iconcache.cpp:32
LPWSTR sSourceFile
Definition: iconcache.cpp:31

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

◆ SIC_Initialize()

BOOL SIC_Initialize ( void  )

Definition at line 481 of file iconcache.cpp.

482{
483 HICON hSm = NULL, hLg = NULL;
484 INT cx_small, cy_small;
485 INT cx_large, cy_large;
486 HDC hDC;
487 INT bpp;
488 DWORD ilMask;
489 BOOL result = FALSE;
490
491 TRACE("Entered SIC_Initialize\n");
492
493 if (sic_hdpa)
494 {
495 TRACE("Icon cache already initialized\n");
496 return TRUE;
497 }
498
499 sic_hdpa = DPA_Create(16);
500 if (!sic_hdpa)
501 {
502 return FALSE;
503 }
504
505 hDC = CreateICW(L"DISPLAY", NULL, NULL, NULL);
506 if (!hDC)
507 {
508 ERR("Failed to create information context (error %d)\n", GetLastError());
509 goto end;
510 }
511
513 DeleteDC(hDC);
514
515 if (bpp <= 4)
516 ilMask = ILC_COLOR4;
517 else if (bpp <= 8)
518 ilMask = ILC_COLOR8;
519 else if (bpp <= 16)
520 ilMask = ILC_COLOR16;
521 else if (bpp <= 24)
522 ilMask = ILC_COLOR24;
523 else if (bpp <= 32)
524 ilMask = ILC_COLOR32;
525 else
526 ilMask = ILC_COLOR;
527
528 ilMask |= ILC_MASK;
529
530 cx_small = GetSystemMetrics(SM_CXSMICON);
531 cy_small = GetSystemMetrics(SM_CYSMICON);
532 cx_large = GetSystemMetrics(SM_CXICON);
533 cy_large = GetSystemMetrics(SM_CYICON);
534
536 cy_small,
537 ilMask,
538 100,
539 100);
541 {
542 ERR("Failed to create the small icon list.\n");
543 goto end;
544 }
545
547 cy_large,
548 ilMask,
549 100,
550 100);
551 if (!ShellBigIconList)
552 {
553 ERR("Failed to create the big icon list.\n");
554 goto end;
555 }
556
557 /* Load the document icon, which is used as the default if an icon isn't found. */
561 cx_small,
562 cy_small,
564 if (!hSm)
565 {
566 ERR("Failed to load small IDI_SHELL_DOCUMENT icon!\n");
567 goto end;
568 }
569
573 cx_large,
574 cy_large,
576 if (!hLg)
577 {
578 ERR("Failed to load large IDI_SHELL_DOCUMENT icon!\n");
579 goto end;
580 }
581
583 {
584 ERR("Failed to add IDI_SHELL_DOCUMENT icon to cache.\n");
585 goto end;
586 }
588 {
589 ERR("Failed to add IDI_SHELL_DOCUMENT icon to cache.\n");
590 goto end;
591 }
592
593 /* Everything went fine */
594 result = TRUE;
595
596end:
597 /* The image list keeps a copy of the icons, we must destroy them */
598 if(hSm) DestroyIcon(hSm);
599 if(hLg) DestroyIcon(hLg);
600
601 /* Clean everything if something went wrong */
602 if(!result)
603 {
607 sic_hdpa = NULL;
610 }
611
612 TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);
613
614 return result;
615}
static HDC hDC
Definition: 3dtext.c:33
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:804
GLuint GLuint end
Definition: gl.h:1545
GLuint64EXT * result
Definition: glext.h:11304
static INT SIC_IconAppend(LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags)
Definition: iconcache.cpp:323
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
#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:549
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HDC WINAPI CreateICW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ const DEVMODEW *)
#define BITSPIXEL
Definition: wingdi.h:720
BOOL WINAPI DeleteDC(_In_ HDC)
#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:2203
#define SM_CYSMICON
Definition: winuser.h:1013
#define SM_CXSMICON
Definition: winuser.h:1012
#define SM_CYICON
Definition: winuser.h:973
#define LR_SHARED
Definition: winuser.h:1100
#define LR_DEFAULTCOLOR
Definition: winuser.h:1087
#define SM_CXICON
Definition: winuser.h:972
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2053

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.