ReactOS  0.4.15-dev-1384-g878186b
CControlPanelFolder Class Reference

#include <CControlPanelFolder.h>

Inheritance diagram for CControlPanelFolder:
Collaboration diagram for CControlPanelFolder:

Public Member Functions

 CControlPanelFolder ()
 
 ~CControlPanelFolder ()
 
virtual HRESULT WINAPI ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
 
virtual HRESULT WINAPI EnumObjects (HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
 
virtual HRESULT WINAPI BindToObject (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 
virtual HRESULT WINAPI BindToStorage (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 
virtual HRESULT WINAPI CompareIDs (LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
 
virtual HRESULT WINAPI CreateViewObject (HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
 
virtual HRESULT WINAPI GetAttributesOf (UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
 
virtual HRESULT WINAPI GetUIObjectOf (HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
 
virtual HRESULT WINAPI GetDisplayNameOf (PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
 
virtual HRESULT WINAPI SetNameOf (HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
 
virtual HRESULT WINAPI GetDefaultSearchGUID (GUID *pguid)
 
virtual HRESULT WINAPI EnumSearches (IEnumExtraSearch **ppenum)
 
virtual HRESULT WINAPI GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
 
virtual HRESULT WINAPI GetDefaultColumnState (UINT iColumn, DWORD *pcsFlags)
 
virtual HRESULT WINAPI GetDetailsEx (PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
 
virtual HRESULT WINAPI GetDetailsOf (PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
 
virtual HRESULT WINAPI MapColumnToSCID (UINT column, SHCOLUMNID *pscid)
 
virtual HRESULT WINAPI GetClassID (CLSID *lpClassId)
 
virtual HRESULT WINAPI Initialize (PCIDLIST_ABSOLUTE pidl)
 
virtual HRESULT WINAPI 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 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 EnumObjects ([in] HWND hwndOwner, [in] SHCONTF grfFlags, [out] IEnumIDList **ppenumIDList)
 
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 CreateViewObject ([in] HWND hwndOwner, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
 
HRESULT GetAttributesOf ([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut)
 
HRESULT GetUIObjectOf ([in] HWND hwndOwner, [in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in] REFIID riid, [in, out, unique] UINT *prgfInOut, [out, iid_is(riid)] void **ppvOut)
 
HRESULT GetDisplayNameOf ([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Private Member Functions

HRESULT WINAPI ExecuteFromIdList (LPCITEMIDLIST pidl)
 

Private Attributes

LPITEMIDLIST pidlRoot
 
int dwAttributes
 
CComPtr< IShellFolder2m_regFolder
 

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
 
- 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)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from IShellFolder
SFGAO_STORAGEANCESTOR typedef ULONG SFGAOF
 

Detailed Description

Definition at line 25 of file CControlPanelFolder.h.

Constructor & Destructor Documentation

◆ CControlPanelFolder()

CControlPanelFolder::CControlPanelFolder ( )

Definition at line 250 of file CControlPanelFolder.cpp.

251 {
252  pidlRoot = NULL; /* absolute pidl */
253 }
#define NULL
Definition: types.h:112

◆ ~CControlPanelFolder()

CControlPanelFolder::~CControlPanelFolder ( )

Definition at line 255 of file CControlPanelFolder.cpp.

256 {
257  TRACE("-- destroying IShellFolder(%p)\n", this);
258  SHFree(pidlRoot);
259 }
#define TRACE(s)
Definition: solgame.cpp:4
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331

Member Function Documentation

◆ BindToObject()

HRESULT WINAPI CControlPanelFolder::BindToObject ( PCUIDLIST_RELATIVE  pidl,
LPBC  pbcReserved,
REFIID  riid,
LPVOID ppvOut 
)
virtual

Definition at line 290 of file CControlPanelFolder.cpp.

295 {
296  return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);
297 }
REFIID riid
Definition: precomp.h:44
CComPtr< IShellFolder2 > m_regFolder

◆ BindToStorage()

HRESULT WINAPI CControlPanelFolder::BindToStorage ( PCUIDLIST_RELATIVE  pidl,
LPBC  pbcReserved,
REFIID  riid,
LPVOID ppvOut 
)
virtual

Definition at line 302 of file CControlPanelFolder.cpp.

307 {
308  FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this, pidl, pbcReserved, shdebugstr_guid(&riid), ppvOut);
309 
310  *ppvOut = NULL;
311  return E_NOTIMPL;
312 }
REFIID riid
Definition: precomp.h:44
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112

◆ CompareIDs()

HRESULT WINAPI CControlPanelFolder::CompareIDs ( LPARAM  lParam,
PCUIDLIST_RELATIVE  pidl1,
PCUIDLIST_RELATIVE  pidl2 
)
virtual

Implements IShellFolder.

Definition at line 317 of file CControlPanelFolder.cpp.

318 {
319  /* Dont use SHELL32_CompareGuidItems because it would cause guid items to come first */
320  if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
321  {
322  return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
323  }
324  PIDLCPanelStruct *pData1 = _ILGetCPanelPointer(pidl1);
325  PIDLCPanelStruct *pData2 = _ILGetCPanelPointer(pidl2);
326 
327  if (!pData1 || !pData2 || LOWORD(lParam)>= CONROLPANELSHELLVIEWCOLUMNS)
328  return E_INVALIDARG;
329 
330  int result;
331  switch(LOWORD(lParam))
332  {
333  case 0: /* name */
334  result = wcsicmp(pData1->szName + pData1->offsDispName, pData2->szName + pData2->offsDispName);
335  break;
336  case 1: /* comment */
337  result = wcsicmp(pData1->szName + pData1->offsComment, pData2->szName + pData2->offsComment);
338  break;
339  default:
340  ERR("Got wrong lParam!\n");
341  return E_INVALIDARG;
342  }
343 
345 }
GLuint64EXT * result
Definition: glext.h:11304
static PIDLCPanelStruct * _ILGetCPanelPointer(LPCITEMIDLIST pidl)
WCHAR szName[1]
Definition: pidl.h:116
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:535
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
#define E_INVALIDARG
Definition: ddrawi.h:101
WORD offsDispName
Definition: pidl.h:114
WORD offsComment
Definition: pidl.h:115
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:238
#define wcsicmp
Definition: compat.h:15
#define CONROLPANELSHELLVIEWCOLUMNS
#define ERR(fmt,...)
Definition: debug.h:110
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

◆ CreateViewObject()

HRESULT WINAPI CControlPanelFolder::CreateViewObject ( HWND  hwndOwner,
REFIID  riid,
LPVOID ppvOut 
)
virtual

Definition at line 350 of file CControlPanelFolder.cpp.

351 {
352  CComPtr<IShellView> pShellView;
354 
355  TRACE("(%p)->(hwnd=%p,%s,%p)\n", this, hwndOwner, shdebugstr_guid(&riid), ppvOut);
356 
357  if (ppvOut) {
358  *ppvOut = NULL;
359 
360  if (IsEqualIID(riid, IID_IDropTarget)) {
361  WARN("IDropTarget not implemented\n");
362  hr = E_NOTIMPL;
363  } else if (IsEqualIID(riid, IID_IContextMenu)) {
364  WARN("IContextMenu not implemented\n");
365  hr = E_NOTIMPL;
366  } else if (IsEqualIID(riid, IID_IShellView)) {
367  SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
368  hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
369  }
370  }
371  TRACE("--(%p)->(interface=%p)\n", this, ppvOut);
372  return hr;
373 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3755
#define E_INVALIDARG
Definition: ddrawi.h:101
struct _SFV_CREATE SFV_CREATE
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ EnumObjects()

HRESULT WINAPI CControlPanelFolder::EnumObjects ( HWND  hwndOwner,
DWORD  dwFlags,
LPENUMIDLIST *  ppEnumIDList 
)
virtual

Definition at line 279 of file CControlPanelFolder.cpp.

280 {
281  CComPtr<IEnumIDList> pRegEnumerator;
282  m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
283 
284  return ShellObjectCreatorInit<CControlPanelEnum>(dwFlags, pRegEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
285 }
CComPtr< IShellFolder2 > m_regFolder
#define IID_PPV_ARG(Itype, ppType)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ EnumSearches()

HRESULT WINAPI CControlPanelFolder::EnumSearches ( IEnumExtraSearch **  ppenum)
virtual

Implements IShellFolder2.

Definition at line 528 of file CControlPanelFolder.cpp.

529 {
530  FIXME("(%p)\n", this);
531  return E_NOTIMPL;
532 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ExecuteFromIdList()

HRESULT WINAPI CControlPanelFolder::ExecuteFromIdList ( LPCITEMIDLIST  pidl)
private

◆ GetAttributesOf()

HRESULT WINAPI CControlPanelFolder::GetAttributesOf ( UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
DWORD rgfInOut 
)
virtual

Definition at line 378 of file CControlPanelFolder.cpp.

379 {
380  HRESULT hr = S_OK;
381  static const DWORD dwControlPanelAttributes =
382  SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_CANLINK;
383 
384  TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
385  this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
386 
387  if (!rgfInOut)
388  return E_INVALIDARG;
389  if (cidl && !apidl)
390  return E_INVALIDARG;
391 
392  if (*rgfInOut == 0)
393  *rgfInOut = ~0;
394 
395  if (!cidl)
396  {
397  *rgfInOut &= dwControlPanelAttributes;
398  }
399  else
400  {
401  while(cidl > 0 && *apidl)
402  {
403  pdump(*apidl);
404  if (_ILIsCPanelStruct(*apidl))
405  *rgfInOut &= SFGAO_CANLINK;
406  else if (_ILIsSpecialFolder(*apidl))
407  m_regFolder->GetAttributesOf(1, apidl, rgfInOut);
408  else
409  ERR("Got an unkown pidl here!\n");
410  apidl++;
411  cidl--;
412  }
413  }
414  /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
415  *rgfInOut &= ~SFGAO_VALIDATE;
416 
417  TRACE("-- result=0x%08x\n", *rgfInOut);
418  return hr;
419 }
HRESULT hr
Definition: shlfolder.c:183
CComPtr< IShellFolder2 > m_regFolder
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
static const DWORD dwControlPanelAttributes
#define E_INVALIDARG
Definition: ddrawi.h:101
BOOL _ILIsCPanelStruct(LPCITEMIDLIST pidl)
Definition: pidl.c:1983
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:51
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248

◆ GetClassID()

HRESULT WINAPI CControlPanelFolder::GetClassID ( CLSID lpClassId)
virtual

Implements IPersist.

Definition at line 601 of file CControlPanelFolder.cpp.

602 {
603  TRACE("(%p)\n", this);
604 
605  if (!lpClassId)
606  return E_POINTER;
607  *lpClassId = CLSID_ControlPanel;
608 
609  return S_OK;
610 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51
#define E_POINTER
Definition: winerror.h:2365

◆ GetCurFolder()

HRESULT WINAPI CControlPanelFolder::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
virtual

Implements IPersistFolder2.

Definition at line 641 of file CControlPanelFolder.cpp.

642 {
643  TRACE("(%p)->(%p)\n", this, pidl);
644 
645  if (!pidl)
646  return E_POINTER;
647  *pidl = ILClone(pidlRoot);
648  return S_OK;
649 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define E_POINTER
Definition: winerror.h:2365

◆ GetDefaultColumn()

HRESULT WINAPI CControlPanelFolder::GetDefaultColumn ( DWORD  dwRes,
ULONG pSort,
ULONG pDisplay 
)
virtual

Implements IShellFolder2.

Definition at line 534 of file CControlPanelFolder.cpp.

535 {
536  TRACE("(%p)\n", this);
537 
538  if (pSort) *pSort = 0;
539  if (pDisplay) *pDisplay = 0;
540  return S_OK;
541 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51

◆ GetDefaultColumnState()

HRESULT WINAPI CControlPanelFolder::GetDefaultColumnState ( UINT  iColumn,
DWORD pcsFlags 
)
virtual

Implements IShellFolder2.

Definition at line 543 of file CControlPanelFolder.cpp.

544 {
545  TRACE("(%p)\n", this);
546 
547  if (!pcsFlags || iColumn >= CONROLPANELSHELLVIEWCOLUMNS) return E_INVALIDARG;
548  *pcsFlags = ControlPanelSFHeader[iColumn].pcsFlags;
549  return S_OK;
550 }
static const shvheader ControlPanelSFHeader[]
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define CONROLPANELSHELLVIEWCOLUMNS
#define S_OK
Definition: intsafe.h:51

◆ GetDefaultSearchGUID()

HRESULT WINAPI CControlPanelFolder::GetDefaultSearchGUID ( GUID pguid)
virtual

Implements IShellFolder2.

Definition at line 522 of file CControlPanelFolder.cpp.

523 {
524  FIXME("(%p)\n", this);
525  return E_NOTIMPL;
526 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetDetailsEx()

HRESULT WINAPI CControlPanelFolder::GetDetailsEx ( PCUITEMID_CHILD  pidl,
const SHCOLUMNID pscid,
VARIANT pv 
)
virtual

Implements IShellFolder2.

Definition at line 552 of file CControlPanelFolder.cpp.

553 {
554  FIXME("(%p)\n", this);
555  return E_NOTIMPL;
556 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetDetailsOf()

HRESULT WINAPI CControlPanelFolder::GetDetailsOf ( PCUITEMID_CHILD  pidl,
UINT  iColumn,
SHELLDETAILS psd 
)
virtual

Implements IShellFolder2.

Definition at line 558 of file CControlPanelFolder.cpp.

559 {
560  if (!psd || iColumn >= CONROLPANELSHELLVIEWCOLUMNS)
561  return E_INVALIDARG;
562 
563  if (!pidl)
564  {
565  psd->fmt = ControlPanelSFHeader[iColumn].fmt;
566  psd->cxChar = ControlPanelSFHeader[iColumn].cxChar;
567  return SHSetStrRet(&psd->str, shell32_hInstance, ControlPanelSFHeader[iColumn].colnameid);
568  }
569  else if (_ILIsSpecialFolder(pidl))
570  {
571  return m_regFolder->GetDetailsOf(pidl, iColumn, psd);
572  }
573  else
574  {
575  PIDLCPanelStruct *pCPanel = _ILGetCPanelPointer(pidl);
576 
577  if (!pCPanel)
578  return E_FAIL;
579 
580  switch(iColumn)
581  {
582  case 0: /* name */
583  return SHSetStrRet(&psd->str, pCPanel->szName + pCPanel->offsDispName);
584  case 1: /* comment */
585  return SHSetStrRet(&psd->str, pCPanel->szName + pCPanel->offsComment);
586  }
587  }
588 
589  return S_OK;
590 }
static PIDLCPanelStruct * _ILGetCPanelPointer(LPCITEMIDLIST pidl)
WCHAR szName[1]
Definition: pidl.h:116
static const shvheader ControlPanelSFHeader[]
CComPtr< IShellFolder2 > m_regFolder
#define E_FAIL
Definition: ddrawi.h:102
STRRET str
Definition: shtypes.idl:108
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
#define E_INVALIDARG
Definition: ddrawi.h:101
WORD offsDispName
Definition: pidl.h:114
WORD offsComment
Definition: pidl.h:115
#define CONROLPANELSHELLVIEWCOLUMNS
#define S_OK
Definition: intsafe.h:51
#define shell32_hInstance

◆ GetDisplayNameOf()

HRESULT WINAPI CControlPanelFolder::GetDisplayNameOf ( PCUITEMID_CHILD  pidl,
DWORD  dwFlags,
LPSTRRET  strRet 
)
virtual

Definition at line 484 of file CControlPanelFolder.cpp.

485 {
486  if (!pidl)
487  return S_FALSE;
488 
489  PIDLCPanelStruct *pCPanel = _ILGetCPanelPointer(pidl);
490 
491  if (pCPanel)
492  {
493  return SHSetStrRet(strRet, pCPanel->szName + pCPanel->offsDispName);
494  }
495  else if (_ILIsSpecialFolder(pidl))
496  {
497  return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
498  }
499 
500  return E_FAIL;
501 }
static PIDLCPanelStruct * _ILGetCPanelPointer(LPCITEMIDLIST pidl)
WCHAR szName[1]
Definition: pidl.h:116
CComPtr< IShellFolder2 > m_regFolder
#define E_FAIL
Definition: ddrawi.h:102
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
#define S_FALSE
Definition: winerror.h:2357
WORD offsDispName
Definition: pidl.h:114
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ GetUIObjectOf()

HRESULT WINAPI CControlPanelFolder::GetUIObjectOf ( HWND  hwndOwner,
UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
REFIID  riid,
UINT prgfInOut,
LPVOID ppvOut 
)
virtual

Definition at line 433 of file CControlPanelFolder.cpp.

435 {
436  LPVOID pObj = NULL;
438 
439  TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
440  this, hwndOwner, cidl, apidl, shdebugstr_guid(&riid), prgfInOut, ppvOut);
441 
442  if (ppvOut) {
443  *ppvOut = NULL;
444 
445  if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1)) {
446 
447  /* HACK: We should use callbacks from CDefaultContextMenu instead of creating one on our own */
448  BOOL bHasCpl = FALSE;
449  for (UINT i = 0; i < cidl; i++)
450  {
451  if(_ILIsCPanelStruct(apidl[i]))
452  {
453  bHasCpl = TRUE;
454  }
455  }
456 
457  if (bHasCpl)
458  hr = ShellObjectCreatorInit<CCPLItemMenu>(cidl, apidl, riid, &pObj);
459  else
460  hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
461  } else if (IsEqualIID(riid, IID_IDataObject) && (cidl >= 1)) {
462  hr = IDataObject_Constructor(hwndOwner, pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
463  } else if ((IsEqualIID(riid, IID_IExtractIconA) || IsEqualIID(riid, IID_IExtractIconW)) && (cidl == 1)) {
464  if (_ILGetCPanelPointer(apidl[0]))
465  hr = CCPLExtractIcon_CreateInstance(this, apidl[0], riid, &pObj);
466  else
467  hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
468  } else {
469  hr = E_NOINTERFACE;
470  }
471 
472  if (SUCCEEDED(hr) && !pObj)
473  hr = E_OUTOFMEMORY;
474 
475  *ppvOut = pObj;
476  }
477  TRACE("(%p)->hr=0x%08x\n", this, hr);
478  return hr;
479 }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
REFIID riid
Definition: precomp.h:44
static PIDLCPanelStruct * _ILGetCPanelPointer(LPCITEMIDLIST pidl)
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
HRESULT CCPLExtractIcon_CreateInstance(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
CComPtr< IShellFolder2 > m_regFolder
const GUID IID_IDataObject
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
if SUCCEEDED(hr)
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
BOOL _ILIsCPanelStruct(LPCITEMIDLIST pidl)
Definition: pidl.c:1983
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ Initialize()

HRESULT WINAPI CControlPanelFolder::Initialize ( PCIDLIST_ABSOLUTE  pidl)
virtual

Implements IPersistFolder.

Definition at line 617 of file CControlPanelFolder.cpp.

618 {
619  if (pidlRoot)
621 
622  pidlRoot = ILClone(pidl);
623 
624  /* Create the inner reg folder */
625  HRESULT hr;
626  static const WCHAR* pszCPanelPath = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}";
627  hr = CRegFolder_CreateInstance(&CLSID_ControlPanel,
628  pidlRoot,
629  pszCPanelPath,
630  L"ControlPanel",
632  if (FAILED_UNEXPECTEDLY(hr))
633  return hr;
634 
635  return S_OK;
636 }
HRESULT hr
Definition: shlfolder.c:183
CComPtr< IShellFolder2 > m_regFolder
#define IID_PPV_ARG(Itype, ppType)
HRESULT CRegFolder_CreateInstance(const GUID *pGuid, LPCITEMIDLIST pidlRoot, LPCWSTR lpszPath, LPCWSTR lpszEnumKeyName, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:785
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:51
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331

◆ MapColumnToSCID()

HRESULT WINAPI CControlPanelFolder::MapColumnToSCID ( UINT  column,
SHCOLUMNID pscid 
)
virtual

Implements IShellFolder2.

Definition at line 592 of file CControlPanelFolder.cpp.

593 {
594  FIXME("(%p)\n", this);
595  return E_NOTIMPL;
596 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ParseDisplayName()

HRESULT WINAPI CControlPanelFolder::ParseDisplayName ( HWND  hwndOwner,
LPBC  pbc,
LPOLESTR  lpszDisplayName,
DWORD pchEaten,
PIDLIST_RELATIVE ppidl,
DWORD pdwAttributes 
)
virtual

Definition at line 264 of file CControlPanelFolder.cpp.

271 {
272  /* We only support parsing guid names */
273  return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes);
274 }
CComPtr< IShellFolder2 > m_regFolder

◆ SetNameOf()

HRESULT WINAPI CControlPanelFolder::SetNameOf ( HWND  hwndOwner,
PCUITEMID_CHILD  pidl,
LPCOLESTR  lpName,
DWORD  dwFlags,
PITEMID_CHILD pPidlOut 
)
virtual

Implements IShellFolder.

Definition at line 515 of file CControlPanelFolder.cpp.

517 {
518  FIXME("(%p)->(%p,pidl=%p,%s,%u,%p)\n", this, hwndOwner, pidl, debugstr_w(lpName), dwFlags, pPidlOut);
519  return E_FAIL;
520 }
_In_ LPCSTR lpName
Definition: winbase.h:2752
#define E_FAIL
Definition: ddrawi.h:102
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

Member Data Documentation

◆ dwAttributes

int CControlPanelFolder::dwAttributes
private

Definition at line 34 of file CControlPanelFolder.h.

◆ m_regFolder

CComPtr<IShellFolder2> CControlPanelFolder::m_regFolder
private

◆ pidlRoot

LPITEMIDLIST CControlPanelFolder::pidlRoot
private

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