ReactOS 0.4.15-dev-8100-g1887773
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 char szDrive[8];
61 if (!_ILGetDrive(pidl, szDrive, _countof(szDrive)))
62 {
63 ERR("pidl %p is not a drive\n", pidl);
64 return DRIVE_UNKNOWN;
65 }
66 return ::GetDriveTypeA(szDrive);
67}
68
69/***********************************************************************
70* IShellFolder implementation
71*/
72
73#define RETRY_COUNT 3
74#define RETRY_SLEEP 250
76{
77 DWORD dwError, dwBytesReturned;
78 DWORD dwCode = (bLock ? FSCTL_LOCK_VOLUME : FSCTL_UNLOCK_VOLUME);
79 for (DWORD i = 0; i < RETRY_COUNT; ++i)
80 {
81 if (DeviceIoControl(hDrive, dwCode, NULL, 0, NULL, 0, &dwBytesReturned, NULL))
82 return TRUE;
83
84 dwError = GetLastError();
85 if (dwError == ERROR_INVALID_FUNCTION)
86 break; /* don't sleep if function is not implemented */
87
89 }
90 SetLastError(dwError);
91 return FALSE;
92}
93
94// NOTE: See also https://support.microsoft.com/en-us/help/165721/how-to-ejecting-removable-media-in-windows-nt-windows-2000-windows-xp
95static BOOL DoEjectDrive(const WCHAR *physical, UINT nDriveType, INT *pnStringID)
96{
97 /* GENERIC_WRITE isn't needed for umount */
98 DWORD dwAccessMode = GENERIC_READ;
100
101 HANDLE hDrive = CreateFile(physical, dwAccessMode, dwShareMode, 0, OPEN_EXISTING, 0, NULL);
102 if (hDrive == INVALID_HANDLE_VALUE)
103 return FALSE;
104
105 BOOL bResult, bNeedUnlock = FALSE;
106 DWORD dwBytesReturned, dwError = NO_ERROR;
107 PREVENT_MEDIA_REMOVAL removal;
108 do
109 {
110 bResult = TryToLockOrUnlockDrive(hDrive, TRUE);
111 if (!bResult)
112 {
113 dwError = GetLastError();
114 *pnStringID = IDS_CANTLOCKVOLUME; /* Unable to lock volume */
115 break;
116 }
117 bResult = DeviceIoControl(hDrive, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &dwBytesReturned, NULL);
118 if (!bResult)
119 {
120 dwError = GetLastError();
121 *pnStringID = IDS_CANTDISMOUNTVOLUME; /* Unable to dismount volume */
122 bNeedUnlock = TRUE;
123 break;
124 }
125 removal.PreventMediaRemoval = FALSE;
126 bResult = DeviceIoControl(hDrive, IOCTL_STORAGE_MEDIA_REMOVAL, &removal, sizeof(removal), NULL,
127 0, &dwBytesReturned, NULL);
128 if (!bResult)
129 {
130 *pnStringID = IDS_CANTEJECTMEDIA; /* Unable to eject media */
131 dwError = GetLastError();
132 bNeedUnlock = TRUE;
133 break;
134 }
135 bResult = DeviceIoControl(hDrive, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &dwBytesReturned, NULL);
136 if (!bResult)
137 {
138 *pnStringID = IDS_CANTEJECTMEDIA; /* Unable to eject media */
139 dwError = GetLastError();
140 bNeedUnlock = TRUE;
141 break;
142 }
143 } while (0);
144
145 if (bNeedUnlock)
146 {
148 }
149
150 CloseHandle(hDrive);
151
152 SetLastError(dwError);
153 return bResult;
154}
155
156// A callback function for finding the stub windows.
157static BOOL CALLBACK
159{
160 CSimpleArray<HWND> *pStubs = reinterpret_cast<CSimpleArray<HWND> *>(lParam);
161
162 WCHAR szClass[64];
163 GetClassNameW(hwnd, szClass, _countof(szClass));
164
165 if (lstrcmpiW(szClass, L"StubWindow32") == 0)
166 {
167 pStubs->Add(hwnd);
168 }
169
170 return TRUE;
171}
172
173// Another callback function to find the owned window of the stub window.
174static BOOL CALLBACK
176{
177 HWND *phwnd = reinterpret_cast<HWND *>(lParam);
178
179 if (phwnd[0] == GetWindow(hwnd, GW_OWNER))
180 {
181 phwnd[1] = hwnd;
182 return FALSE;
183 }
184
185 return TRUE;
186}
187
188// Parameters for format_drive_thread function below.
190{
192};
193
194static unsigned __stdcall format_drive_thread(void *args)
195{
197 UINT nDriveNumber = params->nDriveNumber;
198 LONG_PTR nProp = nDriveNumber | 0x7F00;
199
200 // Search the stub windows that already exist.
201 CSimpleArray<HWND> old_stubs;
202 EnumWindows(EnumStubProc, (LPARAM)&old_stubs);
203
204 for (INT n = 0; n < old_stubs.GetSize(); ++n)
205 {
206 HWND hwndStub = old_stubs[n];
207
208 // The target stub window has the prop.
209 if (GetPropW(hwndStub, L"DriveNumber") == (HANDLE)nProp)
210 {
211 // Found.
212 HWND ahwnd[2];
213 ahwnd[0] = hwndStub;
214 ahwnd[1] = NULL;
216
217 // Activate.
218 BringWindowToTop(ahwnd[1]);
219
220 delete params;
221 return 0;
222 }
223 }
224
225 // Create a stub window.
229 if (!stub.Create(NULL, NULL, NULL, style, exstyle))
230 {
231 ERR("StubWindow32 creation failed\n");
232 delete params;
233 return 0;
234 }
235
236 // Add prop to the target stub window.
237 SetPropW(stub, L"DriveNumber", (HANDLE)nProp);
238
239 // Do format.
240 SHFormatDrive(stub, nDriveNumber, SHFMT_ID_DEFAULT, 0);
241
242 // Clean up.
243 RemovePropW(stub, L"DriveNumber");
244 stub.DestroyWindow();
245 delete params;
246
247 return 0;
248}
249
250static HRESULT DoFormatDrive(HWND hwnd, UINT nDriveNumber)
251{
253 params->nDriveNumber = nDriveNumber;
254
255 // Create thread to avoid locked.
256 unsigned tid;
258 if (hThread == NULL)
259 {
260 delete params;
261 return E_FAIL;
262 }
263
265
266 return S_OK;
267}
268
270 HWND hwnd,
271 IDataObject *pdtobj,
272 UINT uMsg,
275{
276 if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
277 return SHELL32_DefaultContextMenuCallBack(psf, pdtobj, uMsg);
278
279 PIDLIST_ABSOLUTE pidlFolder;
280 PUITEMID_CHILD *apidl;
281 UINT cidl;
282 UINT nDriveType;
284 HRESULT hr = SH_GetApidlFromDataObject(pdtobj, &pidlFolder, &apidl, &cidl);
286 return hr;
287
288 char szDrive[8] = {0};
289 if (!_ILGetDrive(apidl[0], szDrive, sizeof(szDrive)))
290 {
291 ERR("pidl is not a drive\n");
292 SHFree(pidlFolder);
293 _ILFreeaPidl(apidl, cidl);
294 return E_FAIL;
295 }
296 nDriveType = GetDriveTypeA(szDrive);
297 GetVolumeInformationA(szDrive, NULL, 0, NULL, NULL, &dwFlags, NULL, 0);
298
299// custom command IDs
300#if 0 // Disabled until our menu building system is fixed
301#define CMDID_FORMAT 0
302#define CMDID_EJECT 1
303#define CMDID_DISCONNECT 2
304#else
305/* FIXME: These IDs should start from 0, however there is difference
306 * between ours and Windows' menu building systems, which should be fixed. */
307#define CMDID_FORMAT 1
308#define CMDID_EJECT 2
309#define CMDID_DISCONNECT 3
310#endif
311
312 if (uMsg == DFM_MERGECONTEXTMENU)
313 {
314 QCMINFO *pqcminfo = (QCMINFO *)lParam;
315
316 UINT idCmdFirst = pqcminfo->idCmdFirst;
317 UINT idCmd = 0;
318 if (!(dwFlags & FILE_READ_ONLY_VOLUME) && nDriveType != DRIVE_REMOTE)
319 {
320 /* add separator and Format */
321 idCmd = idCmdFirst + CMDID_FORMAT;
322 _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
324 }
325 if (nDriveType == DRIVE_REMOVABLE || nDriveType == DRIVE_CDROM)
326 {
327 /* add separator and Eject */
328 idCmd = idCmdFirst + CMDID_EJECT;
329 _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
331 }
332 if (nDriveType == DRIVE_REMOTE)
333 {
334 /* add separator and Disconnect */
335 idCmd = idCmdFirst + CMDID_DISCONNECT;
336 _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
338 }
339
340 if (idCmd)
341#if 0 // see FIXME above
342 pqcminfo->idCmdFirst = ++idCmd;
343#else
344 pqcminfo->idCmdFirst = (idCmd + 2);
345#endif
346 hr = S_OK;
347 }
348 else if (uMsg == DFM_INVOKECOMMAND)
349 {
350 WCHAR wszBuf[4] = L"A:\\";
351 wszBuf[0] = (WCHAR)szDrive[0];
352
353 INT nStringID = 0;
354 DWORD dwError = NO_ERROR;
355
357 {
358 // pdtobj should be valid at this point!
359 ATLASSERT(pdtobj);
360 hr = SH_ShowDriveProperties(wszBuf, pdtobj) ? S_OK : E_UNEXPECTED;
361 if (FAILED(hr))
362 {
363 dwError = ERROR_CAN_NOT_COMPLETE;
364 nStringID = IDS_CANTSHOWPROPERTIES;
365 }
366 }
367 else
368 {
369 if (wParam == CMDID_FORMAT)
370 {
371 hr = DoFormatDrive(hwnd, szDrive[0] - 'A');
372 }
373 else if (wParam == CMDID_EJECT)
374 {
375 /* do eject */
376 WCHAR physical[10];
377 wsprintfW(physical, _T("\\\\.\\%c:"), szDrive[0]);
378
379 if (DoEjectDrive(physical, nDriveType, &nStringID))
380 {
382 }
383 else
384 {
385 dwError = GetLastError();
386 }
387 }
388 else if (wParam == CMDID_DISCONNECT)
389 {
390 /* do disconnect */
391 wszBuf[2] = UNICODE_NULL;
392 dwError = WNetCancelConnection2W(wszBuf, 0, FALSE);
393 if (dwError == NO_ERROR)
394 {
396 }
397 else
398 {
399 nStringID = IDS_CANTDISCONNECT;
400 }
401 }
402 }
403
404 if (nStringID != 0)
405 {
406 /* show error message */
407 WCHAR szFormat[128], szMessage[128];
408 LoadStringW(shell32_hInstance, nStringID, szFormat, _countof(szFormat));
409 wsprintfW(szMessage, szFormat, dwError);
410 MessageBoxW(hwnd, szMessage, NULL, MB_ICONERROR);
411 }
412 }
413
414 SHFree(pidlFolder);
415 _ILFreeaPidl(apidl, cidl);
416
417 return hr;
418}
419
421 HWND hwnd,
422 UINT cidl,
424 IShellFolder *psf,
425 IContextMenu **ppcm)
426{
427 HKEY hKeys[2];
428 UINT cKeys = 0;
429 AddClassKeyToArray(L"Drive", hKeys, &cKeys);
430 AddClassKeyToArray(L"Folder", hKeys, &cKeys);
431
432 return CDefFolderMenu_Create2(pidlFolder, hwnd, cidl, apidl, psf, DrivesContextMenuCallback, cKeys, hKeys, ppcm);
433}
434
435static HRESULT
437 LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
438{
439 WCHAR wszPath[MAX_PATH];
440 WCHAR wszAutoRunInfPath[MAX_PATH];
441 WCHAR wszValue[MAX_PATH], wszTemp[MAX_PATH];
442
443 // get path
444 if (!ILGetDisplayNameExW(psf, pidl, wszPath, 0))
445 return E_FAIL;
446 if (!PathIsDirectoryW(wszPath))
447 return E_FAIL;
448
449 // build the full path of autorun.inf
450 StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath);
451 PathAppendW(wszAutoRunInfPath, L"autorun.inf");
452
453 // autorun.inf --> wszValue
454 if (GetPrivateProfileStringW(L"autorun", L"icon", NULL, wszValue, _countof(wszValue),
455 wszAutoRunInfPath) && wszValue[0] != 0)
456 {
457 // wszValue --> wszTemp
458 ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp));
459
460 // parse the icon location
461 *piIndex = PathParseIconLocationW(wszTemp);
462
463 // wszPath + wszTemp --> wszPath
464 if (PathIsRelativeW(wszTemp))
465 PathAppendW(wszPath, wszTemp);
466 else
467 StringCchCopyW(wszPath, _countof(wszPath), wszTemp);
468
469 // wszPath --> szIconFile
470 GetFullPathNameW(wszPath, cchMax, szIconFile, NULL);
471
472 return S_OK;
473 }
474
475 return E_FAIL;
476}
477
478static HRESULT
480{
481 WCHAR wszAutoRunInfPath[MAX_PATH];
482 WCHAR wszTemp[MAX_PATH];
483
484 if (!PathIsDirectoryW(wszPath))
485 return E_FAIL;
486
487 StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath);
488 PathAppendW(wszAutoRunInfPath, L"autorun.inf");
489
490 if (GetPrivateProfileStringW(L"autorun", L"label", NULL, wszTemp, _countof(wszTemp),
491 wszAutoRunInfPath) && wszTemp[0] != 0)
492 {
493 StringCchCopyW(wszLabel, _countof(wszTemp), wszTemp);
494 return S_OK;
495 }
496
497 return E_FAIL;
498}
499
500BOOL IsDriveFloppyA(LPCSTR pszDriveRoot);
501
503{
504 CComPtr<IDefaultExtractIconInit> initIcon;
507 return hr;
508
509 CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
510 UINT DriveType = GetDriveTypeA(pszDrive);
513
514 WCHAR wTemp[MAX_PATH];
515 int icon_idx, reg_idx;
516 UINT flags = 0;
517
518 switch (DriveType)
519 {
520 case DRIVE_FIXED:
521 case DRIVE_UNKNOWN:
522 reg_idx = IDI_SHELL_DRIVE;
523 break;
524 case DRIVE_CDROM:
525 reg_idx = IDI_SHELL_CDROM;
526 break;
527 case DRIVE_REMOTE:
528 reg_idx = IDI_SHELL_NETDRIVE;
529 break;
530 case DRIVE_REMOVABLE:
531 if (!IsDriveFloppyA(pszDrive))
532 reg_idx = IDI_SHELL_REMOVEABLE;
533 else
534 reg_idx = IDI_SHELL_3_14_FLOPPY;
535 break;
536 case DRIVE_RAMDISK:
537 reg_idx = IDI_SHELL_RAMDISK;
538 break;
540 default:
541 reg_idx = IDI_SHELL_DOCUMENT;
542 break;
543 }
544
545 hr = getIconLocationForDrive(psf, pidl, 0, wTemp, _countof(wTemp),
546 &icon_idx, &flags);
547 if (SUCCEEDED(hr))
548 {
549 initIcon->SetNormalIcon(wTemp, icon_idx);
550 }
551 else if (HLM_GetIconW(reg_idx - 1, wTemp, _countof(wTemp), &icon_idx))
552 {
553 initIcon->SetNormalIcon(wTemp, icon_idx);
554 }
555 else if ((DriveType == DRIVE_FIXED || DriveType == DRIVE_UNKNOWN) &&
556 (HCR_GetIconW(L"Drive", wTemp, NULL, _countof(wTemp), &icon_idx)))
557 {
558 initIcon->SetNormalIcon(wTemp, icon_idx);
559 }
560 else
561 {
562 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
563 {
564 icon_idx = IDI_SHELL_REMOVEABLE;
565 }
566 else
567 {
568 icon_idx = iDriveIconIds[DriveType];
569 }
570 initIcon->SetNormalIcon(swShell32Name, -icon_idx);
571 }
572
573 return initIcon->QueryInterface(riid, ppvOut);
574}
575
577 public CEnumIDListBase
578{
579 public:
580 HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags, IEnumIDList* pRegEnumerator)
581 {
582 /* enumerate the folders */
583 if (dwFlags & SHCONTF_FOLDERS)
584 {
585 WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
586 DWORD dwDrivemap = GetLogicalDrives();
587
588 while (wszDriveName[0] <= 'Z')
589 {
590 if(dwDrivemap & 0x00000001L)
591 AddToEnumList(_ILCreateDrive(wszDriveName));
592 wszDriveName[0]++;
593 dwDrivemap = dwDrivemap >> 1;
594 }
595 }
596
597 /* Enumerate the items of the reg folder */
598 AppendItemsFromEnumerator(pRegEnumerator);
599
600 return S_OK;
601 }
602
604 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
606};
607
608/***********************************************************************
609* IShellFolder [MyComputer] implementation
610*/
611
618};
619
621 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
622 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
624 SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_CANLINK;
626 SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
627 SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANRENAME | SFGAO_CANLINK;
628
630{
631 pidlRoot = NULL;
632}
633
635{
636 TRACE("-- destroying IShellFolder(%p)\n", this);
638}
639
641{
642 pidlRoot = _ILCreateMyComputer(); /* my qualified pidl */
643 if (pidlRoot == NULL)
644 return E_OUTOFMEMORY;
645
646 HRESULT hr = CRegFolder_CreateInstance(&CLSID_MyComputer,
647 pidlRoot,
648 L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
649 L"MyComputer",
651
652 return hr;
653}
654
655/**************************************************************************
656* CDrivesFolder::ParseDisplayName
657*/
659 DWORD * pchEaten, PIDLIST_RELATIVE * ppidl, DWORD * pdwAttributes)
660{
662
663 TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
664 hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
665 pchEaten, ppidl, pdwAttributes);
666
667 if (!ppidl)
668 return hr;
669
670 *ppidl = NULL;
671
672 if (!lpszDisplayName)
673 return hr;
674
675 /* handle CLSID paths */
676 if (lpszDisplayName[0] == L':' && lpszDisplayName[1] == L':')
677 {
678 return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl,
679 pdwAttributes);
680 }
681
682 if (lpszDisplayName[0] &&
683 ((L'A' <= lpszDisplayName[0] && lpszDisplayName[0] <= L'Z') ||
684 (L'a' <= lpszDisplayName[0] && lpszDisplayName[0] <= L'z')) &&
685 lpszDisplayName[1] == L':' && lpszDisplayName[2] == L'\\')
686 {
687 // "C:\..."
688 WCHAR szRoot[8];
689 PathBuildRootW(szRoot, ((*lpszDisplayName - 1) & 0x1F));
690
691 if (SHIsFileSysBindCtx(pbc, NULL) != S_OK && !(BindCtx_GetMode(pbc, 0) & STGM_CREATE))
692 {
693 if (::GetDriveType(szRoot) == DRIVE_NO_ROOT_DIR)
695 }
696
697 CComHeapPtr<ITEMIDLIST> pidlTemp(_ILCreateDrive(szRoot));
698 if (!pidlTemp)
699 return E_OUTOFMEMORY;
700
701 if (lpszDisplayName[3])
702 {
703 CComPtr<IShellFolder> pChildFolder;
704 hr = BindToObject(pidlTemp, pbc, IID_PPV_ARG(IShellFolder, &pChildFolder));
706 return hr;
707
708 ULONG chEaten;
709 CComHeapPtr<ITEMIDLIST> pidlChild;
710 hr = pChildFolder->ParseDisplayName(hwndOwner, pbc, &lpszDisplayName[3], &chEaten,
711 &pidlChild, pdwAttributes);
713 return hr;
714
715 hr = SHILCombine(pidlTemp, pidlChild, ppidl);
716 }
717 else
718 {
719 *ppidl = pidlTemp.Detach();
720 if (pdwAttributes && *pdwAttributes)
721 GetAttributesOf(1, (PCUITEMID_CHILD_ARRAY)ppidl, pdwAttributes);
722 hr = S_OK;
723 }
724 }
725
726 TRACE("(%p)->(-- ret=0x%08x)\n", this, hr);
727
728 return hr;
729}
730
731/**************************************************************************
732* CDrivesFolder::EnumObjects
733*/
734HRESULT WINAPI CDrivesFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
735{
736 CComPtr<IEnumIDList> pRegEnumerator;
737 m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
738
739 return ShellObjectCreatorInit<CDrivesFolderEnum>(hwndOwner, dwFlags, pRegEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
740}
741
742/**************************************************************************
743* CDrivesFolder::BindToObject
744*/
746{
747 TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", this,
748 pidl, pbcReserved, shdebugstr_guid(&riid), ppvOut);
749
750 if (!pidl)
751 return E_INVALIDARG;
752
753 if (_ILIsSpecialFolder(pidl))
754 return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);
755
756 CHAR* pchDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
757
758 PERSIST_FOLDER_TARGET_INFO pfti = {0};
759 pfti.dwAttributes = -1;
760 pfti.csidl = -1;
761 pfti.szTargetParsingName[0] = *pchDrive;
762 pfti.szTargetParsingName[1] = L':';
763 pfti.szTargetParsingName[2] = L'\\';
764
766 &pfti,
767 pidl,
768 &CLSID_ShellFSFolder,
769 riid,
770 ppvOut);
772 return hr;
773
774 return S_OK;
775}
776
777/**************************************************************************
778* CDrivesFolder::BindToStorage
779*/
781{
782 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this,
783 pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
784
785 *ppvOut = NULL;
786 return E_NOTIMPL;
787}
788
789/**************************************************************************
790* CDrivesFolder::CompareIDs
791*/
792
794{
796
797 if (!pidl1 || !pidl2)
798 {
799 ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
800 return E_INVALIDARG;
801 }
802
803 if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
804 return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
805
806 UINT iColumn = LOWORD(lParam);
807 if (!_ILIsDrive(pidl1) || !_ILIsDrive(pidl2) || iColumn >= _countof(MyComputerSFHeader))
808 return E_INVALIDARG;
809
810 CHAR* pszDrive1 = _ILGetDataPointer(pidl1)->u.drive.szDriveName;
811 CHAR* pszDrive2 = _ILGetDataPointer(pidl2)->u.drive.szDriveName;
812
813 int result;
814 switch (MyComputerSFHeader[iColumn].colnameid)
815 {
817 {
818 result = stricmp(pszDrive1, pszDrive2);
820 break;
821 }
823 {
824 /* We want to return immediately because SHELL32_CompareDetails also compares children. */
825 return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
826 }
829 {
830 ULARGE_INTEGER Drive1Available, Drive1Total, Drive2Available, Drive2Total;
831
832 if (GetVolumeInformationA(pszDrive1, NULL, 0, NULL, NULL, NULL, NULL, 0))
833 GetDiskFreeSpaceExA(pszDrive1, &Drive1Available, &Drive1Total, NULL);
834 else
835 Drive1Available.QuadPart = Drive1Total.QuadPart = 0;
836
837 if (GetVolumeInformationA(pszDrive2, NULL, 0, NULL, NULL, NULL, NULL, 0))
838 GetDiskFreeSpaceExA(pszDrive2, &Drive2Available, &Drive2Total, NULL);
839 else
840 Drive2Available.QuadPart = Drive2Total.QuadPart = 0;
841
842 LARGE_INTEGER Diff;
843 if (lParam == 3) /* Size */
844 Diff.QuadPart = Drive1Total.QuadPart - Drive2Total.QuadPart;
845 else /* Size available */
846 Diff.QuadPart = Drive1Available.QuadPart - Drive2Available.QuadPart;
847
849 break;
850 }
853 break;
855 }
856
857 if (HRESULT_CODE(hres) == 0)
858 return SHELL32_CompareChildren(this, lParam, pidl1, pidl2);
859
860 return hres;
861}
862
863/**************************************************************************
864* CDrivesFolder::CreateViewObject
865*/
867{
868 CComPtr<IShellView> pShellView;
870
871 TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
872 hwndOwner, shdebugstr_guid (&riid), ppvOut);
873
874 if (!ppvOut)
875 return hr;
876
877 *ppvOut = NULL;
878
879 if (IsEqualIID(riid, IID_IDropTarget))
880 {
881 WARN("IDropTarget not implemented\n");
882 hr = E_NOTIMPL;
883 }
884 else if (IsEqualIID(riid, IID_IContextMenu))
885 {
886 HKEY hKeys[16];
887 UINT cKeys = 0;
888 AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
889
890 DEFCONTEXTMENU dcm;
891 dcm.hwnd = hwndOwner;
892 dcm.pcmcb = this;
893 dcm.pidlFolder = pidlRoot;
894 dcm.psf = this;
895 dcm.cidl = 0;
896 dcm.apidl = NULL;
897 dcm.cKeys = cKeys;
898 dcm.aKeys = hKeys;
900 hr = SHCreateDefaultContextMenu(&dcm, riid, ppvOut);
901 }
902 else if (IsEqualIID(riid, IID_IShellView))
903 {
904 SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
905 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
906 }
907 TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
908 return hr;
909}
910
911/**************************************************************************
912* CDrivesFolder::GetAttributesOf
913*/
915{
916 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
917 this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
918
919 if (cidl && !apidl)
920 return E_INVALIDARG;
921
922 if (*rgfInOut == 0)
923 *rgfInOut = ~0;
924
925 /* FIXME: always add SFGAO_CANLINK */
926 if(cidl == 0)
927 *rgfInOut &= dwComputerAttributes;
928 else
929 {
930 for (UINT i = 0; i < cidl; ++i)
931 {
932 if (_ILIsDrive(apidl[i]))
933 {
934 *rgfInOut &= dwDriveAttributes;
935
936 if (_ILGetDriveType(apidl[i]) == DRIVE_CDROM)
937 *rgfInOut &= ~SFGAO_CANRENAME; // CD-ROM drive cannot rename
938 }
939 else if (_ILIsControlPanel(apidl[i]))
940 *rgfInOut &= dwControlPanelAttributes;
941 else if (_ILIsSpecialFolder(*apidl))
942 m_regFolder->GetAttributesOf(1, &apidl[i], rgfInOut);
943 else
944 ERR("Got unknown pidl type!\n");
945 }
946 }
947
948 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
949 *rgfInOut &= ~SFGAO_VALIDATE;
950
951 TRACE("-- result=0x%08x\n", *rgfInOut);
952 return S_OK;
953}
954
955/**************************************************************************
956* CDrivesFolder::GetUIObjectOf
957*
958* PARAMETERS
959* hwndOwner [in] Parent window for any output
960* cidl [in] array size
961* apidl [in] simple pidl array
962* riid [in] Requested Interface
963* prgfInOut [ ] reserved
964* ppvObject [out] Resulting Interface
965*
966*/
968 UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
969 REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
970{
971 LPVOID pObj = NULL;
973
974 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
975 hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
976
977 if (!ppvOut)
978 return hr;
979
980 *ppvOut = NULL;
981
982 if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
983 {
984 if (_ILIsDrive(apidl[0]))
985 hr = CDrivesContextMenu_CreateInstance(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), (IContextMenu**)&pObj);
986 else
987 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
988 }
989 else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
990 {
991 hr = IDataObject_Constructor(hwndOwner,
992 pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
993 }
994 else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
995 {
996 if (_ILIsDrive(apidl[0]))
997 hr = CDrivesExtractIcon_CreateInstance(this, apidl[0], riid, &pObj);
998 else
999 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
1000 }
1001 else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
1002 {
1003 CComPtr<IShellFolder> psfChild;
1004 hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
1006 return hr;
1007
1008 return psfChild->CreateViewObject(NULL, riid, ppvOut);
1009 }
1010 else
1011 hr = E_NOINTERFACE;
1012
1013 if (SUCCEEDED(hr) && !pObj)
1014 hr = E_OUTOFMEMORY;
1015
1016 *ppvOut = pObj;
1017 TRACE("(%p)->hr=0x%08x\n", this, hr);
1018 return hr;
1019}
1020
1021/**************************************************************************
1022* CDrivesFolder::GetDisplayNameOf
1023*/
1025{
1026 LPWSTR pszPath;
1027 HRESULT hr = S_OK;
1028
1029 TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
1030 pdump (pidl);
1031
1032 if (!strRet)
1033 return E_INVALIDARG;
1034
1035 if (!_ILIsPidlSimple (pidl))
1036 {
1037 return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
1038 }
1039 else if (_ILIsSpecialFolder(pidl))
1040 {
1041 return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
1042 }
1043 else if (!_ILIsDrive(pidl))
1044 {
1045 ERR("Wrong pidl type\n");
1046 return E_INVALIDARG;
1047 }
1048
1049 pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
1050 if (!pszPath)
1051 return E_OUTOFMEMORY;
1052
1053 pszPath[0] = 0;
1054
1055 _ILSimpleGetTextW(pidl, pszPath, MAX_PATH); /* append my own path */
1056 /* long view "lw_name (C:)" */
1057 if (!(dwFlags & SHGDN_FORPARSING))
1058 {
1059 WCHAR wszDrive[18] = {0};
1060
1061 lstrcpynW(wszDrive, pszPath, 4);
1062 pszPath[0] = L'\0';
1063
1064 if (!SUCCEEDED(getLabelForDrive(wszDrive, pszPath)))
1065 {
1066 DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags;
1067
1068 GetVolumeInformationW(wszDrive, pszPath,
1069 MAX_PATH - 7,
1070 &dwVolumeSerialNumber,
1071 &dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
1072 pszPath[MAX_PATH-1] = L'\0';
1073
1074 if (!wcslen(pszPath))
1075 {
1077 DriveType = GetDriveTypeW(wszDrive);
1078
1079 switch (DriveType)
1080 {
1081 case DRIVE_FIXED:
1083 break;
1084 case DRIVE_REMOTE:
1086 break;
1087 case DRIVE_CDROM:
1089 break;
1090 default:
1091 ResourceId = 0;
1092 }
1093
1094 if (ResourceId)
1095 {
1096 dwFileSystemFlags = LoadStringW(shell32_hInstance, ResourceId, pszPath, MAX_PATH);
1097 if (dwFileSystemFlags > MAX_PATH - 7)
1098 pszPath[MAX_PATH-7] = L'\0';
1099 }
1100 }
1101 }
1102 wcscat(pszPath, L" (");
1103 wszDrive[2] = L'\0';
1104 wcscat(pszPath, wszDrive);
1105 wcscat(pszPath, L")");
1106 }
1107
1108 if (SUCCEEDED(hr))
1109 {
1110 strRet->uType = STRRET_WSTR;
1111 strRet->pOleStr = pszPath;
1112 }
1113 else
1114 CoTaskMemFree(pszPath);
1115
1116 TRACE("-- (%p)->(%s)\n", this, strRet->uType == STRRET_CSTR ? strRet->cStr : debugstr_w(strRet->pOleStr));
1117 return hr;
1118}
1119
1120/**************************************************************************
1121* CDrivesFolder::SetNameOf
1122* Changes the name of a file object or subfolder, possibly changing its item
1123* identifier in the process.
1124*
1125* PARAMETERS
1126* hwndOwner [in] Owner window for output
1127* pidl [in] simple pidl of item to change
1128* lpszName [in] the items new display name
1129* dwFlags [in] SHGNO formatting flags
1130* ppidlOut [out] simple pidl returned
1131*/
1133 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
1134{
1135 WCHAR szName[30];
1136
1137 if (_ILIsDrive(pidl))
1138 {
1141 if (pPidlOut)
1142 *pPidlOut = _ILCreateDrive(szName);
1143 return S_OK;
1144 }
1145
1146 return m_regFolder->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
1147}
1148
1150{
1151 FIXME("(%p)\n", this);
1152 return E_NOTIMPL;
1153}
1154
1156{
1157 FIXME("(%p)\n", this);
1158 return E_NOTIMPL;
1159}
1160
1162{
1163 TRACE("(%p)\n", this);
1164
1165 if (pSort)
1166 *pSort = 0;
1167 if (pDisplay)
1168 *pDisplay = 0;
1169 return S_OK;
1170}
1171
1173{
1174 TRACE("(%p)\n", this);
1175
1176 if (!pcsFlags || iColumn >= _countof(MyComputerSFHeader))
1177 return E_INVALIDARG;
1178 *pcsFlags = MyComputerSFHeader[iColumn].colstate;
1179 return S_OK;
1180}
1181
1183{
1184 FIXME("(%p)\n", this);
1185 return E_NOTIMPL;
1186}
1187
1189{
1190 HRESULT hr;
1191
1192 TRACE("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
1193
1194 if (!psd || iColumn >= _countof(MyComputerSFHeader))
1195 return E_INVALIDARG;
1196
1197 if (!pidl)
1198 {
1199 psd->fmt = MyComputerSFHeader[iColumn].fmt;
1200 psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
1201 return SHSetStrRet(&psd->str, MyComputerSFHeader[iColumn].colnameid);
1202 }
1203 else if (!_ILIsDrive(pidl))
1204 {
1205 switch (MyComputerSFHeader[iColumn].colnameid)
1206 {
1209 return m_regFolder->GetDetailsOf(pidl, iColumn, psd);
1212 return SHSetStrRet(&psd->str, ""); /* blank col */
1214 return m_regFolder->GetDetailsOf(pidl, 2, psd); /* 2 = comments */
1216 }
1217 }
1218 else
1219 {
1220 ULARGE_INTEGER ulTotalBytes, ulFreeBytes;
1221 CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
1222 UINT DriveType = GetDriveTypeA(pszDrive);
1225
1226 switch (MyComputerSFHeader[iColumn].colnameid)
1227 {
1230 break;
1232 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
1233 hr = SHSetStrRet(&psd->str, IDS_DRIVE_REMOVABLE);
1234 else
1235 hr = SHSetStrRet(&psd->str, iDriveTypeIds[DriveType]);
1236 break;
1239 psd->str.cStr[0] = 0x00;
1240 psd->str.uType = STRRET_CSTR;
1241 if (GetVolumeInformationA(pszDrive, NULL, 0, NULL, NULL, NULL, NULL, 0))
1242 {
1243 GetDiskFreeSpaceExA(pszDrive, &ulFreeBytes, &ulTotalBytes, NULL);
1244 if (iColumn == 2)
1245 StrFormatByteSize64A(ulTotalBytes.QuadPart, psd->str.cStr, MAX_PATH);
1246 else
1247 StrFormatByteSize64A(ulFreeBytes.QuadPart, psd->str.cStr, MAX_PATH);
1248 }
1249 hr = S_OK;
1250 break;
1252 hr = SHSetStrRet(&psd->str, ""); /* FIXME: comments */
1253 break;
1255 }
1256 }
1257
1258 return hr;
1259}
1260
1262{
1263 FIXME("(%p)\n", this);
1264 return E_NOTIMPL;
1265}
1266
1267/************************************************************************
1268 * CDrivesFolder::GetClassID
1269 */
1271{
1272 TRACE("(%p)\n", this);
1273
1274 if (!lpClassId)
1275 return E_POINTER;
1276
1277 *lpClassId = CLSID_MyComputer;
1278 return S_OK;
1279}
1280
1281/************************************************************************
1282 * CDrivesFolder::Initialize
1283 *
1284 * NOTES: it makes no sense to change the pidl
1285 */
1287{
1288 return S_OK;
1289}
1290
1291/**************************************************************************
1292 * CDrivesFolder::GetCurFolder
1293 */
1295{
1296 TRACE("(%p)->(%p)\n", this, pidl);
1297
1298 if (!pidl)
1299 return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
1300
1301 *pidl = ILClone(pidlRoot);
1302 return S_OK;
1303}
1304
1305/************************************************************************/
1306/* IContextMenuCB interface */
1307
1309{
1310 enum { IDC_PROPERTIES };
1311 /* no data object means no selection */
1312 if (!pdtobj)
1313 {
1314 if (uMsg == DFM_INVOKECOMMAND && wParam == IDC_PROPERTIES)
1315 {
1316 // "System" properties
1317 return SHELL_ExecuteControlPanelCPL(hwndOwner, L"sysdm.cpl") ? S_OK : E_FAIL;
1318 }
1319 else if (uMsg == DFM_MERGECONTEXTMENU)
1320 {
1321 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1322 HMENU hpopup = CreatePopupMenu();
1324 pqcminfo->idCmdFirst = Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1325 DestroyMenu(hpopup);
1326 return S_OK;
1327 }
1328 }
1329 return SHELL32_DefaultContextMenuCallBack(psf, pdtobj, uMsg);
1330}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3951
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 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 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
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 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(const GUID *pGuid, LPCITEMIDLIST pidlRoot, LPCWSTR lpszPath, LPCWSTR lpszEnumKeyName, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:866
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 IDS_PROPERTIES
Definition: resource.h:102
#define FIXME(fmt,...)
Definition: debug.h:114
#define WARN(fmt,...)
Definition: debug.h:115
#define ERR(fmt,...)
Definition: debug.h:113
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() 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:36
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
LPITEMIDLIST pidlRoot
Definition: CDrivesFolder.h:35
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 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:428
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
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 SHELL_ExecuteControlPanelCPL(hwnd, cpl)
Definition: precomp.h:147
DWORD BindCtx_GetMode(_In_ IBindCtx *pbc, _In_ DWORD dwDefault)
Definition: utils.cpp:114
HRESULT SHIsFileSysBindCtx(_In_ IBindCtx *pBindCtx, _Out_opt_ WIN32_FIND_DATAW *pFindData)
Definition: utils.cpp:139
HRESULT SHELL32_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdo, UINT msg)
Definition: shlfolder.cpp:515
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:170
DWORD WINAPI SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
Definition: drive.cpp:699
BOOL IsDriveFloppyA(LPCSTR pszDriveRoot)
Definition: drvdefext.cpp:386
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
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
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:1644
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
DWORD _ILGetDrive(LPCITEMIDLIST pidl, LPSTR pOut, UINT uSize)
Definition: pidl.c:1886
LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)
Definition: pidl.c:1839
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2218
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl)
Definition: pidl.c:2677
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:100
BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
Definition: pidl.c:1951
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1995
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2138
static const WCHAR szName[]
Definition: powrprof.c:45
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define LVCFMT_RIGHT
Definition: commctrl.h:2599
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
_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:291
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:577
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:168
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:206
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:224
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:277
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:247
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE *ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
Definition: shlfolder.cpp:361
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:1883
#define SHCNE_MEDIAREMOVED
Definition: shlobj.h:1882
#define SHFMT_ID_DEFAULT
Definition: shlobj.h:325
#define SHCNF_PATHW
Definition: shlobj.h:1911
#define MM_ADDSEPARATOR
Definition: shlobj.h:2514
struct _SFV_CREATE SFV_CREATE
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2598
#define SHCNF_FLUSHNOWAIT
Definition: shlobj.h:1915
#define IDS_DISCONNECT
Definition: shresdef.h:244
#define IDS_DRIVE_CDROM
Definition: shresdef.h:114
#define IDS_CANTDISMOUNTVOLUME
Definition: shresdef.h:150
#define IDS_EJECT
Definition: shresdef.h:243
#define IDS_DRIVE_FIXED
Definition: shresdef.h:113
#define IDS_DRIVE_NETWORK
Definition: shresdef.h:115
#define IDS_DRIVE_REMOVABLE
Definition: shresdef.h:117
#define IDI_SHELL_3_14_FLOPPY
Definition: shresdef.h:557
#define IDI_SHELL_NETDRIVE
Definition: shresdef.h:560
#define IDS_CANTLOCKVOLUME
Definition: shresdef.h:149
#define IDS_DRIVE_FLOPPY
Definition: shresdef.h:116
#define IDS_SHV_COLUMN_DISK_AVAILABLE
Definition: shresdef.h:57
#define IDI_SHELL_DOCUMENT
Definition: shresdef.h:551
#define IDS_CANTSHOWPROPERTIES
Definition: shresdef.h:152
#define IDI_SHELL_CDROM
Definition: shresdef.h:562
#define IDI_SHELL_DRIVE
Definition: shresdef.h:559
#define IDS_CANTEJECTMEDIA
Definition: shresdef.h:151
#define IDI_SHELL_RAMDISK
Definition: shresdef.h:563
#define IDS_CANTDISCONNECT
Definition: shresdef.h:153
#define IDI_SHELL_REMOVEABLE
Definition: shresdef.h:558
#define IDS_SHV_COLUMN_DISK_CAPACITY
Definition: shresdef.h:56
#define IDS_FORMATDRIVE
Definition: shresdef.h:229
#define IDS_SHV_COLUMN_COMMENTS
Definition: shresdef.h:69
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:2536
IShellFolder * psf
Definition: shlobj.h:2538
IUnknown * punkAssociationInfo
Definition: shlobj.h:2541
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2540
const HKEY * aKeys
Definition: shlobj.h:2543
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2537
STRRET str
Definition: shtypes.idl:108
BOOLEAN PreventMediaRemoval
Definition: ntddstor.h:343
HMENU hmenu
Definition: shlobj.h:1382
UINT idCmdLast
Definition: shlobj.h:1385
UINT idCmdFirst
Definition: shlobj.h:1384
UINT indexMenu
Definition: shlobj.h:1383
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
WORD colstate
Definition: shfldr.h:31
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 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 GW_OWNER
Definition: winuser.h:766
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:744
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:787
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:750
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:746
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
BOOL WINAPI BringWindowToTop(_In_ HWND)
DWORD WINAPI WNetCancelConnection2W(LPCWSTR lpName, DWORD dwFlags, BOOL fForce)
Definition: wnet.c:2418
#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
char CHAR
Definition: xmlstorage.h:175