ReactOS  0.4.15-dev-439-g292f67a
CCommonFolder< TSelf, TItemId, TExtractIcon > Class Template Reference

#include <foldercommon.h>

Inheritance diagram for CCommonFolder< TSelf, TItemId, TExtractIcon >:
Collaboration diagram for CCommonFolder< TSelf, TItemId, TExtractIcon >:

Public Member Functions

 CCommonFolder ()
 
virtual ~CCommonFolder ()
 
virtual HRESULT STDMETHODCALLTYPE ParseDisplayName (HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName, ULONG *pchEaten, LPITEMIDLIST *ppidl, ULONG *pdwAttributes)
 
virtual HRESULT STDMETHODCALLTYPE EnumObjects (HWND hwndOwner, SHCONTF grfFlags, IEnumIDList **ppenumIDList) PURE
 
virtual HRESULT STDMETHODCALLTYPE BindToObject (LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvOut)
 
virtual HRESULT STDMETHODCALLTYPE BindToStorage (LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvObj)
 
virtual HRESULT STDMETHODCALLTYPE CompareIDs (LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
 
virtual HRESULT STDMETHODCALLTYPE CreateViewObject (HWND hwndOwner, REFIID riid, void **ppvOut)
 
virtual HRESULT STDMETHODCALLTYPE GetAttributesOf (UINT cidl, PCUITEMID_CHILD_ARRAY apidl, SFGAOF *rgfInOut)
 
virtual HRESULT STDMETHODCALLTYPE GetUIObjectOf (HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, void **ppvOut)
 
virtual HRESULT STDMETHODCALLTYPE GetDisplayNameOf (LPCITEMIDLIST pidl, SHGDNF uFlags, STRRET *lpName)
 
virtual HRESULT STDMETHODCALLTYPE SetNameOf (HWND hwnd, LPCITEMIDLIST pidl, LPCOLESTR lpszName, SHGDNF uFlags, LPITEMIDLIST *ppidlOut)
 
virtual HRESULT STDMETHODCALLTYPE GetDefaultSearchGUID (GUID *lpguid)
 
virtual HRESULT STDMETHODCALLTYPE EnumSearches (IEnumExtraSearch **ppenum)
 
virtual HRESULT STDMETHODCALLTYPE GetDefaultColumn (DWORD dwReserved, ULONG *pSort, ULONG *pDisplay)
 
virtual HRESULT STDMETHODCALLTYPE GetDefaultColumnState (UINT iColumn, SHCOLSTATEF *pcsFlags) PURE
 
virtual HRESULT STDMETHODCALLTYPE GetDetailsEx (LPCITEMIDLIST pidl, const SHCOLUMNID *pscid, VARIANT *pv) PURE
 
virtual HRESULT STDMETHODCALLTYPE GetDetailsOf (LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS *psd) PURE
 
virtual HRESULT STDMETHODCALLTYPE MapColumnToSCID (UINT iColumn, SHCOLUMNID *pscid) PURE
 
virtual HRESULT STDMETHODCALLTYPE GetClassID (CLSID *lpClassId)
 
virtual HRESULT STDMETHODCALLTYPE Initialize (PCIDLIST_ABSOLUTE pidl)
 
virtual HRESULT STDMETHODCALLTYPE GetCurFolder (PIDLIST_ABSOLUTE *pidl)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
- Public Member Functions inherited from IShellFolder2
HRESULT GetDetailsEx ([in] PCUITEMID_CHILD pidl, [in] const SHCOLUMNID *pscid, [out] VARIANT *pv)
 
HRESULT GetDetailsOf ([in] PCUITEMID_CHILD pidl, [in] UINT iColumn, [out] SHELLDETAILS *psd)
 
- Public Member Functions inherited from IShellFolder
HRESULT ParseDisplayName ([in] HWND hwndOwner, [in] LPBC pbcReserved, [in, string] LPOLESTR lpszDisplayName, [out] ULONG *pchEaten, [out] PIDLIST_RELATIVE *ppidl, [in, out, unique] ULONG *pdwAttributes)
 
HRESULT BindToObject ([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
 
HRESULT BindToStorage ([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvObj)
 
HRESULT CompareIDs ([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
 
HRESULT GetDisplayNameOf ([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
 
HRESULT SetNameOf ([in] HWND hwnd, [in] PCUITEMID_CHILD pidl, [in, string] LPCOLESTR lpszName, [in] SHGDNF uFlags, [out] PITEMID_CHILD *ppidlOut)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Static Public Member Functions

static HRESULT CALLBACK DefCtxMenuCallback (IShellFolder *, HWND, IDataObject *, UINT uMsg, WPARAM, LPARAM)
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 

Protected Member Functions

virtual HRESULT STDMETHODCALLTYPE InternalBindToObject (PWSTR path, const TItemId *info, LPITEMIDLIST first, LPCITEMIDLIST rest, LPITEMIDLIST fullPidl, LPBC pbcReserved, IShellFolder **ppsfChild) PURE
 
virtual HRESULT STDMETHODCALLTYPE ResolveSymLink (const TItemId *info, LPITEMIDLIST *fullPidl)
 
virtual HRESULT STDMETHODCALLTYPE CompareName (LPARAM lParam, const TItemId *first, const TItemId *second)
 
virtual HRESULT STDMETHODCALLTYPE CompareIDs (LPARAM lParam, const TItemId *first, const TItemId *second) PURE
 
virtual ULONG STDMETHODCALLTYPE ConvertAttributes (const TItemId *entry, PULONG inMask) PURE
 
virtual BOOL STDMETHODCALLTYPE IsFolder (LPCITEMIDLIST pcidl)
 
virtual BOOL STDMETHODCALLTYPE IsFolder (const TItemId *info) PURE
 
virtual BOOL STDMETHODCALLTYPE IsSymLink (LPCITEMIDLIST pcidl)
 
virtual BOOL STDMETHODCALLTYPE IsSymLink (const TItemId *info)
 
virtual HRESULT GetInfoFromPidl (LPCITEMIDLIST pcidl, const TItemId **pentry) PURE
 

Protected Attributes

WCHAR m_NtPath [MAX_PATH]
 
LPITEMIDLIST m_shellPidl
 

Additional Inherited Members

- Public Types inherited from IShellFolder2
typedef struct IShellFolder2::SHCOLUMNIDLPSHCOLUMNID
 
typedef const SHCOLUMNIDLPCSHCOLUMNID
 
- Public Types inherited from IShellFolder
enum  tagSHGDN {
  SHGDN_NORMAL = 0, SHGDN_INFOLDER = 1, SHGDN_FOREDITING = 0x1000, SHGDN_INCLUDE_NONFILESYS = 0x2000,
  SHGDN_FORADDRESSBAR = 0x4000, SHGDN_FORPARSING = 0x8000
}
 
enum  tagSHCONTF {
  SHCONTF_FOLDERS = 32, SHCONTF_NONFOLDERS = 64, SHCONTF_INCLUDEHIDDEN = 128, SHCONTF_INIT_ON_FIRST_NEXT = 256,
  SHCONTF_NETPRINTERSRCH = 512, SHCONTF_SHAREABLE = 1024, SHCONTF_STORAGE = 2048, SHCONTF_NAVIGATION_ENUM = 0x01000,
  SHCONTF_FASTITEMS = 0x02000, SHCONTF_FLATLIST = 0x04000, SHCONTF_ENABLE_ASYNC = 0x08000, SHCONTF_INCLUDESUPERHIDDEN = 0x10000
}
 
typedef IShellFolderLPSHELLFOLDER
 
typedef enum IShellFolder::tagSHGDN SHGNO
 
typedef DWORD SHGDNF
 
typedef DWORD SHCONTF
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IPersistFolder2
typedef IPersistFolder2LPPERSISTFOLDER2
 
- Public Types inherited from IPersistFolder
typedef IPersistFolderLPPERSISTFOLDER
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from IShellFolder
SFGAO_STORAGEANCESTOR typedef ULONG SFGAOF
 

Detailed Description

template<class TSelf, typename TItemId, class TExtractIcon>
class CCommonFolder< TSelf, TItemId, TExtractIcon >

Definition at line 58 of file foldercommon.h.

Constructor & Destructor Documentation

◆ CCommonFolder()

template<class TSelf, typename TItemId, class TExtractIcon>
CCommonFolder< TSelf, TItemId, TExtractIcon >::CCommonFolder ( )
inline

Definition at line 70 of file foldercommon.h.

70  :
72  {
73  }
smooth NULL
Definition: ftsmooth.c:416
LPITEMIDLIST m_shellPidl
Definition: foldercommon.h:66

◆ ~CCommonFolder()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual CCommonFolder< TSelf, TItemId, TExtractIcon >::~CCommonFolder ( )
inlinevirtual

Definition at line 75 of file foldercommon.h.

76  {
77  if (m_shellPidl)
79  }
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
LPITEMIDLIST m_shellPidl
Definition: foldercommon.h:66

Member Function Documentation

◆ BindToObject()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::BindToObject ( LPCITEMIDLIST  pidl,
LPBC  pbcReserved,
REFIID  riid,
void **  ppvOut 
)
inlinevirtual

Definition at line 166 of file foldercommon.h.

171  {
172  const TItemId * info;
173 
174  if (IsEqualIID(riid, IID_IShellFolder))
175  {
176  HRESULT hr = GetInfoFromPidl(pidl, &info);
177  if (FAILED_UNEXPECTEDLY(hr))
178  return hr;
179 
181 
182  StringCbCopyW(path, sizeof(path), m_NtPath);
183  PathAppendW(path, info->entryName);
184 
186  LPCITEMIDLIST rest = ILGetNext(pidl);
187 
189 
190  CComPtr<IShellFolder> psfChild;
191  hr = InternalBindToObject(path, info, first, rest, fullPidl, pbcReserved, &psfChild);
192 
193  ILFree(fullPidl);
194  ILFree(first);
195 
196  if (FAILED(hr))
197  return hr;
198 
199  if (hr == S_FALSE)
200  return S_OK;
201 
202  if (rest->mkid.cb > 0)
203  {
204  return psfChild->BindToObject(rest, pbcReserved, riid, ppvOut);
205  }
206 
207  return psfChild->QueryInterface(riid, ppvOut);
208  }
209 
210  return E_NOTIMPL;
211  }
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
const GLint * first
Definition: glext.h:5794
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
struct _test_info info[]
Definition: SetCursorPos.c:19
virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const TItemId **pentry) PURE
#define S_FALSE
Definition: winerror.h:2357
LPITEMIDLIST m_shellPidl
Definition: foldercommon.h:66
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:26
WCHAR m_NtPath[MAX_PATH]
Definition: foldercommon.h:64
LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl)
Definition: pidl.c:253
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
virtual HRESULT STDMETHODCALLTYPE InternalBindToObject(PWSTR path, const TItemId *info, LPITEMIDLIST first, LPCITEMIDLIST rest, LPITEMIDLIST fullPidl, LPBC pbcReserved, IShellFolder **ppsfChild) PURE
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ BindToStorage()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::BindToStorage ( LPCITEMIDLIST  pidl,
LPBC  pbcReserved,
REFIID  riid,
void **  ppvObj 
)
inlinevirtual

Definition at line 232 of file foldercommon.h.

237  {
239  return E_NOTIMPL;
240  }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

◆ CompareIDs() [1/2]

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::CompareIDs ( LPARAM  lParam,
LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2 
)
inlinevirtual

Definition at line 242 of file foldercommon.h.

246  {
247  HRESULT hr;
248 
249  TRACE("CompareIDs %d\n", lParam);
250 
251  const TItemId * id1;
252  hr = GetInfoFromPidl(pidl1, &id1);
253  if (FAILED(hr))
254  return E_INVALIDARG;
255 
256  const TItemId * id2;
257  hr = GetInfoFromPidl(pidl2, &id2);
258  if (FAILED(hr))
259  return E_INVALIDARG;
260 
261  hr = CompareIDs(lParam, id1, id2);
262  if (hr != S_EQUAL)
263  return hr;
264 
265  // The wollowing snipped is basically SHELL32_CompareChildren
266 
267  PUIDLIST_RELATIVE rest1 = ILGetNext(pidl1);
268  PUIDLIST_RELATIVE rest2 = ILGetNext(pidl2);
269 
270  bool isEmpty1 = (rest1->mkid.cb == 0);
271  bool isEmpty2 = (rest2->mkid.cb == 0);
272 
273  if (isEmpty1 || isEmpty2)
274  return MAKE_COMPARE_HRESULT(isEmpty2 - isEmpty1);
275 
276  LPCITEMIDLIST first1 = ILCloneFirst(pidl1);
277  if (!first1)
278  return E_OUTOFMEMORY;
279 
280  CComPtr<IShellFolder> psfNext;
281  hr = BindToObject(first1, NULL, IID_PPV_ARG(IShellFolder, &psfNext));
282  if (FAILED_UNEXPECTEDLY(hr))
283  return hr;
284 
285  return psfNext->CompareIDs(lParam, rest1, rest2);
286  }
virtual HRESULT STDMETHODCALLTYPE BindToObject(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvOut)
Definition: foldercommon.h:166
virtual HRESULT STDMETHODCALLTYPE CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: foldercommon.h:242
HRESULT hr
Definition: shlfolder.c:183
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
ITEMIDLIST_RELATIVE UNALIGNED * PUIDLIST_RELATIVE
Definition: shtypes.idl:55
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:535
#define IID_PPV_ARG(Itype, ppType)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const TItemId **pentry) PURE
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define S_EQUAL
Definition: shellutils.h:533
LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl)
Definition: pidl.c:253
LPARAM lParam
Definition: combotst.c:139

◆ CompareIDs() [2/2]

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::CompareIDs ( LPARAM  lParam,
const TItemId *  first,
const TItemId *  second 
)
protectedvirtual

Reimplemented in CNtObjectFolder, and CRegistryFolder.

◆ CompareName()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::CompareName ( LPARAM  lParam,
const TItemId *  first,
const TItemId *  second 
)
inlineprotectedvirtual

Definition at line 289 of file foldercommon.h.

293  {
294  bool f1 = IsFolder(first);
295  bool f2 = IsFolder(second);
296 
298  if (hr != S_EQUAL)
299  return hr;
300 
301  bool canonical = (lParam & 0xFFFF0000) == SHCIDS_CANONICALONLY;
302  if (canonical)
303  {
304  // Shortcut: avoid comparing contents if not necessary when the results are not for display.
305  hr = MAKE_COMPARE_HRESULT(second->entryNameLength - first->entryNameLength);
306  if (hr != S_EQUAL)
307  return hr;
308 
309  int minlength = min(first->entryNameLength, second->entryNameLength);
310  if (minlength > 0)
311  {
312  hr = MAKE_COMPARE_HRESULT(memcmp(first->entryName, second->entryName, minlength));
313  if (hr != S_EQUAL)
314  return hr;
315  }
316 
317  return S_EQUAL;
318  }
319 
320  int minlength = min(first->entryNameLength, second->entryNameLength);
321  if (minlength > 0)
322  {
323  hr = MAKE_COMPARE_HRESULT(StrCmpNW(first->entryName, second->entryName, minlength / sizeof(WCHAR)));
324  if (hr != S_EQUAL)
325  return hr;
326  }
327 
328  return MAKE_COMPARE_HRESULT(second->entryNameLength - first->entryNameLength);
329  }
#define SHCIDS_CANONICALONLY
Definition: precomp.h:50
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
INT WINAPI StrCmpNW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen)
Definition: string.c:504
HRESULT hr
Definition: shlfolder.c:183
const GLint * first
Definition: glext.h:5794
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:535
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
#define S_EQUAL
Definition: shellutils.h:533
#define f1(x, y, z)
Definition: sha1.c:30
virtual BOOL STDMETHODCALLTYPE IsFolder(LPCITEMIDLIST pcidl)
Definition: foldercommon.h:664
#define min(a, b)
Definition: monoChain.cc:55
int f2(S1 &, S2 &)
LPARAM lParam
Definition: combotst.c:139

◆ ConvertAttributes()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual ULONG STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::ConvertAttributes ( const TItemId *  entry,
PULONG  inMask 
)
protectedvirtual

Reimplemented in CNtObjectFolder, and CRegistryFolder.

◆ CreateViewObject()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::CreateViewObject ( HWND  hwndOwner,
REFIID  riid,
void **  ppvOut 
)
inlinevirtual

Implements IShellFolder.

Definition at line 332 of file foldercommon.h.

336  {
337  if (!IsEqualIID(riid, IID_IShellView))
338  return E_NOINTERFACE;
339 
340  _CComObject<CFolderViewCB> *pcb;
341 
342  HRESULT hr = _CComObject<CFolderViewCB>::CreateInstance(&pcb);
343  if (FAILED(hr))
344  return hr;
345 
346  pcb->AddRef();
347 
348  SFV_CREATE sfv;
349  sfv.cbSize = sizeof(sfv);
350  sfv.pshf = this;
351  sfv.psvOuter = NULL;
352  sfv.psfvcb = pcb;
353 
354  IShellView* view;
355 
356  hr = SHCreateShellFolderView(&sfv, &view);
357  if (FAILED(hr))
358  return hr;
359 
360  pcb->Initialize(view);
361 
362  pcb->Release();
363 
364  *ppvOut = view;
365 
366  return S_OK;
367  }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1285
REFIID riid
Definition: precomp.h:44
IShellView * psvOuter
Definition: shlobj.h:1284
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3594
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:78
IShellFolder * pshf
Definition: shlobj.h:1283
#define S_OK
Definition: intsafe.h:59
UINT cbSize
Definition: shlobj.h:1282
static IOleDocumentView * view
Definition: activex.c:1749
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ DefCtxMenuCallback()

template<class TSelf, typename TItemId, class TExtractIcon>
static HRESULT CALLBACK CCommonFolder< TSelf, TItemId, TExtractIcon >::DefCtxMenuCallback ( IShellFolder ,
HWND  ,
IDataObject ,
UINT  uMsg,
WPARAM  ,
LPARAM   
)
inlinestatic

Definition at line 696 of file foldercommon.h.

697  {
698  switch (uMsg)
699  {
701  return S_OK;
702  case DFM_INVOKECOMMAND:
703  case DFM_INVOKECOMMANDEX:
704  case DFM_GETDEFSTATICID: // Required for Windows 7 to pick a default
705  return S_FALSE;
706  }
707  return E_NOTIMPL;
708  }
#define S_FALSE
Definition: winerror.h:2357
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
#define DFM_GETDEFSTATICID
Definition: precomp.h:47
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
#define DFM_INVOKECOMMANDEX
Definition: precomp.h:46

◆ EnumObjects()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::EnumObjects ( HWND  hwndOwner,
SHCONTF  grfFlags,
IEnumIDList **  ppenumIDList 
)
virtual

Implements IShellFolder.

Reimplemented in CRegistryFolder, and CNtObjectFolder.

◆ EnumSearches()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::EnumSearches ( IEnumExtraSearch **  ppenum)
inlinevirtual

Implements IShellFolder2.

Definition at line 586 of file foldercommon.h.

588  {
590  return E_NOTIMPL;
591  }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

◆ GetAttributesOf()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::GetAttributesOf ( UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
SFGAOF rgfInOut 
)
inlinevirtual

Implements IShellFolder.

Definition at line 369 of file foldercommon.h.

373  {
374  const TItemId * info;
375 
376  TRACE("GetAttributesOf %d\n", cidl);
377 
378  if (cidl == 0)
379  {
380  *rgfInOut &= SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_BROWSABLE;
381  return S_OK;
382  }
383 
384  for (int i = 0; i < (int)cidl; i++)
385  {
386  PCUITEMID_CHILD pidl = apidl[i];
387 
388  HRESULT hr = GetInfoFromPidl(pidl, &info);
389  if (FAILED_UNEXPECTEDLY(hr))
390  return hr;
391 
392  // Update attributes.
393  *rgfInOut = ConvertAttributes(info, rgfInOut);
394  }
395 
396  return S_OK;
397  }
HRESULT hr
Definition: shlfolder.c:183
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
struct _test_info info[]
Definition: SetCursorPos.c:19
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
virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const TItemId **pentry) PURE
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define S_OK
Definition: intsafe.h:59
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
virtual ULONG STDMETHODCALLTYPE ConvertAttributes(const TItemId *entry, PULONG inMask) PURE

◆ GetClassID()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::GetClassID ( CLSID lpClassId)
inlinevirtual

Implements IPersist.

Definition at line 624 of file foldercommon.h.

625  {
626  if (!lpClassId)
627  return E_POINTER;
628 
629  *lpClassId = CLSID_NtObjectFolder;
630  return S_OK;
631  }
const GUID CLSID_NtObjectFolder
Definition: ntobjfolder.cpp:14
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ GetCurFolder()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
inlinevirtual

Implements IPersistFolder2.

Definition at line 644 of file foldercommon.h.

645  {
646  if (pidl)
647  *pidl = ILClone(m_shellPidl);
648  if (!m_shellPidl)
649  return S_FALSE;
650  return S_OK;
651  }
#define S_FALSE
Definition: winerror.h:2357
LPITEMIDLIST m_shellPidl
Definition: foldercommon.h:66
#define S_OK
Definition: intsafe.h:59
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228

◆ GetDefaultColumn()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::GetDefaultColumn ( DWORD  dwReserved,
ULONG pSort,
ULONG pDisplay 
)
inlinevirtual

Implements IShellFolder2.

Definition at line 593 of file foldercommon.h.

597  {
598  if (pSort)
599  *pSort = 0;
600  if (pDisplay)
601  *pDisplay = 0;
602  return S_OK;
603  }
#define S_OK
Definition: intsafe.h:59

◆ GetDefaultColumnState()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::GetDefaultColumnState ( UINT  iColumn,
SHCOLSTATEF pcsFlags 
)
virtual

Implements IShellFolder2.

Reimplemented in CNtObjectFolder, and CRegistryFolder.

◆ GetDefaultSearchGUID()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::GetDefaultSearchGUID ( GUID lpguid)
inlinevirtual

Implements IShellFolder2.

Definition at line 579 of file foldercommon.h.

581  {
583  return E_NOTIMPL;
584  }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

◆ GetDetailsEx()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::GetDetailsEx ( LPCITEMIDLIST  pidl,
const SHCOLUMNID pscid,
VARIANT pv 
)
virtual

Reimplemented in CNtObjectFolder, and CRegistryFolder.

◆ GetDetailsOf()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::GetDetailsOf ( LPCITEMIDLIST  pidl,
UINT  iColumn,
SHELLDETAILS psd 
)
virtual

Reimplemented in CNtObjectFolder, and CRegistryFolder.

◆ GetDisplayNameOf()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::GetDisplayNameOf ( LPCITEMIDLIST  pidl,
SHGDNF  uFlags,
STRRET lpName 
)
inlinevirtual

Definition at line 500 of file foldercommon.h.

504  {
505  const TItemId * info;
506 
507  TRACE("GetDisplayNameOf %p\n", pidl);
508 
509  HRESULT hr = GetInfoFromPidl(pidl, &info);
510  if (FAILED_UNEXPECTEDLY(hr))
511  return hr;
512 
514  {
515  hr = MakeStrRetFromString(info->entryName, info->entryNameLength, lpName);
516  if (FAILED_UNEXPECTEDLY(hr))
517  return hr;
518  }
519 
520  WCHAR path[MAX_PATH] = { 0 };
521 
523  {
525  {
527  if (FAILED_UNEXPECTEDLY(hr))
528  return hr;
529  }
530  }
531 
532  PathAppendW(path, info->entryName);
533 
534  LPCITEMIDLIST pidlNext = ILGetNext(pidl);
535  if (pidlNext && pidlNext->mkid.cb > 0)
536  {
537  LPITEMIDLIST pidlFirst = ILCloneFirst(pidl);
538 
539  CComPtr<IShellFolder> psfChild;
540  hr = BindToObject(pidlFirst, NULL, IID_PPV_ARG(IShellFolder, &psfChild));
541  if (FAILED_UNEXPECTEDLY(hr))
542  return hr;
543 
545  STRRET childName;
546 
547  hr = psfChild->GetDisplayNameOf(pidlNext, uFlags | SHGDN_INFOLDER, &childName);
548  if (FAILED_UNEXPECTEDLY(hr))
549  return hr;
550 
551  hr = StrRetToBufW(&childName, pidlNext, temp, _countof(temp));
552  if (FAILED_UNEXPECTEDLY(hr))
553  return hr;
554 
556 
557  ILFree(pidlFirst);
558  }
559 
561  if (FAILED_UNEXPECTEDLY(hr))
562  return hr;
563 
564  return S_OK;
565  }
virtual HRESULT STDMETHODCALLTYPE BindToObject(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvOut)
Definition: foldercommon.h:166
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
HRESULT hr
Definition: shlfolder.c:183
#define GET_SHGDN_RELATION(dwFlags)
Definition: precomp.h:53
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1522
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
_In_ LPCSTR lpName
Definition: winbase.h:2752
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
UINT uFlags
Definition: api.c:59
#define IID_PPV_ARG(Itype, ppType)
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
struct _test_info info[]
Definition: SetCursorPos.c:19
#define GET_SHGDN_FOR(dwFlags)
Definition: precomp.h:52
virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const TItemId **pentry) PURE
smooth NULL
Definition: ftsmooth.c:416
LPITEMIDLIST m_shellPidl
Definition: foldercommon.h:66
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
#define _countof(array)
Definition: sndvol32.h:68
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:26
HRESULT INLINE GetFullName(PCIDLIST_ABSOLUTE pidl, DWORD uFlags, PWSTR strName, DWORD cchName)
Definition: util.h:29
LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl)
Definition: pidl.c:253
#define S_OK
Definition: intsafe.h:59
static calc_node_t temp
Definition: rpn_ieee.c:38
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
HRESULT INLINE MakeStrRetFromString(LPCWSTR string, DWORD cbLength, STRRET *str)
Definition: util.h:7

◆ GetInfoFromPidl()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT CCommonFolder< TSelf, TItemId, TExtractIcon >::GetInfoFromPidl ( LPCITEMIDLIST  pcidl,
const TItemId **  pentry 
)
protectedvirtual

Reimplemented in CNtObjectFolder, and CRegistryFolder.

◆ GetUIObjectOf()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::GetUIObjectOf ( HWND  hwndOwner,
UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
REFIID  riid,
UINT prgfInOut,
void **  ppvOut 
)
inlinevirtual

Implements IShellFolder.

Definition at line 399 of file foldercommon.h.

406  {
407  DWORD res;
408  TRACE("GetUIObjectOf\n");
409 
410  if (IsEqualIID(riid, IID_IContextMenu) ||
411  IsEqualIID(riid, IID_IContextMenu2) ||
412  IsEqualIID(riid, IID_IContextMenu3))
413  {
414  CComPtr<IContextMenu> pcm;
415 
416  HKEY keys[1];
417 
419 
420  CComPtr<IShellFolder> psfParent = this;
421 
423 
424  int nkeys = _countof(keys);
425  if (cidl == 1 && IsSymLink(apidl[0]))
426  {
427  const TItemId * info;
428  HRESULT hr = GetInfoFromPidl(apidl[0], &info);
429  if (FAILED(hr))
430  return hr;
431 
434  if (FAILED(hr))
435  return hr;
436 
437  CComPtr<IShellFolder> psfTarget;
439  if (FAILED(hr))
440  {
441  ILFree(target);
442  return hr;
443  }
444 
445  parent = ILClone(target);
447  psfParent = psfTarget;
448 
449  apidl = &child;
450  }
451 
452  if (cidl == 1 && IsFolder(apidl[0]))
453  {
454  res = RegOpenKey(HKEY_CLASSES_ROOT, L"Folder", keys + 0);
455  if (!NT_SUCCESS(res))
456  return HRESULT_FROM_NT(res);
457  }
458  else
459  {
460  nkeys = 0;
461  }
462 
463  HRESULT hr = CDefFolderMenu_Create2(parent, hwndOwner, cidl, apidl, psfParent, DefCtxMenuCallback, nkeys, keys, &pcm);
464  if (FAILED_UNEXPECTEDLY(hr))
465  return hr;
466 
467  return pcm->QueryInterface(riid, ppvOut);
468  }
469 
470  if (IsEqualIID(riid, IID_IExtractIconW))
471  {
472  return ShellObjectCreatorInit<TExtractIcon>(m_NtPath, m_shellPidl, cidl, apidl, riid, ppvOut);
473  }
474 
476  {
477  return CIDLData_CreateFromIDArray(m_shellPidl, cidl, apidl, (IDataObject**)ppvOut);
478  }
479 
480  if (IsEqualIID(riid, IID_IQueryAssociations))
481  {
482  if (cidl == 1 && IsFolder(apidl[0]))
483  {
484  CComPtr<IQueryAssociations> pqa;
485  HRESULT hr = AssocCreate(CLSID_QueryAssociations, IID_PPV_ARG(IQueryAssociations, &pqa));
486  if (FAILED_UNEXPECTEDLY(hr))
487  return hr;
488 
489  hr = pqa->Init(ASSOCF_INIT_DEFAULTTOFOLDER, L"NTObjShEx.NTDirectory", NULL, hwndOwner);
490  if (FAILED_UNEXPECTEDLY(hr))
491  return hr;
492 
493  return pqa->QueryInterface(riid, ppvOut);
494  }
495  }
496 
497  return E_NOTIMPL;
498  }
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
virtual BOOL STDMETHODCALLTYPE IsSymLink(LPCITEMIDLIST pcidl)
Definition: foldercommon.h:677
virtual HRESULT STDMETHODCALLTYPE ResolveSymLink(const TItemId *info, LPITEMIDLIST *fullPidl)
Definition: foldercommon.h:223
static HRESULT CALLBACK DefCtxMenuCallback(IShellFolder *, HWND, IDataObject *, UINT uMsg, WPARAM, LPARAM)
Definition: foldercommon.h:696
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
const GUID IID_IDataObject
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
Definition: pidl.c:212
#define IID_PPV_ARG(Itype, ppType)
static HWND child
Definition: cursoricon.c:298
struct _test_info info[]
Definition: SetCursorPos.c:19
virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const TItemId **pentry) PURE
smooth NULL
Definition: ftsmooth.c:416
LPITEMIDLIST m_shellPidl
Definition: foldercommon.h:66
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2944
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG HRESULT
Definition: typedefs.h:78
#define _countof(array)
Definition: sndvol32.h:68
#define HRESULT_FROM_NT(x)
Definition: winerror.h:94
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
WCHAR m_NtPath[MAX_PATH]
Definition: foldercommon.h:64
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1331
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define E_NOTIMPL
Definition: ddrawi.h:99
virtual BOOL STDMETHODCALLTYPE IsFolder(LPCITEMIDLIST pcidl)
Definition: foldercommon.h:664
GLuint res
Definition: glext.h:9613
GLenum target
Definition: glext.h:7315
HRESULT WINAPI AssocCreate(CLSID clsid, REFIID refiid, void **lpInterface)
Definition: assoc.c:89
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
HRESULT WINAPI CIDLData_CreateFromIDArray(PCIDLIST_ABSOLUTE pidlFolder, UINT cpidlFiles, PCUIDLIST_RELATIVE_ARRAY lppidlFiles, LPDATAOBJECT *ppdataObject)
Definition: shellord.c:2080
#define RegOpenKey
Definition: winreg.h:519
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
HRESULT WINAPI CDefFolderMenu_Create2(PCIDLIST_ABSOLUTE pidlFolder, HWND hwnd, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IShellFolder *psf, LPFNDFMCALLBACK lpfn, UINT nKeys, const HKEY *ahkeyClsKeys, IContextMenu **ppcm)
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ Initialize()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::Initialize ( PCIDLIST_ABSOLUTE  pidl)
inlinevirtual

