ReactOS 0.4.15-dev-7113-g9ea2222
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;
515 UINT flags = 0;
517 (HCR_GetIconW(L"Drive", wTemp, NULL, MAX_PATH, &icon_idx)))
518 {
519 initIcon->SetNormalIcon(wTemp, icon_idx);
520 }
521 else if (SUCCEEDED(getIconLocationForDrive(psf, pidl, 0, wTemp, _countof(wTemp),
522 &icon_idx, &flags)))
523 {
524 initIcon->SetNormalIcon(wTemp, icon_idx);
525 }
526 else
527 {
528 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
529 {
530 icon_idx = IDI_SHELL_REMOVEABLE;
531 }
532 else
533 {
534 icon_idx = iDriveIconIds[DriveType];
535 }
536 initIcon->SetNormalIcon(swShell32Name, -icon_idx);
537 }
538
539 return initIcon->QueryInterface(riid, ppvOut);
540}
541
543 public CEnumIDListBase
544{
545 public:
546 HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags, IEnumIDList* pRegEnumerator)
547 {
548 /* enumerate the folders */
549 if (dwFlags & SHCONTF_FOLDERS)
550 {
551 WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
552 DWORD dwDrivemap = GetLogicalDrives();
553
554 while (wszDriveName[0] <= 'Z')
555 {
556 if(dwDrivemap & 0x00000001L)
557 AddToEnumList(_ILCreateDrive(wszDriveName));
558 wszDriveName[0]++;
559 dwDrivemap = dwDrivemap >> 1;
560 }
561 }
562
563 /* Enumerate the items of the reg folder */
564 AppendItemsFromEnumerator(pRegEnumerator);
565
566 return S_OK;
567 }
568
570 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
572};
573
574/***********************************************************************
575* IShellFolder [MyComputer] implementation
576*/
577
584};
585
587 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
588 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
590 SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_CANLINK;
592 SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
593 SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANRENAME | SFGAO_CANLINK;
594
596{
597 pidlRoot = NULL;
598}
599
601{
602 TRACE ("-- destroying IShellFolder(%p)\n", this);
604}
605
607{
608 pidlRoot = _ILCreateMyComputer(); /* my qualified pidl */
609 if (pidlRoot == NULL)
610 return E_OUTOFMEMORY;
611
612 HRESULT hr = CRegFolder_CreateInstance(&CLSID_MyComputer,
613 pidlRoot,
614 L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
615 L"MyComputer",
617
618 return hr;
619}
620
621/**************************************************************************
622* CDrivesFolder::ParseDisplayName
623*/
625 DWORD * pchEaten, PIDLIST_RELATIVE * ppidl, DWORD * pdwAttributes)
626{
628 LPCWSTR szNext = NULL;
629 LPITEMIDLIST pidlTemp = NULL;
630 INT nDriveNumber;
631
632 TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
633 hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
634 pchEaten, ppidl, pdwAttributes);
635
636 *ppidl = 0;
637 if (pchEaten)
638 *pchEaten = 0; /* strange but like the original */
639
640 /* handle CLSID paths */
641 if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
642 return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes);
643
644 nDriveNumber = PathGetDriveNumberW(lpszDisplayName);
645 if (nDriveNumber < 0)
646 return E_INVALIDARG;
647
648 /* check if this drive actually exists */
649 if ((::GetLogicalDrives() & (1 << nDriveNumber)) == 0)
650 {
652 }
653
654 pidlTemp = _ILCreateDrive(lpszDisplayName);
655 if (!pidlTemp)
656 return E_OUTOFMEMORY;
657
658 if (lpszDisplayName[2] == L'\\')
659 {
660 szNext = &lpszDisplayName[3];
661 }
662
663 if (szNext && *szNext)
664 {
665 hr = SHELL32_ParseNextElement (this, hwndOwner, pbc, &pidlTemp,
666 (LPOLESTR) szNext, pchEaten, pdwAttributes);
667 }
668 else
669 {
670 hr = S_OK;
671 if (pdwAttributes && *pdwAttributes)
672 {
673 if (_ILIsDrive(pidlTemp))
674 {
675 *pdwAttributes &= dwDriveAttributes;
676
677 if (_ILGetDriveType(pidlTemp) == DRIVE_CDROM)
678 *pdwAttributes &= ~SFGAO_CANRENAME; // CD-ROM drive cannot rename
679 }
680 else if (_ILIsSpecialFolder(pidlTemp))
681 m_regFolder->GetAttributesOf(1, &pidlTemp, pdwAttributes);
682 else
683 ERR("Got an unknown pidl here!\n");
684 }
685 }
686
687 *ppidl = pidlTemp;
688
689 TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
690
691 return hr;
692}
693
694/**************************************************************************
695* CDrivesFolder::EnumObjects
696*/
697HRESULT WINAPI CDrivesFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
698{
699 CComPtr<IEnumIDList> pRegEnumerator;
700 m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
701
702 return ShellObjectCreatorInit<CDrivesFolderEnum>(hwndOwner, dwFlags, pRegEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
703}
704
705/**************************************************************************
706* CDrivesFolder::BindToObject
707*/
709{
710 TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", this,
711 pidl, pbcReserved, shdebugstr_guid(&riid), ppvOut);
712
713 if (!pidl)
714 return E_INVALIDARG;
715
716 if (_ILIsSpecialFolder(pidl))
717 return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);
718
719 CHAR* pchDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
720
721 PERSIST_FOLDER_TARGET_INFO pfti = {0};
722 pfti.dwAttributes = -1;
723 pfti.csidl = -1;
724 pfti.szTargetParsingName[0] = *pchDrive;
725 pfti.szTargetParsingName[1] = L':';
726 pfti.szTargetParsingName[2] = L'\\';
727
729 &pfti,
730 pidl,
731 &CLSID_ShellFSFolder,
732 riid,
733 ppvOut);
735 return hr;
736
737 return S_OK;
738}
739
740/**************************************************************************
741* CDrivesFolder::BindToStorage
742*/
744{
745 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this,
746 pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
747
748 *ppvOut = NULL;
749 return E_NOTIMPL;
750}
751
752/**************************************************************************
753* CDrivesFolder::CompareIDs
754*/
755
757{
759
760 if (!pidl1 || !pidl2)
761 {
762 ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
763 return E_INVALIDARG;
764 }
765
766 if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
767 return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
768
769 UINT iColumn = LOWORD(lParam);
770 if (!_ILIsDrive(pidl1) || !_ILIsDrive(pidl2) || iColumn >= _countof(MyComputerSFHeader))
771 return E_INVALIDARG;
772
773 CHAR* pszDrive1 = _ILGetDataPointer(pidl1)->u.drive.szDriveName;
774 CHAR* pszDrive2 = _ILGetDataPointer(pidl2)->u.drive.szDriveName;
775
776 int result;
777 switch (MyComputerSFHeader[iColumn].colnameid)
778 {
780 {
781 result = stricmp(pszDrive1, pszDrive2);
783 break;
784 }
786 {
787 /* We want to return immediately because SHELL32_CompareDetails also compares children. */
788 return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
789 }
792 {
793 ULARGE_INTEGER Drive1Available, Drive1Total, Drive2Available, Drive2Total;
794
795 if (GetVolumeInformationA(pszDrive1, NULL, 0, NULL, NULL, NULL, NULL, 0))
796 GetDiskFreeSpaceExA(pszDrive1, &Drive1Available, &Drive1Total, NULL);
797 else
798 Drive1Available.QuadPart = Drive1Total.QuadPart = 0;
799
800 if (GetVolumeInformationA(pszDrive2, NULL, 0, NULL, NULL, NULL, NULL, 0))
801 GetDiskFreeSpaceExA(pszDrive2, &Drive2Available, &Drive2Total, NULL);
802 else
803 Drive2Available.QuadPart = Drive2Total.QuadPart = 0;
804
805 LARGE_INTEGER Diff;
806 if (lParam == 3) /* Size */
807 Diff.QuadPart = Drive1Total.QuadPart - Drive2Total.QuadPart;
808 else /* Size available */
809 Diff.QuadPart = Drive1Available.QuadPart - Drive2Available.QuadPart;
810
812 break;
813 }
816 break;
818 }
819
820 if (HRESULT_CODE(hres) == 0)
821 return SHELL32_CompareChildren(this, lParam, pidl1, pidl2);
822
823 return hres;
824}
825
826/**************************************************************************
827* CDrivesFolder::CreateViewObject
828*/
830{
831 CComPtr<IShellView> pShellView;
833
834 TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
835 hwndOwner, shdebugstr_guid (&riid), ppvOut);
836
837 if (!ppvOut)
838 return hr;
839
840 *ppvOut = NULL;
841
842 if (IsEqualIID(riid, IID_IDropTarget))
843 {
844 WARN("IDropTarget not implemented\n");
845 hr = E_NOTIMPL;
846 }
847 else if (IsEqualIID(riid, IID_IContextMenu))
848 {
849 HKEY hKeys[16];
850 UINT cKeys = 0;
851 AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
852
853 DEFCONTEXTMENU dcm;
854 dcm.hwnd = hwndOwner;
855 dcm.pcmcb = this;
856 dcm.pidlFolder = pidlRoot;
857 dcm.psf = this;
858 dcm.cidl = 0;
859 dcm.apidl = NULL;
860 dcm.cKeys = cKeys;
861 dcm.aKeys = hKeys;
863 hr = SHCreateDefaultContextMenu(&dcm, riid, ppvOut);
864 }
865 else if (IsEqualIID(riid, IID_IShellView))
866 {
867 SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
868 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
869 }
870 TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
871 return hr;
872}
873
874/**************************************************************************
875* CDrivesFolder::GetAttributesOf
876*/
878{
879 TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
880 this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
881
882 if (cidl && !apidl)
883 return E_INVALIDARG;
884
885 if (*rgfInOut == 0)
886 *rgfInOut = ~0;
887
888 /* FIXME: always add SFGAO_CANLINK */
889 if(cidl == 0)
890 *rgfInOut &= dwComputerAttributes;
891 else
892 {
893 for (UINT i = 0; i < cidl; ++i)
894 {
895 if (_ILIsDrive(apidl[i]))
896 {
897 *rgfInOut &= dwDriveAttributes;
898
899 if (_ILGetDriveType(apidl[i]) == DRIVE_CDROM)
900 *rgfInOut &= ~SFGAO_CANRENAME; // CD-ROM drive cannot rename
901 }
902 else if (_ILIsControlPanel(apidl[i]))
903 *rgfInOut &= dwControlPanelAttributes;
904 else if (_ILIsSpecialFolder(*apidl))
905 m_regFolder->GetAttributesOf(1, &apidl[i], rgfInOut);
906 else
907 ERR("Got unknown pidl type!\n");
908 }
909 }
910
911 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
912 *rgfInOut &= ~SFGAO_VALIDATE;
913
914 TRACE ("-- result=0x%08x\n", *rgfInOut);
915 return S_OK;
916}
917
918/**************************************************************************
919* CDrivesFolder::GetUIObjectOf
920*
921* PARAMETERS
922* hwndOwner [in] Parent window for any output
923* cidl [in] array size
924* apidl [in] simple pidl array
925* riid [in] Requested Interface
926* prgfInOut [ ] reserved
927* ppvObject [out] Resulting Interface
928*
929*/
931 UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
932 REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
933{
934 LPVOID pObj = NULL;
936
937 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
938 hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
939
940 if (!ppvOut)
941 return hr;
942
943 *ppvOut = NULL;
944
945 if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
946 {
947 if (_ILIsDrive(apidl[0]))
948 hr = CDrivesContextMenu_CreateInstance(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), (IContextMenu**)&pObj);
949 else
950 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
951 }
952 else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
953 {
954 hr = IDataObject_Constructor (hwndOwner,
955 pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
956 }
957 else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
958 {
959 if (_ILIsDrive(apidl[0]))
960 hr = CDrivesExtractIcon_CreateInstance(this, apidl[0], riid, &pObj);
961 else
962 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
963 }
964 else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
965 {
966 CComPtr<IShellFolder> psfChild;
967 hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
969 return hr;
970
971 return psfChild->CreateViewObject(NULL, riid, ppvOut);
972 }
973 else
975
976 if (SUCCEEDED(hr) && !pObj)
978
979 *ppvOut = pObj;
980 TRACE ("(%p)->hr=0x%08x\n", this, hr);
981 return hr;
982}
983
984/**************************************************************************
985* CDrivesFolder::GetDisplayNameOf
986*/
988{
989 LPWSTR pszPath;
990 HRESULT hr = S_OK;
991
992 TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
993 pdump (pidl);
994
995 if (!strRet)
996 return E_INVALIDARG;
997
998 if (!_ILIsPidlSimple (pidl))
999 {
1000 return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
1001 }
1002 else if (_ILIsSpecialFolder(pidl))
1003 {
1004 return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
1005 }
1006 else if (!_ILIsDrive(pidl))
1007 {
1008 ERR("Wrong pidl type\n");
1009 return E_INVALIDARG;
1010 }
1011
1012 pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
1013 if (!pszPath)
1014 return E_OUTOFMEMORY;
1015
1016 pszPath[0] = 0;
1017
1018 _ILSimpleGetTextW(pidl, pszPath, MAX_PATH); /* append my own path */
1019 /* long view "lw_name (C:)" */
1020 if (!(dwFlags & SHGDN_FORPARSING))
1021 {
1022 WCHAR wszDrive[18] = {0};
1023
1024 lstrcpynW(wszDrive, pszPath, 4);
1025 pszPath[0] = L'\0';
1026
1027 if (!SUCCEEDED(getLabelForDrive(wszDrive, pszPath)))
1028 {
1029 DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags;
1030
1031 GetVolumeInformationW(wszDrive, pszPath,
1032 MAX_PATH - 7,
1033 &dwVolumeSerialNumber,
1034 &dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
1035 pszPath[MAX_PATH-1] = L'\0';
1036
1037 if (!wcslen(pszPath))
1038 {
1040 DriveType = GetDriveTypeW(wszDrive);
1041
1042 switch (DriveType)
1043 {
1044 case DRIVE_FIXED:
1046 break;
1047 case DRIVE_REMOTE:
1049 break;
1050 case DRIVE_CDROM:
1052 break;
1053 default:
1054 ResourceId = 0;
1055 }
1056
1057 if (ResourceId)
1058 {
1059 dwFileSystemFlags = LoadStringW(shell32_hInstance, ResourceId, pszPath, MAX_PATH);
1060 if (dwFileSystemFlags > MAX_PATH - 7)
1061 pszPath[MAX_PATH-7] = L'\0';
1062 }
1063 }
1064 }
1065 wcscat (pszPath, L" (");
1066 wszDrive[2] = L'\0';
1067 wcscat (pszPath, wszDrive);
1068 wcscat (pszPath, L")");
1069 }
1070
1071 if (SUCCEEDED(hr))
1072 {
1073 strRet->uType = STRRET_WSTR;
1074 strRet->pOleStr = pszPath;
1075 }
1076 else
1077 CoTaskMemFree(pszPath);
1078
1079 TRACE("-- (%p)->(%s)\n", this, strRet->uType == STRRET_CSTR ? strRet->cStr : debugstr_w(strRet->pOleStr));
1080 return hr;
1081}
1082
1083/**************************************************************************
1084* CDrivesFolder::SetNameOf
1085* Changes the name of a file object or subfolder, possibly changing its item
1086* identifier in the process.
1087*
1088* PARAMETERS
1089* hwndOwner [in] Owner window for output
1090* pidl [in] simple pidl of item to change
1091* lpszName [in] the items new display name
1092* dwFlags [in] SHGNO formatting flags
1093* ppidlOut [out] simple pidl returned
1094*/
1096 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
1097{
1098 WCHAR szName[30];
1099
1100 if (_ILIsDrive(pidl))
1101 {
1104 if (pPidlOut)
1105 *pPidlOut = _ILCreateDrive(szName);
1106 return S_OK;
1107 }
1108
1109 return m_regFolder->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
1110}
1111
1113{
1114 FIXME ("(%p)\n", this);
1115 return E_NOTIMPL;
1116}
1117
1119{
1120 FIXME ("(%p)\n", this);
1121 return E_NOTIMPL;
1122}
1123
1125{
1126 TRACE ("(%p)\n", this);
1127
1128 if (pSort)
1129 *pSort = 0;
1130 if (pDisplay)
1131 *pDisplay = 0;
1132 return S_OK;
1133}
1134
1136{
1137 TRACE ("(%p)\n", this);
1138
1139 if (!pcsFlags || iColumn >= _countof(MyComputerSFHeader))
1140 return E_INVALIDARG;
1141 *pcsFlags = MyComputerSFHeader[iColumn].pcsFlags;
1142 return S_OK;
1143}
1144
1146{
1147 FIXME ("(%p)\n", this);
1148 return E_NOTIMPL;
1149}
1150
1152{
1153 HRESULT hr;
1154
1155 TRACE ("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
1156
1157 if (!psd || iColumn >= _countof(MyComputerSFHeader))
1158 return E_INVALIDARG;
1159
1160 if (!pidl)
1161 {
1162 psd->fmt = MyComputerSFHeader[iColumn].fmt;
1163 psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
1164 return SHSetStrRet(&psd->str, MyComputerSFHeader[iColumn].colnameid);
1165 }
1166 else if (!_ILIsDrive(pidl))
1167 {
1168 switch (MyComputerSFHeader[iColumn].colnameid)
1169 {
1172 return m_regFolder->GetDetailsOf(pidl, iColumn, psd);
1175 return SHSetStrRet(&psd->str, ""); /* blank col */
1177 return m_regFolder->GetDetailsOf(pidl, 2, psd); /* 2 = comments */
1179 }
1180 }
1181 else
1182 {
1183 ULARGE_INTEGER ulTotalBytes, ulFreeBytes;
1184 CHAR* pszDrive = _ILGetDataPointer(pidl)->u.drive.szDriveName;
1185 UINT DriveType = GetDriveTypeA(pszDrive);
1188
1189 switch (MyComputerSFHeader[iColumn].colnameid)
1190 {
1193 break;
1195 if (DriveType == DRIVE_REMOVABLE && !IsDriveFloppyA(pszDrive))
1196 hr = SHSetStrRet(&psd->str, IDS_DRIVE_REMOVABLE);
1197 else
1198 hr = SHSetStrRet(&psd->str, iDriveTypeIds[DriveType]);
1199 break;
1202 psd->str.cStr[0] = 0x00;
1203 psd->str.uType = STRRET_CSTR;
1204 if (GetVolumeInformationA(pszDrive, NULL, 0, NULL, NULL, NULL, NULL, 0))
1205 {
1206 GetDiskFreeSpaceExA(pszDrive, &ulFreeBytes, &ulTotalBytes, NULL);
1207 if (iColumn == 2)
1208 StrFormatByteSize64A(ulTotalBytes.QuadPart, psd->str.cStr, MAX_PATH);
1209 else
1210 StrFormatByteSize64A(ulFreeBytes.QuadPart, psd->str.cStr, MAX_PATH);
1211 }
1212 hr = S_OK;
1213 break;
1215 hr = SHSetStrRet(&psd->str, ""); /* FIXME: comments */
1216 break;
1218 }
1219 }
1220
1221 return hr;
1222}
1223
1225{
1226 FIXME("(%p)\n", this);
1227 return E_NOTIMPL;
1228}
1229
1230/************************************************************************
1231 * CDrivesFolder::GetClassID
1232 */
1234{
1235 TRACE ("(%p)\n", this);
1236
1237 if (!lpClassId)
1238 return E_POINTER;
1239
1240 *lpClassId = CLSID_MyComputer;
1241 return S_OK;
1242}
1243
1244/************************************************************************
1245 * CDrivesFolder::Initialize
1246 *
1247 * NOTES: it makes no sense to change the pidl
1248 */
1250{
1251 return S_OK;
1252}
1253
1254/**************************************************************************
1255 * CDrivesFolder::GetCurFolder
1256 */
1258{
1259 TRACE("(%p)->(%p)\n", this, pidl);
1260
1261 if (!pidl)
1262 return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
1263
1264 *pidl = ILClone(pidlRoot);
1265 return S_OK;
1266}
1267
1268/************************************************************************/
1269/* IContextMenuCB interface */
1270
1272{
1273 if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
1274 return S_OK;
1275
1276 /* no data object means no selection */
1277 if (!pdtobj)
1278 {
1279 if (uMsg == DFM_INVOKECOMMAND && wParam == 1) // #1
1280 {
1281 // "System" properties
1282 ShellExecuteW(hwndOwner,
1283 NULL,
1284 L"rundll32.exe",
1285 L"shell32.dll,Control_RunDLL sysdm.cpl",
1286 NULL,
1288 }
1289 else if (uMsg == DFM_MERGECONTEXTMENU)
1290 {
1291 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1292 HMENU hpopup = CreatePopupMenu();
1293 _InsertMenuItemW(hpopup, 0, TRUE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED); // #0
1295 Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu++, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1296 DestroyMenu(hpopup);
1297 }
1298
1299 return S_OK;
1300 }
1301
1303 return S_OK;
1304
1305 return Shell_DefaultContextMenuCallBack(this, pdtobj);
1306}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4027
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:792
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)
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE *pidl)
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum)
virtual HRESULT WINAPI GetClassID(CLSID *lpClassId)
CComPtr< IShellFolder2 > m_regFolder
Definition: CDrivesFolder.h:36
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
LPITEMIDLIST pidlRoot
Definition: CDrivesFolder.h:35
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidl)
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
HRESULT WINAPI FinalConstruct()
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
virtual HRESULT WINAPI CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid)
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:122
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:463
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:288
#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:160
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:198
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:216
void AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:269
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:239
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE *ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
Definition: shlfolder.cpp:329
HRESULT SHELL32_ParseNextElement(IShellFolder2 *psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST *pidlInOut, LPOLESTR szNext, DWORD *pEaten, DWORD *pdwAttributes)
Definition: shlfolder.cpp:71
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:1815
#define SHCNE_MEDIAREMOVED
Definition: shlobj.h:1814
#define SHFMT_ID_DEFAULT
Definition: shlobj.h:325
#define SHCNF_PATHW
Definition: shlobj.h:1843
#define MM_ADDSEPARATOR
Definition: shlobj.h:2446
struct _SFV_CREATE SFV_CREATE
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2530
#define SHCNF_FLUSHNOWAIT
Definition: shlobj.h:1847
#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:544
#define IDI_SHELL_NETDRIVE
Definition: shresdef.h:547
#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 IDS_CANTSHOWPROPERTIES
Definition: shresdef.h:152
#define IDI_SHELL_CDROM
Definition: shresdef.h:549
#define IDI_SHELL_DRIVE
Definition: shresdef.h:546
#define IDS_CANTEJECTMEDIA
Definition: shresdef.h:151
#define IDI_SHELL_RAMDISK
Definition: shresdef.h:550
#define IDS_CANTDISCONNECT
Definition: shresdef.h:153
#define IDI_SHELL_REMOVEABLE
Definition: shresdef.h:545
#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:2468
IShellFolder * psf
Definition: shlobj.h:2470
IUnknown * punkAssociationInfo
Definition: shlobj.h:2473
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2472
const HKEY * aKeys
Definition: shlobj.h:2475
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2469
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
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:769
#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:786
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