ReactOS 0.4.15-dev-7788-g1ad9096
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-2019 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 S_OK;
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 }
347 else if (uMsg == DFM_INVOKECOMMAND)
348 {
349 WCHAR wszBuf[4] = L"A:\\";
350 wszBuf[0] = (WCHAR)szDrive[0];
351
352 INT nStringID = 0;
353 DWORD dwError = NO_ERROR;
354
356 {
357 // pdtobj should be valid at this point!
358 ATLASSERT(pdtobj);
359 hr = SH_ShowDriveProperties(wszBuf, pdtobj) ? S_OK : E_UNEXPECTED;
360 if (FAILED(hr))
361 {
362 dwError = ERROR_CAN_NOT_COMPLETE;
363 nStringID = IDS_CANTSHOWPROPERTIES;
364 }
365 }
366 else
367 {
368 if (wParam == CMDID_FORMAT)
369 {
370 hr = DoFormatDrive(hwnd, szDrive[0] - 'A');
371 }
372 else if (wParam == CMDID_EJECT)
373 {
374 /* do eject */
375 WCHAR physical[10];
376 wsprintfW(physical, _T("\\\\.\\%c:"), szDrive[0]);
377
378 if (DoEjectDrive(physical, nDriveType, &nStringID))
379 {
381 }
382 else
383 {
384 dwError = GetLastError();
385 }
386 }
387 else if (wParam == CMDID_DISCONNECT)
388 {
389 /* do disconnect */
390 wszBuf[2] = UNICODE_NULL;
391 dwError = WNetCancelConnection2W(wszBuf, 0, FALSE);
392 if (dwError == NO_ERROR)
393 {
395 }
396 else
397 {
398 nStringID = IDS_CANTDISCONNECT;
399 }
400 }
401 }
402
403 if (nStringID != 0)
404 {
405 /* show error message */
406 WCHAR szFormat[128], szMessage[128];
407 LoadStringW(shell32_hInstance, nStringID, szFormat, _countof(szFormat));
408 wsprintfW(szMessage, szFormat, dwError);
409 MessageBoxW(hwnd, szMessage, NULL, MB_ICONERROR);
410 }
411 }
412
413 SHFree(pidlFolder);
414 _ILFreeaPidl(apidl, cidl);
415
416 return hr;
417}
418
420 HWND hwnd,
421 UINT cidl,
423 IShellFolder *psf,
424 IContextMenu **ppcm)
425{
426 HKEY hKeys[2];
427 UINT cKeys = 0;
428 AddClassKeyToArray(L"Drive", hKeys, &cKeys);
429 AddClassKeyToArray(L"Folder", hKeys, &cKeys);
430
431 return CDefFolderMenu_Create2(pidlFolder, hwnd, cidl, apidl, psf, DrivesContextMenuCallback, cKeys, hKeys, ppcm);
432}
433
434static HRESULT
436 LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
437{
438 WCHAR wszPath[MAX_PATH];
439 WCHAR wszAutoRunInfPath[MAX_PATH];
440 WCHAR wszValue[MAX_PATH], wszTemp[MAX_PATH];
441
442 // get path
443 if (!ILGetDisplayNameExW(psf, pidl, wszPath, 0))
444 return E_FAIL;
445 if (!PathIsDirectoryW(wszPath))
446 return E_FAIL;
447
448 // build the full path of autorun.inf
449 StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath);
450 PathAppendW(wszAutoRunInfPath, L"autorun.inf");
451
452 // autorun.inf --> wszValue
453 if (GetPrivateProfileStringW(L"autorun", L"icon", NULL, wszValue, _countof(wszValue),
454 wszAutoRunInfPath) && wszValue[0] != 0)
455 {
456 // wszValue --> wszTemp
457 ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp));
458
459 // parse the icon location
460 *piIndex = PathParseIconLocationW(wszTemp);
461
462 // wszPath + wszTemp --> wszPath
463 if (PathIsRelativeW(wszTemp))
464 PathAppendW(wszPath, wszTemp);
465 else
466 StringCchCopyW(wszPath, _countof(wszPath), wszTemp);
467
468 // wszPath --> szIconFile
469 GetFullPathNameW(wszPath, cchMax, szIconFile, NULL);
470
471 return S_OK;
472 }
473
474 return E_FAIL;
475}
476
477static HRESULT
479{
480 WCHAR wszAutoRunInfPath[MAX_PATH];
481 WCHAR wszTemp[MAX_PATH];
482
483 if (!PathIsDirectoryW(wszPath))
484 return E_FAIL;
485
486 StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath);
487 PathAppendW(wszAutoRunInfPath, L"autorun.inf");
488
489 if (GetPrivateProfileStringW(L"autorun", L"label", NULL, wszTemp, _countof(wszTemp),
490 wszAutoRunInfPath) && wszTemp[0] != 0)
491 {
492 StringCchCopyW(wszLabel, _countof(wszTemp), wszTemp);
493 return S_OK;
494 }
495
496 return E_FAIL;
497}
498
499BOOL IsDriveFloppyA(LPCSTR pszDriveRoot);
500
502{
503 CComPtr<IDefaultExtractIconInit> initIcon;
506 return hr;
507
508 CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
509 UINT DriveType = GetDriveTypeA(pszDrive);
512
513 WCHAR wTemp[MAX_PATH];
514 int icon_idx, reg_idx;
515 UINT flags = 0;
516
517 switch (DriveType)
518 {
519 case DRIVE_FIXED:
520 case DRIVE_UNKNOWN:
521 reg_idx = IDI_SHELL_DRIVE;
522 break;
523 case DRIVE_CDROM:
524 reg_idx = IDI_SHELL_CDROM;
525 break;
526 case DRIVE_REMOTE:
527 reg_idx = IDI_SHELL_NETDRIVE;
528 break;
529 case DRIVE_REMOVABLE:
530 if (!IsDriveFloppyA(pszDrive))
531 reg_idx = IDI_SHELL_REMOVEABLE;
532 else
533 reg_idx = IDI_SHELL_3_14_FLOPPY;
534 break;
535 case DRIVE_RAMDISK:
536 reg_idx = IDI_SHELL_RAMDISK;
537 break;
539 default:
540 reg_idx = IDI_SHELL_DOCUMENT;
541 break;
542 }
543
544 hr = getIconLocationForDrive(psf, pidl, 0, wTemp, _countof(wTemp),
545 &icon_idx, &flags);
546 if (SUCCEEDED(hr))
547 {
548 initIcon->SetNormalIcon(wTemp, icon_idx);
549 }
550 else if (HLM_GetIconW(reg_idx - 1, wTemp, _countof(wTemp), &icon_idx))
551 {
552 initIcon->SetNormalIcon(wTemp, icon_idx);
553 }
554 else if ((DriveType == DRIVE_FIXED || DriveType == DRIVE_UNKNOWN) &&
555 (HCR_GetIconW(L"Drive", wTemp, NULL, _countof(wTemp), &icon_idx)))
556 {
557 initIcon->SetNormalIcon(wTemp, icon_idx);
558 }
559 else
560 {
561 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
562 {
563 icon_idx = IDI_SHELL_REMOVEABLE;
564 }
565 else
566 {
567 icon_idx = iDriveIconIds[DriveType];
568 }
569 initIcon->SetNormalIcon(swShell32Name, -icon_idx);
570 }
571
572 return initIcon->QueryInterface(riid, ppvOut);
573}
574
576 public CEnumIDListBase
577{
578 public:
579 HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags, IEnumIDList* pRegEnumerator)
580 {
581 /* enumerate the folders */
582 if (dwFlags & SHCONTF_FOLDERS)
583 {
584 WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
585 DWORD dwDrivemap = GetLogicalDrives();
586
587 while (wszDriveName[0] <= 'Z')
588 {
589 if(dwDrivemap & 0x00000001L)
590 AddToEnumList(_ILCreateDrive(wszDriveName));
591 wszDriveName[0]++;
592 dwDrivemap = dwDrivemap >> 1;
593 }
594 }
595
596 /* Enumerate the items of the reg folder */
597 AppendItemsFromEnumerator(pRegEnumerator);
598
599 return S_OK;
600 }
601
603 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
605};
606
607/***********************************************************************
608* IShellFolder [MyComputer] implementation
609*/
610
617};
618
620 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
621 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
623 SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_CANLINK;
625 SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
626 SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANRENAME | SFGAO_CANLINK;
627
629{
630 pidlRoot = NULL;
631}
632
634{
635 TRACE("-- destroying IShellFolder(%p)\n", this);
637}
638
640{
641 pidlRoot = _ILCreateMyComputer(); /* my qualified pidl */
642 if (pidlRoot == NULL)
643 return E_OUTOFMEMORY;
644
645 HRESULT hr = CRegFolder_CreateInstance(&CLSID_MyComputer,
646 pidlRoot,
647 L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
648 L"MyComputer",
650
651 return hr;
652}
653
654/**************************************************************************
655* CDrivesFolder::ParseDisplayName
656*/
658 DWORD * pchEaten, PIDLIST_RELATIVE * ppidl, DWORD * pdwAttributes)
659{
661 LPCWSTR szNext = NULL;
662 LPITEMIDLIST pidlTemp = NULL;
663 INT nDriveNumber;
664
665 TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
666 hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
667 pchEaten, ppidl, pdwAttributes);
668
669 *ppidl = 0;
670 if (pchEaten)
671 *pchEaten = 0; /* strange but like the original */
672
673 /* handle CLSID paths */
674 if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
675 return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes);
676
677 nDriveNumber = PathGetDriveNumberW(lpszDisplayName);
678 if (nDriveNumber < 0)
679 return E_INVALIDARG;
680
681 /* check if this drive actually exists */
682 if ((::GetLogicalDrives() & (1 << nDriveNumber)) == 0)
683 {
685 }
686
687 pidlTemp = _ILCreateDrive(lpszDisplayName);
688 if (!pidlTemp)
689 return E_OUTOFMEMORY;
690
691 if (lpszDisplayName[2] == L'\\')
692 {
693 szNext = &lpszDisplayName[3];
694 }
695
696 if (szNext && *szNext)
697 {
698 hr = SHELL32_ParseNextElement (this, hwndOwner, pbc, &pidlTemp,
699 (LPOLESTR) szNext, pchEaten, pdwAttributes);
700 }
701 else
702 {
703 hr = S_OK;
704 if (pdwAttributes && *pdwAttributes)
705 {
706 if (_ILIsDrive(pidlTemp))
707 {
708 *pdwAttributes &= dwDriveAttributes;
709
710 if (_ILGetDriveType(pidlTemp) == DRIVE_CDROM)
711 *pdwAttributes &= ~SFGAO_CANRENAME; // CD-ROM drive cannot rename
712 }
713 else if (_ILIsSpecialFolder(pidlTemp))
714 m_regFolder->GetAttributesOf(1, &pidlTemp, pdwAttributes);
715 else
716 ERR("Got unknown pidl\n");
717 }
718 }
719
720 *ppidl = pidlTemp;
721
722 TRACE("(%p)->(-- ret=0x%08x)\n", this, hr);
723
724 return hr;
725}
726
727/**************************************************************************
728* CDrivesFolder::EnumObjects
729*/
730HRESULT WINAPI CDrivesFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
731{
732 CComPtr<IEnumIDList> pRegEnumerator;
733 m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
734
735 return ShellObjectCreatorInit<CDrivesFolderEnum>(hwndOwner, dwFlags, pRegEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
736}
737
738/**************************************************************************
739* CDrivesFolder::BindToObject
740*/
742{
743 TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", this,
744 pidl, pbcReserved, shdebugstr_guid(&riid), ppvOut);
745
746 if (!pidl)
747 return E_INVALIDARG;
748
749 if (_ILIsSpecialFolder(pidl))
750 return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);
751
752 CHAR* pchDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
753
754 PERSIST_FOLDER_TARGET_INFO pfti = {0};
755 pfti.dwAttributes = -1;
756 pfti.csidl = -1;
757 pfti.szTargetParsingName[0] = *pchDrive;
758 pfti.szTargetParsingName[1] = L':';
759 pfti.szTargetParsingName[2] = L'\\';
760
762 &pfti,
763 pidl,
764 &CLSID_ShellFSFolder,
765 riid,
766 ppvOut);
768 return hr;
769
770 return S_OK;
771}
772
773/**************************************************************************
774* CDrivesFolder::BindToStorage
775*/
777{
778 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this,
779 pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
780
781 *ppvOut = NULL;
782 return E_NOTIMPL;
783}
784
785/**************************************************************************
786* CDrivesFolder::CompareIDs
787*/
788
790{
792
793 if (!pidl1 || !pidl2)
794 {
795 ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
796 return E_INVALIDARG;
797 }
798
799 if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
800 return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
801
802 UINT iColumn = LOWORD(lParam);
803 if (!_ILIsDrive(pidl1) || !_ILIsDrive(pidl2) || iColumn >= _countof(MyComputerSFHeader))
804 return E_INVALIDARG;
805
806 CHAR* pszDrive1 = _ILGetDataPointer(pidl1)->u.drive.szDriveName;
807 CHAR* pszDrive2 = _ILGetDataPointer(pidl2)->u.drive.szDriveName;
808
809 int result;
810 switch (MyComputerSFHeader[iColumn].colnameid)
811 {
813 {
814 result = stricmp(pszDrive1, pszDrive2);
816 break;
817 }
819 {
820 /* We want to return immediately because SHELL32_CompareDetails also compares children. */
821 return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
822 }
825 {
826 ULARGE_INTEGER Drive1Available, Drive1Total, Drive2Available, Drive2Total;
827
828 if (GetVolumeInformationA(pszDrive1, NULL, 0, NULL, NULL, NULL, NULL, 0))
829 GetDiskFreeSpaceExA(pszDrive1, &Drive1Available, &Drive1Total, NULL);
830 else
831 Drive1Available.QuadPart = Drive1Total.QuadPart = 0;
832
833 if (GetVolumeInformationA(pszDrive2, NULL, 0, NULL, NULL, NULL, NULL, 0))
834 GetDiskFreeSpaceExA(pszDrive2, &Drive2Available, &Drive2Total, NULL);
835 else
836 Drive2Available.QuadPart = Drive2Total.QuadPart = 0;
837
838 LARGE_INTEGER Diff;
839 if (lParam == 3) /* Size */
840 Diff.QuadPart = Drive1Total.QuadPart - Drive2Total.QuadPart;
841 else /* Size available */
842 Diff.QuadPart = Drive1Available.QuadPart - Drive2Available.QuadPart;
843
845 break;
846 }
849 break;
851 }
852
853 if (HRESULT_CODE(hres) == 0)
854 return SHELL32_CompareChildren(this, lParam, pidl1, pidl2);
855
856 return hres;
857}
858
859/**************************************************************************
860* CDrivesFolder::CreateViewObject
861*/
863{
864 CComPtr<IShellView> pShellView;
866
867 TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
868 hwndOwner, shdebugstr_guid (&riid), ppvOut);
869
870 if (!ppvOut)
871 return hr;
872
873 *ppvOut = NULL;
874
875 if (IsEqualIID(riid, IID_IDropTarget))
876 {
877 WARN("IDropTarget not implemented\n");
878 hr = E_NOTIMPL;
879 }
880 else if (IsEqualIID(riid, IID_IContextMenu))
881 {
882 HKEY hKeys[16];
883 UINT cKeys = 0;
884 AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
885
886 DEFCONTEXTMENU dcm;
887 dcm.hwnd = hwndOwner;
888 dcm.pcmcb = this;
889 dcm.pidlFolder = pidlRoot;
890 dcm.psf = this;
891 dcm.cidl = 0;
892 dcm.apidl = NULL;
893 dcm.cKeys = cKeys;
894 dcm.aKeys = hKeys;
896 hr = SHCreateDefaultContextMenu(&dcm, riid, ppvOut);
897 }
898 else if (IsEqualIID(riid, IID_IShellView))
899 {
900 SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
901 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
902 }
903 TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
904 return hr;
905}
906
907/**************************************************************************
908* CDrivesFolder::GetAttributesOf
909*/
911{
912 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
913 this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
914
915 if (cidl && !apidl)
916 return E_INVALIDARG;
917
918 if (*rgfInOut == 0)
919 *rgfInOut = ~0;
920
921 /* FIXME: always add SFGAO_CANLINK */
922 if(cidl == 0)
923 *rgfInOut &= dwComputerAttributes;
924 else
925 {
926 for (UINT i = 0; i < cidl; ++i)
927 {
928 if (_ILIsDrive(apidl[i]))
929 {
930 *rgfInOut &= dwDriveAttributes;
931
932 if (_ILGetDriveType(apidl[i]) == DRIVE_CDROM)
933 *rgfInOut &= ~SFGAO_CANRENAME; // CD-ROM drive cannot rename
934 }
935 else if (_ILIsControlPanel(apidl[i]))
936 *rgfInOut &= dwControlPanelAttributes;
937 else if (_ILIsSpecialFolder(*apidl))
938 m_regFolder->GetAttributesOf(1, &apidl[i], rgfInOut);
939 else
940 ERR("Got unknown pidl type!\n");
941 }
942 }
943
944 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
945 *rgfInOut &= ~SFGAO_VALIDATE;
946
947 TRACE("-- result=0x%08x\n", *rgfInOut);
948 return S_OK;
949}
950
951/**************************************************************************
952* CDrivesFolder::GetUIObjectOf
953*
954* PARAMETERS
955* hwndOwner [in] Parent window for any output
956* cidl [in] array size
957* apidl [in] simple pidl array
958* riid [in] Requested Interface
959* prgfInOut [ ] reserved
960* ppvObject [out] Resulting Interface
961*
962*/
964 UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
965 REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
966{
967 LPVOID pObj = NULL;
969
970 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
971 hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
972
973 if (!ppvOut)
974 return hr;
975
976 *ppvOut = NULL;
977
978 if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
979 {
980 if (_ILIsDrive(apidl[0]))
981 hr = CDrivesContextMenu_CreateInstance(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), (IContextMenu**)&pObj);
982 else
983 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
984 }
985 else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
986 {
987 hr = IDataObject_Constructor(hwndOwner,
988 pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
989 }
990 else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
991 {
992 if (_ILIsDrive(apidl[0]))
993 hr = CDrivesExtractIcon_CreateInstance(this, apidl[0], riid, &pObj);
994 else
995 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
996 }
997 else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
998 {
999 CComPtr<IShellFolder> psfChild;
1000 hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
1002 return hr;
1003
1004 return psfChild->CreateViewObject(NULL, riid, ppvOut);
1005 }
1006 else
1007 hr = E_NOINTERFACE;
1008
1009 if (SUCCEEDED(hr) && !pObj)
1010 hr = E_OUTOFMEMORY;
1011
1012 *ppvOut = pObj;
1013 TRACE("(%p)->hr=0x%08x\n", this, hr);
1014 return hr;
1015}
1016
1017/**************************************************************************
1018* CDrivesFolder::GetDisplayNameOf
1019*/
1021{
1022 LPWSTR pszPath;
1023 HRESULT hr = S_OK;
1024
1025 TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
1026 pdump (pidl);
1027
1028 if (!strRet)
1029 return E_INVALIDARG;
1030
1031 if (!_ILIsPidlSimple (pidl))
1032 {
1033 return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
1034 }
1035 else if (_ILIsSpecialFolder(pidl))
1036 {
1037 return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
1038 }
1039 else if (!_ILIsDrive(pidl))
1040 {
1041 ERR("Wrong pidl type\n");
1042 return E_INVALIDARG;
1043 }
1044
1045 pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
1046 if (!pszPath)
1047 return E_OUTOFMEMORY;
1048
1049 pszPath[0] = 0;
1050
1051 _ILSimpleGetTextW(pidl, pszPath, MAX_PATH); /* append my own path */
1052 /* long view "lw_name (C:)" */
1053 if (!(dwFlags & SHGDN_FORPARSING))
1054 {
1055 WCHAR wszDrive[18] = {0};
1056
1057 lstrcpynW(wszDrive, pszPath, 4);
1058 pszPath[0] = L'\0';
1059
1060 if (!SUCCEEDED(getLabelForDrive(wszDrive, pszPath)))
1061 {
1062 DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags;
1063
1064 GetVolumeInformationW(wszDrive, pszPath,
1065 MAX_PATH - 7,
1066 &dwVolumeSerialNumber,
1067 &dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
1068 pszPath[MAX_PATH-1] = L'\0';
1069
1070 if (!wcslen(pszPath))
1071 {
1073 DriveType = GetDriveTypeW(wszDrive);
1074
1075 switch (DriveType)
1076 {
1077 case DRIVE_FIXED:
1079 break;
1080 case DRIVE_REMOTE:
1082 break;
1083 case DRIVE_CDROM:
1085 break;
1086 default:
1087 ResourceId = 0;
1088 }
1089
1090 if (ResourceId)
1091 {
1092 dwFileSystemFlags = LoadStringW(shell32_hInstance, ResourceId, pszPath, MAX_PATH);
1093 if (dwFileSystemFlags > MAX_PATH - 7)
1094 pszPath[MAX_PATH-7] = L'\0';
1095 }
1096 }
1097 }
1098 wcscat(pszPath, L" (");
1099 wszDrive[2] = L'\0';
1100 wcscat(pszPath, wszDrive);
1101 wcscat(pszPath, L")");
1102 }
1103
1104 if (SUCCEEDED(hr))
1105 {
1106 strRet->uType = STRRET_WSTR;
1107 strRet->pOleStr = pszPath;
1108 }
1109 else
1110 CoTaskMemFree(pszPath);
1111
1112 TRACE("-- (%p)->(%s)\n", this, strRet->uType == STRRET_CSTR ? strRet->cStr : debugstr_w(strRet->pOleStr));
1113 return hr;
1114}
1115
1116/**************************************************************************
1117* CDrivesFolder::SetNameOf
1118* Changes the name of a file object or subfolder, possibly changing its item
1119* identifier in the process.
1120*
1121* PARAMETERS
1122* hwndOwner [in] Owner window for output
1123* pidl [in] simple pidl of item to change
1124* lpszName [in] the items new display name
1125* dwFlags [in] SHGNO formatting flags
1126* ppidlOut [out] simple pidl returned
1127*/
1129 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
1130{
1131 WCHAR szName[30];
1132
1133 if (_ILIsDrive(pidl))
1134 {
1137 if (pPidlOut)
1138 *pPidlOut = _ILCreateDrive(szName);
1139 return S_OK;
1140 }
1141
1142 return m_regFolder->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
1143}
1144
1146{
1147 FIXME("(%p)\n", this);
1148 return E_NOTIMPL;
1149}
1150
1152{
1153 FIXME("(%p)\n", this);
1154 return E_NOTIMPL;
1155}
1156
1158{
1159 TRACE("(%p)\n", this);
1160
1161 if (pSort)
1162 *pSort = 0;
1163 if (pDisplay)
1164 *pDisplay = 0;
1165 return S_OK;
1166}
1167
1169{
1170 TRACE("(%p)\n", this);
1171
1172 if (!pcsFlags || iColumn >= _countof(MyComputerSFHeader))
1173 return E_INVALIDARG;
1174 *pcsFlags = MyComputerSFHeader[iColumn].pcsFlags;
1175 return S_OK;
1176}
1177
1179{
1180 FIXME("(%p)\n", this);
1181 return E_NOTIMPL;
1182}
1183
1185{
1186 HRESULT hr;
1187
1188 TRACE("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
1189
1190 if (!psd || iColumn >= _countof(MyComputerSFHeader))
1191 return E_INVALIDARG;
1192
1193 if (!pidl)
1194 {
1195 psd->fmt = MyComputerSFHeader[iColumn].fmt;
1196 psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
1197 return SHSetStrRet(&psd->str, MyComputerSFHeader[iColumn].colnameid);
1198 }
1199 else if (!_ILIsDrive(pidl))
1200 {
1201 switch (MyComputerSFHeader[iColumn].colnameid)
1202 {
1205 return m_regFolder->GetDetailsOf(pidl, iColumn, psd);
1208 return SHSetStrRet(&psd->str, ""); /* blank col */
1210 return m_regFolder->GetDetailsOf(pidl, 2, psd); /* 2 = comments */
1212 }
1213 }
1214 else
1215 {
1216 ULARGE_INTEGER ulTotalBytes, ulFreeBytes;
1217 CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
1218 UINT DriveType = GetDriveTypeA(pszDrive);
1221
1222 switch (MyComputerSFHeader[iColumn].colnameid)
1223 {
1226 break;
1228 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
1229 hr = SHSetStrRet(&psd->str, IDS_DRIVE_REMOVABLE);
1230 else
1231 hr = SHSetStrRet(&psd->str, iDriveTypeIds[DriveType]);
1232 break;
1235 psd->str.cStr[0] = 0x00;
1236 psd->str.uType = STRRET_CSTR;
1237 if (GetVolumeInformationA(pszDrive, NULL, 0, NULL, NULL, NULL, NULL, 0))
1238 {
1239 GetDiskFreeSpaceExA(pszDrive, &ulFreeBytes, &ulTotalBytes, NULL);
1240 if (iColumn == 2)
1241 StrFormatByteSize64A(ulTotalBytes.QuadPart, psd->str.cStr, MAX_PATH);
1242 else
1243 StrFormatByteSize64A(ulFreeBytes.QuadPart, psd->str.cStr, MAX_PATH);
1244 }
1245 hr = S_OK;
1246 break;
1248 hr = SHSetStrRet(&psd->str, ""); /* FIXME: comments */
1249 break;
1251 }
1252 }
1253
1254 return hr;
1255}
1256
1258{
1259 FIXME("(%p)\n", this);
1260 return E_NOTIMPL;
1261}
1262
1263/************************************************************************
1264 * CDrivesFolder::GetClassID
1265 */
1267{
1268 TRACE("(%p)\n", this);
1269
1270 if (!lpClassId)
1271 return E_POINTER;
1272
1273 *lpClassId = CLSID_MyComputer;
1274 return S_OK;
1275}
1276
1277/************************************************************************
1278 * CDrivesFolder::Initialize
1279 *
1280 * NOTES: it makes no sense to change the pidl
1281 */
1283{
1284 return S_OK;
1285}
1286
1287/**************************************************************************
1288 * CDrivesFolder::GetCurFolder
1289 */
1291{
1292 TRACE("(%p)->(%p)\n", this, pidl);
1293
1294 if (!pidl)
1295 return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
1296
1297 *pidl = ILClone(pidlRoot);
1298 return S_OK;
1299}
1300
1301/************************************************************************/
1302/* IContextMenuCB interface */
1303
1305{
1306 if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
1307 return S_OK;
1308
1309 /* no data object means no selection */
1310 if (!pdtobj)
1311 {
1312 if (uMsg == DFM_INVOKECOMMAND && wParam == 1) // #1
1313 {
1314 // "System" properties
1315 ShellExecuteW(hwndOwner,
1316 NULL,
1317 L"rundll32.exe",
1318 L"shell32.dll,Control_RunDLL sysdm.cpl",
1319 NULL,
1321 }
1322 else if (uMsg == DFM_MERGECONTEXTMENU)
1323 {
1324 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1325 HMENU hpopup = CreatePopupMenu();
1326 _InsertMenuItemW(hpopup, 0, TRUE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED); // #0
1328 Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu++, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1329 DestroyMenu(hpopup);
1330 }
1331
1332 return S_OK;
1333 }
1334
1336 return S_OK;
1337
1338 return Shell_DefaultContextMenuCallBack(this, pdtobj);
1339}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3855
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:834
UINT DriveType
INT ResourceId
#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:111
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
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 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
HRESULT WINAPI Shell_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdtobj)
Definition: shlfolder.cpp:460
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
int WINAPI PathGetDriveNumberW(const WCHAR *path)
Definition: path.c:553
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:2488
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
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
#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
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:1628
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
DWORD _ILGetDrive(LPCITEMIDLIST pidl, LPSTR pOut, UINT uSize)
Definition: pidl.c:1870
LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)
Definition: pidl.c:1823
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2202
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl)
Definition: pidl.c:2661
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:91
BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
Definition: pidl.c:1935
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1979
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2122
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:573
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:159
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:197
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:215
void AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:268
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:238
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE *ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
Definition: shlfolder.cpp:328
HRESULT SHELL32_ParseNextElement(IShellFolder2 *psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST *pidlInOut, LPOLESTR szNext, DWORD *pEaten, DWORD *pdwAttributes)
Definition: shlfolder.cpp:70
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2379
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:1882
#define SHCNE_MEDIAREMOVED
Definition: shlobj.h:1881
#define SHFMT_ID_DEFAULT
Definition: shlobj.h:325
#define SHCNF_PATHW
Definition: shlobj.h:1910
#define MM_ADDSEPARATOR
Definition: shlobj.h:2513
struct _SFV_CREATE SFV_CREATE
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2597
#define SHCNF_FLUSHNOWAIT
Definition: shlobj.h:1914
#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:555
#define IDI_SHELL_NETDRIVE
Definition: shresdef.h:558
#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:549
#define IDS_CANTSHOWPROPERTIES
Definition: shresdef.h:152
#define IDI_SHELL_CDROM
Definition: shresdef.h:560
#define IDI_SHELL_DRIVE
Definition: shresdef.h:557
#define IDS_CANTEJECTMEDIA
Definition: shresdef.h:151
#define IDI_SHELL_RAMDISK
Definition: shresdef.h:561
#define IDS_CANTDISCONNECT
Definition: shresdef.h:153
#define IDI_SHELL_REMOVEABLE
Definition: shresdef.h:556
#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
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
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
#define _countof(array)
Definition: sndvol32.h:68
#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:2535
IShellFolder * psf
Definition: shlobj.h:2537
IUnknown * punkAssociationInfo
Definition: shlobj.h:2540
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2539
const HKEY * aKeys
Definition: shlobj.h:2542
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2536
STRRET str
Definition: shtypes.idl:108
BOOLEAN PreventMediaRemoval
Definition: ntddstor.h:343
HMENU hmenu
Definition: shlobj.h:1381
UINT idCmdLast
Definition: shlobj.h:1384
UINT idCmdFirst
Definition: shlobj.h:1383
UINT indexMenu
Definition: shlobj.h:1382
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
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 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:3684
_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 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 ERROR_INVALID_DRIVE
Definition: winerror.h:118
#define SW_SHOWNORMAL
Definition: winuser.h:770
#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
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175