Implements IPersistFolder.

Reimplemented in CNtObjectFolder, and CRegistryFolder.

Definition at line 634 of file foldercommon.h.

635  {
636  m_shellPidl = ILClone(pidl);
637 
638  StringCbCopyW(m_NtPath, sizeof(m_NtPath), L"\\");
639 
640  return S_OK;
641  }
LPITEMIDLIST m_shellPidl
Definition: foldercommon.h:66
WCHAR m_NtPath[MAX_PATH]
Definition: foldercommon.h:64
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166

◆ InternalBindToObject()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::InternalBindToObject ( PWSTR  path,
const TItemId *  info,
LPITEMIDLIST  first,
LPCITEMIDLIST  rest,
LPITEMIDLIST  fullPidl,
LPBC  pbcReserved,
IShellFolder **  ppsfChild 
)
protectedvirtual

Reimplemented in CRegistryFolder, and CNtObjectFolder.

◆ IsFolder() [1/2]

template<class TSelf, typename TItemId, class TExtractIcon>
virtual BOOL STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::IsFolder ( LPCITEMIDLIST  pcidl)
inlineprotectedvirtual

Definition at line 664 of file foldercommon.h.

665  {
666  const TItemId * info;
667 
668  HRESULT hr = GetInfoFromPidl(pcidl, &info);
669  if (FAILED(hr))
670  return hr;
671 
672  return IsFolder(info);
673  }
HRESULT hr
Definition: shlfolder.c:183
struct _test_info info[]
Definition: SetCursorPos.c:19
virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const TItemId **pentry) PURE
LONG HRESULT
Definition: typedefs.h:78
virtual BOOL STDMETHODCALLTYPE IsFolder(LPCITEMIDLIST pcidl)
Definition: foldercommon.h:664

◆ IsFolder() [2/2]

template<class TSelf, typename TItemId, class TExtractIcon>
virtual BOOL STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::IsFolder ( const TItemId *  info)
protectedvirtual

Reimplemented in CNtObjectFolder, and CRegistryFolder.

◆ IsSymLink() [1/2]

template<class TSelf, typename TItemId, class TExtractIcon>
virtual BOOL STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::IsSymLink ( LPCITEMIDLIST  pcidl)
inlineprotectedvirtual

Definition at line 677 of file foldercommon.h.

678  {
679  const TItemId * info;
680 
681  HRESULT hr = GetInfoFromPidl(pcidl, &info);
682  if (FAILED(hr))
683  return hr;
684 
685  return IsSymLink(info);
686  }
HRESULT hr
Definition: shlfolder.c:183
virtual BOOL STDMETHODCALLTYPE IsSymLink(LPCITEMIDLIST pcidl)
Definition: foldercommon.h:677
struct _test_info info[]
Definition: SetCursorPos.c:19
virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const TItemId **pentry) PURE
LONG HRESULT
Definition: typedefs.h:78

◆ IsSymLink() [2/2]

template<class TSelf, typename TItemId, class TExtractIcon>
virtual BOOL STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::IsSymLink ( const TItemId *  info)
inlineprotectedvirtual

Reimplemented in CNtObjectFolder.

Definition at line 688 of file foldercommon.h.

689  {
690  return FALSE;
691  }

◆ MapColumnToSCID()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::MapColumnToSCID ( UINT  iColumn,
SHCOLUMNID pscid 
)
virtual

Implements IShellFolder2.

Reimplemented in CNtObjectFolder, and CRegistryFolder.

◆ ParseDisplayName()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::ParseDisplayName ( HWND  hwndOwner,
LPBC  pbcReserved,
LPOLESTR  lpszDisplayName,
ULONG pchEaten,
LPITEMIDLIST ppidl,
ULONG pdwAttributes 
)
inlinevirtual

Definition at line 82 of file foldercommon.h.

89  {
90  if (!ppidl)
91  return E_POINTER;
92 
93  if (pchEaten)
94  *pchEaten = 0;
95 
96  if (pdwAttributes)
97  *pdwAttributes = 0;
98 
99  TRACE("CCommonFolder::ParseDisplayName name=%S (ntPath=%S)\n", lpszDisplayName, m_NtPath);
100 
101  const TItemId * info;
102  IEnumIDList * it;
104  if (FAILED(hr))
105  return hr;
106 
107  PWSTR end = StrChrW(lpszDisplayName, '\\');
108  int length = end ? end - lpszDisplayName : wcslen(lpszDisplayName);
109 
110  while (TRUE)
111  {
112  hr = it->Next(1, ppidl, NULL);
113 
114  if (FAILED(hr))
115  return hr;
116 
117  if (hr != S_OK)
119 
120  hr = GetInfoFromPidl(*ppidl, &info);
121  if (FAILED_UNEXPECTEDLY(hr))
122  return hr;
123 
124  if (StrCmpNW(info->entryName, lpszDisplayName, length) == 0)
125  break;
126  }
127 
128  // if has remaining path to parse (and the path didn't just terminate in a backslash)
129  if (end && wcslen(end) > 1)
130  {
131  CComPtr<IShellFolder> psfChild;
132  hr = BindToObject(*ppidl, pbcReserved, IID_PPV_ARG(IShellFolder, &psfChild));
133  if (FAILED_UNEXPECTEDLY(hr))
134  return hr;
135 
137  hr = psfChild->ParseDisplayName(hwndOwner, pbcReserved, end + 1, pchEaten, &child, pdwAttributes);
138  if (FAILED(hr))
139  return hr;
140 
141  LPITEMIDLIST old = *ppidl;
142  *ppidl = ILCombine(old, child);
143  ILFree(old);
144 
145  // Count the path separator
146  if (pchEaten)
147  (*pchEaten) += 1;
148  }
149  else
150  {
151  if (pdwAttributes)
152  *pdwAttributes = ConvertAttributes(info, pdwAttributes);
153  }
154 
155  if (pchEaten)
156  *pchEaten += wcslen(info->entryName);
157 
158  return S_OK;
159  }
#define TRUE
Definition: types.h:120
virtual HRESULT STDMETHODCALLTYPE BindToObject(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvOut)
Definition: foldercommon.h:166
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
INT WINAPI StrCmpNW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen)
Definition: string.c:504
HRESULT hr
Definition: shlfolder.c:183
uint16_t * PWSTR
Definition: typedefs.h:55
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
GLuint GLuint end
Definition: gl.h:1545
#define IID_PPV_ARG(Itype, ppType)
static HWND child
Definition: cursoricon.c:298
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] PITEMID_CHILD *rgelt, [out] ULONG *pceltFetched)
struct _test_info info[]
Definition: SetCursorPos.c:19
virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const TItemId **pentry) PURE
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
WCHAR m_NtPath[MAX_PATH]
Definition: foldercommon.h:64
virtual HRESULT STDMETHODCALLTYPE EnumObjects(HWND hwndOwner, SHCONTF grfFlags, IEnumIDList **ppenumIDList) PURE
#define S_OK
Definition: intsafe.h:59
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:468
#define E_POINTER
Definition: winerror.h:2365
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
virtual ULONG STDMETHODCALLTYPE ConvertAttributes(const TItemId *entry, PULONG inMask) PURE

◆ ResolveSymLink()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::ResolveSymLink ( const TItemId *  info,
LPITEMIDLIST fullPidl 
)
inlineprotectedvirtual

Reimplemented in CNtObjectFolder.

Definition at line 223 of file foldercommon.h.

226  {
227  return E_NOTIMPL;
228  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SetNameOf()

template<class TSelf, typename TItemId, class TExtractIcon>
virtual HRESULT STDMETHODCALLTYPE CCommonFolder< TSelf, TItemId, TExtractIcon >::SetNameOf ( HWND  hwnd,
LPCITEMIDLIST  pidl,
LPCOLESTR  lpszName,
SHGDNF  uFlags,
LPITEMIDLIST ppidlOut 
)
inlinevirtual

Definition at line 567 of file foldercommon.h.

573  {
575  return E_NOTIMPL;
576  }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:115

Member Data Documentation

◆ m_NtPath

template<class TSelf, typename TItemId, class TExtractIcon>
WCHAR CCommonFolder< TSelf, TItemId, TExtractIcon >::m_NtPath[MAX_PATH]
protected

Definition at line 64 of file foldercommon.h.

◆ m_shellPidl

template<class TSelf, typename TItemId, class TExtractIcon>
LPITEMIDLIST CCommonFolder< TSelf, TItemId, TExtractIcon >::m_shellPidl
protected

Definition at line 66 of file foldercommon.h.


The documentation for this class was generated from the following file: