ReactOS 0.4.15-dev-5667-ged97270
CDrivesFolder Class Reference

#include <CDrivesFolder.h>

Inheritance diagram for CDrivesFolder:
Collaboration diagram for CDrivesFolder:

Public Member Functions

 CDrivesFolder ()
 
 ~CDrivesFolder ()
 
HRESULT WINAPI FinalConstruct ()
 
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)
 
virtual HRESULT WINAPI CallBack (IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- 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 ()
 
HRESULT GetDefaultSearchGUID ([out] GUID *lpguid)
 
HRESULT EnumSearches ([out] IEnumExtraSearch **ppenum)
 
HRESULT GetDefaultColumn ([in] DWORD dwReserved, [out] ULONG *pSort, [out] ULONG *pDisplay)
 
HRESULT GetDefaultColumnState ([in] UINT iColumn, [out] SHCOLSTATEF *pcsFlags)
 
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)
 
HRESULT MapColumnToSCID ([in] UINT iColumn, [in] SHCOLUMNID *pscid)
 
- 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 CompareIDs ([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
 
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)
 
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 ()
 
HRESULT GetCurFolder ([out] PIDLIST_ABSOLUTE *ppidl)
 
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidl)
 
HRESULT GetClassID ([out] CLSID *pClassID)
 
HRESULT CallBack ([in] IShellFolder *psf, [in] HWND hwndOwner, [in] IDataObject *pdtobj, [in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam)
 

Private Attributes

LPITEMIDLIST pidlRoot
 
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
 
typedef ULONG SFGAOF
 
- 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
 

Detailed Description

Definition at line 26 of file CDrivesFolder.h.

Constructor & Destructor Documentation

◆ CDrivesFolder()

CDrivesFolder::CDrivesFolder ( )

Definition at line 586 of file CDrivesFolder.cpp.

587{
588 pidlRoot = NULL;
589}
LPITEMIDLIST pidlRoot
Definition: CDrivesFolder.h:35
#define NULL
Definition: types.h:112

◆ ~CDrivesFolder()

CDrivesFolder::~CDrivesFolder ( )

Definition at line 591 of file CDrivesFolder.cpp.

592{
593 TRACE ("-- destroying IShellFolder(%p)\n", this);
595}
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
#define TRACE(s)
Definition: solgame.cpp:4

Member Function Documentation

◆ BindToObject()

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

Definition at line 694 of file CDrivesFolder.cpp.

695{
696 TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", this,
697 pidl, pbcReserved, shdebugstr_guid(&riid), ppvOut);
698
699 if (!pidl)
700 return E_INVALIDARG;
701
702 if (_ILIsSpecialFolder(pidl))
703 return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);
704
705 CHAR* pchDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
706
707 PERSIST_FOLDER_TARGET_INFO pfti = {0};
708 pfti.dwAttributes = -1;
709 pfti.csidl = -1;
710 pfti.szTargetParsingName[0] = *pchDrive;
711 pfti.szTargetParsingName[1] = L':';
712 pfti.szTargetParsingName[2] = L'\\';
713
715 &pfti,
716 pidl,
717 &CLSID_ShellFSFolder,
718 riid,
719 ppvOut);
721 return hr;
722
723 return S_OK;
724}
CComPtr< IShellFolder2 > m_regFolder
Definition: CDrivesFolder.h:36
#define E_INVALIDARG
Definition: ddrawi.h:101
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:427
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define L(x)
Definition: ntvdm.h:50
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2187
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:160
HRESULT hr
Definition: shlfolder.c:183
char CHAR
Definition: xmlstorage.h:175

Referenced by GetUIObjectOf().

◆ BindToStorage()

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

Definition at line 729 of file CDrivesFolder.cpp.

730{
731 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this,
732 pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
733
734 *ppvOut = NULL;
735 return E_NOTIMPL;
736}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CallBack()

HRESULT WINAPI CDrivesFolder::CallBack ( IShellFolder psf,
HWND  hwndOwner,
IDataObject pdtobj,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
virtual

Implements IContextMenuCB.

Definition at line 1240 of file CDrivesFolder.cpp.

1241{
1242 if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
1243 return S_OK;
1244
1245 /* no data object means no selection */
1246 if (!pdtobj)
1247 {
1248 if (uMsg == DFM_INVOKECOMMAND && wParam == 1) // #1
1249 {
1250 // "System" properties
1251 ShellExecuteW(hwndOwner,
1252 NULL,
1253 L"rundll32.exe",
1254 L"shell32.dll,Control_RunDLL sysdm.cpl",
1255 NULL,
1257 }
1258 else if (uMsg == DFM_MERGECONTEXTMENU)
1259 {
1260 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1261 HMENU hpopup = CreatePopupMenu();
1262 _InsertMenuItemW(hpopup, 0, TRUE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED); // #0
1264 Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu++, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1265 DestroyMenu(hpopup);
1266 }
1267
1268 return S_OK;
1269 }
1270
1272 return S_OK;
1273
1274 return Shell_DefaultContextMenuCallBack(this, pdtobj);
1275}
#define IDS_PROPERTIES
Definition: resource.h:101
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
HRESULT WINAPI Shell_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdtobj)
Definition: shlfolder.cpp:462
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2346
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
#define MM_ADDSEPARATOR
Definition: shlobj.h:2380
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2464
HMENU hmenu
Definition: shlobj.h:1315
UINT idCmdLast
Definition: shlobj.h:1318
UINT idCmdFirst
Definition: shlobj.h:1317
UINT indexMenu
Definition: shlobj.h:1316
#define SW_SHOWNORMAL
Definition: winuser.h:764
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
#define MFT_SEPARATOR
Definition: winuser.h:739
#define MFS_ENABLED
Definition: winuser.h:745
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MFT_STRING
Definition: winuser.h:741
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ CompareIDs()

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

Implements IShellFolder.

Definition at line 742 of file CDrivesFolder.cpp.

743{
745
746 if (!pidl1 || !pidl2)
747 {
748 ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
749 return E_INVALIDARG;
750 }
751
752 if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
753 return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
754
755 if (!_ILIsDrive(pidl1) || !_ILIsDrive(pidl2) || LOWORD(lParam) >= MYCOMPUTERSHELLVIEWCOLUMNS)
756 return E_INVALIDARG;
757
758 CHAR* pszDrive1 = _ILGetDataPointer(pidl1)->u.drive.szDriveName;
759 CHAR* pszDrive2 = _ILGetDataPointer(pidl2)->u.drive.szDriveName;
760
761 int result;
762 switch(LOWORD(lParam))
763 {
764 case 0: /* name */
765 {
766 result = stricmp(pszDrive1, pszDrive2);
768 break;
769 }
770 case 1: /* Type */
771 {
772 /* We want to return immediately because SHELL32_CompareDetails also compares children. */
773 return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
774 }
775 case 2: /* Size */
776 case 3: /* Size Available */
777 {
778 ULARGE_INTEGER Drive1Available, Drive1Total, Drive2Available, Drive2Total;
779
780 if (GetVolumeInformationA(pszDrive1, NULL, 0, NULL, NULL, NULL, NULL, 0))
781 GetDiskFreeSpaceExA(pszDrive1, &Drive1Available, &Drive1Total, NULL);
782 else
783 Drive1Available.QuadPart = Drive1Total.QuadPart = 0;
784
785 if (GetVolumeInformationA(pszDrive2, NULL, 0, NULL, NULL, NULL, NULL, 0))
786 GetDiskFreeSpaceExA(pszDrive2, &Drive2Available, &Drive2Total, NULL);
787 else
788 Drive2Available.QuadPart = Drive2Total.QuadPart = 0;
789
790 LARGE_INTEGER Diff;
791 if (lParam == 3) /* Size */
792 Diff.QuadPart = Drive1Total.QuadPart - Drive2Total.QuadPart;
793 else /* Size available */
794 Diff.QuadPart = Drive1Available.QuadPart - Drive2Available.QuadPart;
795
797 break;
798 }
799 case 4: /* comments */
801 break;
802 default:
803 return E_INVALIDARG;
804 }
805
806 if (HRESULT_CODE(hres) == 0)
807 return SHELL32_CompareChildren(this, lParam, pidl1, pidl2);
808
809 return hres;
810}
#define MYCOMPUTERSHELLVIEWCOLUMNS
#define ERR(fmt,...)
Definition: debug.h:110
#define stricmp(_String1, _String2)
Definition: compat.h:24
BOOL WINAPI GetDiskFreeSpaceExA(IN LPCSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:313
BOOL WINAPI GetVolumeInformationA(IN LPCSTR lpRootPathName, IN LPSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
Definition: volume.c:32
GLuint64EXT * result
Definition: glext.h:11304
HRESULT hres
Definition: protocol.c:465
#define LOWORD(l)
Definition: pedump.c:82
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1964
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:561
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:216
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:239
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
LONGLONG QuadPart
Definition: typedefs.h:114
#define HRESULT_CODE(hr)
Definition: winerror.h:76

◆ CreateViewObject()

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

Definition at line 815 of file CDrivesFolder.cpp.

816{
817 CComPtr<IShellView> pShellView;
819
820 TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
821 hwndOwner, shdebugstr_guid (&riid), ppvOut);
822
823 if (!ppvOut)
824 return hr;
825
826 *ppvOut = NULL;
827
828 if (IsEqualIID(riid, IID_IDropTarget))
829 {
830 WARN("IDropTarget not implemented\n");
831 hr = E_NOTIMPL;
832 }
833 else if (IsEqualIID(riid, IID_IContextMenu))
834 {
835 HKEY hKeys[16];
836 UINT cKeys = 0;
837 AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
838
839 DEFCONTEXTMENU dcm;
840 dcm.hwnd = hwndOwner;
841 dcm.pcmcb = this;
842 dcm.pidlFolder = pidlRoot;
843 dcm.psf = this;
844 dcm.cidl = 0;
845 dcm.apidl = NULL;
846 dcm.cKeys = cKeys;
847 dcm.aKeys = hKeys;
849 hr = SHCreateDefaultContextMenu(&dcm, riid, ppvOut);
850 }
851 else if (IsEqualIID(riid, IID_IShellView))
852 {
853 SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
854 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
855 }
856 TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
857 return hr;
858}
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3931
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv)
#define WARN(fmt,...)
Definition: debug.h:112
unsigned int UINT
Definition: ndis.h:50
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
void AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:268
struct _SFV_CREATE SFV_CREATE
IContextMenuCB * pcmcb
Definition: shlobj.h:2402
IShellFolder * psf
Definition: shlobj.h:2404
IUnknown * punkAssociationInfo
Definition: shlobj.h:2407
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2406
const HKEY * aKeys
Definition: shlobj.h:2409
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2403

◆ EnumObjects()

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

Definition at line 683 of file CDrivesFolder.cpp.

684{
685 CComPtr<IEnumIDList> pRegEnumerator;
686 m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
687
688 return ShellObjectCreatorInit<CDrivesFolderEnum>(hwndOwner, dwFlags, pRegEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
689}
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define IID_PPV_ARG(Itype, ppType)

◆ EnumSearches()

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

Implements IShellFolder2.

Definition at line 1099 of file CDrivesFolder.cpp.

1100{
1101 FIXME ("(%p)\n", this);
1102 return E_NOTIMPL;
1103}

◆ FinalConstruct()

HRESULT WINAPI CDrivesFolder::FinalConstruct ( )

Definition at line 597 of file CDrivesFolder.cpp.

598{
599 pidlRoot = _ILCreateMyComputer(); /* my qualified pidl */
600 if (pidlRoot == NULL)
601 return E_OUTOFMEMORY;
602
603 HRESULT hr = CRegFolder_CreateInstance(&CLSID_MyComputer,
604 pidlRoot,
605 L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
606 L"MyComputer",
608
609 return hr;
610}
HRESULT CRegFolder_CreateInstance(const GUID *pGuid, LPCITEMIDLIST pidlRoot, LPCWSTR lpszPath, LPCWSTR lpszEnumKeyName, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:789
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1613

◆ GetAttributesOf()

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

Definition at line 863 of file CDrivesFolder.cpp.

864{
865 TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
866 this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
867
868 if (cidl && !apidl)
869 return E_INVALIDARG;
870
871 if (*rgfInOut == 0)
872 *rgfInOut = ~0;
873
874 /* FIXME: always add SFGAO_CANLINK */
875 if(cidl == 0)
876 *rgfInOut &= dwComputerAttributes;
877 else
878 {
879 for (UINT i = 0; i < cidl; ++i)
880 {
881 if (_ILIsDrive(apidl[i]))
882 *rgfInOut &= dwDriveAttributes;
883 else if (_ILIsControlPanel(apidl[i]))
884 *rgfInOut &= dwControlPanelAttributes;
885 else if (_ILIsSpecialFolder(*apidl))
886 m_regFolder->GetAttributesOf(1, &apidl[i], rgfInOut);
887 else
888 ERR("Got unknown pidl type!\n");
889 }
890 }
891
892 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
893 *rgfInOut &= ~SFGAO_VALIDATE;
894
895 TRACE ("-- result=0x%08x\n", *rgfInOut);
896 return S_OK;
897}
static const DWORD dwComputerAttributes
static const DWORD dwDriveAttributes
static const DWORD dwControlPanelAttributes
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
BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
Definition: pidl.c:1920

◆ GetClassID()

HRESULT WINAPI CDrivesFolder::GetClassID ( CLSID lpClassId)
virtual

Implements IPersist.

Definition at line 1202 of file CDrivesFolder.cpp.

1203{
1204 TRACE ("(%p)\n", this);
1205
1206 if (!lpClassId)
1207 return E_POINTER;
1208
1209 *lpClassId = CLSID_MyComputer;
1210 return S_OK;
1211}
#define E_POINTER
Definition: winerror.h:2365

◆ GetCurFolder()

HRESULT WINAPI CDrivesFolder::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
virtual

Implements IPersistFolder2.

Definition at line 1226 of file CDrivesFolder.cpp.

1227{
1228 TRACE("(%p)->(%p)\n", this, pidl);
1229
1230 if (!pidl)
1231 return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
1232
1233 *pidl = ILClone(pidlRoot);
1234 return S_OK;
1235}
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228

◆ GetDefaultColumn()

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

Implements IShellFolder2.

Definition at line 1105 of file CDrivesFolder.cpp.

1106{
1107 TRACE ("(%p)\n", this);
1108
1109 if (pSort)
1110 *pSort = 0;
1111 if (pDisplay)
1112 *pDisplay = 0;
1113 return S_OK;
1114}

◆ GetDefaultColumnState()

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

Implements IShellFolder2.

Definition at line 1116 of file CDrivesFolder.cpp.

1117{
1118 TRACE ("(%p)\n", this);
1119
1120 if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
1121 return E_INVALIDARG;
1122 *pcsFlags = MyComputerSFHeader[iColumn].pcsFlags;
1123 return S_OK;
1124}
static const shvheader MyComputerSFHeader[]

◆ GetDefaultSearchGUID()

HRESULT WINAPI CDrivesFolder::GetDefaultSearchGUID ( GUID pguid)
virtual

Implements IShellFolder2.

Definition at line 1093 of file CDrivesFolder.cpp.

1094{
1095 FIXME ("(%p)\n", this);
1096 return E_NOTIMPL;
1097}

◆ GetDetailsEx()

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

Implements IShellFolder2.

Definition at line 1126 of file CDrivesFolder.cpp.

1127{
1128 FIXME ("(%p)\n", this);
1129 return E_NOTIMPL;
1130}

◆ GetDetailsOf()

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

Implements IShellFolder2.

Definition at line 1132 of file CDrivesFolder.cpp.

1133{
1134 HRESULT hr;
1135
1136 TRACE ("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
1137
1138 if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
1139 return E_INVALIDARG;
1140
1141 if (!pidl)
1142 {
1143 psd->fmt = MyComputerSFHeader[iColumn].fmt;
1144 psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
1145 return SHSetStrRet(&psd->str, MyComputerSFHeader[iColumn].colnameid);
1146 }
1147 else if (!_ILIsDrive(pidl))
1148 {
1149 return m_regFolder->GetDetailsOf(pidl, iColumn, psd);
1150 }
1151 else
1152 {
1153 ULARGE_INTEGER ulTotalBytes, ulFreeBytes;
1154 CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
1155 UINT DriveType = GetDriveTypeA(pszDrive);
1158
1159 switch (iColumn)
1160 {
1161 case 0: /* name */
1163 break;
1164 case 1: /* type */
1165 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
1166 hr = SHSetStrRet(&psd->str, IDS_DRIVE_REMOVABLE);
1167 else
1168 hr = SHSetStrRet(&psd->str, iDriveTypeIds[DriveType]);
1169 break;
1170 case 2: /* total size */
1171 case 3: /* free size */
1172 psd->str.cStr[0] = 0x00;
1173 psd->str.uType = STRRET_CSTR;
1174 if (GetVolumeInformationA(pszDrive, NULL, 0, NULL, NULL, NULL, NULL, 0))
1175 {
1176 GetDiskFreeSpaceExA(pszDrive, &ulFreeBytes, &ulTotalBytes, NULL);
1177 if (iColumn == 2)
1178 StrFormatByteSize64A(ulTotalBytes.QuadPart, psd->str.cStr, MAX_PATH);
1179 else
1180 StrFormatByteSize64A(ulFreeBytes.QuadPart, psd->str.cStr, MAX_PATH);
1181 }
1182 hr = S_OK;
1183 break;
1184 case 4: /* FIXME: comments */
1185 hr = SHSetStrRet(&psd->str, "");
1186 break;
1187 }
1188 }
1189
1190 return hr;
1191}
static int iDriveTypeIds[7]
UINT DriveType
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
#define MAX_PATH
Definition: compat.h:34
UINT WINAPI GetDriveTypeA(IN LPCSTR lpRootPathName)
Definition: disk.c:468
LPSTR WINAPI StrFormatByteSize64A(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
Definition: string.c:2488
BOOL IsDriveFloppyA(LPCSTR pszDriveRoot)
Definition: drvdefext.cpp:372
#define IDS_DRIVE_REMOVABLE
Definition: shresdef.h:117
@ STRRET_CSTR
Definition: shtypes.idl:87
STRRET str
Definition: shtypes.idl:108
char cStr[MAX_PATH]
Definition: shtypes.idl:98
UINT uType
Definition: shtypes.idl:93
#define DRIVE_RAMDISK
Definition: winbase.h:255
#define DRIVE_FIXED
Definition: winbase.h:252
#define DRIVE_REMOVABLE
Definition: winbase.h:251

◆ GetDisplayNameOf()

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

Definition at line 968 of file CDrivesFolder.cpp.

969{
970 LPWSTR pszPath;
971 HRESULT hr = S_OK;
972
973 TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
974 pdump (pidl);
975
976 if (!strRet)
977 return E_INVALIDARG;
978
979 if (!_ILIsPidlSimple (pidl))
980 {
981 return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
982 }
983 else if (_ILIsSpecialFolder(pidl))
984 {
985 return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
986 }
987 else if (!_ILIsDrive(pidl))
988 {
989 ERR("Wrong pidl type\n");
990 return E_INVALIDARG;
991 }
992
993 pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
994 if (!pszPath)
995 return E_OUTOFMEMORY;
996
997 pszPath[0] = 0;
998
999 _ILSimpleGetTextW(pidl, pszPath, MAX_PATH); /* append my own path */
1000 /* long view "lw_name (C:)" */
1001 if (!(dwFlags & SHGDN_FORPARSING))
1002 {
1003 WCHAR wszDrive[18] = {0};
1004
1005 lstrcpynW(wszDrive, pszPath, 4);
1006 pszPath[0] = L'\0';
1007
1008 if (!SUCCEEDED(getLabelForDrive(wszDrive, pszPath)))
1009 {
1010 DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags;
1011
1012 GetVolumeInformationW(wszDrive, pszPath,
1013 MAX_PATH - 7,
1014 &dwVolumeSerialNumber,
1015 &dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
1016 pszPath[MAX_PATH-1] = L'\0';
1017
1018 if (!wcslen(pszPath))
1019 {
1020 UINT DriveType, ResourceId;
1021 DriveType = GetDriveTypeW(wszDrive);
1022
1023 switch (DriveType)
1024 {
1025 case DRIVE_FIXED:
1026 ResourceId = IDS_DRIVE_FIXED;
1027 break;
1028 case DRIVE_REMOTE:
1029 ResourceId = IDS_DRIVE_NETWORK;
1030 break;
1031 case DRIVE_CDROM:
1032 ResourceId = IDS_DRIVE_CDROM;
1033 break;
1034 default:
1035 ResourceId = 0;
1036 }
1037
1038 if (ResourceId)
1039 {
1040 dwFileSystemFlags = LoadStringW(shell32_hInstance, ResourceId, pszPath, MAX_PATH);
1041 if (dwFileSystemFlags > MAX_PATH - 7)
1042 pszPath[MAX_PATH-7] = L'\0';
1043 }
1044 }
1045 }
1046 wcscat (pszPath, L" (");
1047 wszDrive[2] = L'\0';
1048 wcscat (pszPath, wszDrive);
1049 wcscat (pszPath, L")");
1050 }
1051
1052 if (SUCCEEDED(hr))
1053 {
1054 strRet->uType = STRRET_WSTR;
1055 strRet->pOleStr = pszPath;
1056 }
1057 else
1058 CoTaskMemFree(pszPath);
1059
1060 TRACE("-- (%p)->(%s)\n", this, strRet->uType == STRRET_CSTR ? strRet->cStr : debugstr_w(strRet->pOleStr));
1061 return hr;
1062}
static HRESULT getLabelForDrive(LPWSTR wszPath, LPWSTR wszLabel)
#define shell32_hInstance
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:311
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
#define lstrcpynW
Definition: compat.h:738
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
Definition: volume.c:226
unsigned long DWORD
Definition: ntddk_ex.h:95
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_w
Definition: kernel32.h:32
#define DRIVE_CDROM
Definition: machpc98.h:115
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2107
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:198
#define IDS_DRIVE_CDROM
Definition: shresdef.h:114
#define IDS_DRIVE_FIXED
Definition: shresdef.h:113
#define IDS_DRIVE_NETWORK
Definition: shresdef.h:115
@ STRRET_WSTR
Definition: shtypes.idl:85
LPWSTR pOleStr
Definition: shtypes.idl:96
#define DRIVE_REMOTE
Definition: winbase.h:253
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by GetDetailsOf().

◆ GetUIObjectOf()

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

Definition at line 911 of file CDrivesFolder.cpp.

914{
915 LPVOID pObj = NULL;
917
918 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
919 hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
920
921 if (!ppvOut)
922 return hr;
923
924 *ppvOut = NULL;
925
926 if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
927 {
928 if (_ILIsDrive(apidl[0]))
929 hr = CDrivesContextMenu_CreateInstance(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), (IContextMenu**)&pObj);
930 else
931 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
932 }
933 else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
934 {
935 hr = IDataObject_Constructor (hwndOwner,
936 pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
937 }
938 else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
939 {
940 if (_ILIsDrive(apidl[0]))
941 hr = CDrivesExtractIcon_CreateInstance(this, apidl[0], riid, &pObj);
942 else
943 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
944 }
945 else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
946 {
947 CComPtr<IShellFolder> psfChild;
948 hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
950 return hr;
951
952 return psfChild->CreateViewObject(NULL, riid, ppvOut);
953 }
954 else
956
957 if (SUCCEEDED(hr) && !pObj)
959
960 *ppvOut = pObj;
961 TRACE ("(%p)->hr=0x%08x\n", this, hr);
962 return hr;
963}
HRESULT CDrivesContextMenu_CreateInstance(PCIDLIST_ABSOLUTE pidlFolder, HWND hwnd, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IShellFolder *psf, IContextMenu **ppcm)
HRESULT CDrivesExtractIcon_CreateInstance(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
const GUID IID_IDataObject
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ Initialize()

HRESULT WINAPI CDrivesFolder::Initialize ( PCIDLIST_ABSOLUTE  pidl)
virtual

Implements IPersistFolder.

Definition at line 1218 of file CDrivesFolder.cpp.

1219{
1220 return S_OK;
1221}

◆ MapColumnToSCID()

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

Implements IShellFolder2.

Definition at line 1193 of file CDrivesFolder.cpp.

1194{
1195 FIXME("(%p)\n", this);
1196 return E_NOTIMPL;
1197}

◆ ParseDisplayName()

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

Definition at line 615 of file CDrivesFolder.cpp.

617{
619 LPCWSTR szNext = NULL;
620 LPITEMIDLIST pidlTemp = NULL;
621 INT nDriveNumber;
622
623 TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
624 hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
625 pchEaten, ppidl, pdwAttributes);
626
627 *ppidl = 0;
628 if (pchEaten)
629 *pchEaten = 0; /* strange but like the original */
630
631 /* handle CLSID paths */
632 if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
633 return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes);
634
635 nDriveNumber = PathGetDriveNumberW(lpszDisplayName);
636 if (nDriveNumber < 0)
637 return E_INVALIDARG;
638
639 /* check if this drive actually exists */
640 if ((::GetLogicalDrives() & (1 << nDriveNumber)) == 0)
641 {
643 }
644
645 pidlTemp = _ILCreateDrive(lpszDisplayName);
646 if (!pidlTemp)
647 return E_OUTOFMEMORY;
648
649 if (lpszDisplayName[2] == L'\\')
650 {
651 szNext = &lpszDisplayName[3];
652 }
653
654 if (szNext && *szNext)
655 {
656 hr = SHELL32_ParseNextElement (this, hwndOwner, pbc, &pidlTemp,
657 (LPOLESTR) szNext, pchEaten, pdwAttributes);
658 }
659 else
660 {
661 hr = S_OK;
662 if (pdwAttributes && *pdwAttributes)
663 {
664 if (_ILIsDrive(pidlTemp))
665 *pdwAttributes &= dwDriveAttributes;
666 else if (_ILIsSpecialFolder(pidlTemp))
667 m_regFolder->GetAttributesOf(1, &pidlTemp, pdwAttributes);
668 else
669 ERR("Got an unkown pidl here!\n");
670 }
671 }
672
673 *ppidl = pidlTemp;
674
675 TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
676
677 return hr;
678}
int WINAPI PathGetDriveNumberW(const WCHAR *path)
Definition: path.c:553
static LPOLESTR
Definition: stg_prop.c:27
LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)
Definition: pidl.c:1808
HRESULT SHELL32_ParseNextElement(IShellFolder2 *psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST *pidlInOut, LPOLESTR szNext, DWORD *pEaten, DWORD *pdwAttributes)
Definition: shlfolder.cpp:71
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
int32_t INT
Definition: typedefs.h:58
DWORD WINAPI GetLogicalDrives(void)
Definition: disk.c:110
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_INVALID_DRIVE
Definition: winerror.h:118
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ SetNameOf()

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

Implements IShellFolder.

Definition at line 1076 of file CDrivesFolder.cpp.

1078{
1079 WCHAR szName[30];
1080
1081 if (_ILIsDrive(pidl))
1082 {
1085 if (pPidlOut)
1086 *pPidlOut = _ILCreateDrive(szName);
1087 return S_OK;
1088 }
1089
1090 return m_regFolder->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
1091}
BOOL WINAPI SetVolumeLabelW(IN LPCWSTR lpRootPathName, IN LPCWSTR lpVolumeName OPTIONAL)
Definition: volume.c:503
static const WCHAR szName[]
Definition: powrprof.c:45
#define _countof(array)
Definition: sndvol32.h:68
_In_ LPCSTR lpName
Definition: winbase.h:2776

Member Data Documentation

◆ m_regFolder

◆ pidlRoot

LPITEMIDLIST CDrivesFolder::pidlRoot
private

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