ReactOS 0.4.15-dev-8636-g945e856
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{
64 PT_COMPUTER_REGITEM,
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 WCHAR szDrive[8];
84 if (!_ILGetDrive(pidl, szDrive, _countof(szDrive)))
85 {
86 ERR("pidl %p is not a drive\n", pidl);
87 return DRIVE_UNKNOWN;
88 }
89 return ::GetDriveTypeW(szDrive);
90}
91
93{
94 // If this function returns true, the item should be hidden in DefView but not in the Explorer folder tree.
96 wsprintfW(path, L"%s\\%s", REGSTR_PATH_EXPLORER, SubKey);
98 DWORD data = 0, size = sizeof(data);
100}
101
102/***********************************************************************
103* IShellFolder implementation
104*/
105
106#define RETRY_COUNT 3
107#define RETRY_SLEEP 250
109{
110 DWORD dwError, dwBytesReturned;
111 DWORD dwCode = (bLock ? FSCTL_LOCK_VOLUME : FSCTL_UNLOCK_VOLUME);
112 for (DWORD i = 0; i < RETRY_COUNT; ++i)
113 {
114 if (DeviceIoControl(hDrive, dwCode, NULL, 0, NULL, 0, &dwBytesReturned, NULL))
115 return TRUE;
116
117 dwError = GetLastError();
118 if (dwError == ERROR_INVALID_FUNCTION)
119 break; /* don't sleep if function is not implemented */
120
122 }
123 SetLastError(dwError);
124 return FALSE;
125}
126
127// NOTE: See also https://support.microsoft.com/en-us/help/165721/how-to-ejecting-removable-media-in-windows-nt-windows-2000-windows-xp
128static BOOL DoEjectDrive(const WCHAR *physical, UINT nDriveType, INT *pnStringID)
129{
130 /* GENERIC_WRITE isn't needed for umount */
131 DWORD dwAccessMode = GENERIC_READ;
132 DWORD dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
133
134 HANDLE hDrive = CreateFile(physical, dwAccessMode, dwShareMode, 0, OPEN_EXISTING, 0, NULL);
135 if (hDrive == INVALID_HANDLE_VALUE)
136 return FALSE;
137
138 BOOL bResult, bNeedUnlock = FALSE;
139 DWORD dwBytesReturned, dwError = NO_ERROR;
140 PREVENT_MEDIA_REMOVAL removal;
141 do
142 {
143 bResult = TryToLockOrUnlockDrive(hDrive, TRUE);
144 if (!bResult)
145 {
146 dwError = GetLastError();
147 *pnStringID = IDS_CANTLOCKVOLUME; /* Unable to lock volume */
148 break;
149 }
150 bResult = DeviceIoControl(hDrive, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &dwBytesReturned, NULL);
151 if (!bResult)
152 {
153 dwError = GetLastError();
154 *pnStringID = IDS_CANTDISMOUNTVOLUME; /* Unable to dismount volume */
155 bNeedUnlock = TRUE;
156 break;
157 }
158 removal.PreventMediaRemoval = FALSE;
159 bResult = DeviceIoControl(hDrive, IOCTL_STORAGE_MEDIA_REMOVAL, &removal, sizeof(removal), NULL,
160 0, &dwBytesReturned, NULL);
161 if (!bResult)
162 {
163 *pnStringID = IDS_CANTEJECTMEDIA; /* Unable to eject media */
164 dwError = GetLastError();
165 bNeedUnlock = TRUE;
166 break;
167 }
168 bResult = DeviceIoControl(hDrive, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &dwBytesReturned, NULL);
169 if (!bResult)
170 {
171 *pnStringID = IDS_CANTEJECTMEDIA; /* Unable to eject media */
172 dwError = GetLastError();
173 bNeedUnlock = TRUE;
174 break;
175 }
176 } while (0);
177
178 if (bNeedUnlock)
179 {
181 }
182
183 CloseHandle(hDrive);
184
185 SetLastError(dwError);
186 return bResult;
187}
188
189// A callback function for finding the stub windows.
190static BOOL CALLBACK
192{
193 CSimpleArray<HWND> *pStubs = reinterpret_cast<CSimpleArray<HWND> *>(lParam);
194
195 WCHAR szClass[64];
196 GetClassNameW(hwnd, szClass, _countof(szClass));
197
198 if (lstrcmpiW(szClass, L"StubWindow32") == 0)
199 {
200 pStubs->Add(hwnd);
201 }
202
203 return TRUE;
204}
205
206// Another callback function to find the owned window of the stub window.
207static BOOL CALLBACK
209{
210 HWND *phwnd = reinterpret_cast<HWND *>(lParam);
211
212 if (phwnd[0] == GetWindow(hwnd, GW_OWNER))
213 {
214 phwnd[1] = hwnd;
215 return FALSE;
216 }
217
218 return TRUE;
219}
220
221// Parameters for format_drive_thread function below.
223{
225};
226
227static unsigned __stdcall format_drive_thread(void *args)
228{
230 UINT nDriveNumber = params->nDriveNumber;
231 LONG_PTR nProp = nDriveNumber | 0x7F00;
232
233 // Search the stub windows that already exist.
234 CSimpleArray<HWND> old_stubs;
235 EnumWindows(EnumStubProc, (LPARAM)&old_stubs);
236
237 for (INT n = 0; n < old_stubs.GetSize(); ++n)
238 {
239 HWND hwndStub = old_stubs[n];
240
241 // The target stub window has the prop.
242 if (GetPropW(hwndStub, L"DriveNumber") == (HANDLE)nProp)
243 {
244 // Found.
245 HWND ahwnd[2];
246 ahwnd[0] = hwndStub;
247 ahwnd[1] = NULL;
249
250 // Activate.
251 BringWindowToTop(ahwnd[1]);
252
253 delete params;
254 return 0;
255 }
256 }
257
258 // Create a stub window.
262 if (!stub.Create(NULL, NULL, NULL, style, exstyle))
263 {
264 ERR("StubWindow32 creation failed\n");
265 delete params;
266 return 0;
267 }
268
269 // Add prop to the target stub window.
270 SetPropW(stub, L"DriveNumber", (HANDLE)nProp);
271
272 // Do format.
273 SHFormatDrive(stub, nDriveNumber, SHFMT_ID_DEFAULT, 0);
274
275 // Clean up.
276 RemovePropW(stub, L"DriveNumber");
277 stub.DestroyWindow();
278 delete params;
279
280 return 0;
281}
282
283static HRESULT DoFormatDrive(HWND hwnd, UINT nDriveNumber)
284{
286 params->nDriveNumber = nDriveNumber;
287
288 // Create thread to avoid locked.
289 unsigned tid;
291 if (hThread == NULL)
292 {
293 delete params;
294 return E_FAIL;
295 }
296
298
299 return S_OK;
300}
301
303 HWND hwnd,
304 IDataObject *pdtobj,
305 UINT uMsg,
308{
309 if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
310 return SHELL32_DefaultContextMenuCallBack(psf, pdtobj, uMsg);
311
312 PIDLIST_ABSOLUTE pidlFolder;
313 PUITEMID_CHILD *apidl;
314 UINT cidl;
315 UINT nDriveType;
317 HRESULT hr = SH_GetApidlFromDataObject(pdtobj, &pidlFolder, &apidl, &cidl);
319 return hr;
320
321 WCHAR szDrive[8] = {0};
322 if (!_ILGetDrive(apidl[0], szDrive, _countof(szDrive)))
323 {
324 ERR("pidl is not a drive\n");
325 SHFree(pidlFolder);
326 _ILFreeaPidl(apidl, cidl);
327 return E_FAIL;
328 }
329 nDriveType = GetDriveTypeW(szDrive);
330 GetVolumeInformationW(szDrive, NULL, 0, NULL, NULL, &dwFlags, NULL, 0);
331
332// custom command IDs
333#if 0 // Disabled until our menu building system is fixed
334#define CMDID_FORMAT 0
335#define CMDID_EJECT 1
336#define CMDID_DISCONNECT 2
337#else
338/* FIXME: These IDs should start from 0, however there is difference
339 * between ours and Windows' menu building systems, which should be fixed. */
340#define CMDID_FORMAT 1
341#define CMDID_EJECT 2
342#define CMDID_DISCONNECT 3
343#endif
344
345 if (uMsg == DFM_MERGECONTEXTMENU)
346 {
347 QCMINFO *pqcminfo = (QCMINFO *)lParam;
348
349 UINT idCmdFirst = pqcminfo->idCmdFirst;
350 UINT idCmd = 0;
351 if (!(dwFlags & FILE_READ_ONLY_VOLUME) && nDriveType != DRIVE_REMOTE)
352 {
353 /* add separator and Format */
354 idCmd = idCmdFirst + CMDID_FORMAT;
355 _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
357 }
358 if (nDriveType == DRIVE_REMOVABLE || nDriveType == DRIVE_CDROM)
359 {
360 /* add separator and Eject */
361 idCmd = idCmdFirst + CMDID_EJECT;
362 _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
364 }
365 if (nDriveType == DRIVE_REMOTE)
366 {
367 /* add separator and Disconnect */
368 idCmd = idCmdFirst + CMDID_DISCONNECT;
369 _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
371 }
372
373 if (idCmd)
374#if 0 // see FIXME above
375 pqcminfo->idCmdFirst = ++idCmd;
376#else
377 pqcminfo->idCmdFirst = (idCmd + 2);
378#endif
379 hr = S_OK;
380 }
381 else if (uMsg == DFM_INVOKECOMMAND)
382 {
383 WCHAR wszBuf[4] = L"A:\\";
384 wszBuf[0] = (WCHAR)szDrive[0];
385
386 INT nStringID = 0;
387 DWORD dwError = NO_ERROR;
388
390 {
391 // pdtobj should be valid at this point!
392 ATLASSERT(pdtobj);
393 hr = SH_ShowDriveProperties(wszBuf, pdtobj) ? S_OK : E_UNEXPECTED;
394 if (FAILED(hr))
395 {
396 dwError = ERROR_CAN_NOT_COMPLETE;
397 nStringID = IDS_CANTSHOWPROPERTIES;
398 }
399 }
400 else
401 {
402 if (wParam == CMDID_FORMAT)
403 {
404 hr = DoFormatDrive(hwnd, szDrive[0] - 'A');
405 }
406 else if (wParam == CMDID_EJECT)
407 {
408 /* do eject */
409 WCHAR physical[10];
410 wsprintfW(physical, _T("\\\\.\\%c:"), szDrive[0]);
411
412 if (DoEjectDrive(physical, nDriveType, &nStringID))
413 {
415 }
416 else
417 {
418 dwError = GetLastError();
419 }
420 }
421 else if (wParam == CMDID_DISCONNECT)
422 {
423 /* do disconnect */
424 wszBuf[2] = UNICODE_NULL;
425 dwError = WNetCancelConnection2W(wszBuf, 0, FALSE);
426 if (dwError == NO_ERROR)
427 {
429 }
430 else
431 {
432 nStringID = IDS_CANTDISCONNECT;
433 }
434 }
435 }
436
437 if (nStringID != 0)
438 {
439 /* show error message */
440 WCHAR szFormat[128], szMessage[128];
441 LoadStringW(shell32_hInstance, nStringID, szFormat, _countof(szFormat));
442 wsprintfW(szMessage, szFormat, dwError);
443 MessageBoxW(hwnd, szMessage, NULL, MB_ICONERROR);
444 }
445 }
446
447 SHFree(pidlFolder);
448 _ILFreeaPidl(apidl, cidl);
449
450 return hr;
451}
452
454 HWND hwnd,
455 UINT cidl,
457 IShellFolder *psf,
458 IContextMenu **ppcm)
459{
460 HKEY hKeys[2];
461 UINT cKeys = 0;
462 AddClassKeyToArray(L"Drive", hKeys, &cKeys);
463 AddClassKeyToArray(L"Folder", hKeys, &cKeys);
464
465 return CDefFolderMenu_Create2(pidlFolder, hwnd, cidl, apidl, psf, DrivesContextMenuCallback, cKeys, hKeys, ppcm);
466}
467
468static HRESULT
470 LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
471{
472 WCHAR wszPath[MAX_PATH];
473 WCHAR wszAutoRunInfPath[MAX_PATH];
474 WCHAR wszValue[MAX_PATH], wszTemp[MAX_PATH];
475
476 // get path
477 if (!ILGetDisplayNameExW(psf, pidl, wszPath, 0))
478 return E_FAIL;
479 if (!PathIsDirectoryW(wszPath))
480 return E_FAIL;
481
482 // build the full path of autorun.inf
483 StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath);
484 PathAppendW(wszAutoRunInfPath, L"autorun.inf");
485
486 // autorun.inf --> wszValue
487 if (GetPrivateProfileStringW(L"autorun", L"icon", NULL, wszValue, _countof(wszValue),
488 wszAutoRunInfPath) && wszValue[0] != 0)
489 {
490 // wszValue --> wszTemp
491 ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp));
492
493 // parse the icon location
494 *piIndex = PathParseIconLocationW(wszTemp);
495
496 // wszPath + wszTemp --> wszPath
497 if (PathIsRelativeW(wszTemp))
498 PathAppendW(wszPath, wszTemp);
499 else
500 StringCchCopyW(wszPath, _countof(wszPath), wszTemp);
501
502 // wszPath --> szIconFile
503 GetFullPathNameW(wszPath, cchMax, szIconFile, NULL);
504
505 return S_OK;
506 }
507
508 return E_FAIL;
509}
510
511static HRESULT
513{
514 WCHAR wszAutoRunInfPath[MAX_PATH];
515 WCHAR wszTemp[MAX_PATH];
516
517 if (!PathIsDirectoryW(wszPath))
518 return E_FAIL;
519
520 StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath);
521 PathAppendW(wszAutoRunInfPath, L"autorun.inf");
522
523 if (GetPrivateProfileStringW(L"autorun", L"label", NULL, wszTemp, _countof(wszTemp),
524 wszAutoRunInfPath) && wszTemp[0] != 0)
525 {
526 StringCchCopyW(wszLabel, _countof(wszTemp), wszTemp);
527 return S_OK;
528 }
529
530 return E_FAIL;
531}
532
533BOOL IsDriveFloppyA(LPCSTR pszDriveRoot);
534
536{
537 CComPtr<IDefaultExtractIconInit> initIcon;
540 return hr;
541
542 CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
543 UINT DriveType = GetDriveTypeA(pszDrive);
546
547 WCHAR wTemp[MAX_PATH];
548 int icon_idx, reg_idx;
549 UINT flags = 0;
550
551 switch (DriveType)
552 {
553 case DRIVE_FIXED:
554 case DRIVE_UNKNOWN:
555 reg_idx = IDI_SHELL_DRIVE;
556 break;
557 case DRIVE_CDROM:
558 reg_idx = IDI_SHELL_CDROM;
559 break;
560 case DRIVE_REMOTE:
561 reg_idx = IDI_SHELL_NETDRIVE;
562 break;
563 case DRIVE_REMOVABLE:
564 if (!IsDriveFloppyA(pszDrive))
565 reg_idx = IDI_SHELL_REMOVEABLE;
566 else
567 reg_idx = IDI_SHELL_3_14_FLOPPY;
568 break;
569 case DRIVE_RAMDISK:
570 reg_idx = IDI_SHELL_RAMDISK;
571 break;
573 default:
574 reg_idx = IDI_SHELL_DOCUMENT;
575 break;
576 }
577
578 hr = getIconLocationForDrive(psf, pidl, 0, wTemp, _countof(wTemp),
579 &icon_idx, &flags);
580 if (SUCCEEDED(hr))
581 {
582 initIcon->SetNormalIcon(wTemp, icon_idx);
583 }
584 else if (HLM_GetIconW(reg_idx - 1, wTemp, _countof(wTemp), &icon_idx))
585 {
586 initIcon->SetNormalIcon(wTemp, icon_idx);
587 }
588 else if ((DriveType == DRIVE_FIXED || DriveType == DRIVE_UNKNOWN) &&
589 (HCR_GetIconW(L"Drive", wTemp, NULL, _countof(wTemp), &icon_idx)))
590 {
591 initIcon->SetNormalIcon(wTemp, icon_idx);
592 }
593 else
594 {
595 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
596 {
597 icon_idx = IDI_SHELL_REMOVEABLE;
598 }
599 else
600 {
601 icon_idx = iDriveIconIds[DriveType];
602 }
603 initIcon->SetNormalIcon(swShell32Name, -icon_idx);
604 }
605
606 return initIcon->QueryInterface(riid, ppvOut);
607}
608
610 public CEnumIDListBase
611{
612 public:
613 HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags, IEnumIDList* pRegEnumerator)
614 {
615 /* enumerate the folders */
616 if (dwFlags & SHCONTF_FOLDERS)
617 {
618 WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
619 DWORD dwDrivemap = GetLogicalDrives();
620
621 while (wszDriveName[0] <= 'Z')
622 {
623 if(dwDrivemap & 0x00000001L)
624 AddToEnumList(_ILCreateDrive(wszDriveName));
625 wszDriveName[0]++;
626 dwDrivemap = dwDrivemap >> 1;
627 }
628 }
629
630 /* Enumerate the items of the reg folder */
631 AppendItemsFromEnumerator(pRegEnumerator);
632
633 return S_OK;
634 }
635
637 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
639};
640
641/***********************************************************************
642* IShellFolder [MyComputer] implementation
643*/
644
651};
652
654 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
655 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
657 SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_CANLINK;
659 SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
660 SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANRENAME | SFGAO_CANLINK;
661
663{
664 pidlRoot = NULL;
665}
666
668{
669 TRACE("-- destroying IShellFolder(%p)\n", this);
671}
672
674{
675 pidlRoot = _ILCreateMyComputer(); /* my qualified pidl */
676 if (pidlRoot == NULL)
677 return E_OUTOFMEMORY;
678
679 REGFOLDERINITDATA RegInit = { static_cast<IShellFolder*>(this), &g_RegFolderInfo };
681 pidlRoot,
683
684 return hr;
685}
686
687/**************************************************************************
688* CDrivesFolder::ParseDisplayName
689*/
691 DWORD * pchEaten, PIDLIST_RELATIVE * ppidl, DWORD * pdwAttributes)
692{
694
695 TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
696 hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
697 pchEaten, ppidl, pdwAttributes);
698
699 if (!ppidl)
700 return hr;
701
702 *ppidl = NULL;
703
704 if (!lpszDisplayName)
705 return hr;
706
707 /* handle CLSID paths */
708 if (lpszDisplayName[0] == L':' && lpszDisplayName[1] == L':')
709 {
710 return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl,
711 pdwAttributes);
712 }
713
714 if (lpszDisplayName[0] &&
715 ((L'A' <= lpszDisplayName[0] && lpszDisplayName[0] <= L'Z') ||
716 (L'a' <= lpszDisplayName[0] && lpszDisplayName[0] <= L'z')) &&
717 lpszDisplayName[1] == L':' && lpszDisplayName[2] == L'\\')
718 {
719 // "C:\..."
720 WCHAR szRoot[8];
721 PathBuildRootW(szRoot, ((*lpszDisplayName - 1) & 0x1F));
722
723 if (SHIsFileSysBindCtx(pbc, NULL) != S_OK && !(BindCtx_GetMode(pbc, 0) & STGM_CREATE))
724 {
725 if (::GetDriveType(szRoot) == DRIVE_NO_ROOT_DIR)
727 }
728
729 CComHeapPtr<ITEMIDLIST> pidlTemp(_ILCreateDrive(szRoot));
730 if (!pidlTemp)
731 return E_OUTOFMEMORY;
732
733 if (lpszDisplayName[3])
734 {
735 CComPtr<IShellFolder> pChildFolder;
736 hr = BindToObject(pidlTemp, pbc, IID_PPV_ARG(IShellFolder, &pChildFolder));
738 return hr;
739
740 ULONG chEaten;
741 CComHeapPtr<ITEMIDLIST> pidlChild;
742 hr = pChildFolder->ParseDisplayName(hwndOwner, pbc, &lpszDisplayName[3], &chEaten,
743 &pidlChild, pdwAttributes);
745 return hr;
746
747 hr = SHILCombine(pidlTemp, pidlChild, ppidl);
748 }
749 else
750 {
751 *ppidl = pidlTemp.Detach();
752 if (pdwAttributes && *pdwAttributes)
753 GetAttributesOf(1, (PCUITEMID_CHILD_ARRAY)ppidl, pdwAttributes);
754 hr = S_OK;
755 }
756 }
757
758 TRACE("(%p)->(-- ret=0x%08x)\n", this, hr);
759
760 return hr;
761}
762
763/**************************************************************************
764* CDrivesFolder::EnumObjects
765*/
766HRESULT WINAPI CDrivesFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
767{
768 CComPtr<IEnumIDList> pRegEnumerator;
769 m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
770
771 return ShellObjectCreatorInit<CDrivesFolderEnum>(hwndOwner, dwFlags, pRegEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
772}
773
774/**************************************************************************
775* CDrivesFolder::BindToObject
776*/
778{
779 TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", this,
780 pidl, pbcReserved, shdebugstr_guid(&riid), ppvOut);
781
782 if (!pidl)
783 return E_INVALIDARG;
784
785 if (_ILIsSpecialFolder(pidl))
786 return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);
787
788 CHAR* pchDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
789
790 PERSIST_FOLDER_TARGET_INFO pfti = {0};
791 pfti.dwAttributes = -1;
792 pfti.csidl = -1;
793 pfti.szTargetParsingName[0] = *pchDrive;
794 pfti.szTargetParsingName[1] = L':';
795 pfti.szTargetParsingName[2] = L'\\';
796
798 &pfti,
799 pidl,
800 &CLSID_ShellFSFolder,
801 riid,
802 ppvOut);
804 return hr;
805
806 return S_OK;
807}
808
809/**************************************************************************
810* CDrivesFolder::BindToStorage
811*/
813{
814 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this,
815 pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
816
817 *ppvOut = NULL;
818 return E_NOTIMPL;
819}
820
821/**************************************************************************
822* CDrivesFolder::CompareIDs
823*/
824
826{
828
829 if (!pidl1 || !pidl2)
830 {
831 ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
832 return E_INVALIDARG;
833 }
834
835 if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
836 return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
837
838 UINT iColumn = LOWORD(lParam);
839 if (!_ILIsDrive(pidl1) || !_ILIsDrive(pidl2) || iColumn >= _countof(MyComputerSFHeader))
840 return E_INVALIDARG;
841
842 CHAR* pszDrive1 = _ILGetDataPointer(pidl1)->u.drive.szDriveName;
843 CHAR* pszDrive2 = _ILGetDataPointer(pidl2)->u.drive.szDriveName;
844
845 int result;
846 switch (MyComputerSFHeader[iColumn].colnameid)
847 {
849 {
850 result = stricmp(pszDrive1, pszDrive2);
852 break;
853 }
855 {
856 /* We want to return immediately because SHELL32_CompareDetails also compares children. */
857 return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
858 }
861 {
862 ULARGE_INTEGER Drive1Available, Drive1Total, Drive2Available, Drive2Total;
863
864 if (GetVolumeInformationA(pszDrive1, NULL, 0, NULL, NULL, NULL, NULL, 0))
865 GetDiskFreeSpaceExA(pszDrive1, &Drive1Available, &Drive1Total, NULL);
866 else
867 Drive1Available.QuadPart = Drive1Total.QuadPart = 0;
868
869 if (GetVolumeInformationA(pszDrive2, NULL, 0, NULL, NULL, NULL, NULL, 0))
870 GetDiskFreeSpaceExA(pszDrive2, &Drive2Available, &Drive2Total, NULL);
871 else
872 Drive2Available.QuadPart = Drive2Total.QuadPart = 0;
873
874 LARGE_INTEGER Diff;
875 if (lParam == 3) /* Size */
876 Diff.QuadPart = Drive1Total.QuadPart - Drive2Total.QuadPart;
877 else /* Size available */
878 Diff.QuadPart = Drive1Available.QuadPart - Drive2Available.QuadPart;
879
881 break;
882 }
885 break;
887 }
888
889 if (HRESULT_CODE(hres) == 0)
890 return SHELL32_CompareChildren(this, lParam, pidl1, pidl2);
891
892 return hres;
893}
894
895/**************************************************************************
896* CDrivesFolder::CreateViewObject
897*/
899{
900 CComPtr<IShellView> pShellView;
902
903 TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
904 hwndOwner, shdebugstr_guid (&riid), ppvOut);
905
906 if (!ppvOut)
907 return hr;
908
909 *ppvOut = NULL;
910
911 if (IsEqualIID(riid, IID_IDropTarget))
912 {
913 WARN("IDropTarget not implemented\n");
914 hr = E_NOTIMPL;
915 }
916 else if (IsEqualIID(riid, IID_IContextMenu))
917 {
918 HKEY hKeys[16];
919 UINT cKeys = 0;
920 AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
921
922 DEFCONTEXTMENU dcm;
923 dcm.hwnd = hwndOwner;
924 dcm.pcmcb = this;
925 dcm.pidlFolder = pidlRoot;
926 dcm.psf = this;
927 dcm.cidl = 0;
928 dcm.apidl = NULL;
929 dcm.cKeys = cKeys;
930 dcm.aKeys = hKeys;
932 hr = SHCreateDefaultContextMenu(&dcm, riid, ppvOut);
933 }
934 else if (IsEqualIID(riid, IID_IShellView))
935 {
936 SFV_CREATE sfvparams = { sizeof(SFV_CREATE), this, NULL, static_cast<IShellFolderViewCB*>(this) };
937 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
938 }
939 TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
940 return hr;
941}
942
943/**************************************************************************
944* CDrivesFolder::GetAttributesOf
945*/
947{
948 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
949 this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
950
951 if (cidl && !apidl)
952 return E_INVALIDARG;
953
954 if (*rgfInOut == 0)
955 *rgfInOut = ~0;
956
957 /* FIXME: always add SFGAO_CANLINK */
958 if(cidl == 0)
959 *rgfInOut &= dwComputerAttributes;
960 else
961 {
962 for (UINT i = 0; i < cidl; ++i)
963 {
964 if (_ILIsDrive(apidl[i]))
965 {
966 *rgfInOut &= dwDriveAttributes;
967
968 if (_ILGetDriveType(apidl[i]) == DRIVE_CDROM)
969 *rgfInOut &= ~SFGAO_CANRENAME; // CD-ROM drive cannot rename
970 }
971 else if (_ILIsControlPanel(apidl[i]))
972 {
973 *rgfInOut &= dwControlPanelAttributes;
974 }
975 else if (_ILIsSpecialFolder(*apidl))
976 {
977 m_regFolder->GetAttributesOf(1, &apidl[i], rgfInOut);
978 }
979 else
980 {
981 ERR("Got unknown pidl type!\n");
982 }
983 }
984 }
985
986 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
987 *rgfInOut &= ~SFGAO_VALIDATE;
988
989 TRACE("-- result=0x%08x\n", *rgfInOut);
990 return S_OK;
991}
992
993/**************************************************************************
994* CDrivesFolder::GetUIObjectOf
995*
996* PARAMETERS
997* hwndOwner [in] Parent window for any output
998* cidl [in] array size
999* apidl [in] simple pidl array
1000* riid [in] Requested Interface
1001* prgfInOut [ ] reserved
1002* ppvObject [out] Resulting Interface
1003*
1004*/
1006 UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
1007 REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
1008{
1009 LPVOID pObj = NULL;
1011
1012 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
1013 hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
1014
1015 if (!ppvOut)
1016 return hr;
1017
1018 *ppvOut = NULL;
1019
1020 if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
1021 {
1022 if (_ILIsDrive(apidl[0]))
1023 hr = CDrivesContextMenu_CreateInstance(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), (IContextMenu**)&pObj);
1024 else
1025 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
1026 }
1027 else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
1028 {
1029 hr = IDataObject_Constructor(hwndOwner,
1030 pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
1031 }
1032 else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
1033 {
1034 if (_ILIsDrive(apidl[0]))
1035 hr = CDrivesExtractIcon_CreateInstance(this, apidl[0], riid, &pObj);
1036 else
1037 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
1038 }
1039 else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
1040 {
1041 CComPtr<IShellFolder> psfChild;
1042 hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
1044 return hr;
1045
1046 return psfChild->CreateViewObject(NULL, riid, ppvOut);
1047 }
1048 else
1049 hr = E_NOINTERFACE;
1050
1051 if (SUCCEEDED(hr) && !pObj)
1052 hr = E_OUTOFMEMORY;
1053
1054 *ppvOut = pObj;
1055 TRACE("(%p)->hr=0x%08x\n", this, hr);
1056 return hr;
1057}
1058
1059/**************************************************************************
1060* CDrivesFolder::GetDisplayNameOf
1061*/
1063{
1064 LPWSTR pszPath;
1065 HRESULT hr = S_OK;
1066
1067 TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
1068 pdump (pidl);
1069
1070 if (!strRet)
1071 return E_INVALIDARG;
1072
1073 if (!_ILIsPidlSimple (pidl))
1074 {
1075 return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
1076 }
1077 else if (_ILIsSpecialFolder(pidl))
1078 {
1079 return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
1080 }
1081 else if (!_ILIsDrive(pidl))
1082 {
1083 ERR("Wrong pidl type\n");
1084 return E_INVALIDARG;
1085 }
1086
1087 pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
1088 if (!pszPath)
1089 return E_OUTOFMEMORY;
1090
1091 pszPath[0] = 0;
1092
1093 _ILSimpleGetTextW(pidl, pszPath, MAX_PATH); /* append my own path */
1094 /* long view "lw_name (C:)" */
1095 if (!(dwFlags & SHGDN_FORPARSING))
1096 {
1097 WCHAR wszDrive[18] = {0};
1098
1099 lstrcpynW(wszDrive, pszPath, 4);
1100 pszPath[0] = L'\0';
1101
1102 if (!SUCCEEDED(getLabelForDrive(wszDrive, pszPath)))
1103 {
1104 DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags;
1105
1106 GetVolumeInformationW(wszDrive, pszPath,
1107 MAX_PATH - 7,
1108 &dwVolumeSerialNumber,
1109 &dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
1110 pszPath[MAX_PATH-1] = L'\0';
1111
1112 if (!wcslen(pszPath))
1113 {
1115 DriveType = GetDriveTypeW(wszDrive);
1116
1117 switch (DriveType)
1118 {
1119 case DRIVE_FIXED:
1121 break;
1122 case DRIVE_REMOTE:
1124 break;
1125 case DRIVE_CDROM:
1127 break;
1128 default:
1129 ResourceId = 0;
1130 }
1131
1132 if (ResourceId)
1133 {
1134 dwFileSystemFlags = LoadStringW(shell32_hInstance, ResourceId, pszPath, MAX_PATH);
1135 if (dwFileSystemFlags > MAX_PATH - 7)
1136 pszPath[MAX_PATH-7] = L'\0';
1137 }
1138 }
1139 }
1140 wcscat(pszPath, L" (");
1141 wszDrive[2] = L'\0';
1142 wcscat(pszPath, wszDrive);
1143 wcscat(pszPath, L")");
1144 }
1145
1146 if (SUCCEEDED(hr))
1147 {
1148 strRet->uType = STRRET_WSTR;
1149 strRet->pOleStr = pszPath;
1150 }
1151 else
1152 CoTaskMemFree(pszPath);
1153
1154 TRACE("-- (%p)->(%s)\n", this, strRet->uType == STRRET_CSTR ? strRet->cStr : debugstr_w(strRet->pOleStr));
1155 return hr;
1156}
1157
1158/**************************************************************************
1159* CDrivesFolder::SetNameOf
1160* Changes the name of a file object or subfolder, possibly changing its item
1161* identifier in the process.
1162*
1163* PARAMETERS
1164* hwndOwner [in] Owner window for output
1165* pidl [in] simple pidl of item to change
1166* lpszName [in] the items new display name
1167* dwFlags [in] SHGNO formatting flags
1168* ppidlOut [out] simple pidl returned
1169*/
1171 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
1172{
1173 WCHAR szName[30];
1174
1175 if (_ILIsDrive(pidl))
1176 {
1179 if (pPidlOut)
1180 *pPidlOut = _ILCreateDrive(szName);
1181 return S_OK;
1182 }
1183
1184 return m_regFolder->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
1185}
1186
1188{
1189 FIXME("(%p)\n", this);
1190 return E_NOTIMPL;
1191}
1192
1194{
1195 FIXME("(%p)\n", this);
1196 return E_NOTIMPL;
1197}
1198
1200{
1201 TRACE("(%p)\n", this);
1202
1203 if (pSort)
1204 *pSort = 0;
1205 if (pDisplay)
1206 *pDisplay = 0;
1207 return S_OK;
1208}
1209
1211{
1212 TRACE("(%p)\n", this);
1213
1214 if (!pcsFlags || iColumn >= _countof(MyComputerSFHeader))
1215 return E_INVALIDARG;
1216 *pcsFlags = MyComputerSFHeader[iColumn].colstate;
1217 return S_OK;
1218}
1219
1221{
1222 FIXME("(%p)\n", this);
1223 return E_NOTIMPL;
1224}
1225
1227{
1228 HRESULT hr;
1229
1230 TRACE("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
1231
1232 if (!psd || iColumn >= _countof(MyComputerSFHeader))
1233 return E_INVALIDARG;
1234
1235 if (!pidl)
1236 {
1237 psd->fmt = MyComputerSFHeader[iColumn].fmt;
1238 psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
1239 return SHSetStrRet(&psd->str, MyComputerSFHeader[iColumn].colnameid);
1240 }
1241 else if (!_ILIsDrive(pidl))
1242 {
1243 switch (MyComputerSFHeader[iColumn].colnameid)
1244 {
1247 return m_regFolder->GetDetailsOf(pidl, iColumn, psd);
1250 return SHSetStrRet(&psd->str, ""); /* blank col */
1252 return m_regFolder->GetDetailsOf(pidl, 2, psd); /* 2 = comments */
1254 }
1255 }
1256 else
1257 {
1258 ULARGE_INTEGER ulTotalBytes, ulFreeBytes;
1259 CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
1260 UINT DriveType = GetDriveTypeA(pszDrive);
1263
1264 switch (MyComputerSFHeader[iColumn].colnameid)
1265 {
1268 break;
1270 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
1271 hr = SHSetStrRet(&psd->str, IDS_DRIVE_REMOVABLE);
1272 else
1273 hr = SHSetStrRet(&psd->str, iDriveTypeIds[DriveType]);
1274 break;
1277 psd->str.cStr[0] = 0x00;
1278 psd->str.uType = STRRET_CSTR;
1279 if (GetVolumeInformationA(pszDrive, NULL, 0, NULL, NULL, NULL, NULL, 0))
1280 {
1281 GetDiskFreeSpaceExA(pszDrive, &ulFreeBytes, &ulTotalBytes, NULL);
1282 if (iColumn == 2)
1283 StrFormatByteSize64A(ulTotalBytes.QuadPart, psd->str.cStr, MAX_PATH);
1284 else
1285 StrFormatByteSize64A(ulFreeBytes.QuadPart, psd->str.cStr, MAX_PATH);
1286 }
1287 hr = S_OK;
1288 break;
1290 hr = SHSetStrRet(&psd->str, ""); /* FIXME: comments */
1291 break;
1293 }
1294 }
1295
1296 return hr;
1297}
1298
1300{
1301 FIXME("(%p)\n", this);
1302 return E_NOTIMPL;
1303}
1304
1305/************************************************************************
1306 * CDrivesFolder::GetClassID
1307 */
1309{
1310 TRACE("(%p)\n", this);
1311
1312 if (!lpClassId)
1313 return E_POINTER;
1314
1315 *lpClassId = CLSID_MyComputer;
1316 return S_OK;
1317}
1318
1319/************************************************************************
1320 * CDrivesFolder::Initialize
1321 *
1322 * NOTES: it makes no sense to change the pidl
1323 */
1325{
1326 return S_OK;
1327}
1328
1329/**************************************************************************
1330 * CDrivesFolder::GetCurFolder
1331 */
1333{
1334 TRACE("(%p)->(%p)\n", this, pidl);
1335
1336 if (!pidl)
1337 return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
1338
1339 *pidl = ILClone(pidlRoot);
1340 return S_OK;
1341}
1342
1343/**************************************************************************
1344 * CDrivesFolder::ShouldShow
1345 */
1347{
1348 if (const CLSID* pClsid = IsRegItem(pidlItem))
1349 return SHELL32_IsShellFolderNamespaceItemHidden(L"HideMyComputerIcons", *pClsid) ? S_FALSE : S_OK;
1350 return S_OK;
1351}
1352
1353/************************************************************************/
1354/* IContextMenuCB interface */
1355
1357{
1358 enum { IDC_PROPERTIES };
1359 /* no data object means no selection */
1360 if (!pdtobj)
1361 {
1362 if (uMsg == DFM_INVOKECOMMAND && wParam == IDC_PROPERTIES)
1363 {
1364 // "System" properties
1365 return SHELL_ExecuteControlPanelCPL(hwndOwner, L"sysdm.cpl") ? S_OK : E_FAIL;
1366 }
1367 else if (uMsg == DFM_MERGECONTEXTMENU)
1368 {
1369 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1370 HMENU hpopup = CreatePopupMenu();
1372 pqcminfo->idCmdFirst = Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1373 DestroyMenu(hpopup);
1374 return S_OK;
1375 }
1376 }
1377 return SHELL32_DefaultContextMenuCallBack(psf, pdtobj, uMsg);
1378}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
static const REGFOLDERINFO g_RegFolderInfo
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4666
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 BOOL CALLBACK EnumStubProc2(HWND hwnd, LPARAM lParam)
static BOOL CALLBACK EnumStubProc(HWND hwnd, LPARAM lParam)
#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 HRESULT DoFormatDrive(HWND hwnd, UINT nDriveNumber)
static BOOL TryToLockOrUnlockDrive(HANDLE hDrive, BOOL bLock)
HRESULT CALLBACK DrivesContextMenuCallback(IShellFolder *psf, HWND hwnd, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
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 getLabelForDrive(LPWSTR wszPath, LPWSTR wszLabel)
static unsigned __stdcall format_drive_thread(void *args)
static int iDriveIconIds[7]
static const shvheader MyComputerSFHeader[]
static int iDriveTypeIds[7]
#define CMDID_EJECT
BOOL IsDriveFloppyA(LPCSTR pszDriveRoot)
Definition: drvdefext.cpp:386
static const REQUIREDREGITEM g_RequiredItems[]
static const DWORD dwDriveAttributes
static const DWORD dwControlPanelAttributes
#define CMDID_DISCONNECT
#define RETRY_SLEEP
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:943
UINT DriveType
INT ResourceId
Definition: LoadImageGCC.c:72
#define shell32_hInstance
UINT cchMax
Arabic default style
Definition: afstyles.h:94
#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:102
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
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
LPITEMIDLIST pidlRoot
Definition: CDrivesFolder.h:37
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)
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#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:311
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:427
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:75
#define IDS_SHV_COLUMN_NAME
Definition: resource.h:74
#define IDC_PROPERTIES
Definition: resource.h:32
#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 stricmp(_String1, _String2)
Definition: compat.h:24
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define FILE_SHARE_READ
Definition: compat.h:136
#define lstrcpynW
Definition: compat.h:738
#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
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
#define RRF_RT_DWORD
Definition: driver.c:581
#define SHELL_ExecuteControlPanelCPL(hwnd, cpl)
Definition: precomp.h:156
DWORD BindCtx_GetMode(_In_ IBindCtx *pbc, _In_ DWORD dwDefault)
Definition: utils.cpp:128
HRESULT SHIsFileSysBindCtx(_In_ IBindCtx *pBindCtx, _Out_opt_ WIN32_FIND_DATAW *pFindData)
Definition: utils.cpp:153
HRESULT SHELL32_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdo, UINT msg)
Definition: shlfolder.cpp:550
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:1723
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1092
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1579
LPSTR WINAPI StrFormatByteSize64A(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
Definition: string.c:2496
BOOL SH_ShowDriveProperties(WCHAR *pwszDrive, IDataObject *pDataObj)
Definition: drive.cpp:251
DWORD WINAPI SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
Definition: drive.cpp:743
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
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLdouble n
Definition: glext.h:7729
GLenum const GLfloat * params
Definition: glext.h:5645
GLbitfield flags
Definition: glext.h:7161
GLuint64EXT * result
Definition: glext.h:11304
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
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)
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
#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 DRIVE_CDROM
Definition: machpc98.h:119
HRESULT hres
Definition: protocol.c:465
static TfClientId tid
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
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
HANDLE hThread
Definition: wizard.c:28
#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
#define WS_CAPTION
Definition: pedump.c:624
#define WS_DISABLED
Definition: pedump.c:621
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1652
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)
Definition: pidl.c:1855
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2160
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1998
DWORD _ILGetDrive(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uSize)
Definition: pidl.c:1900
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl)
Definition: pidl.c:2600
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:100
BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
Definition: pidl.c:1965
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2009
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2080
#define PT_GUID
Definition: pidl.h:87
#define PT_SHELLEXT
Definition: pidl.h:91
static const WCHAR szName[]
Definition: powrprof.c:45
#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 REGSTR_PATH_EXPLORER
Definition: regstr.h:33
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:297
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:621
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:196
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:234
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:252
static __inline int SHELL32_GUIDToStringW(REFGUID guid, LPWSTR str)
Definition: shfldr.h:143
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:305
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:275
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE *ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
Definition: shlfolder.cpp:396
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:1897
#define SHCNE_MEDIAREMOVED
Definition: shlobj.h:1896
#define SHFMT_ID_DEFAULT
Definition: shlobj.h:332
#define SHCNF_PATHW
Definition: shlobj.h:1925
#define MM_ADDSEPARATOR
Definition: shlobj.h:2528
struct _SFV_CREATE SFV_CREATE
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2612
#define SHCNF_FLUSHNOWAIT
Definition: shlobj.h:1929
#define IDS_DISCONNECT
Definition: shresdef.h:245
#define IDS_DRIVE_CDROM
Definition: shresdef.h:112
#define IDS_CANTDISMOUNTVOLUME
Definition: shresdef.h:148
#define IDS_EJECT
Definition: shresdef.h:244
#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:560
#define IDI_SHELL_NETDRIVE
Definition: shresdef.h:563
#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:554
#define IDS_CANTSHOWPROPERTIES
Definition: shresdef.h:150
#define IDI_SHELL_CDROM
Definition: shresdef.h:565
#define IDI_SHELL_DRIVE
Definition: shresdef.h:562
#define IDS_CANTEJECTMEDIA
Definition: shresdef.h:149
#define IDI_SHELL_RAMDISK
Definition: shresdef.h:566
#define IDS_CANTDISCONNECT
Definition: shresdef.h:151
#define IDI_SHELL_REMOVEABLE
Definition: shresdef.h:561
#define IDS_SHV_COLUMN_DISK_CAPACITY
Definition: shresdef.h:54
#define IDS_FORMATDRIVE
Definition: shresdef.h:230
#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
IContextMenuCB * pcmcb
Definition: shlobj.h:2550
IShellFolder * psf
Definition: shlobj.h:2552
IUnknown * punkAssociationInfo
Definition: shlobj.h:2555
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2554
const HKEY * aKeys
Definition: shlobj.h:2557
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2551
STRRET str
Definition: shtypes.idl:108
BOOLEAN PreventMediaRemoval
Definition: ntddstor.h:343
HMENU hmenu
Definition: shlobj.h:1390
UINT idCmdLast
Definition: shlobj.h:1393
UINT idCmdFirst
Definition: shlobj.h:1392
UINT indexMenu
Definition: shlobj.h:1391
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:208
union tagPIDLDATA::@557 u
struct _stub stub
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
PVOID HANDLE
Definition: typedefs.h:73
int32_t INT
Definition: typedefs.h:58
#define __stdcall
Definition: typedefs.h:25
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:256
#define DRIVE_NO_ROOT_DIR
Definition: winbase.h:257
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define GetDriveType
Definition: winbase.h:3812
#define DRIVE_REMOTE
Definition: winbase.h:253
_In_ LPCSTR lpName
Definition: winbase.h:2789
DWORD WINAPI GetLogicalDrives(void)
Definition: disk.c:110
#define DRIVE_RAMDISK
Definition: winbase.h:255
#define DRIVE_FIXED
Definition: winbase.h:252
#define DRIVE_REMOVABLE
Definition: winbase.h:251
#define CreateFile
Definition: winbase.h:3749
_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 E_UNEXPECTED
Definition: winerror.h:2456
#define ERROR_CAN_NOT_COMPLETE
Definition: winerror.h:582
#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
#define GW_OWNER
Definition: winuser.h:769
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define WS_EX_APPWINDOW
Definition: winuser.h:383
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define MFT_SEPARATOR
Definition: winuser.h:747
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:790
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define MFS_ENABLED
Definition: winuser.h:753
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
BOOL WINAPI DestroyMenu(_In_ HMENU)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
#define MFT_STRING
Definition: winuser.h:749
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
BOOL WINAPI BringWindowToTop(_In_ HWND)
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