ReactOS 0.4.16-dev-1273-g5b94656
item_prop.cpp File Reference
#include "precomp.h"
Include dependency graph for item_prop.cpp:

Go to the source code of this file.

Classes

struct  ShellPropSheetDialog
 
struct  ShellPropSheetDialog::DATA
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static HRESULT SHELL_GetCaptionFromDataObject (IDataObject *pDO, LPWSTR Buf, UINT cchBuf)
 
static void CALLBACK FSFolderItemPropDialogInitCallback (LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
 
static void CALLBACK ClassPropDialogInitCallback (LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
 
HRESULT SHELL32_ShowFilesystemItemPropertiesDialogAsync (IDataObject *pDO)
 
HRESULT SHELL32_ShowFilesystemItemsPropertiesDialogAsync (HWND hOwner, IDataObject *pDO)
 
HRESULT SHELL32_ShowShellExtensionProperties (const CLSID *pClsid, IDataObject *pDO)
 
HRESULT SHELL_ShowItemIDListProperties (LPCITEMIDLIST pidl)
 
EXTERN_C HRESULT WINAPI SHMultiFileProperties (IDataObject *pDataObject, DWORD dwFlags)
 

Function Documentation

◆ ClassPropDialogInitCallback()

static void CALLBACK ClassPropDialogInitCallback ( LPCWSTR  InitString,
IDataObject pDO,
HKEY hKeys,
UINT cKeys 
)
static

Definition at line 150 of file item_prop.cpp.

151{
153 AddClassKeyToArray(InitString, hKeys, cKeys); // Add pages from HKCR\%ProgId% (with shellex\PropertySheetHandlers appended later)
154}
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:408

Referenced by SHELL32_ShowFilesystemItemPropertiesDialogAsync(), and SHELL32_ShowShellExtensionProperties().

◆ FSFolderItemPropDialogInitCallback()

static void CALLBACK FSFolderItemPropDialogInitCallback ( LPCWSTR  InitString,
IDataObject pDO,
HKEY hKeys,
UINT cKeys 
)
static

Definition at line 130 of file item_prop.cpp.

131{
132 UNREFERENCED_PARAMETER(InitString);
133 CDataObjectHIDA cida(pDO);
134 if (SUCCEEDED(cida.hr()) && cida->cidl)
135 {
136#if 0
137 CCidaChildArrayHelper items(cida);
138 if (FAILED(hr = items.hr()))
139 return hr;
140#else
141 // Note: Since we are only passing a single item to AddFSClassKeysToArray,
142 // we don't need the rest of the array to be valid.
143 PCUITEMID_CHILD pidl = HIDA_GetPIDLItem(cida, 0);
144#endif
145 AddFSClassKeysToArray(1, &pidl, hKeys, cKeys); // Add file-type specific pages
146 }
147}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
static TCHAR * items[]
Definition: page1.c:45
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:695
void AddFSClassKeysToArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:430
HRESULT hr
Definition: shlfolder.c:183
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70

Referenced by SHELL32_ShowFilesystemItemPropertiesDialogAsync().

◆ SHELL32_ShowFilesystemItemPropertiesDialogAsync()

HRESULT SHELL32_ShowFilesystemItemPropertiesDialogAsync ( IDataObject pDO)

Definition at line 157 of file item_prop.cpp.

158{
159 CDataObjectHIDA cida(pDO);
160 HRESULT hr = cida.hr();
162 return hr;
163
164 const CLSID *pClsid = NULL;
166 LPCWSTR InitString = NULL;
167
168 if (cida->cidl && _ILIsDrive(HIDA_GetPIDLItem(cida, 0)))
169 {
170 pClsid = &CLSID_ShellDrvDefExt;
172 InitString = L"Drive";
173 }
174 else
175 {
176 pClsid = &CLSID_ShellFileDefExt;
178 }
179 return ShellPropSheetDialog().ShowAsync(pClsid, pDO, InitFunc, InitString);
180}
#define NULL
Definition: types.h:112
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:30
static void CALLBACK FSFolderItemPropDialogInitCallback(LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
Definition: item_prop.cpp:130
static void CALLBACK ClassPropDialogInitCallback(LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
Definition: item_prop.cpp:150
#define L(x)
Definition: ntvdm.h:50
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2131
void(CALLBACK * PFNINITIALIZE)(LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
Definition: item_prop.cpp:29
static HRESULT ShowAsync(const CLSID *pClsidDefault, IDataObject *pDO, PFNINITIALIZE InitFunc, LPCWSTR InitString)
Definition: item_prop.cpp:63
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by DrivesContextMenuCallback(), SHELL32_ShowFilesystemItemsPropertiesDialogAsync(), and SHMultiFileProperties().

◆ SHELL32_ShowFilesystemItemsPropertiesDialogAsync()

HRESULT SHELL32_ShowFilesystemItemsPropertiesDialogAsync ( HWND  hOwner,
IDataObject pDO 
)

Definition at line 183 of file item_prop.cpp.

184{
185 if (DataObject_GetHIDACount(pDO) == 1)
187 return SHMultiFileProperties(pDO, 0);
188}
HRESULT DataObject_GetHIDACount(IDataObject *pdo)
EXTERN_C HRESULT WINAPI SHMultiFileProperties(IDataObject *pDataObject, DWORD dwFlags)
Definition: item_prop.cpp:223
HRESULT SHELL32_ShowFilesystemItemPropertiesDialogAsync(IDataObject *pDO)
Definition: item_prop.cpp:157

Referenced by SHELL32_ShowPropertiesDialog().

◆ SHELL32_ShowShellExtensionProperties()

HRESULT SHELL32_ShowShellExtensionProperties ( const CLSID pClsid,
IDataObject pDO 
)

Definition at line 191 of file item_prop.cpp.

192{
193 WCHAR ClassBuf[6 + 38 + 1] = L"CLSID\\";
194 StringFromGUID2(*pClsid, ClassBuf + 6, 38 + 1);
196}
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by RegFolderContextMenuCallback().

◆ SHELL_GetCaptionFromDataObject()

static HRESULT SHELL_GetCaptionFromDataObject ( IDataObject pDO,
LPWSTR  Buf,
UINT  cchBuf 
)
static

Definition at line 13 of file item_prop.cpp.

14{
17 {
18 hr = SHGetNameAndFlagsW(pidl, SHGDN_INFOLDER, Buf, cchBuf, NULL);
19 ILFree(pidl);
20
21 if (SUCCEEDED(hr) && DataObject_GetHIDACount(pDO) > 1)
22 StringCchCatW(Buf, cchBuf, L", ...");
23 }
24 return hr;
25}
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT SHGetNameAndFlagsW(_In_ LPCITEMIDLIST pidl, _In_ DWORD dwFlags, _Out_opt_ LPWSTR pszText, _In_ UINT cchBuf, _Inout_opt_ DWORD *pdwAttributes)
Definition: utils.cpp:503
PIDLIST_ABSOLUTE SHELL_DataObject_ILCloneFullItem(_In_ IDataObject *pDO, _In_ UINT Index)
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1045
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325

Referenced by ShellPropSheetDialog::Show().

◆ SHELL_ShowItemIDListProperties()

HRESULT SHELL_ShowItemIDListProperties ( LPCITEMIDLIST  pidl)

Definition at line 199 of file item_prop.cpp.

200{
201 assert(pidl);
202
203 CComHeapPtr<ITEMIDLIST> alloc;
204 if (IS_INTRESOURCE(pidl))
205 {
206 HRESULT hr = SHGetSpecialFolderLocation(NULL, LOWORD(pidl), const_cast<LPITEMIDLIST*>(&pidl));
207 if (FAILED(hr))
208 return hr;
209 alloc.Attach(const_cast<LPITEMIDLIST>(pidl));
210 }
211 SHELLEXECUTEINFOA sei = {
212 sizeof(sei), SEE_MASK_INVOKEIDLIST | SEE_MASK_ASYNCOK, NULL, "properties",
213 NULL, NULL, NULL, SW_SHOWNORMAL, NULL, const_cast<LPITEMIDLIST>(pidl)
214 };
216}
#define IS_INTRESOURCE(x)
Definition: loader.c:613
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3384
#define assert(x)
Definition: debug.h:53
#define S_OK
Definition: intsafe.h:52
#define HResultFromWin32
Definition: loader.cpp:14
#define LOWORD(l)
Definition: pedump.c:82
#define alloc
Definition: rosglue.h:13
#define SEE_MASK_ASYNCOK
Definition: shellapi.h:43
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExA(LPSHELLEXECUTEINFOA sei)
Definition: shlexec.cpp:2403
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define SW_SHOWNORMAL
Definition: winuser.h:781

Referenced by CFSFolder::CallBack(), and CRecycleBin::InvokeCommand().

◆ SHMultiFileProperties()

EXTERN_C HRESULT WINAPI SHMultiFileProperties ( IDataObject pDataObject,
DWORD  dwFlags 
)

Definition at line 223 of file item_prop.cpp.

224{
225 if (DataObject_GetHIDACount(pDataObject) == 1)
227
228 return ShellPropSheetDialog().ShowAsync(&CLSID_ShellFileDefExt, pDataObject, NULL, NULL);
229}

Referenced by SHELL32_ShowFilesystemItemsPropertiesDialogAsync().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )