2 * Virtual Workplace folder
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998, 1999, 2002 Juergen Schmied
6 * Copyright 2009 Andrew Hill
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 WINE_DEFAULT_DEBUG_CHANNEL (shell
);
28 CDrivesFolder should create a CRegFolder to represent the virtual items that exist only in
29 the registry. The CRegFolder is aggregated by the CDrivesFolder.
30 The CDrivesFolderEnum class should enumerate only drives on the system. Since the CRegFolder
31 implementation of IShellFolder::EnumObjects enumerates the virtual items, the
32 CDrivesFolderEnum is only responsible for returning the physical items.
34 2. At least on my XP system, the drive pidls returned are of type PT_DRIVE1, not PT_DRIVE
35 3. The parsing name returned for my computer is incorrect. It should be "My Computer"
38 /***********************************************************************
39 * IShellFolder implementation
42 class CDrivesFolderEnum
:
43 public CEnumIDListBase
48 HRESULT WINAPI
Initialize(HWND hwndOwner
, DWORD dwFlags
);
49 BOOL
CreateMyCompEnumList(DWORD dwFlags
);
51 BEGIN_COM_MAP(CDrivesFolderEnum
)
52 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList
, IEnumIDList
)
56 /***********************************************************************
57 * IShellFolder [MyComputer] implementation
60 static const shvheader MyComputerSFHeader
[] = {
61 {IDS_SHV_COLUMN1
, SHCOLSTATE_TYPE_STR
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_LEFT
, 15},
62 {IDS_SHV_COLUMN3
, SHCOLSTATE_TYPE_STR
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_LEFT
, 10},
63 {IDS_SHV_COLUMN6
, SHCOLSTATE_TYPE_STR
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_RIGHT
, 10},
64 {IDS_SHV_COLUMN7
, SHCOLSTATE_TYPE_STR
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_RIGHT
, 10},
67 #define MYCOMPUTERSHELLVIEWCOLUMNS 4
69 static const DWORD dwComputerAttributes
=
70 SFGAO_CANRENAME
| SFGAO_CANDELETE
| SFGAO_HASPROPSHEET
| SFGAO_DROPTARGET
|
71 SFGAO_FILESYSANCESTOR
| SFGAO_FOLDER
| SFGAO_HASSUBFOLDER
| SFGAO_CANLINK
;
72 static const DWORD dwControlPanelAttributes
=
73 SFGAO_HASSUBFOLDER
| SFGAO_FOLDER
| SFGAO_CANLINK
;
74 static const DWORD dwDriveAttributes
=
75 SFGAO_HASSUBFOLDER
| SFGAO_FILESYSTEM
| SFGAO_FOLDER
| SFGAO_FILESYSANCESTOR
|
76 SFGAO_DROPTARGET
| SFGAO_HASPROPSHEET
| SFGAO_CANRENAME
| SFGAO_CANLINK
;
78 CDrivesFolderEnum::CDrivesFolderEnum()
82 CDrivesFolderEnum::~CDrivesFolderEnum()
86 HRESULT WINAPI
CDrivesFolderEnum::Initialize(HWND hwndOwner
, DWORD dwFlags
)
88 if (CreateMyCompEnumList(dwFlags
) == FALSE
)
94 /**************************************************************************
95 * CDrivesFolderEnum::CreateMyCompEnumList()
98 BOOL
CDrivesFolderEnum::CreateMyCompEnumList(DWORD dwFlags
)
101 static const WCHAR MyComputer_NameSpaceW
[] = L
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\Namespace";
103 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags
);
105 /* enumerate the folders */
106 if (dwFlags
& SHCONTF_FOLDERS
)
108 WCHAR wszDriveName
[] = {'A', ':', '\\', '\0'};
109 DWORD dwDrivemap
= GetLogicalDrives();
113 while (bRet
&& wszDriveName
[0] <= 'Z')
115 if(dwDrivemap
& 0x00000001L
)
116 bRet
= AddToEnumList(_ILCreateDrive(wszDriveName
));
118 dwDrivemap
= dwDrivemap
>> 1;
121 TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n", this);
122 for (i
= 0; i
< 2; i
++)
124 if (bRet
&& ERROR_SUCCESS
== RegOpenKeyExW(i
== 0 ? HKEY_LOCAL_MACHINE
: HKEY_CURRENT_USER
,
125 MyComputer_NameSpaceW
, 0, KEY_READ
, &hKey
))
134 dwSize
= sizeof(wszBuf
) / sizeof(wszBuf
[0]);
135 ErrorCode
= RegEnumKeyExW(hKey
, j
, wszBuf
, &dwSize
, 0, NULL
, NULL
, NULL
);
136 if (ERROR_SUCCESS
== ErrorCode
)
138 if (wszBuf
[0] != L
'{')
140 dwSize
= sizeof(wszBuf
);
141 RegGetValueW(hKey
, wszBuf
, NULL
, RRF_RT_REG_SZ
, NULL
, wszBuf
, &dwSize
);
144 /* FIXME: shell extensions - the type should be PT_SHELLEXT (tested) */
145 pidl
= _ILCreateGuidFromStrW(wszBuf
);
147 bRet
= AddToEnumList(pidl
);
149 ERR("Invalid MyComputer namespace extesion: %s\n", wszBuf
);
152 else if (ERROR_NO_MORE_ITEMS
== ErrorCode
)
164 CDrivesFolder::CDrivesFolder()
169 CDrivesFolder::~CDrivesFolder()
171 TRACE ("-- destroying IShellFolder(%p)\n", this);
175 HRESULT WINAPI
CDrivesFolder::FinalConstruct()
177 pidlRoot
= _ILCreateMyComputer(); /* my qualified pidl */
178 if (pidlRoot
== NULL
)
179 return E_OUTOFMEMORY
;
184 /**************************************************************************
185 * CDrivesFolder::ParseDisplayName
187 HRESULT WINAPI
CDrivesFolder::ParseDisplayName(HWND hwndOwner
, LPBC pbc
, LPOLESTR lpszDisplayName
,
188 DWORD
* pchEaten
, PIDLIST_RELATIVE
* ppidl
, DWORD
* pdwAttributes
)
190 HRESULT hr
= E_INVALIDARG
;
191 LPCWSTR szNext
= NULL
;
192 LPITEMIDLIST pidlTemp
= NULL
;
194 TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
195 hwndOwner
, pbc
, lpszDisplayName
, debugstr_w (lpszDisplayName
),
196 pchEaten
, ppidl
, pdwAttributes
);
200 *pchEaten
= 0; /* strange but like the original */
202 /* handle CLSID paths */
203 if (lpszDisplayName
[0] == ':' && lpszDisplayName
[1] == ':')
204 return SH_ParseGuidDisplayName(this, hwndOwner
, pbc
, lpszDisplayName
, pchEaten
, ppidl
, pdwAttributes
);
206 if (PathGetDriveNumberW(lpszDisplayName
) < 0)
209 pidlTemp
= _ILCreateDrive(lpszDisplayName
);
211 return E_OUTOFMEMORY
;
213 if (lpszDisplayName
[2] == L
'\\')
215 szNext
= &lpszDisplayName
[3];
218 if (szNext
&& *szNext
)
220 hr
= SHELL32_ParseNextElement (this, hwndOwner
, pbc
, &pidlTemp
,
221 (LPOLESTR
) szNext
, pchEaten
, pdwAttributes
);
226 if (pdwAttributes
&& *pdwAttributes
)
228 if (_ILIsDrive(pidlTemp
))
229 *pdwAttributes
&= dwDriveAttributes
;
230 else if (_ILIsSpecialFolder(pidlTemp
))
231 SHELL32_GetGuidItemAttributes(this, pidlTemp
, pdwAttributes
);
233 ERR("Got an unkown pidl here!\n");
239 TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr
);
244 /**************************************************************************
245 * CDrivesFolder::EnumObjects
247 HRESULT WINAPI
CDrivesFolder::EnumObjects(HWND hwndOwner
, DWORD dwFlags
, LPENUMIDLIST
*ppEnumIDList
)
249 return ShellObjectCreatorInit
<CDrivesFolderEnum
>(hwndOwner
, dwFlags
, IID_IEnumIDList
, ppEnumIDList
);
252 /**************************************************************************
253 * CDrivesFolder::BindToObject
255 HRESULT WINAPI
CDrivesFolder::BindToObject(PCUIDLIST_RELATIVE pidl
, LPBC pbcReserved
, REFIID riid
, LPVOID
*ppvOut
)
257 TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", this,
258 pidl
, pbcReserved
, shdebugstr_guid(&riid
), ppvOut
);
260 if (_ILIsSpecialFolder(pidl
))
261 return SHELL32_BindToGuidItem(pidlRoot
, pidl
, pbcReserved
, riid
, ppvOut
);
263 return SHELL32_BindToFS(pidlRoot
, NULL
, pidl
, riid
, ppvOut
);
266 /**************************************************************************
267 * CDrivesFolder::BindToStorage
269 HRESULT WINAPI
CDrivesFolder::BindToStorage(PCUIDLIST_RELATIVE pidl
, LPBC pbcReserved
, REFIID riid
, LPVOID
*ppvOut
)
271 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this,
272 pidl
, pbcReserved
, shdebugstr_guid (&riid
), ppvOut
);
278 /**************************************************************************
279 * CDrivesFolder::CompareIDs
282 HRESULT WINAPI
CDrivesFolder::CompareIDs(LPARAM lParam
, PCUIDLIST_RELATIVE pidl1
, PCUIDLIST_RELATIVE pidl2
)
284 if (!pidl1
|| !pidl2
)
286 ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam
, pidl1
, pidl2
);
290 if (_ILIsSpecialFolder(pidl1
) || _ILIsSpecialFolder(pidl2
))
291 return SHELL32_CompareGuidItems(this, lParam
, pidl1
, pidl2
);
293 if (!_ILIsDrive(pidl1
) || !_ILIsDrive(pidl2
) || LOWORD(lParam
) >= MYCOMPUTERSHELLVIEWCOLUMNS
)
296 CHAR
* pszDrive1
= _ILGetDataPointer(pidl1
)->u
.drive
.szDriveName
;
297 CHAR
* pszDrive2
= _ILGetDataPointer(pidl2
)->u
.drive
.szDriveName
;
300 switch(LOWORD(lParam
))
304 result
= stricmp(pszDrive1
, pszDrive2
);
305 return MAKE_COMPARE_HRESULT(result
);
309 return SHELL32_CompareDetails(this, lParam
, pidl1
, pidl2
);
312 case 3: /* Size Available */
314 ULARGE_INTEGER Drive1Available
, Drive1Total
, Drive2Available
, Drive2Total
;
316 if (GetVolumeInformationA(pszDrive1
, NULL
, 0, NULL
, NULL
, NULL
, NULL
, 0))
317 GetDiskFreeSpaceExA(pszDrive1
, &Drive1Available
, &Drive1Total
, NULL
);
319 Drive1Available
.QuadPart
= Drive1Total
.QuadPart
= 0;
321 if (GetVolumeInformationA(pszDrive2
, NULL
, 0, NULL
, NULL
, NULL
, NULL
, 0))
322 GetDiskFreeSpaceExA(pszDrive2
, &Drive2Available
, &Drive2Total
, NULL
);
324 Drive2Available
.QuadPart
= Drive2Total
.QuadPart
= 0;
327 if (lParam
== 2) /* Size */
328 Diff
.QuadPart
= Drive1Total
.QuadPart
- Drive2Total
.QuadPart
;
329 else /* Size available */
330 Diff
.QuadPart
= Drive1Available
.QuadPart
- Drive2Available
.QuadPart
;
332 return MAKE_COMPARE_HRESULT(Diff
.QuadPart
);
338 /**************************************************************************
339 * CDrivesFolder::CreateViewObject
341 HRESULT WINAPI
CDrivesFolder::CreateViewObject(HWND hwndOwner
, REFIID riid
, LPVOID
* ppvOut
)
343 CComPtr
<IShellView
> pShellView
;
344 HRESULT hr
= E_INVALIDARG
;
346 TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
347 hwndOwner
, shdebugstr_guid (&riid
), ppvOut
);
354 if (IsEqualIID(riid
, IID_IDropTarget
))
356 WARN("IDropTarget not implemented\n");
359 else if (IsEqualIID(riid
, IID_IContextMenu
))
361 WARN("IContextMenu not implemented\n");
364 else if (IsEqualIID(riid
, IID_IShellView
))
366 hr
= CDefView_Constructor(this, riid
, ppvOut
);
368 TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut
);
372 static BOOL
_ILIsControlPanel(LPCITEMIDLIST pidl
)
374 GUID
*guid
= _ILGetGUIDPointer(pidl
);
376 TRACE("(%p)\n", pidl
);
379 return IsEqualIID(*guid
, CLSID_ControlPanel
);
383 /**************************************************************************
384 * CDrivesFolder::GetAttributesOf
386 HRESULT WINAPI
CDrivesFolder::GetAttributesOf(UINT cidl
, PCUITEMID_CHILD_ARRAY apidl
, DWORD
* rgfInOut
)
388 TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
389 this, cidl
, apidl
, rgfInOut
, rgfInOut
? *rgfInOut
: 0);
397 /* FIXME: always add SFGAO_CANLINK */
399 *rgfInOut
&= dwComputerAttributes
;
402 for (UINT i
= 0; i
< cidl
; ++i
)
404 if (_ILIsDrive(apidl
[i
]))
405 *rgfInOut
&= dwDriveAttributes
;
406 else if (_ILIsControlPanel(apidl
[i
]))
407 *rgfInOut
&= dwControlPanelAttributes
;
408 else if (_ILIsSpecialFolder(*apidl
))
409 SHELL32_GetGuidItemAttributes(this, apidl
[i
], rgfInOut
);
411 ERR("Got unknown pidl type!\n");
415 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
416 *rgfInOut
&= ~SFGAO_VALIDATE
;
418 TRACE ("-- result=0x%08x\n", *rgfInOut
);
422 /**************************************************************************
423 * CDrivesFolder::GetUIObjectOf
426 * hwndOwner [in] Parent window for any output
427 * cidl [in] array size
428 * apidl [in] simple pidl array
429 * riid [in] Requested Interface
430 * prgfInOut [ ] reserved
431 * ppvObject [out] Resulting Interface
434 HRESULT WINAPI
CDrivesFolder::GetUIObjectOf(HWND hwndOwner
,
435 UINT cidl
, PCUITEMID_CHILD_ARRAY apidl
,
436 REFIID riid
, UINT
*prgfInOut
, LPVOID
*ppvOut
)
440 HRESULT hr
= E_INVALIDARG
;
442 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
443 hwndOwner
, cidl
, apidl
, shdebugstr_guid (&riid
), prgfInOut
, ppvOut
);
450 if (IsEqualIID (riid
, IID_IContextMenu
) && (cidl
>= 1))
452 hr
= CDefFolderMenu_Create2(pidlRoot
, hwndOwner
, cidl
, apidl
, (IShellFolder
*)this, NULL
, 0, NULL
, (IContextMenu
**)&pObj
);
454 else if (IsEqualIID (riid
, IID_IDataObject
) && (cidl
>= 1))
456 hr
= IDataObject_Constructor (hwndOwner
,
457 pidlRoot
, apidl
, cidl
, (IDataObject
**)&pObj
);
459 else if ((IsEqualIID (riid
, IID_IExtractIconA
) || IsEqualIID (riid
, IID_IExtractIconW
)) && (cidl
== 1))
461 hr
= GenericExtractIcon_CreateInstance(this, apidl
[0], riid
, &pObj
);
463 else if (IsEqualIID (riid
, IID_IDropTarget
) && (cidl
>= 1))
465 IDropTarget
* pDt
= NULL
;
466 hr
= this->QueryInterface(IID_PPV_ARG(IDropTarget
, &pDt
));
469 else if ((IsEqualIID(riid
, IID_IShellLinkW
) ||
470 IsEqualIID(riid
, IID_IShellLinkA
)) && (cidl
== 1))
472 pidl
= ILCombine (pidlRoot
, apidl
[0]);
473 hr
= IShellLink_ConstructFromFile(NULL
, riid
, pidl
, (LPVOID
*) &pObj
);
479 if (SUCCEEDED(hr
) && !pObj
)
483 TRACE ("(%p)->hr=0x%08x\n", this, hr
);
487 /**************************************************************************
488 * CDrivesFolder::GetDisplayNameOf
490 HRESULT WINAPI
CDrivesFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl
, DWORD dwFlags
, LPSTRRET strRet
)
495 TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl
, dwFlags
, strRet
);
501 if (!_ILIsPidlSimple (pidl
))
503 return SHELL32_GetDisplayNameOfChild(this, pidl
, dwFlags
, strRet
);
505 else if (!_ILIsDesktop(pidl
) && _ILIsSpecialFolder(pidl
))
507 return SHELL32_GetDisplayNameOfGUIDItem(this, L
"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", pidl
, dwFlags
, strRet
);
509 else if (pidl
->mkid
.cb
&& !_ILIsDrive(pidl
))
511 ERR("Wrong pidl type\n");
515 pszPath
= (LPWSTR
)CoTaskMemAlloc((MAX_PATH
+ 1) * sizeof(WCHAR
));
517 return E_OUTOFMEMORY
;
523 /* parsing name like ::{...} */
526 SHELL32_GUIDToStringW(CLSID_MyComputer
, &pszPath
[2]);
530 _ILSimpleGetTextW(pidl
, pszPath
, MAX_PATH
); /* append my own path */
531 /* long view "lw_name (C:)" */
532 if (!(dwFlags
& SHGDN_FORPARSING
))
534 WCHAR wszDrive
[18] = {0};
535 DWORD dwVolumeSerialNumber
, dwMaximumComponentLength
, dwFileSystemFlags
;
536 static const WCHAR wszOpenBracket
[] = {' ', '(', 0};
537 static const WCHAR wszCloseBracket
[] = {')', 0};
539 lstrcpynW(wszDrive
, pszPath
, 4);
541 GetVolumeInformationW(wszDrive
, pszPath
,
543 &dwVolumeSerialNumber
,
544 &dwMaximumComponentLength
, &dwFileSystemFlags
, NULL
, 0);
545 pszPath
[MAX_PATH
-1] = L
'\0';
546 if (!wcslen(pszPath
))
548 UINT DriveType
, ResourceId
;
549 DriveType
= GetDriveTypeW(wszDrive
);
553 ResourceId
= IDS_DRIVE_FIXED
;
556 ResourceId
= IDS_DRIVE_NETWORK
;
559 ResourceId
= IDS_DRIVE_CDROM
;
566 dwFileSystemFlags
= LoadStringW(shell32_hInstance
, ResourceId
, pszPath
, MAX_PATH
);
567 if (dwFileSystemFlags
> MAX_PATH
- 7)
568 pszPath
[MAX_PATH
-7] = L
'\0';
571 wcscat (pszPath
, wszOpenBracket
);
573 wcscat (pszPath
, wszDrive
);
574 wcscat (pszPath
, wszCloseBracket
);
580 strRet
->uType
= STRRET_WSTR
;
581 strRet
->pOleStr
= pszPath
;
584 CoTaskMemFree(pszPath
);
586 TRACE("-- (%p)->(%s)\n", this, strRet
->uType
== STRRET_CSTR
? strRet
->cStr
: debugstr_w(strRet
->pOleStr
));
590 /**************************************************************************
591 * CDrivesFolder::SetNameOf
592 * Changes the name of a file object or subfolder, possibly changing its item
593 * identifier in the process.
596 * hwndOwner [in] Owner window for output
597 * pidl [in] simple pidl of item to change
598 * lpszName [in] the items new display name
599 * dwFlags [in] SHGNO formatting flags
600 * ppidlOut [out] simple pidl returned
602 HRESULT WINAPI
CDrivesFolder::SetNameOf(HWND hwndOwner
, PCUITEMID_CHILD pidl
,
603 LPCOLESTR lpName
, DWORD dwFlags
, PITEMID_CHILD
*pPidlOut
)
607 if (_ILIsDrive(pidl
))
609 if (_ILSimpleGetTextW(pidl
, szName
, _countof(szName
)))
610 SetVolumeLabelW(szName
, lpName
);
612 *pPidlOut
= _ILCreateDrive(szName
);
616 return SHELL32_SetNameOfGuidItem(pidl
, lpName
, dwFlags
, pPidlOut
);
619 HRESULT WINAPI
CDrivesFolder::GetDefaultSearchGUID(GUID
* pguid
)
621 FIXME ("(%p)\n", this);
625 HRESULT WINAPI
CDrivesFolder::EnumSearches(IEnumExtraSearch
** ppenum
)
627 FIXME ("(%p)\n", this);
631 HRESULT WINAPI
CDrivesFolder::GetDefaultColumn (DWORD dwRes
, ULONG
*pSort
, ULONG
*pDisplay
)
633 TRACE ("(%p)\n", this);
642 HRESULT WINAPI
CDrivesFolder::GetDefaultColumnState(UINT iColumn
, DWORD
* pcsFlags
)
644 TRACE ("(%p)\n", this);
646 if (!pcsFlags
|| iColumn
>= MYCOMPUTERSHELLVIEWCOLUMNS
)
648 *pcsFlags
= MyComputerSFHeader
[iColumn
].pcsFlags
;
652 HRESULT WINAPI
CDrivesFolder::GetDetailsEx(PCUITEMID_CHILD pidl
, const SHCOLUMNID
* pscid
, VARIANT
* pv
)
654 FIXME ("(%p)\n", this);
658 /* FIXME: drive size >4GB is rolling over */
659 HRESULT WINAPI
CDrivesFolder::GetDetailsOf(PCUITEMID_CHILD pidl
, UINT iColumn
, SHELLDETAILS
*psd
)
663 TRACE ("(%p)->(%p %i %p)\n", this, pidl
, iColumn
, psd
);
665 if (!psd
|| iColumn
>= MYCOMPUTERSHELLVIEWCOLUMNS
)
670 psd
->fmt
= MyComputerSFHeader
[iColumn
].fmt
;
671 psd
->cxChar
= MyComputerSFHeader
[iColumn
].cxChar
;
672 return SHSetStrRet(&psd
->str
, MyComputerSFHeader
[iColumn
].colnameid
);
674 else if (_ILIsSpecialFolder(pidl
))
676 return SHELL32_GetDetailsOfGuidItem(this, pidl
, iColumn
, psd
);
680 char szPath
[MAX_PATH
];
681 ULARGE_INTEGER ulBytes
;
683 psd
->str
.cStr
[0] = 0x00;
684 psd
->str
.uType
= STRRET_CSTR
;
688 hr
= GetDisplayNameOf(pidl
, SHGDN_NORMAL
| SHGDN_INFOLDER
, &psd
->str
);
691 _ILGetFileType(pidl
, psd
->str
.cStr
, MAX_PATH
);
693 case 2: /* total size */
694 _ILSimpleGetText (pidl
, szPath
, MAX_PATH
);
695 if (GetVolumeInformationA(szPath
, NULL
, 0, NULL
, NULL
, NULL
, NULL
, 0))
697 GetDiskFreeSpaceExA(szPath
, NULL
, &ulBytes
, NULL
);
698 StrFormatByteSize64A(ulBytes
.QuadPart
, psd
->str
.cStr
, MAX_PATH
);
701 case 3: /* free size */
702 _ILSimpleGetText (pidl
, szPath
, MAX_PATH
);
703 if (GetVolumeInformationA(szPath
, NULL
, 0, NULL
, NULL
, NULL
, NULL
, 0))
705 GetDiskFreeSpaceExA(szPath
, &ulBytes
, NULL
, NULL
);
706 StrFormatByteSize64A(ulBytes
.QuadPart
, psd
->str
.cStr
, MAX_PATH
);
716 HRESULT WINAPI
CDrivesFolder::MapColumnToSCID(UINT column
, SHCOLUMNID
* pscid
)
718 FIXME("(%p)\n", this);
722 /************************************************************************
723 * CDrivesFolder::GetClassID
725 HRESULT WINAPI
CDrivesFolder::GetClassID(CLSID
*lpClassId
)
727 TRACE ("(%p)\n", this);
732 *lpClassId
= CLSID_MyComputer
;
736 /************************************************************************
737 * CDrivesFolder::Initialize
739 * NOTES: it makes no sense to change the pidl
741 HRESULT WINAPI
CDrivesFolder::Initialize(LPCITEMIDLIST pidl
)
743 TRACE ("(%p)->(%p)\n", this, pidl
);
746 SHFree((LPVOID
)pidlRoot
);
748 pidlRoot
= ILClone(pidl
);
752 /**************************************************************************
753 * CDrivesFolder::GetCurFolder
755 HRESULT WINAPI
CDrivesFolder::GetCurFolder(LPITEMIDLIST
*pidl
)
757 TRACE("(%p)->(%p)\n", this, pidl
);
762 *pidl
= ILClone(pidlRoot
);