ReactOS  0.4.15-dev-3745-g356babc
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 /*
30 CDrivesFolder should create a CRegFolder to represent the virtual items that exist only in
31 the registry. The CRegFolder is aggregated by the CDrivesFolder.
32 The CDrivesFolderEnum class should enumerate only drives on the system. Since the CRegFolder
33 implementation of IShellFolder::EnumObjects enumerates the virtual items, the
34 CDrivesFolderEnum is only responsible for returning the physical items.
35 
36 2. At least on my XP system, the drive pidls returned are of type PT_DRIVE1, not PT_DRIVE
37 3. The parsing name returned for my computer is incorrect. It should be "My Computer"
38 */
39 
40 static 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 
49 static 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 
58 /***********************************************************************
59 * IShellFolder implementation
60 */
61 
62 #define RETRY_COUNT 3
63 #define RETRY_SLEEP 250
64 static BOOL TryToLockOrUnlockDrive(HANDLE hDrive, BOOL bLock)
65 {
66  DWORD dwError, dwBytesReturned;
67  DWORD dwCode = (bLock ? FSCTL_LOCK_VOLUME : FSCTL_UNLOCK_VOLUME);
68  for (DWORD i = 0; i < RETRY_COUNT; ++i)
69  {
70  if (DeviceIoControl(hDrive, dwCode, NULL, 0, NULL, 0, &dwBytesReturned, NULL))
71  return TRUE;
72 
73  dwError = GetLastError();
74  if (dwError == ERROR_INVALID_FUNCTION)
75  break; /* don't sleep if function is not implemented */
76 
78  }
79  SetLastError(dwError);
80  return FALSE;
81 }
82 
83 // NOTE: See also https://support.microsoft.com/en-us/help/165721/how-to-ejecting-removable-media-in-windows-nt-windows-2000-windows-xp
84 static BOOL DoEjectDrive(const WCHAR *physical, UINT nDriveType, INT *pnStringID)
85 {
86  /* GENERIC_WRITE isn't needed for umount */
87  DWORD dwAccessMode = GENERIC_READ;
88  DWORD dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
89 
90  HANDLE hDrive = CreateFile(physical, dwAccessMode, dwShareMode, 0, OPEN_EXISTING, 0, NULL);
91  if (hDrive == INVALID_HANDLE_VALUE)
92  return FALSE;
93 
94  BOOL bResult, bNeedUnlock = FALSE;
95  DWORD dwBytesReturned, dwError = NO_ERROR;
96  PREVENT_MEDIA_REMOVAL removal;
97  do
98  {
99  bResult = TryToLockOrUnlockDrive(hDrive, TRUE);
100  if (!bResult)
101  {
102  dwError = GetLastError();
103  *pnStringID = IDS_CANTLOCKVOLUME; /* Unable to lock volume */
104  break;
105  }
106  bResult = DeviceIoControl(hDrive, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &dwBytesReturned, NULL);
107  if (!bResult)
108  {
109  dwError = GetLastError();
110  *pnStringID = IDS_CANTDISMOUNTVOLUME; /* Unable to dismount volume */
111  bNeedUnlock = TRUE;
112  break;
113  }
114  removal.PreventMediaRemoval = FALSE;
115  bResult = DeviceIoControl(hDrive, IOCTL_STORAGE_MEDIA_REMOVAL, &removal, sizeof(removal), NULL,
116  0, &dwBytesReturned, NULL);
117  if (!bResult)
118  {
119  *pnStringID = IDS_CANTEJECTMEDIA; /* Unable to eject media */
120  dwError = GetLastError();
121  bNeedUnlock = TRUE;
122  break;
123  }
124  bResult = DeviceIoControl(hDrive, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &dwBytesReturned, NULL);
125  if (!bResult)
126  {
127  *pnStringID = IDS_CANTEJECTMEDIA; /* Unable to eject media */
128  dwError = GetLastError();
129  bNeedUnlock = TRUE;
130  break;
131  }
132  } while (0);
133 
134  if (bNeedUnlock)
135  {
136  TryToLockOrUnlockDrive(hDrive, FALSE);
137  }
138 
139  CloseHandle(hDrive);
140 
141  SetLastError(dwError);
142  return bResult;
143 }
144 
145 // A callback function for finding the stub windows.
146 static BOOL CALLBACK
148 {
149  CSimpleArray<HWND> *pStubs = reinterpret_cast<CSimpleArray<HWND> *>(lParam);
150 
151  WCHAR szClass[64];
152  GetClassNameW(hwnd, szClass, _countof(szClass));
153 
154  if (lstrcmpiW(szClass, L"StubWindow32") == 0)
155  {
156  pStubs->Add(hwnd);
157  }
158 
159  return TRUE;
160 }
161 
162 // Another callback function to find the owned window of the stub window.
163 static BOOL CALLBACK
165 {
166  HWND *phwnd = reinterpret_cast<HWND *>(lParam);
167 
168  if (phwnd[0] == GetWindow(hwnd, GW_OWNER))
169  {
170  phwnd[1] = hwnd;
171  return FALSE;
172  }
173 
174  return TRUE;
175 }
176 
177 // Parameters for format_drive_thread function below.
179 {
181 };
182 
183 static unsigned __stdcall format_drive_thread(void *args)
184 {
186  UINT nDriveNumber = params->nDriveNumber;
187  LONG_PTR nProp = nDriveNumber | 0x7F00;
188 
189  // Search the stub windows that already exist.
190  CSimpleArray<HWND> old_stubs;
191  EnumWindows(EnumStubProc, (LPARAM)&old_stubs);
192 
193  for (INT n = 0; n < old_stubs.GetSize(); ++n)
194  {
195  HWND hwndStub = old_stubs[n];
196 
197  // The target stub window has the prop.
198  if (GetPropW(hwndStub, L"DriveNumber") == (HANDLE)nProp)
199  {
200  // Found.
201  HWND ahwnd[2];
202  ahwnd[0] = hwndStub;
203  ahwnd[1] = NULL;
205 
206  // Activate.
207  BringWindowToTop(ahwnd[1]);
208 
209  delete params;
210  return 0;
211  }
212  }
213 
214  // Create a stub window.
218  if (!stub.Create(NULL, NULL, NULL, style, exstyle))
219  {
220  ERR("StubWindow32 creation failed\n");
221  delete params;
222  return 0;
223  }
224 
225  // Add prop to the target stub window.
226  SetPropW(stub, L"DriveNumber", (HANDLE)nProp);
227 
228  // Do format.
229  SHFormatDrive(stub, nDriveNumber, SHFMT_ID_DEFAULT, 0);
230 
231  // Clean up.
232  RemovePropW(stub, L"DriveNumber");
233  stub.DestroyWindow();
234  delete params;
235 
236  return 0;
237 }
238 
239 static HRESULT DoFormatDrive(HWND hwnd, UINT nDriveNumber)
240 {
242  params->nDriveNumber = nDriveNumber;
243 
244  // Create thread to avoid locked.
245  unsigned tid;
247  if (hThread == NULL)
248  {
249  delete params;
250  return E_FAIL;
251  }
252 
254 
255  return S_OK;
256 }
257 
259  HWND hwnd,
260  IDataObject *pdtobj,
261  UINT uMsg,
262  WPARAM wParam,
263  LPARAM lParam)
264 {
265  if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
266  return S_OK;
267 
268  PIDLIST_ABSOLUTE pidlFolder;
269  PUITEMID_CHILD *apidl;
270  UINT cidl;
271  UINT nDriveType;
272  DWORD dwFlags;
273  HRESULT hr = SH_GetApidlFromDataObject(pdtobj, &pidlFolder, &apidl, &cidl);
274  if (FAILED_UNEXPECTEDLY(hr))
275  return hr;
276 
277  char szDrive[8] = {0};
278  if (!_ILGetDrive(apidl[0], szDrive, sizeof(szDrive)))
279  {
280  ERR("pidl is not a drive\n");
281  SHFree(pidlFolder);
282  _ILFreeaPidl(apidl, cidl);
283  return E_FAIL;
284  }
285  nDriveType = GetDriveTypeA(szDrive);
286  GetVolumeInformationA(szDrive, NULL, 0, NULL, NULL, &dwFlags, NULL, 0);
287 
288 // custom command IDs
289 #define CMDID_FORMAT 1
290 #define CMDID_EJECT 2
291 #define CMDID_DISCONNECT 3
292 
293  if (uMsg == DFM_MERGECONTEXTMENU)
294  {
295  QCMINFO *pqcminfo = (QCMINFO *)lParam;
296 
297  UINT idCmdFirst = pqcminfo->idCmdFirst;
298  if (!(dwFlags & FILE_READ_ONLY_VOLUME) && nDriveType != DRIVE_REMOTE)
299  {
300  /* add separator and Format */
301  UINT idCmd = idCmdFirst + CMDID_FORMAT;
302  _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
304  }
305  if (nDriveType == DRIVE_REMOVABLE || nDriveType == DRIVE_CDROM)
306  {
307  /* add separator and Eject */
308  UINT idCmd = idCmdFirst + CMDID_EJECT;
309  _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
311  }
312  if (nDriveType == DRIVE_REMOTE)
313  {
314  /* add separator and Disconnect */
315  UINT idCmd = idCmdFirst + CMDID_DISCONNECT;
316  _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0);
318  }
319 
320  pqcminfo->idCmdFirst += 3;
321  }
322  else if (uMsg == DFM_INVOKECOMMAND)
323  {
324  WCHAR wszBuf[4] = L"A:\\";
325  wszBuf[0] = (WCHAR)szDrive[0];
326 
327  INT nStringID = 0;
328  DWORD dwError = NO_ERROR;
329 
330  if (wParam == DFM_CMD_PROPERTIES)
331  {
332  hr = SH_ShowDriveProperties(wszBuf, pidlFolder, apidl);
333  if (FAILED(hr))
334  {
335  dwError = ERROR_CAN_NOT_COMPLETE;
336  nStringID = IDS_CANTSHOWPROPERTIES;
337  }
338  }
339  else
340  {
341  if (wParam == CMDID_FORMAT)
342  {
343  hr = DoFormatDrive(hwnd, szDrive[0] - 'A');
344  }
345  else if (wParam == CMDID_EJECT)
346  {
347  /* do eject */
348  WCHAR physical[10];
349  wsprintfW(physical, _T("\\\\.\\%c:"), szDrive[0]);
350 
351  if (DoEjectDrive(physical, nDriveType, &nStringID))
352  {
354  }
355  else
356  {
357  dwError = GetLastError();
358  }
359  }
360  else if (wParam == CMDID_DISCONNECT)
361  {
362  /* do disconnect */
363  wszBuf[2] = UNICODE_NULL;
364  dwError = WNetCancelConnection2W(wszBuf, 0, FALSE);
365  if (dwError == NO_ERROR)
366  {
368  }
369  else
370  {
371  nStringID = IDS_CANTDISCONNECT;
372  }
373  }
374  }
375 
376  if (nStringID != 0)
377  {
378  /* show error message */
379  WCHAR szFormat[128], szMessage[128];
380  LoadStringW(shell32_hInstance, nStringID, szFormat, _countof(szFormat));
381  wsprintfW(szMessage, szFormat, dwError);
382  MessageBoxW(hwnd, szMessage, NULL, MB_ICONERROR);
383  }
384  }
385 
386  SHFree(pidlFolder);
387  _ILFreeaPidl(apidl, cidl);
388 
389  return hr;
390 }
391 
393  HWND hwnd,
394  UINT cidl,
395  PCUITEMID_CHILD_ARRAY apidl,
396  IShellFolder *psf,
397  IContextMenu **ppcm)
398 {
399  HKEY hKeys[2];
400  UINT cKeys = 0;
401  AddClassKeyToArray(L"Drive", hKeys, &cKeys);
402  AddClassKeyToArray(L"Folder", hKeys, &cKeys);
403 
404  return CDefFolderMenu_Create2(pidlFolder, hwnd, cidl, apidl, psf, DrivesContextMenuCallback, cKeys, hKeys, ppcm);
405 }
406 
407 static HRESULT
409  LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
410 {
411  WCHAR wszPath[MAX_PATH];
412  WCHAR wszAutoRunInfPath[MAX_PATH];
413  WCHAR wszValue[MAX_PATH], wszTemp[MAX_PATH];
414 
415  // get path
416  if (!ILGetDisplayNameExW(psf, pidl, wszPath, 0))
417  return E_FAIL;
418  if (!PathIsDirectoryW(wszPath))
419  return E_FAIL;
420 
421  // build the full path of autorun.inf
422  StringCchCopyW(wszAutoRunInfPath, _countof(wszAutoRunInfPath), wszPath);
423  PathAppendW(wszAutoRunInfPath, L"autorun.inf");
424 
425  // autorun.inf --> wszValue
426  if (GetPrivateProfileStringW(L"autorun", L"icon", NULL, wszValue, _countof(wszValue),
427  wszAutoRunInfPath) && wszValue[0] != 0)
428  {
429  // wszValue --> wszTemp
430  ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp));
431 
432  // parse the icon location
433  *piIndex = PathParseIconLocationW(wszTemp);
434 
435  // wszPath + wszTemp --> wszPath
436  if (PathIsRelativeW(wszTemp))
437  PathAppendW(wszPath, wszTemp);
438  else
439  StringCchCopyW(wszPath, _countof(wszPath), wszTemp);
440 
441  // wszPath --> szIconFile
442  GetFullPathNameW(wszPath, cchMax, szIconFile, NULL);
443 
444  return S_OK;
445  }
446 
447  return E_FAIL;
448 }
449 
450 BOOL IsDriveFloppyA(LPCSTR pszDriveRoot);
451 
453 {
454  CComPtr<IDefaultExtractIconInit> initIcon;
456  if (FAILED_UNEXPECTEDLY(hr))
457  return hr;
458 
459  CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
460  UINT DriveType = GetDriveTypeA(pszDrive);
461  if (DriveType > DRIVE_RAMDISK)
463 
464  WCHAR wTemp[MAX_PATH];
465  int icon_idx;
466  UINT flags = 0;
467  if ((DriveType == DRIVE_FIXED || DriveType == DRIVE_UNKNOWN) &&
468  (HCR_GetIconW(L"Drive", wTemp, NULL, MAX_PATH, &icon_idx)))
469  {
470  initIcon->SetNormalIcon(wTemp, icon_idx);
471  }
472  else if (SUCCEEDED(getIconLocationForDrive(psf, pidl, 0, wTemp, _countof(wTemp),
473  &icon_idx, &flags)))
474  {
475  initIcon->SetNormalIcon(wTemp, icon_idx);
476  }
477  else
478  {
479  if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
480  {
481  icon_idx = IDI_SHELL_REMOVEABLE;
482  }
483  else
484  {
485  icon_idx = iDriveIconIds[DriveType];
486  }
487  initIcon->SetNormalIcon(swShell32Name, -icon_idx);
488  }
489 
490  return initIcon->QueryInterface(riid, ppvOut);
491 }
492 
494  public CEnumIDListBase
495 {
496  public:
497  HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags, IEnumIDList* pRegEnumerator)
498  {
499  /* enumerate the folders */
500  if (dwFlags & SHCONTF_FOLDERS)
501  {
502  WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
503  DWORD dwDrivemap = GetLogicalDrives();
504 
505  while (wszDriveName[0] <= 'Z')
506  {
507  if(dwDrivemap & 0x00000001L)
508  AddToEnumList(_ILCreateDrive(wszDriveName));
509  wszDriveName[0]++;
510  dwDrivemap = dwDrivemap >> 1;
511  }
512  }
513 
514  /* Enumerate the items of the reg folder */
515  AppendItemsFromEnumerator(pRegEnumerator);
516 
517  return S_OK;
518  }
519 
521  COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
522  END_COM_MAP()
523 };
524 
525 /***********************************************************************
526 * IShellFolder [MyComputer] implementation
527 */
528 
529 static const shvheader MyComputerSFHeader[] = {
535 };
536 
537 #define MYCOMPUTERSHELLVIEWCOLUMNS 5
538 
540  SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
541  SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
543  SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_CANLINK;
544 static const DWORD dwDriveAttributes =
545  SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
546  SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANRENAME | SFGAO_CANLINK;
547 
549 {
550  pidlRoot = NULL;
551 }
552 
554 {
555  TRACE ("-- destroying IShellFolder(%p)\n", this);
556  SHFree(pidlRoot);
557 }
558 
560 {
561  pidlRoot = _ILCreateMyComputer(); /* my qualified pidl */
562  if (pidlRoot == NULL)
563  return E_OUTOFMEMORY;
564 
565  HRESULT hr = CRegFolder_CreateInstance(&CLSID_MyComputer,
566  pidlRoot,
567  L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
568  L"MyComputer",
570 
571  return hr;
572 }
573 
574 /**************************************************************************
575 * CDrivesFolder::ParseDisplayName
576 */
578  DWORD * pchEaten, PIDLIST_RELATIVE * ppidl, DWORD * pdwAttributes)
579 {
581  LPCWSTR szNext = NULL;
582  LPITEMIDLIST pidlTemp = NULL;
583  INT nDriveNumber;
584 
585  TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
586  hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
587  pchEaten, ppidl, pdwAttributes);
588 
589  *ppidl = 0;
590  if (pchEaten)
591  *pchEaten = 0; /* strange but like the original */
592 
593  /* handle CLSID paths */
594  if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
595  return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes);
596 
597  nDriveNumber = PathGetDriveNumberW(lpszDisplayName);
598  if (nDriveNumber < 0)
599  return E_INVALIDARG;
600 
601  /* check if this drive actually exists */
602  if ((::GetLogicalDrives() & (1 << nDriveNumber)) == 0)
603  {
605  }
606 
607  pidlTemp = _ILCreateDrive(lpszDisplayName);
608  if (!pidlTemp)
609  return E_OUTOFMEMORY;
610 
611  if (lpszDisplayName[2] == L'\\')
612  {
613  szNext = &lpszDisplayName[3];
614  }
615 
616  if (szNext && *szNext)
617  {
618  hr = SHELL32_ParseNextElement (this, hwndOwner, pbc, &pidlTemp,
619  (LPOLESTR) szNext, pchEaten, pdwAttributes);
620  }
621  else
622  {
623  hr = S_OK;
624  if (pdwAttributes && *pdwAttributes)
625  {
626  if (_ILIsDrive(pidlTemp))
627  *pdwAttributes &= dwDriveAttributes;
628  else if (_ILIsSpecialFolder(pidlTemp))
629  m_regFolder->GetAttributesOf(1, &pidlTemp, pdwAttributes);
630  else
631  ERR("Got an unkown pidl here!\n");
632  }
633  }
634 
635  *ppidl = pidlTemp;
636 
637  TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
638 
639  return hr;
640 }
641 
642 /**************************************************************************
643 * CDrivesFolder::EnumObjects
644 */
645 HRESULT WINAPI CDrivesFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
646 {
647  CComPtr<IEnumIDList> pRegEnumerator;
648  m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
649 
650  return ShellObjectCreatorInit<CDrivesFolderEnum>(hwndOwner, dwFlags, pRegEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
651 }
652 
653 /**************************************************************************
654 * CDrivesFolder::BindToObject
655 */
657 {
658  TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", this,
659  pidl, pbcReserved, shdebugstr_guid(&riid), ppvOut);
660 
661  if (!pidl)
662  return E_INVALIDARG;
663 
664  if (_ILIsSpecialFolder(pidl))
665  return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);
666 
667  CHAR* pchDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
668 
669  PERSIST_FOLDER_TARGET_INFO pfti = {0};
670  pfti.dwAttributes = -1;
671  pfti.csidl = -1;
672  pfti.szTargetParsingName[0] = *pchDrive;
673  pfti.szTargetParsingName[1] = L':';
674  pfti.szTargetParsingName[2] = L'\\';
675 
677  &pfti,
678  pidl,
679  &CLSID_ShellFSFolder,
680  riid,
681  ppvOut);
682  if (FAILED_UNEXPECTEDLY(hr))
683  return hr;
684 
685  return S_OK;
686 }
687 
688 /**************************************************************************
689 * CDrivesFolder::BindToStorage
690 */
692 {
693  FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this,
694  pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
695 
696  *ppvOut = NULL;
697  return E_NOTIMPL;
698 }
699 
700 /**************************************************************************
701 * CDrivesFolder::CompareIDs
702 */
703 
705 {
706  HRESULT hres;
707 
708  if (!pidl1 || !pidl2)
709  {
710  ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
711  return E_INVALIDARG;
712  }
713 
714  if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
715  return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
716 
717  if (!_ILIsDrive(pidl1) || !_ILIsDrive(pidl2) || LOWORD(lParam) >= MYCOMPUTERSHELLVIEWCOLUMNS)
718  return E_INVALIDARG;
719 
720  CHAR* pszDrive1 = _ILGetDataPointer(pidl1)->u.drive.szDriveName;
721  CHAR* pszDrive2 = _ILGetDataPointer(pidl2)->u.drive.szDriveName;
722 
723  int result;
724  switch(LOWORD(lParam))
725  {
726  case 0: /* name */
727  {
728  result = stricmp(pszDrive1, pszDrive2);
730  break;
731  }
732  case 1: /* comments */
734  break;
735  case 2: /* Type */
736  {
737  /* We want to return immediately because SHELL32_CompareDetails also compares children. */
738  return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
739  }
740  case 3: /* Size */
741  case 4: /* Size Available */
742  {
743  ULARGE_INTEGER Drive1Available, Drive1Total, Drive2Available, Drive2Total;
744 
745  if (GetVolumeInformationA(pszDrive1, NULL, 0, NULL, NULL, NULL, NULL, 0))
746  GetDiskFreeSpaceExA(pszDrive1, &Drive1Available, &Drive1Total, NULL);
747  else
748  Drive1Available.QuadPart = Drive1Total.QuadPart = 0;
749 
750  if (GetVolumeInformationA(pszDrive2, NULL, 0, NULL, NULL, NULL, NULL, 0))
751  GetDiskFreeSpaceExA(pszDrive2, &Drive2Available, &Drive2Total, NULL);
752  else
753  Drive2Available.QuadPart = Drive2Total.QuadPart = 0;
754 
755  LARGE_INTEGER Diff;
756  if (lParam == 3) /* Size */
757  Diff.QuadPart = Drive1Total.QuadPart - Drive2Total.QuadPart;
758  else /* Size available */
759  Diff.QuadPart = Drive1Available.QuadPart - Drive2Available.QuadPart;
760 
762  break;
763  }
764  default:
765  return E_INVALIDARG;
766  }
767 
768  if (HRESULT_CODE(hres) == 0)
769  return SHELL32_CompareChildren(this, lParam, pidl1, pidl2);
770 
771  return hres;
772 }
773 
774 /**************************************************************************
775 * CDrivesFolder::CreateViewObject
776 */
778 {
779  CComPtr<IShellView> pShellView;
781 
782  TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
783  hwndOwner, shdebugstr_guid (&riid), ppvOut);
784 
785  if (!ppvOut)
786  return hr;
787 
788  *ppvOut = NULL;
789 
790  if (IsEqualIID(riid, IID_IDropTarget))
791  {
792  WARN("IDropTarget not implemented\n");
793  hr = E_NOTIMPL;
794  }
795  else if (IsEqualIID(riid, IID_IContextMenu))
796  {
797  HKEY hKeys[16];
798  UINT cKeys = 0;
799  AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
800 
801  DEFCONTEXTMENU dcm;
802  dcm.hwnd = hwndOwner;
803  dcm.pcmcb = this;
804  dcm.pidlFolder = pidlRoot;
805  dcm.psf = this;
806  dcm.cidl = 0;
807  dcm.apidl = NULL;
808  dcm.cKeys = cKeys;
809  dcm.aKeys = hKeys;
811  hr = SHCreateDefaultContextMenu(&dcm, riid, ppvOut);
812  }
813  else if (IsEqualIID(riid, IID_IShellView))
814  {
815  SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
816  hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
817  }
818  TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
819  return hr;
820 }
821 
823 {
824  GUID *guid = _ILGetGUIDPointer(pidl);
825 
826  TRACE("(%p)\n", pidl);
827 
828  if (guid)
829  return IsEqualIID(*guid, CLSID_ControlPanel);
830  return FALSE;
831 }
832 
833 /**************************************************************************
834 * CDrivesFolder::GetAttributesOf
835 */
837 {
838  TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
839  this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
840 
841  if (cidl && !apidl)
842  return E_INVALIDARG;
843 
844  if (*rgfInOut == 0)
845  *rgfInOut = ~0;
846 
847  /* FIXME: always add SFGAO_CANLINK */
848  if(cidl == 0)
849  *rgfInOut &= dwComputerAttributes;
850  else
851  {
852  for (UINT i = 0; i < cidl; ++i)
853  {
854  if (_ILIsDrive(apidl[i]))
855  *rgfInOut &= dwDriveAttributes;
856  else if (_ILIsControlPanel(apidl[i]))
857  *rgfInOut &= dwControlPanelAttributes;
858  else if (_ILIsSpecialFolder(*apidl))
859  m_regFolder->GetAttributesOf(1, &apidl[i], rgfInOut);
860  else
861  ERR("Got unknown pidl type!\n");
862  }
863  }
864 
865  /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
866  *rgfInOut &= ~SFGAO_VALIDATE;
867 
868  TRACE ("-- result=0x%08x\n", *rgfInOut);
869  return S_OK;
870 }
871 
872 /**************************************************************************
873 * CDrivesFolder::GetUIObjectOf
874 *
875 * PARAMETERS
876 * hwndOwner [in] Parent window for any output
877 * cidl [in] array size
878 * apidl [in] simple pidl array
879 * riid [in] Requested Interface
880 * prgfInOut [ ] reserved
881 * ppvObject [out] Resulting Interface
882 *
883 */
885  UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
886  REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
887 {
888  LPVOID pObj = NULL;
890 
891  TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
892  hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
893 
894  if (!ppvOut)
895  return hr;
896 
897  *ppvOut = NULL;
898 
899  if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
900  {
901  if (_ILIsDrive(apidl[0]))
902  hr = CDrivesContextMenu_CreateInstance(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), (IContextMenu**)&pObj);
903  else
904  hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
905  }
906  else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
907  {
908  hr = IDataObject_Constructor (hwndOwner,
909  pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
910  }
911  else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
912  {
913  if (_ILIsDrive(apidl[0]))
914  hr = CDrivesExtractIcon_CreateInstance(this, apidl[0], riid, &pObj);
915  else
916  hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
917  }
918  else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
919  {
920  CComPtr<IShellFolder> psfChild;
921  hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
922  if (FAILED_UNEXPECTEDLY(hr))
923  return hr;
924 
925  return psfChild->CreateViewObject(NULL, riid, ppvOut);
926  }
927  else
928  hr = E_NOINTERFACE;
929 
930  if (SUCCEEDED(hr) && !pObj)
931  hr = E_OUTOFMEMORY;
932 
933  *ppvOut = pObj;
934  TRACE ("(%p)->hr=0x%08x\n", this, hr);
935  return hr;
936 }
937 
938 /**************************************************************************
939 * CDrivesFolder::GetDisplayNameOf
940 */
942 {
943  LPWSTR pszPath;
944  HRESULT hr = S_OK;
945 
946  TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
947  pdump (pidl);
948 
949  if (!strRet)
950  return E_INVALIDARG;
951 
952  if (!_ILIsPidlSimple (pidl))
953  {
954  return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
955  }
956  else if (_ILIsSpecialFolder(pidl))
957  {
958  return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
959  }
960  else if (!_ILIsDrive(pidl))
961  {
962  ERR("Wrong pidl type\n");
963  return E_INVALIDARG;
964  }
965 
966  pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
967  if (!pszPath)
968  return E_OUTOFMEMORY;
969 
970  pszPath[0] = 0;
971 
972  _ILSimpleGetTextW(pidl, pszPath, MAX_PATH); /* append my own path */
973  /* long view "lw_name (C:)" */
974  if (!(dwFlags & SHGDN_FORPARSING))
975  {
976  WCHAR wszDrive[18] = {0};
977  DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags;
978 
979  lstrcpynW(wszDrive, pszPath, 4);
980  pszPath[0] = L'\0';
981  GetVolumeInformationW(wszDrive, pszPath,
982  MAX_PATH - 7,
983  &dwVolumeSerialNumber,
984  &dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
985  pszPath[MAX_PATH-1] = L'\0';
986  if (!wcslen(pszPath))
987  {
988  UINT DriveType, ResourceId;
989  DriveType = GetDriveTypeW(wszDrive);
990  switch(DriveType)
991  {
992  case DRIVE_FIXED:
993  ResourceId = IDS_DRIVE_FIXED;
994  break;
995  case DRIVE_REMOTE:
996  ResourceId = IDS_DRIVE_NETWORK;
997  break;
998  case DRIVE_CDROM:
999  ResourceId = IDS_DRIVE_CDROM;
1000  break;
1001  default:
1002  ResourceId = 0;
1003  }
1004  if (ResourceId)
1005  {
1006  dwFileSystemFlags = LoadStringW(shell32_hInstance, ResourceId, pszPath, MAX_PATH);
1007  if (dwFileSystemFlags > MAX_PATH - 7)
1008  pszPath[MAX_PATH-7] = L'\0';
1009  }
1010  }
1011  wcscat (pszPath, L" (");
1012  wszDrive[2] = L'\0';
1013  wcscat (pszPath, wszDrive);
1014  wcscat (pszPath, L")");
1015  }
1016 
1017  if (SUCCEEDED(hr))
1018  {
1019  strRet->uType = STRRET_WSTR;
1020  strRet->pOleStr = pszPath;
1021  }
1022  else
1023  CoTaskMemFree(pszPath);
1024 
1025  TRACE("-- (%p)->(%s)\n", this, strRet->uType == STRRET_CSTR ? strRet->cStr : debugstr_w(strRet->pOleStr));
1026  return hr;
1027 }
1028 
1029 /**************************************************************************
1030 * CDrivesFolder::SetNameOf
1031 * Changes the name of a file object or subfolder, possibly changing its item
1032 * identifier in the process.
1033 *
1034 * PARAMETERS
1035 * hwndOwner [in] Owner window for output
1036 * pidl [in] simple pidl of item to change
1037 * lpszName [in] the items new display name
1038 * dwFlags [in] SHGNO formatting flags
1039 * ppidlOut [out] simple pidl returned
1040 */
1042  LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
1043 {
1044  WCHAR szName[30];
1045 
1046  if (_ILIsDrive(pidl))
1047  {
1048  if (_ILSimpleGetTextW(pidl, szName, _countof(szName)))
1050  if (pPidlOut)
1051  *pPidlOut = _ILCreateDrive(szName);
1052  return S_OK;
1053  }
1054 
1055  return m_regFolder->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
1056 }
1057 
1059 {
1060  FIXME ("(%p)\n", this);
1061  return E_NOTIMPL;
1062 }
1063 
1065 {
1066  FIXME ("(%p)\n", this);
1067  return E_NOTIMPL;
1068 }
1069 
1071 {
1072  TRACE ("(%p)\n", this);
1073 
1074  if (pSort)
1075  *pSort = 0;
1076  if (pDisplay)
1077  *pDisplay = 0;
1078  return S_OK;
1079 }
1080 
1082 {
1083  TRACE ("(%p)\n", this);
1084 
1085  if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
1086  return E_INVALIDARG;
1087  *pcsFlags = MyComputerSFHeader[iColumn].pcsFlags;
1088  return S_OK;
1089 }
1090 
1092 {
1093  FIXME ("(%p)\n", this);
1094  return E_NOTIMPL;
1095 }
1096 
1098 {
1099  HRESULT hr;
1100 
1101  TRACE ("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
1102 
1103  if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
1104  return E_INVALIDARG;
1105 
1106  if (!pidl)
1107  {
1108  psd->fmt = MyComputerSFHeader[iColumn].fmt;
1109  psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
1110  return SHSetStrRet(&psd->str, MyComputerSFHeader[iColumn].colnameid);
1111  }
1112  else if (!_ILIsDrive(pidl))
1113  {
1114  return m_regFolder->GetDetailsOf(pidl, iColumn, psd);
1115  }
1116  else
1117  {
1118  ULARGE_INTEGER ulTotalBytes, ulFreeBytes;
1119  CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
1120  UINT DriveType = GetDriveTypeA(pszDrive);
1121  if (DriveType > DRIVE_RAMDISK)
1123 
1124  switch (iColumn)
1125  {
1126  case 0: /* name */
1128  break;
1129  case 1: /* FIXME: comments */
1130  hr = SHSetStrRet(&psd->str, "");
1131  break;
1132  case 2: /* type */
1133  if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
1134  hr = SHSetStrRet(&psd->str, IDS_DRIVE_REMOVABLE);
1135  else
1136  hr = SHSetStrRet(&psd->str, iDriveTypeIds[DriveType]);
1137  break;
1138  case 3: /* total size */
1139  case 4: /* free size */
1140  psd->str.cStr[0] = 0x00;
1141  psd->str.uType = STRRET_CSTR;
1142  if (GetVolumeInformationA(pszDrive, NULL, 0, NULL, NULL, NULL, NULL, 0))
1143  {
1144  GetDiskFreeSpaceExA(pszDrive, &ulFreeBytes, &ulTotalBytes, NULL);
1145  if (iColumn == 3)
1146  StrFormatByteSize64A(ulTotalBytes.QuadPart, psd->str.cStr, MAX_PATH);
1147  else
1148  StrFormatByteSize64A(ulFreeBytes.QuadPart, psd->str.cStr, MAX_PATH);
1149  }
1150  hr = S_OK;
1151  break;
1152  }
1153  }
1154 
1155  return hr;
1156 }
1157 
1159 {
1160  FIXME("(%p)\n", this);
1161  return E_NOTIMPL;
1162 }
1163 
1164 /************************************************************************
1165  * CDrivesFolder::GetClassID
1166  */
1168 {
1169  TRACE ("(%p)\n", this);
1170 
1171  if (!lpClassId)
1172  return E_POINTER;
1173 
1174  *lpClassId = CLSID_MyComputer;
1175  return S_OK;
1176 }
1177 
1178 /************************************************************************
1179  * CDrivesFolder::Initialize
1180  *
1181  * NOTES: it makes no sense to change the pidl
1182  */
1184 {
1185  return S_OK;
1186 }
1187 
1188 /**************************************************************************
1189  * CDrivesFolder::GetCurFolder
1190  */
1192 {
1193  TRACE("(%p)->(%p)\n", this, pidl);
1194 
1195  if (!pidl)
1196  return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
1197 
1198  *pidl = ILClone(pidlRoot);
1199  return S_OK;
1200 }
1201 
1202 /************************************************************************/
1203 /* IContextMenuCB interface */
1204 
1206 {
1207  if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
1208  return S_OK;
1209 
1210  /* no data object means no selection */
1211  if (!pdtobj)
1212  {
1213  if (uMsg == DFM_INVOKECOMMAND && wParam == 1) // #1
1214  {
1215  // "System" properties
1216  ShellExecuteW(hwndOwner,
1217  NULL,
1218  L"rundll32.exe",
1219  L"shell32.dll,Control_RunDLL sysdm.cpl",
1220  NULL,
1221  SW_SHOWNORMAL);
1222  }
1223  else if (uMsg == DFM_MERGECONTEXTMENU)
1224  {
1225  QCMINFO *pqcminfo = (QCMINFO *)lParam;
1226  HMENU hpopup = CreatePopupMenu();
1227  _InsertMenuItemW(hpopup, 0, TRUE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED); // #0
1229  Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu++, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1230  DestroyMenu(hpopup);
1231  }
1232 
1233  return S_OK;
1234  }
1235 
1236  if (uMsg != DFM_INVOKECOMMAND || wParam != DFM_CMD_PROPERTIES)
1237  return S_OK;
1238 
1239  return Shell_DefaultContextMenuCallBack(this, pdtobj);
1240 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
HRESULT WINAPI FinalConstruct()
#define IDS_SHV_COLUMN_COMMENTS
Definition: shresdef.h:69
#define WS_DISABLED
Definition: pedump.c:621
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1722
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
#define IDS_CANTDISMOUNTVOLUME
Definition: shresdef.h:147
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
UINT idCmdLast
Definition: shlobj.h:1318
#define MFT_STRING
Definition: winuser.h:741
#define IDI_SHELL_DRIVE
Definition: shresdef.h:532
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid)
#define FSCTL_UNLOCK_VOLUME
Definition: nt_native.h:833
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
Definition: profile.c:1142
#define REFIID
Definition: guiddef.h:118
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1578
#define CloseHandle
Definition: compat.h:598
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2176
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT CDrivesExtractIcon_CreateInstance(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
UINT WINAPI GetDriveTypeA(IN LPCSTR lpRootPathName)
Definition: disk.c:468
#define CMDID_EJECT
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
static BOOL CALLBACK EnumStubProc(HWND hwnd, LPARAM lParam)
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
HRESULT hr
Definition: shlfolder.c:183
GLuint64EXT * result
Definition: glext.h:11304
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
const HKEY * aKeys
Definition: shlobj.h:2396
#define IOCTL_STORAGE_MEDIA_REMOVAL
Definition: ntddstor.h:104
interface IBindCtx * LPBC
Definition: objfwd.h:18
virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
LPSTR WINAPI StrFormatByteSize64A(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
Definition: string.c:2488
#define TRUE
Definition: types.h:120
REFIID riid
Definition: precomp.h:44
virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidl)
static BOOL TryToLockOrUnlockDrive(HANDLE hDrive, BOOL bLock)
LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)
Definition: pidl.c:1808
BOOL AddToEnumList(LPITEMIDLIST pidl)
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:288
#define IDS_SHV_COLUMN_DISK_CAPACITY
Definition: shresdef.h:56
char CHAR
Definition: xmlstorage.h:175
#define CMDID_FORMAT
ITEMID_CHILD UNALIGNED * PUITEMID_CHILD
Definition: shtypes.idl:68
HRESULT WINAPI Shell_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdtobj)
Definition: shlfolder.cpp:429
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv)
#define WARN(fmt,...)
Definition: debug.h:112
#define CMDID_DISCONNECT
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
#define RETRY_SLEEP
void AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:267
#define DRIVE_RAMDISK
Definition: winbase.h:252
#define LVCFMT_RIGHT
Definition: commctrl.h:2599
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
IContextMenuCB * pcmcb
Definition: shlobj.h:2389
#define CALLBACK
Definition: compat.h:35
_In_ LPCSTR lpName
Definition: winbase.h:2770
Definition: stubgen.c:11
LPWSTR pOleStr
Definition: shtypes.idl:96
HMENU hmenu
Definition: shlobj.h:1315
virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE *pidl)
GLdouble n
Definition: glext.h:7729
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
#define IDI_SHELL_REMOVEABLE
Definition: shresdef.h:531
#define IDS_CANTSHOWPROPERTIES
Definition: shresdef.h:149
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
UINT DriveType
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
HRESULT CALLBACK DrivesContextMenuCallback(IShellFolder *psf, HWND hwnd, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL IsDriveFloppyA(LPCSTR pszDriveRoot)
Definition: drvdefext.cpp:372
const GUID IID_IDataObject
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:546
UINT_PTR WPARAM
Definition: windef.h:207
#define IDS_PROPERTIES
Definition: resource.h:101
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
UINT uFlags
Definition: api.c:59
#define SHFMT_ID_DEFAULT
Definition: shlobj.h:297
_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)
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
static LPOLESTR
Definition: stg_prop.c:27
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:159
CComPtr< IShellFolder2 > m_regFolder
Definition: CDrivesFolder.h:36
static const DWORD dwComputerAttributes
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
#define NO_ERROR
Definition: dderror.h:5
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3792
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
Definition: match.c:390
#define RETRY_COUNT
#define IDS_DRIVE_CDROM
Definition: shresdef.h:114
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
STRRET str
Definition: shtypes.idl:108
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
#define FILE_SHARE_READ
Definition: compat.h:136
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
#define DRIVE_REMOVABLE
Definition: winbase.h:248
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
#define IDS_SHV_COLUMN_TYPE
Definition: resource.h:75
#define lstrcpynW
Definition: compat.h:597
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:126
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
struct _stub stub
char cStr[MAX_PATH]
Definition: shtypes.idl:98
const GUID * guid
#define L(x)
Definition: ntvdm.h:50
IShellFolder * psf
Definition: shlobj.h:2391
#define DRIVE_REMOTE
Definition: winbase.h:250
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define MFS_ENABLED
Definition: winuser.h:745
#define DRIVE_CDROM
Definition: machpc98.h:115
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
#define FALSE
Definition: types.h:117
#define IDS_FORMATDRIVE
Definition: shresdef.h:226
#define UNICODE_NULL
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
#define IDS_SHV_COLUMN_DISK_AVAILABLE
Definition: shresdef.h:57
GLenum const GLfloat * params
Definition: glext.h:5645
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ERROR_CAN_NOT_COMPLETE
Definition: winerror.h:582
static const DWORD dwControlPanelAttributes
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:215
if SUCCEEDED(hr)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define IOCTL_STORAGE_EJECT_MEDIA
Definition: ntddstor.h:107
#define IDS_CANTLOCKVOLUME
Definition: shresdef.h:146
#define E_INVALIDARG
Definition: ddrawi.h:101
BOOL WINAPI BringWindowToTop(_In_ HWND)
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE *ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
Definition: shlfolder.cpp:327
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
LONG_PTR LPARAM
Definition: windef.h:208
UINT indexMenu
Definition: shlobj.h:1316
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:197
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2096
static HRESULT getIconLocationForDrive(IShellFolder *psf, PCITEMID_CHILD pidl, UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
static HRESULT DoFormatDrive(HWND hwnd, UINT nDriveNumber)
const char * LPCSTR
Definition: xmlstorage.h:183
struct _SFV_CREATE SFV_CREATE
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1613
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:91
#define DRIVE_UNKNOWN
Definition: winbase.h:253
#define OPEN_EXISTING
Definition: compat.h:634
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
_Check_return_ _CRTIMP int __cdecl stricmp(_In_z_ const char *_Str1, _In_z_ const char *_Str2)
HRESULT SHELL32_ParseNextElement(IShellFolder2 *psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST *pidlInOut, LPOLESTR szNext, DWORD *pEaten, DWORD *pdwAttributes)
Definition: shlfolder.cpp:70
#define FSCTL_DISMOUNT_VOLUME
Definition: nt_native.h:834
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:238
#define WS_CAPTION
Definition: pedump.c:624
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:542
HRESULT CRegFolder_CreateInstance(const GUID *pGuid, LPCITEMIDLIST pidlRoot, LPCWSTR lpszPath, LPCWSTR lpszEnumKeyName, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:779
#define _T(x)
Definition: vfdio.h:22
#define IDI_SHELL_3_14_FLOPPY
Definition: shresdef.h:530
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
#define IDS_DRIVE_FIXED
Definition: shresdef.h:113
HRESULT hres
Definition: protocol.c:465
#define SHCNE_MEDIAREMOVED
Definition: shlobj.h:1735
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDS_CANTEJECTMEDIA
Definition: shresdef.h:148
#define MM_ADDSEPARATOR
Definition: shlobj.h:2367
BOOL WINAPI SetVolumeLabelW(IN LPCWSTR lpRootPathName, IN LPCWSTR lpVolumeName OPTIONAL)
Definition: volume.c:503
LONG HRESULT
Definition: typedefs.h:79
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2314
UINT idCmdFirst
Definition: shlobj.h:1317
#define _countof(array)
Definition: sndvol32.h:68
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
static int iDriveTypeIds[7]
#define MAX_PATH
Definition: compat.h:34
#define WINAPI
Definition: msvc.h:6
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC, _In_ LPARAM)
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2451
PVOID HANDLE
Definition: typedefs.h:73
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDS_DRIVE_REMOVABLE
Definition: shresdef.h:117
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
#define IDS_DISCONNECT
Definition: shresdef.h:241
#define SetLastError(x)
Definition: compat.h:611
#define __stdcall
Definition: typedefs.h:25
GLbitfield flags
Definition: glext.h:7161
UINT cchMax
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1953
#define MFT_SEPARATOR
Definition: winuser.h:739
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
BOOLEAN PreventMediaRemoval
Definition: ntddstor.h:343
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
virtual HRESULT WINAPI GetClassID(CLSID *lpClassId)
#define ERROR_INVALID_DRIVE
Definition: winerror.h:118
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define MB_ICONERROR
Definition: winuser.h:781
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
static int iDriveIconIds[7]
#define GENERIC_READ
Definition: compat.h:135
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
static unsigned __stdcall format_drive_thread(void *args)
#define IDS_CANTDISCONNECT
Definition: shresdef.h:150
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl)
Definition: pidl.c:2635
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
static const DWORD dwDriveAttributes
#define DRIVE_FIXED
Definition: winbase.h:249
DWORD WINAPI WNetCancelConnection2W(LPCWSTR lpName, DWORD dwFlags, BOOL fForce)
Definition: wnet.c:2418
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define SHCNF_PATHW
Definition: shlobj.h:1764
DWORD WINAPI GetLogicalDrives(VOID)
Definition: disk.c:110
#define IDS_DRIVE_NETWORK
Definition: shresdef.h:115
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1092
#define ERR(fmt,...)
Definition: debug.h:110
DWORD WINAPI SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
Definition: drive.cpp:698
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
virtual HRESULT WINAPI CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags, IEnumIDList *pRegEnumerator)
#define S_OK
Definition: intsafe.h:52
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define shell32_hInstance
HRESULT SH_ShowDriveProperties(WCHAR *pwszDrive, LPCITEMIDLIST pidlFolder, PCUITEMID_CHILD_ARRAY apidl)
Definition: drive.cpp:170
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
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
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:913
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define MYCOMPUTERSHELLVIEWCOLUMNS
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:562
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
#define E_NOTIMPL
Definition: ddrawi.h:99
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
HRESULT CDrivesContextMenu_CreateInstance(PCIDLIST_ABSOLUTE pidlFolder, HWND hwnd, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IShellFolder *psf, IContextMenu **ppcm)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define GW_OWNER
Definition: winuser.h:761
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
WINE_DEFAULT_DEBUG_CHANNEL(shell)
HANDLE hThread
Definition: wizard.c:28
#define IDI_SHELL_CDROM
Definition: shresdef.h:535
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
int WINAPI PathGetDriveNumberW(const WCHAR *path)
Definition: path.c:553
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
static BOOL CALLBACK EnumStubProc2(HWND hwnd, LPARAM lParam)
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
#define HRESULT_CODE(hr)
Definition: winerror.h:76
BOOL WINAPI GetDiskFreeSpaceExA(IN LPCSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:313
static const WCHAR szName[]
Definition: msipriv.h:1194
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2258
#define FSCTL_LOCK_VOLUME
Definition: nt_native.h:832
unsigned int ULONG
Definition: retypes.h:1
IUnknown * punkAssociationInfo
Definition: shlobj.h:2394
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum)
#define IDI_SHELL_RAMDISK
Definition: shresdef.h:536
#define IDI_SHELL_NETDRIVE
Definition: shresdef.h:533
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define END_COM_MAP()
Definition: atlcom.h:553
#define FILE_READ_ONLY_VOLUME
Definition: from_kernel.h:246
#define IDS_SHV_COLUMN_NAME
Definition: resource.h:74
WCHAR * LPWSTR
Definition: xmlstorage.h:184
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
UINT uType
Definition: shtypes.idl:93
#define E_POINTER
Definition: winerror.h:2365
static BOOL DoEjectDrive(const WCHAR *physical, UINT nDriveType, INT *pnStringID)
Arabic default style
Definition: afstyles.h:93
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2393
DWORD _ILGetDrive(LPCITEMIDLIST pidl, LPSTR pOut, UINT uSize)
Definition: pidl.c:1855
LPITEMIDLIST pidlRoot
Definition: CDrivesFolder.h:35
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
static const shvheader MyComputerSFHeader[]
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
static TfClientId tid
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2390
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define SHCNE_DRIVEREMOVED
Definition: shlobj.h:1736
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)
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define SHCNF_FLUSHNOWAIT
Definition: shlobj.h:1768
LONGLONG QuadPart
Definition: typedefs.h:114
#define IDS_DRIVE_FLOPPY
Definition: shresdef.h:116
#define IDS_EJECT
Definition: shresdef.h:240