ReactOS 0.4.16-dev-983-g23ad936
CDrivesFolder.cpp
Go to the documentation of this file.
1/*
2 * Virtual Workplace folder
3 *
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998, 1999, 2002 Juergen Schmied
6 * Copyright 2009 Andrew Hill
7 * Copyright 2017-2024 Katayama Hirofumi MZ
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <precomp.h>
25#include <process.h>
26
28
29/*
30CDrivesFolder should create a CRegFolder to represent the virtual items that exist only in
31the registry. The CRegFolder is aggregated by the CDrivesFolder.
32The CDrivesFolderEnum class should enumerate only drives on the system. Since the CRegFolder
33implementation of IShellFolder::EnumObjects enumerates the virtual items, the
34CDrivesFolderEnum is only responsible for returning the physical items.
35
362. At least on my XP system, the drive pidls returned are of type PT_DRIVE1, not PT_DRIVE
373. The parsing name returned for my computer is incorrect. It should be "My Computer"
38*/
39
40static int iDriveIconIds[7] = { IDI_SHELL_DRIVE, /* DRIVE_UNKNOWN */
41 IDI_SHELL_CDROM, /* DRIVE_NO_ROOT_DIR*/
42 IDI_SHELL_3_14_FLOPPY, /* DRIVE_REMOVABLE*/
43 IDI_SHELL_DRIVE, /* DRIVE_FIXED*/
44 IDI_SHELL_NETDRIVE, /* DRIVE_REMOTE*/
45 IDI_SHELL_CDROM, /* DRIVE_CDROM*/
46 IDI_SHELL_RAMDISK /* DRIVE_RAMDISK*/
47 };
48
49static int iDriveTypeIds[7] = { IDS_DRIVE_FIXED, /* DRIVE_UNKNOWN */
50 IDS_DRIVE_FIXED, /* DRIVE_NO_ROOT_DIR*/
51 IDS_DRIVE_FLOPPY, /* DRIVE_REMOVABLE*/
52 IDS_DRIVE_FIXED, /* DRIVE_FIXED*/
53 IDS_DRIVE_NETWORK, /* DRIVE_REMOTE*/
54 IDS_DRIVE_CDROM, /* DRIVE_CDROM*/
55 IDS_DRIVE_FIXED /* DRIVE_RAMDISK*/
56 };
57
59{
60 { CLSID_ControlPanel, 0, 0x50 },
61};
63{
66 CLSID_MyComputer,
67 L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
68 L"MyComputer",
69};
70
71static const CLSID* IsRegItem(PCUITEMID_CHILD pidl)
72{
73 if (pidl && pidl->mkid.cb == 2 + 2 + sizeof(CLSID))
74 {
75 if (pidl->mkid.abID[0] == PT_SHELLEXT || pidl->mkid.abID[0] == PT_GUID) // FIXME: Remove PT_GUID when CRegFolder is fixed
76 return (const CLSID*)(&pidl->mkid.abID[2]);
77 }
78 return NULL;
79}
80
82{
83 const CLSID *pClass = IsRegItem(pidl);
84 return pClass && *pClass == clsid;
85}
86
88{
89 if (!_ILIsDrive(pidl))
90 return -1;
91 BYTE letter = ((PIDLDATA*)pidl->mkid.abID)->u.drive.szDriveName[0];
92 BYTE number = (letter | 32) - 'a';
93 return number < 26 ? number : -1;
94}
95
96template<class T> static T* GetDrivePath(PCUITEMID_CHILD pidl, T *Path)
97{
98 int number = GetDriveNumber(pidl);
99 if (number < 0)
100 return NULL;
101 Path[0] = 'A' + number;
102 Path[1] = ':';
103 Path[2] = '\\';
104 Path[3] = '\0';
105 return Path;
106}
107
108
110{
111 WCHAR szDrive[8];
112 if (!_ILGetDrive(pidl, szDrive, _countof(szDrive)))
113 {
114 ERR("pidl %p is not a drive\n", pidl);
115 return DRIVE_UNKNOWN;
116 }
117 return ::GetDriveTypeW(szDrive);
118}
119
121{
122 // If this function returns true, the item should be hidden in DefView but not in the Explorer folder tree.
124 wsprintfW(path, L"%s\\%s", REGSTR_PATH_EXPLORER, SubKey);
126 DWORD data = 0, size = sizeof(data);
128}
129
130/***********************************************************************
131* IShellFolder implementation
132*/
133
134#define RETRY_COUNT 3
135#define RETRY_SLEEP 250
137{
138 DWORD dwError, dwBytesReturned;
139 DWORD dwCode = (bLock ? FSCTL_LOCK_VOLUME : FSCTL_UNLOCK_VOLUME);
140 for (DWORD i = 0; i < RETRY_COUNT; ++i)
141 {
142 if (DeviceIoControl(hDrive, dwCode, NULL, 0, NULL, 0, &dwBytesReturned, NULL))
143 return TRUE;
144
145 dwError = GetLastError();
146 if (dwError == ERROR_INVALID_FUNCTION)
147 break; /* don't sleep if function is not implemented */
148
150 }
151 SetLastError(dwError);
152 return FALSE;
153}
154
155// NOTE: See also https://support.microsoft.com/en-us/help/165721/how-to-ejecting-removable-media-in-windows-nt-windows-2000-windows-xp
156static BOOL DoEjectDrive(const WCHAR *physical, UINT nDriveType, INT *pnStringID)
157{
158 /* GENERIC_WRITE isn't needed for umount */
159 DWORD dwAccessMode = GENERIC_READ;
160 DWORD dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
161
162 HANDLE hDrive = CreateFile(physical, dwAccessMode, dwShareMode, 0, OPEN_EXISTING, 0, NULL);
163 if (hDrive == INVALID_HANDLE_VALUE)
164 return FALSE;
165
166 BOOL bResult, bNeedUnlock = FALSE;
167 DWORD dwBytesReturned, dwError = NO_ERROR;
168 PREVENT_MEDIA_REMOVAL removal;
169 do
170 {
171 bResult = TryToLockOrUnlockDrive(hDrive, TRUE);
172 if (!bResult)
173 {
174 dwError = GetLastError();
175 *pnStringID = IDS_CANTLOCKVOLUME; /* Unable to lock volume */
176 break;
177 }
178 bResult = DeviceIoControl(hDrive, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &dwBytesReturned, NULL);
179 if (!bResult)
180 {
181 dwError = GetLastError();
182 *pnStringID = IDS_CANTDISMOUNTVOLUME; /* Unable to dismount volume */
183 bNeedUnlock = TRUE;
184 break;
185 }
186 removal.PreventMediaRemoval = FALSE;
187 bResult = DeviceIoControl(hDrive, IOCTL_STORAGE_MEDIA_REMOVAL, &removal, sizeof(removal), NULL,
188 0, &dwBytesReturned, NULL);
189 if (!bResult)
190 {
191 *pnStringID = IDS_CANTEJECTMEDIA; /* Unable to eject media */
192 dwError = GetLastError();
193 bNeedUnlock = TRUE;
194 break;
195 }
196 bResult = DeviceIoControl(hDrive, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &dwBytesReturned, NULL);
197 if (!bResult)
198 {
199 *pnStringID = IDS_CANTEJECTMEDIA; /* Unable to eject media */
200 dwError = GetLastError();
201 bNeedUnlock = TRUE;
202 break;
203 }
204 } while (0);
205
206 if (bNeedUnlock)
207 {
209 }
210
211 CloseHandle(hDrive);
212
213 SetLastError(dwError);
214 return bResult;
215}
216
218{
219 UINT nDrive = PtrToUlong(args);
220 WCHAR szPath[] = { LOWORD(L'A' + nDrive), L'\0' }; // Arbitrary, just needs to include nDrive
223 if (FAILED(hr))
224 return hr;
226 return stub.DestroyWindow();
227}
228
230{
232 return succ ? S_OK : E_FAIL;
233}
234
236 HWND hwnd,
237 IDataObject *pdtobj,
238 UINT uMsg,
241{
242 if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
243 return SHELL32_DefaultContextMenuCallBack(psf, pdtobj, uMsg);
244
245 PIDLIST_ABSOLUTE pidlFolder;
246 PUITEMID_CHILD *apidl;
247 UINT cidl;
248 UINT nDriveType;
250 HRESULT hr = SH_GetApidlFromDataObject(pdtobj, &pidlFolder, &apidl, &cidl);
252 return hr;
253
254 WCHAR szDrive[8] = {0};
255 if (!_ILGetDrive(apidl[0], szDrive, _countof(szDrive)))
256 {
257 ERR("pidl is not a drive\n");
258 SHFree(pidlFolder);
259 _ILFreeaPidl(apidl, cidl);
260 return E_FAIL;
261 }
262 nDriveType = GetDriveTypeW(szDrive);
263 if (!GetVolumeInformationW(szDrive, NULL, 0, NULL, NULL, &dwFlags, NULL, 0))
264 {
265 if (nDriveType >= DRIVE_REMOTE)
267 else
268 dwFlags = 0; // Assume drive with unknown filesystem, allow format
269 }
270
271// custom command IDs
272#if 0 // Disabled until our menu building system is fixed
273#define CMDID_FORMAT 0
274#define CMDID_EJECT 1
275#define CMDID_DISCONNECT 2
276#else
277/* FIXME: These IDs should start from 0, however there is difference
278 * between ours and Windows' menu building systems, which should be fixed. */
279#define CMDID_FORMAT 1
280#define CMDID_EJECT 2
281#define CMDID_DISCONNECT 3
282#endif
283
284 if (uMsg == DFM_MERGECONTEXTMENU)
285 {
286 QCMINFO *pqcminfo = (QCMINFO *)lParam;
287
288 UINT idCmdFirst = pqcminfo->idCmdFirst;
289 UINT idCmd = 0;
290 if (!(dwFlags & FILE_READ_ONLY_VOLUME) && nDriveType != DRIVE_REMOTE && cidl == 1)
291 {
292 /* add separator and Format */
293 idCmd = idCmdFirst + CMDID_FORMAT;
294 _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
296 }
297 if (nDriveType == DRIVE_REMOVABLE || nDriveType == DRIVE_CDROM)
298 {
299 /* add separator and Eject */
300 idCmd = idCmdFirst + CMDID_EJECT;
301 _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
303 }
304 if (nDriveType == DRIVE_REMOTE)
305 {
306 /* add separator and Disconnect */
307 idCmd = idCmdFirst + CMDID_DISCONNECT;
308 _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
310 }
311
312 if (idCmd)
313#if 0 // see FIXME above
314 pqcminfo->idCmdFirst = ++idCmd;
315#else
316 pqcminfo->idCmdFirst = (idCmd + 2);
317#endif
318 hr = S_OK;
319 }
320 else if (uMsg == DFM_INVOKECOMMAND)
321 {
322 WCHAR wszBuf[4] = L"A:\\";
323 wszBuf[0] = (WCHAR)szDrive[0];
324
325 INT nStringID = 0;
326 DWORD dwError = NO_ERROR;
327
329 {
330 ATLASSERT(pdtobj);
332 // Not setting nStringID because SHOpenPropSheet already displayed an error box
333 }
334 else
335 {
336 if (wParam == CMDID_FORMAT)
337 {
338 hr = DoFormatDriveAsync(hwnd, szDrive[0] - 'A');
339 }
340 else if (wParam == CMDID_EJECT)
341 {
342 /* do eject */
343 WCHAR physical[10];
344 wsprintfW(physical, _T("\\\\.\\%c:"), szDrive[0]);
345
346 if (DoEjectDrive(physical, nDriveType, &nStringID))
347 {
349 }
350 else
351 {
352 dwError = GetLastError();
353 }
354 }
355 else if (wParam == CMDID_DISCONNECT)
356 {
357 /* do disconnect */
358 wszBuf[2] = UNICODE_NULL;
359 dwError = WNetCancelConnection2W(wszBuf, 0, FALSE);
360 if (dwError == NO_ERROR)
361 {
363 }
364 else
365 {
366 nStringID = IDS_CANTDISCONNECT;
367 }
368 }
369 }
370
371 if (nStringID != 0)
372 {
373 /* show error message */
374 WCHAR szFormat[128], szMessage[128];
375 LoadStringW(shell32_hInstance, nStringID, szFormat, _countof(szFormat));
376 wsprintfW(szMessage, szFormat, dwError);
377 MessageBoxW(hwnd, szMessage, NULL, MB_ICONERROR);
378 }
379 }
380
381 SHFree(pidlFolder);
382 _ILFreeaPidl(apidl, cidl);
383
384 return hr;
385}
386
388 HWND hwnd,
389 UINT cidl,
391 IShellFolder *psf,
392 IContextMenu **ppcm)
393{
394 HKEY hKeys[2];
395 UINT cKeys = 0;
396 AddClassKeyToArray(L"Drive", hKeys, &cKeys);
397 AddClassKeyToArray(L"Folder", hKeys, &cKeys);
398
399 return CDefFolderMenu_Create2(pidlFolder, hwnd, cidl, apidl, psf, DrivesContextMenuCallback, cKeys, hKeys, ppcm);
400}
401
402static HRESULT
404 LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
405{
406 WCHAR wszPath[MAX_PATH];
407 WCHAR wszAutoRunInfPath[MAX_PATH];
408 WCHAR wszValue[MAX_PATH], wszTemp[MAX_PATH];
409
410 // get path
411 if (!ILGetDisplayNameExW(psf, pidl, wszPath, 0))
412 return E_FAIL;
413 if (!PathIsDirectoryW(wszPath))
414 return E_FAIL;
415
416 // build the full path of autorun.inf
417 StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath);
418 PathAppendW(wszAutoRunInfPath, L"autorun.inf");
419
420 // autorun.inf --> wszValue
421 if (GetPrivateProfileStringW(L"autorun", L"icon", NULL, wszValue, _countof(wszValue),
422 wszAutoRunInfPath) && wszValue[0] != 0)
423 {
424 // wszValue --> wszTemp
425 ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp));
426
427 // parse the icon location
428 *piIndex = PathParseIconLocationW(wszTemp);
429
430 // wszPath + wszTemp --> wszPath
431 if (PathIsRelativeW(wszTemp))
432 PathAppendW(wszPath, wszTemp);
433 else
434 StringCchCopyW(wszPath, _countof(wszPath), wszTemp);
435
436 // wszPath --> szIconFile
437 GetFullPathNameW(wszPath, cchMax, szIconFile, NULL);
438
439 return S_OK;
440 }
441
442 return E_FAIL;
443}
444
445static HRESULT
447{
448 WCHAR wszAutoRunInfPath[MAX_PATH];
449 WCHAR wszTemp[MAX_PATH];
450
451 if (!PathIsDirectoryW(wszPath))
452 return E_FAIL;
453
454 StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath);
455 PathAppendW(wszAutoRunInfPath, L"autorun.inf");
456
457 if (GetPrivateProfileStringW(L"autorun", L"label", NULL, wszTemp, _countof(wszTemp),
458 wszAutoRunInfPath) && wszTemp[0] != 0)
459 {
460 StringCchCopyW(szLabel, cchMax, wszTemp);
461 return S_OK;
462 }
463
464 return E_FAIL;
465}
466
467static inline HRESULT GetRawDriveLabel(PCWSTR DrivePath, LPWSTR szLabel, UINT cchMax)
468{
469 if (GetVolumeInformationW(DrivePath, szLabel, cchMax, NULL, NULL, NULL, NULL, 0))
470 return *szLabel ? S_OK : S_FALSE;
472}
473
474static HRESULT GetDriveLabel(PCWSTR DrivePath, LPWSTR szLabel, UINT cchMax)
475{
476 HRESULT hr = getLabelForDriveFromAutoRun(DrivePath, szLabel, cchMax);
477 return hr == S_OK ? S_OK : GetRawDriveLabel(DrivePath, szLabel, cchMax);
478}
479
480BOOL IsDriveFloppyA(LPCSTR pszDriveRoot);
481
483{
484 CComPtr<IDefaultExtractIconInit> initIcon;
487 return hr;
488
489 CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
490 UINT DriveType = GetDriveTypeA(pszDrive);
493
494 WCHAR wTemp[MAX_PATH];
495 int icon_idx, reg_idx;
496 UINT flags = 0;
497
498 switch (DriveType)
499 {
500 case DRIVE_FIXED:
501 case DRIVE_UNKNOWN:
502 reg_idx = IDI_SHELL_DRIVE;
503 break;
504 case DRIVE_CDROM:
505 reg_idx = IDI_SHELL_CDROM;
506 break;
507 case DRIVE_REMOTE:
508 reg_idx = IDI_SHELL_NETDRIVE;
509 break;
510 case DRIVE_REMOVABLE:
511 if (!IsDriveFloppyA(pszDrive))
512 reg_idx = IDI_SHELL_REMOVEABLE;
513 else
514 reg_idx = IDI_SHELL_3_14_FLOPPY;
515 break;
516 case DRIVE_RAMDISK:
517 reg_idx = IDI_SHELL_RAMDISK;
518 break;
520 default:
521 reg_idx = IDI_SHELL_DOCUMENT;
522 break;
523 }
524
525 hr = getIconLocationForDrive(psf, pidl, 0, wTemp, _countof(wTemp),
526 &icon_idx, &flags);
527 if (SUCCEEDED(hr))
528 {
529 initIcon->SetNormalIcon(wTemp, icon_idx);
530 }
531 else if (HLM_GetIconW(reg_idx - 1, wTemp, _countof(wTemp), &icon_idx))
532 {
533 initIcon->SetNormalIcon(wTemp, icon_idx);
534 }
535 else if ((DriveType == DRIVE_FIXED || DriveType == DRIVE_UNKNOWN) &&
536 (HCR_GetIconW(L"Drive", wTemp, NULL, _countof(wTemp), &icon_idx)))
537 {
538 initIcon->SetNormalIcon(wTemp, icon_idx);
539 }
540 else
541 {
542 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
543 {
544 icon_idx = IDI_SHELL_REMOVEABLE;
545 }
546 else
547 {
548 icon_idx = iDriveIconIds[DriveType];
549 }
550 initIcon->SetNormalIcon(swShell32Name, -icon_idx);
551 }
552
553 return initIcon->QueryInterface(riid, ppvOut);
554}
555
557 public CEnumIDListBase
558{
559 public:
560 HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags, IEnumIDList* pRegEnumerator)
561 {
562 /* enumerate the folders */
563 if (dwFlags & SHCONTF_FOLDERS)
564 {
565 WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
566 DWORD dwDrivemap = GetLogicalDrives();
567
568 while (wszDriveName[0] <= 'Z')
569 {
570 if(dwDrivemap & 0x00000001L)
571 AddToEnumList(_ILCreateDrive(wszDriveName));
572 wszDriveName[0]++;
573 dwDrivemap = dwDrivemap >> 1;
574 }
575 }
576
577 /* Enumerate the items of the reg folder */
578 AppendItemsFromEnumerator(pRegEnumerator);
579
580 return S_OK;
581 }
582
584 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
586};
587
588/***********************************************************************
589* IShellFolder [MyComputer] implementation
590*/
591
598};
599
601 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
602 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_CANLINK;
604 SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_CANLINK;
606 SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
607 SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANRENAME | SFGAO_CANLINK | SFGAO_CANCOPY;
608
610{
611 pidlRoot = NULL;
613}
614
616{
617 TRACE("-- destroying IShellFolder(%p)\n", this);
619}
620
622{
623 pidlRoot = _ILCreateMyComputer(); /* my qualified pidl */
624 if (pidlRoot == NULL)
625 return E_OUTOFMEMORY;
626
627 REGFOLDERINITDATA RegInit = { static_cast<IShellFolder*>(this), &g_RegFolderInfo };
629 pidlRoot,
631
632 return hr;
633}
634
635/**************************************************************************
636* CDrivesFolder::ParseDisplayName
637*/
639 DWORD * pchEaten, PIDLIST_RELATIVE * ppidl, DWORD * pdwAttributes)
640{
642
643 TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
644 hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
645 pchEaten, ppidl, pdwAttributes);
646
647 if (!ppidl)
648 return hr;
649
650 *ppidl = NULL;
651
652 if (!lpszDisplayName)
653 return hr;
654
655 /* handle CLSID paths */
656 if (lpszDisplayName[0] == L':' && lpszDisplayName[1] == L':')
657 {
658 return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl,
659 pdwAttributes);
660 }
661
662 if (((L'A' <= lpszDisplayName[0] && lpszDisplayName[0] <= L'Z') ||
663 (L'a' <= lpszDisplayName[0] && lpszDisplayName[0] <= L'z')) &&
664 lpszDisplayName[1] == L':' && (lpszDisplayName[2] == L'\\' || !lpszDisplayName[2]))
665 {
666 // "C:\..."
667 WCHAR szRoot[8];
668 PathBuildRootW(szRoot, ((*lpszDisplayName - 1) & 0x1F));
669
670 if (SHIsFileSysBindCtx(pbc, NULL) != S_OK && !(BindCtx_GetMode(pbc, 0) & STGM_CREATE))
671 {
672 if (::GetDriveType(szRoot) == DRIVE_NO_ROOT_DIR)
674 }
675
676 CComHeapPtr<ITEMIDLIST> pidlTemp(_ILCreateDrive(szRoot));
677 if (!pidlTemp)
678 return E_OUTOFMEMORY;
679
680 if (lpszDisplayName[2] && lpszDisplayName[3])
681 {
682 CComPtr<IShellFolder> pChildFolder;
683 hr = BindToObject(pidlTemp, pbc, IID_PPV_ARG(IShellFolder, &pChildFolder));
685 return hr;
686
687 ULONG chEaten;
688 CComHeapPtr<ITEMIDLIST> pidlChild;
689 hr = pChildFolder->ParseDisplayName(hwndOwner, pbc, &lpszDisplayName[3], &chEaten,
690 &pidlChild, pdwAttributes);
692 return hr;
693
694 hr = SHILCombine(pidlTemp, pidlChild, ppidl);
695 }
696 else
697 {
698 *ppidl = pidlTemp.Detach();
699 if (pdwAttributes && *pdwAttributes)
700 GetAttributesOf(1, (PCUITEMID_CHILD_ARRAY)ppidl, pdwAttributes);
701 hr = S_OK;
702 }
703 }
704
705 TRACE("(%p)->(-- ret=0x%08x)\n", this, hr);
706
707 return hr;
708}
709
710/**************************************************************************
711* CDrivesFolder::EnumObjects
712*/
713HRESULT WINAPI CDrivesFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
714{
715 CComPtr<IEnumIDList> pRegEnumerator;
716 m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
717
718 return ShellObjectCreatorInit<CDrivesFolderEnum>(hwndOwner, dwFlags, pRegEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
719}
720
721/**************************************************************************
722* CDrivesFolder::BindToObject
723*/
725{
726 TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", this,
727 pidl, pbcReserved, shdebugstr_guid(&riid), ppvOut);
728
729 if (!pidl)
730 return E_INVALIDARG;
731
732 if (_ILIsSpecialFolder(pidl))
733 return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);
734
735 CHAR* pchDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
736
737 PERSIST_FOLDER_TARGET_INFO pfti = {0};
738 pfti.dwAttributes = -1;
739 pfti.csidl = -1;
740 pfti.szTargetParsingName[0] = *pchDrive;
741 pfti.szTargetParsingName[1] = L':';
742 pfti.szTargetParsingName[2] = L'\\';
743
745 &pfti,
746 pidl,
747 &CLSID_ShellFSFolder,
748 riid,
749 ppvOut);
751 return hr;
752
753 return S_OK;
754}
755
756/**************************************************************************
757* CDrivesFolder::BindToStorage
758*/
760{
761 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this,
762 pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
763
764 *ppvOut = NULL;
765 return E_NOTIMPL;
766}
767
768/**************************************************************************
769* CDrivesFolder::CompareIDs
770*/
771
773{
775
776 if (!pidl1 || !pidl2)
777 {
778 ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
779 return E_INVALIDARG;
780 }
781
782 if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
783 return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
784
785 UINT iColumn = LOWORD(lParam);
786 if (!_ILIsDrive(pidl1) || !_ILIsDrive(pidl2) || iColumn >= _countof(MyComputerSFHeader))
787 return E_INVALIDARG;
788
789 CHAR* pszDrive1 = _ILGetDataPointer(pidl1)->u.drive.szDriveName;
790 CHAR* pszDrive2 = _ILGetDataPointer(pidl2)->u.drive.szDriveName;
791
792 int result;
793 switch (MyComputerSFHeader[iColumn].colnameid)
794 {
796 {
797 result = _stricmp(pszDrive1, pszDrive2);
799 break;
800 }
802 {
803 /* We want to return immediately because SHELL32_CompareDetails also compares children. */
804 return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
805 }
808 {
809 ULARGE_INTEGER Drive1Available, Drive1Total, Drive2Available, Drive2Total;
810
811 if (GetVolumeInformationA(pszDrive1, NULL, 0, NULL, NULL, NULL, NULL, 0))
812 GetDiskFreeSpaceExA(pszDrive1, &Drive1Available, &Drive1Total, NULL);
813 else
814 Drive1Available.QuadPart = Drive1Total.QuadPart = 0;
815
816 if (GetVolumeInformationA(pszDrive2, NULL, 0, NULL, NULL, NULL, NULL, 0))
817 GetDiskFreeSpaceExA(pszDrive2, &Drive2Available, &Drive2Total, NULL);
818 else
819 Drive2Available.QuadPart = Drive2Total.QuadPart = 0;
820
821 LARGE_INTEGER Diff;
822 if (lParam == 3) /* Size */
823 Diff.QuadPart = Drive1Total.QuadPart - Drive2Total.QuadPart;
824 else /* Size available */
825 Diff.QuadPart = Drive1Available.QuadPart - Drive2Available.QuadPart;
826
828 break;
829 }
832 break;
834 }
835
836 if (HRESULT_CODE(hres) == 0)
837 return SHELL32_CompareChildren(this, lParam, pidl1, pidl2);
838
839 return hres;
840}
841
842/**************************************************************************
843* CDrivesFolder::CreateViewObject
844*/
846{
847 CComPtr<IShellView> pShellView;
849
850 TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
851 hwndOwner, shdebugstr_guid (&riid), ppvOut);
852
853 if (!ppvOut)
854 return hr;
855
856 *ppvOut = NULL;
857
858 if (IsEqualIID(riid, IID_IDropTarget))
859 {
860 WARN("IDropTarget not implemented\n");
861 hr = E_NOTIMPL;
862 }
863 else if (IsEqualIID(riid, IID_IContextMenu))
864 {
865 DEFCONTEXTMENU dcm = { hwndOwner, this, pidlRoot, this };
866 hr = SHCreateDefaultContextMenu(&dcm, riid, ppvOut);
867 }
868 else if (IsEqualIID(riid, IID_IShellView))
869 {
870 SFV_CREATE sfvparams = { sizeof(SFV_CREATE), this, NULL, static_cast<IShellFolderViewCB*>(this) };
871 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
872 }
873 TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
874 return hr;
875}
876
877/**************************************************************************
878* CDrivesFolder::GetAttributesOf
879*/
881{
882 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
883 this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
884
885 if (cidl && !apidl)
886 return E_INVALIDARG;
887
888 if (*rgfInOut == 0)
889 *rgfInOut = ~0;
890
891 if(cidl == 0)
892 *rgfInOut &= dwComputerAttributes;
893 else
894 {
895 for (UINT i = 0; i < cidl; ++i)
896 {
897 if (_ILIsDrive(apidl[i]))
898 {
899 *rgfInOut &= dwDriveAttributes;
900
901 if (_ILGetDriveType(apidl[i]) == DRIVE_CDROM)
902 *rgfInOut &= ~SFGAO_CANRENAME; // CD-ROM drive cannot rename
903 }
904 else if (IsRegItem(apidl[i], CLSID_ControlPanel))
905 {
906 *rgfInOut &= dwControlPanelAttributes;
907 }
908 else if (_ILIsSpecialFolder(*apidl))
909 {
910 m_regFolder->GetAttributesOf(1, &apidl[i], rgfInOut);
911 }
912 else
913 {
914 ERR("Got unknown pidl type!\n");
915 }
916 }
917 }
918
919 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
920 *rgfInOut &= ~SFGAO_VALIDATE;
921
922 TRACE("-- result=0x%08x\n", *rgfInOut);
923 return S_OK;
924}
925
926/**************************************************************************
927* CDrivesFolder::GetUIObjectOf
928*
929* PARAMETERS
930* hwndOwner [in] Parent window for any output
931* cidl [in] array size
932* apidl [in] simple pidl array
933* riid [in] Requested Interface
934* prgfInOut [ ] reserved
935* ppvObject [out] Resulting Interface
936*
937*/
939 UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
940 REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
941{
942 LPVOID pObj = NULL;
944
945 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
946 hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
947
948 if (!ppvOut)
949 return hr;
950
951 *ppvOut = NULL;
952
953 if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
954 {
955 if (_ILIsDrive(apidl[0]))
956 hr = CDrivesContextMenu_CreateInstance(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), (IContextMenu**)&pObj);
957 else
958 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
959 }
960 else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
961 {
962 hr = IDataObject_Constructor(hwndOwner,
963 pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
964 }
965 else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
966 {
967 if (_ILIsDrive(apidl[0]))
968 hr = CDrivesExtractIcon_CreateInstance(this, apidl[0], riid, &pObj);
969 else
970 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
971 }
972 else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
973 {
974 CComPtr<IShellFolder> psfChild;
975 hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
977 return hr;
978
979 return psfChild->CreateViewObject(NULL, riid, ppvOut);
980 }
981 else
983
984 if (SUCCEEDED(hr) && !pObj)
986
987 *ppvOut = pObj;
988 TRACE("(%p)->hr=0x%08x\n", this, hr);
989 return hr;
990}
991
992/**************************************************************************
993* CDrivesFolder::GetDisplayNameOf
994*/
996{
997 WCHAR szDrive[8];
998
999 TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
1000 pdump (pidl);
1001
1002 if (!strRet)
1003 return E_INVALIDARG;
1004
1005 if (!_ILIsPidlSimple (pidl))
1006 {
1007 return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
1008 }
1009 else if (_ILIsSpecialFolder(pidl))
1010 {
1011 return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
1012 }
1013 else if (!GetDrivePath(pidl, szDrive))
1014 {
1015 ERR("Wrong pidl type\n");
1016 return E_INVALIDARG;
1017 }
1018
1019 PWSTR pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
1020 if (!pszPath)
1021 return E_OUTOFMEMORY;
1022 pszPath[0] = UNICODE_NULL;
1023 szDrive[0] &= ~32; // Always uppercase
1024
1025 /* long view "lw_name (C:)" */
1027 if (!(dwFlags & SHGDN_FORPARSING))
1028 {
1029 if (m_DriveDisplayMode < 0)
1030 {
1031 DWORD err, type, data, cb = sizeof(data);
1032 err = SHRegGetUSValueW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
1033 L"ShowDriveLettersFirst", &type, &data, &cb, FALSE, NULL, 0);
1034 m_DriveDisplayMode = (!err && type == REG_DWORD && cb == sizeof(data)) ? (BYTE)data : 0;
1035 }
1036 BOOL bRemoteFirst = m_DriveDisplayMode == 1;
1037 BOOL bNoLetter = m_DriveDisplayMode == 2;
1038 BOOL bAllFirst = m_DriveDisplayMode == 4;
1039 PWSTR pszLabel = pszPath;
1040
1041 if (!bNoLetter && (bAllFirst || (bRemoteFirst && GetDriveTypeW(szDrive) == DRIVE_REMOTE)))
1042 {
1043 bNoLetter = TRUE; // Handling the letter now, don't append it again later
1044 if (!bEditLabel)
1045 pszLabel += wsprintfW(pszPath, L"(%c:) ", szDrive[0]);
1046 }
1047
1048 if (GetDriveLabel(szDrive, pszLabel, MAX_PATH - 7) != S_OK && !bEditLabel)
1049 {
1050 UINT ResourceId = 0;
1051 switch (GetDriveTypeW(szDrive))
1052 {
1053 case DRIVE_REMOVABLE: ResourceId = IDS_DRIVE_REMOVABLE; break; // TODO: Floppy (cached)
1054 case DRIVE_FIXED: ResourceId = IDS_DRIVE_FIXED; break;
1056 case DRIVE_CDROM: ResourceId = IDS_DRIVE_CDROM; break;
1057 }
1058 if (ResourceId)
1059 {
1061 if (len > MAX_PATH - 7)
1062 pszLabel[MAX_PATH-7] = UNICODE_NULL;
1063 }
1064 }
1065
1066 if (!*pszLabel && !bEditLabel) // No label nor fallback description, use SHGDN_FORPARSING
1067 *pszPath = UNICODE_NULL;
1068 else if (!bNoLetter && !bEditLabel)
1069 wsprintfW(pszPath + wcslen(pszPath), L" (%c:)", szDrive[0]);
1070 }
1071
1072 if (!*pszPath && !bEditLabel) // SHGDN_FORPARSING or failure above (except editing empty label)
1073 {
1075 szDrive[2] = UNICODE_NULL; // Remove backslash
1076 wcscpy(pszPath, szDrive);
1077 }
1078 strRet->uType = STRRET_WSTR;
1079 strRet->pOleStr = pszPath;
1080
1081 TRACE("-- (%p)->(%s)\n", this, strRet->uType == STRRET_CSTR ? strRet->cStr : debugstr_w(strRet->pOleStr));
1082 return S_OK;
1083}
1084
1085/**************************************************************************
1086* CDrivesFolder::SetNameOf
1087* Changes the name of a file object or subfolder, possibly changing its item
1088* identifier in the process.
1089*
1090* PARAMETERS
1091* hwndOwner [in] Owner window for output
1092* pidl [in] simple pidl of item to change
1093* lpszName [in] the items new display name
1094* dwFlags [in] SHGNO formatting flags
1095* ppidlOut [out] simple pidl returned
1096*/
1098 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
1099{
1100 if (_ILIsDrive(pidl))
1101 {
1102 WCHAR szDrive[8];
1103 HRESULT hr = GetDrivePath(pidl, szDrive) ? SetDriveLabel(hwndOwner, szDrive, lpName) : E_FAIL;
1104 if (pPidlOut)
1105 *pPidlOut = SUCCEEDED(hr) ? _ILCreateDrive(szDrive) : NULL;
1106 return hr;
1107 }
1108 return m_regFolder->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
1109}
1110
1112{
1114 if (SUCCEEDED(hr))
1115 SHChangeNotify(SHCNE_RENAMEFOLDER, SHCNF_PATHW, DrivePath, DrivePath); // DisplayName changed
1116 else if (hwndOwner)
1117 SHELL_ErrorBox(hwndOwner, hr);
1118 return hr;
1119}
1120
1122{
1123 FIXME("(%p)\n", this);
1124 return E_NOTIMPL;
1125}
1126
1128{
1129 FIXME("(%p)\n", this);
1130 return E_NOTIMPL;
1131}
1132
1134{
1135 TRACE("(%p)\n", this);
1136
1137 if (pSort)
1138 *pSort = 0;
1139 if (pDisplay)
1140 *pDisplay = 0;
1141 return S_OK;
1142}
1143
1145{
1146 TRACE("(%p)\n", this);
1147
1148 if (!pcsFlags || iColumn >= _countof(MyComputerSFHeader))
1149 return E_INVALIDARG;
1150 *pcsFlags = MyComputerSFHeader[iColumn].colstate;
1151 return S_OK;
1152}
1153
1155{
1156 FIXME("(%p)\n", this);
1157 return E_NOTIMPL;
1158}
1159
1161{
1162 HRESULT hr;
1163
1164 TRACE("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
1165
1166 if (!psd || iColumn >= _countof(MyComputerSFHeader))
1167 return E_INVALIDARG;
1168
1169 if (!pidl)
1170 {
1171 psd->fmt = MyComputerSFHeader[iColumn].fmt;
1172 psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
1173 return SHSetStrRet(&psd->str, MyComputerSFHeader[iColumn].colnameid);
1174 }
1175 else if (!_ILIsDrive(pidl))
1176 {
1177 switch (MyComputerSFHeader[iColumn].colnameid)
1178 {
1181 return m_regFolder->GetDetailsOf(pidl, iColumn, psd);
1184 return SHSetStrRet(&psd->str, ""); /* blank col */
1186 return m_regFolder->GetDetailsOf(pidl, 2, psd); /* 2 = comments */
1188 }
1189 }
1190 else
1191 {
1192 ULARGE_INTEGER ulTotalBytes, ulFreeBytes;
1193 CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
1194 UINT DriveType = GetDriveTypeA(pszDrive);
1197
1198 switch (MyComputerSFHeader[iColumn].colnameid)
1199 {
1202 break;
1204 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
1205 hr = SHSetStrRet(&psd->str, IDS_DRIVE_REMOVABLE);
1206 else
1207 hr = SHSetStrRet(&psd->str, iDriveTypeIds[DriveType]);
1208 break;
1211 psd->str.cStr[0] = 0x00;
1212 psd->str.uType = STRRET_CSTR;
1213 if (GetVolumeInformationA(pszDrive, NULL, 0, NULL, NULL, NULL, NULL, 0))
1214 {
1215 GetDiskFreeSpaceExA(pszDrive, &ulFreeBytes, &ulTotalBytes, NULL);
1216 if (iColumn == 2)
1217 StrFormatByteSize64A(ulTotalBytes.QuadPart, psd->str.cStr, MAX_PATH);
1218 else
1219 StrFormatByteSize64A(ulFreeBytes.QuadPart, psd->str.cStr, MAX_PATH);
1220 }
1221 hr = S_OK;
1222 break;
1224 hr = SHSetStrRet(&psd->str, ""); /* FIXME: comments */
1225 break;
1227 }
1228 }
1229
1230 return hr;
1231}
1232
1234{
1235 FIXME("(%p)\n", this);
1236 return E_NOTIMPL;
1237}
1238
1239/************************************************************************
1240 * CDrivesFolder::GetClassID
1241 */
1243{
1244 TRACE("(%p)\n", this);
1245
1246 if (!lpClassId)
1247 return E_POINTER;
1248
1249 *lpClassId = CLSID_MyComputer;
1250 return S_OK;
1251}
1252
1253/************************************************************************
1254 * CDrivesFolder::Initialize
1255 *
1256 * NOTES: it makes no sense to change the pidl
1257 */
1259{
1260 return S_OK;
1261}
1262
1263/**************************************************************************
1264 * CDrivesFolder::GetCurFolder
1265 */
1267{
1268 TRACE("(%p)->(%p)\n", this, pidl);
1269
1270 if (!pidl)
1271 return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
1272
1273 *pidl = ILClone(pidlRoot);
1274 return S_OK;
1275}
1276
1277/**************************************************************************
1278 * CDrivesFolder::ShouldShow
1279 */
1281{
1282 if (const CLSID* pClsid = IsRegItem(pidlItem))
1283 return SHELL32_IsShellFolderNamespaceItemHidden(L"HideMyComputerIcons", *pClsid) ? S_FALSE : S_OK;
1284 return S_OK;
1285}
1286
1287/************************************************************************/
1288/* IContextMenuCB interface */
1289
1291{
1292 enum { IDC_PROPERTIES };
1293 /* no data object means no selection */
1294 if (!pdtobj)
1295 {
1296 if (uMsg == DFM_INVOKECOMMAND && wParam == IDC_PROPERTIES)
1297 {
1298 // "System" properties
1299 return SHELL_ExecuteControlPanelCPL(hwndOwner, L"sysdm.cpl") ? S_OK : E_FAIL;
1300 }
1301 else if (uMsg == DFM_MERGECONTEXTMENU) // TODO: DFM_MERGECONTEXTMENU_BOTTOM
1302 {
1303 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1304 HMENU hpopup = CreatePopupMenu();
1306 pqcminfo->idCmdFirst = Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1307 DestroyMenu(hpopup);
1308 return S_OK;
1309 }
1310 }
1311 return SHELL32_DefaultContextMenuCallBack(psf, pdtobj, uMsg);
1312}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
static const REGFOLDERINFO g_RegFolderInfo
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4794
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv)
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)
static const CLSID * IsRegItem(PCUITEMID_CHILD pidl)
BOOL SHELL32_IsShellFolderNamespaceItemHidden(LPCWSTR SubKey, REFCLSID Clsid)
static HRESULT getIconLocationForDrive(IShellFolder *psf, PCITEMID_CHILD pidl, UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
BOOL _ILGetDriveType(LPCITEMIDLIST pidl)
static HRESULT DoFormatDriveAsync(HWND hwnd, UINT nDrive)
#define RETRY_COUNT
HRESULT CDrivesContextMenu_CreateInstance(PCIDLIST_ABSOLUTE pidlFolder, HWND hwnd, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IShellFolder *psf, IContextMenu **ppcm)
#define CMDID_FORMAT
static const CLSID * IsRegItem(PCUITEMID_CHILD pidl)
static BOOL TryToLockOrUnlockDrive(HANDLE hDrive, BOOL bLock)
HRESULT CALLBACK DrivesContextMenuCallback(IShellFolder *psf, HWND hwnd, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
static T * GetDrivePath(PCUITEMID_CHILD pidl, T *Path)
static BOOL DoEjectDrive(const WCHAR *physical, UINT nDriveType, INT *pnStringID)
static const DWORD dwComputerAttributes
BOOL SHELL32_IsShellFolderNamespaceItemHidden(LPCWSTR SubKey, REFCLSID Clsid)
static const REGFOLDERINFO g_RegFolderInfo
static HRESULT GetRawDriveLabel(PCWSTR DrivePath, LPWSTR szLabel, UINT cchMax)
static int iDriveIconIds[7]
static const shvheader MyComputerSFHeader[]
static int iDriveTypeIds[7]
static INT8 GetDriveNumber(PCUITEMID_CHILD pidl)
#define CMDID_EJECT
BOOL IsDriveFloppyA(LPCSTR pszDriveRoot)
Definition: drvdefext.cpp:386
static const REQUIREDREGITEM g_RequiredItems[]
static HRESULT getLabelForDriveFromAutoRun(PCWSTR wszPath, LPWSTR szLabel, UINT cchMax)
static const DWORD dwDriveAttributes
static const DWORD dwControlPanelAttributes
#define CMDID_DISCONNECT
#define RETRY_SLEEP
static HRESULT GetDriveLabel(PCWSTR DrivePath, LPWSTR szLabel, UINT cchMax)
static DWORD CALLBACK DoFormatDriveThread(LPVOID args)
HRESULT CDrivesExtractIcon_CreateInstance(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
HRESULT CRegFolder_CreateInstance(PREGFOLDERINITDATA pInit, LPCITEMIDLIST pidlRoot, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:953
UINT DriveType
INT ResourceId
Definition: LoadImageGCC.c:72
signed char INT8
PRTL_UNICODE_STRING_BUFFER Path
#define shell32_hInstance
UINT cchMax
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define IDS_PROPERTIES
Definition: resource.h:108
PWCHAR Label
Definition: format.c:70
#define _stricmp
Definition: cat.c:22
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags, IEnumIDList *pRegEnumerator)
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
STDMETHOD() GetCurFolder(PIDLIST_ABSOLUTE *pidl) override
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
STDMETHOD() Initialize(PCIDLIST_ABSOLUTE pidl) override
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
STDMETHOD() GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
STDMETHOD() BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() GetDefaultSearchGUID(GUID *pguid) override
STDMETHOD() CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) override
STDMETHOD() ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override
STDMETHOD() ShouldShow(IShellFolder *psf, PCIDLIST_ABSOLUTE pidlFolder, PCUITEMID_CHILD pidlItem) override
STDMETHOD() GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) override
STDMETHOD() GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
STDMETHOD() GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
STDMETHOD() MapColumnToSCID(UINT column, SHCOLUMNID *pscid) override
CComPtr< IShellFolder2 > m_regFolder
Definition: CDrivesFolder.h:38
static HRESULT SetDriveLabel(HWND hwndOwner, PCWSTR DrivePath, PCWSTR Label)
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
LPITEMIDLIST pidlRoot
Definition: CDrivesFolder.h:37
INT8 m_DriveDisplayMode
Definition: CDrivesFolder.h:39
STDMETHOD() CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
HRESULT WINAPI FinalConstruct()
STDMETHOD() SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
STDMETHOD() BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() GetClassID(CLSID *lpClassId) override
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
BOOL AddToEnumList(LPITEMIDLIST pidl)
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
@ TYPE_FORMATDRIVE
Definition: precomp.h:208
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
wcscpy
#define CHARS_IN_GUID
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:322
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:438
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDS_SHV_COLUMN_TYPE
Definition: resource.h:78
#define IDS_SHV_COLUMN_NAME
Definition: resource.h:77
#define IDC_PROPERTIES
Definition: resource.h:32
#define GET_SHGDN_RELATION(dwFlags)
Definition: precomp.h:53
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
UINT uFlags
Definition: api.c:59
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define FILE_SHARE_READ
Definition: compat.h:136
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
UINT WINAPI GetDriveTypeA(IN LPCSTR lpRootPathName)
Definition: disk.c:468
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
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 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
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
BOOL WINAPI SetVolumeLabelW(IN LPCWSTR lpRootPathName, IN LPCWSTR lpVolumeName OPTIONAL)
Definition: volume.c:503
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
Definition: profile.c:1142
#define RRF_RT_DWORD
Definition: driver.c:581
DWORD WINAPI SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
Definition: drive.cpp:762
#define SHELL_ExecuteControlPanelCPL(hwnd, cpl)
Definition: precomp.h:188
DWORD BindCtx_GetMode(_In_ IBindCtx *pbc, _In_ DWORD dwDefault)
Definition: utils.cpp:278
HRESULT SHIsFileSysBindCtx(_In_ IBindCtx *pBindCtx, _Out_opt_ WIN32_FIND_DATAW *pFindData)
Definition: utils.cpp:303
HRESULT SHELL32_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdo, UINT msg)
Definition: shlfolder.cpp:528
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
LPWSTR WINAPI PathBuildRootW(LPWSTR lpszPath, int drive)
Definition: path.c:348
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1729
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1098
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1585
LONG WINAPI SHRegGetUSValueW(LPCWSTR pSubKey, LPCWSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData, BOOL flagIgnoreHKCU, LPVOID pDefaultData, DWORD wDefaultDataSize)
Definition: reg.c:594
LPSTR WINAPI StrFormatByteSize64A(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
Definition: string.c:2502
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback)
Definition: thread.c:356
#define UlongToPtr(u)
Definition: config.h:106
#define PtrToUlong(u)
Definition: config.h:107
BOOL IsDriveFloppyA(LPCSTR pszDriveRoot)
Definition: drvdefext.cpp:386
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
#define FILE_READ_ONLY_VOLUME
Definition: from_kernel.h:246
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLsizei len
Definition: glext.h:6722
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
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT SHELL32_ShowFilesystemItemPropertiesDialogAsync(IDataObject *pDO)
Definition: item_prop.cpp:157
#define debugstr_w
Definition: kernel32.h:32
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define END_COM_MAP()
Definition: atlcom.h:592
#define T
Definition: mbstring.h:31
#define PT_COMPUTER_REGITEM
Definition: lnktool.cpp:39
#define HResultFromWin32
Definition: loader.cpp:14
#define DRIVE_CDROM
Definition: machpc98.h:119
LPCWSTR szPath
Definition: env.c:37
static unsigned int number
Definition: dsound.c:1479
HRESULT hres
Definition: protocol.c:465
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static LPOLESTR
Definition: stg_prop.c:27
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
REFCLSID clsid
Definition: msctf.c:82
unsigned int UINT
Definition: ndis.h:50
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FSCTL_LOCK_VOLUME
Definition: nt_native.h:832
#define FSCTL_UNLOCK_VOLUME
Definition: nt_native.h:833
#define FSCTL_DISMOUNT_VOLUME
Definition: nt_native.h:834
#define DEFAULT_UNREACHABLE
#define UNICODE_NULL
#define IOCTL_STORAGE_EJECT_MEDIA
Definition: ntddstor.h:107
#define IOCTL_STORAGE_MEDIA_REMOVAL
Definition: ntddstor.h:104
#define L(x)
Definition: ntvdm.h:50
#define STGM_CREATE
Definition: objbase.h:926
interface IBindCtx * LPBC
Definition: objfwd.h:18
const GUID IID_IDataObject
#define PathAppendW
Definition: pathcch.h:309
#define LOWORD(l)
Definition: pedump.c:82
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1763
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)
Definition: pidl.c:1965
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2236
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2084
DWORD _ILGetDrive(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uSize)
Definition: pidl.c:2010
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl)
Definition: pidl.c:2572
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:100
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2095
#define PT_GUID
Definition: pidl.h:87
#define PT_SHELLEXT
Definition: pidl.h:91
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define LVCFMT_RIGHT
Definition: commctrl.h:2604
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
#define err(...)
#define REGSTR_PATH_EXPLORER
Definition: regstr.h:33
#define REG_DWORD
Definition: sdbapi.c:596
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:314
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:623
#define SHELL_ErrorBox
Definition: shellutils.h:126
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:208
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:246
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:264
static __inline int SHELL32_GUIDToStringW(REFGUID guid, LPWSTR str)
Definition: shfldr.h:144
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:323
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:287
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE *ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
Definition: shlfolder.cpp:414
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
HRESULT hr
Definition: shlfolder.c:183
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
#define SHCNE_DRIVEREMOVED
Definition: shlobj.h:1905
#define SHCNE_RENAMEFOLDER
Definition: shlobj.h:1915
#define SHCNE_MEDIAREMOVED
Definition: shlobj.h:1904
#define SHFMT_ID_DEFAULT
Definition: shlobj.h:332
#define SHCNF_PATHW
Definition: shlobj.h:1933
#define MM_ADDSEPARATOR
Definition: shlobj.h:2536
struct _SFV_CREATE SFV_CREATE
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2620
#define SHCNF_FLUSHNOWAIT
Definition: shlobj.h:1937
#define CTF_PROCESS_REF
Definition: shlwapi.h:1980
#define IDS_DISCONNECT
Definition: shresdef.h:244
#define IDS_DRIVE_CDROM
Definition: shresdef.h:112
#define IDS_CANTDISMOUNTVOLUME
Definition: shresdef.h:148
#define IDS_EJECT
Definition: shresdef.h:243
#define IDS_DRIVE_FIXED
Definition: shresdef.h:111
#define IDS_DRIVE_NETWORK
Definition: shresdef.h:113
#define IDS_DRIVE_REMOVABLE
Definition: shresdef.h:115
#define IDI_SHELL_3_14_FLOPPY
Definition: shresdef.h:585
#define IDI_SHELL_NETDRIVE
Definition: shresdef.h:588
#define IDS_CANTLOCKVOLUME
Definition: shresdef.h:147
#define IDS_DRIVE_FLOPPY
Definition: shresdef.h:114
#define IDS_SHV_COLUMN_DISK_AVAILABLE
Definition: shresdef.h:55
#define IDI_SHELL_DOCUMENT
Definition: shresdef.h:579
#define IDI_SHELL_CDROM
Definition: shresdef.h:590
#define IDI_SHELL_DRIVE
Definition: shresdef.h:587
#define IDS_CANTEJECTMEDIA
Definition: shresdef.h:149
#define IDI_SHELL_RAMDISK
Definition: shresdef.h:591
#define IDS_CANTDISCONNECT
Definition: shresdef.h:151
#define IDI_SHELL_REMOVEABLE
Definition: shresdef.h:586
#define IDS_SHV_COLUMN_DISK_CAPACITY
Definition: shresdef.h:54
#define IDS_FORMATDRIVE
Definition: shresdef.h:229
#define IDS_SHV_COLUMN_COMMENTS
Definition: shresdef.h:67
ITEMID_CHILD UNALIGNED * PUITEMID_CHILD
Definition: shtypes.idl:68
@ STRRET_CSTR
Definition: shtypes.idl:87
@ STRRET_WSTR
Definition: shtypes.idl:85
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
@ SHCOLSTATE_TYPE_STR
Definition: shtypes.idl:121
@ SHCOLSTATE_ONBYDEFAULT
Definition: shtypes.idl:125
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
DWORD SHCOLSTATEF
Definition: shtypes.idl:142
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
STRRET str
Definition: shtypes.idl:108
BOOLEAN PreventMediaRemoval
Definition: ntddstor.h:343
HMENU hmenu
Definition: shlobj.h:1398
UINT idCmdLast
Definition: shlobj.h:1401
UINT idCmdFirst
Definition: shlobj.h:1400
UINT indexMenu
Definition: shlobj.h:1399
char cStr[MAX_PATH]
Definition: shtypes.idl:98
UINT uType
Definition: shtypes.idl:93
LPWSTR pOleStr
Definition: shtypes.idl:96
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
Definition: stubgen.c:11
Definition: match.c:390
Definition: name.c:39
WORD colstate
Definition: shfldr.h:31
struct tagDriveStruct drive
Definition: pidl.h:214
union tagPIDLDATA::@587 u
struct _stub stub
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
LONGLONG QuadPart
Definition: typedefs.h:114
#define _T(x)
Definition: vfdio.h:22
#define DRIVE_UNKNOWN
Definition: winbase.h:282
#define DRIVE_NO_ROOT_DIR
Definition: winbase.h:283
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define GetDriveType
Definition: winbase.h:3843
#define DRIVE_REMOTE
Definition: winbase.h:279
_In_ LPCSTR lpName
Definition: winbase.h:2820
DWORD WINAPI GetLogicalDrives(void)
Definition: disk.c:110
#define DRIVE_RAMDISK
Definition: winbase.h:281
#define DRIVE_FIXED
Definition: winbase.h:278
#define DRIVE_REMOVABLE
Definition: winbase.h:277
#define CreateFile
Definition: winbase.h:3780
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define E_POINTER
Definition: winerror.h:2365
#define HRESULT_CODE(hr)
Definition: winerror.h:76
#define HKEY_CURRENT_USER
Definition: winreg.h:11
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define MFT_SEPARATOR
Definition: winuser.h:755
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:798
#define MFS_ENABLED
Definition: winuser.h:761
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MFT_STRING
Definition: winuser.h:757
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
DWORD WINAPI WNetCancelConnection2W(LPCWSTR lpName, DWORD dwFlags, BOOL fForce)
Definition: wnet.c:2420
#define IID_PPV_ARG(Itype, ppType)
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175
unsigned char BYTE
Definition: xxhash.c:193