ReactOS 0.4.15-dev-8241-g63935f8
CDesktopFolder.cpp
Go to the documentation of this file.
1/*
2 * Virtual Desktop Folder
3 *
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998, 1999, 2002 Juergen Schmied
6 * Copyright 2009 Andrew Hill
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#include <precomp.h>
24#include "CFSFolder.h" // Only for CFSFolder::*FSColumn* helpers!
25
27
29{
30 return cidl == 0 || (cidl == 1 && apidl && _ILIsEmpty(apidl[0]));
31}
32
35 HWND hwndOwner,
36 LPBC pbc,
37 LPOLESTR lpszDisplayName,
38 DWORD *pchEaten,
39 PIDLIST_RELATIVE *ppidl,
40 DWORD *pdwAttributes)
41{
42 LPWSTR pch;
43 INT cch, csidl;
45 PARSEDURLW ParsedURL = { sizeof(ParsedURL) };
46
47 ::ParseURLW(lpszDisplayName, &ParsedURL);
48
49 DWORD attrs = (pdwAttributes ? *pdwAttributes : 0) | SFGAO_STREAM;
50 if (ParsedURL.pszSuffix[0] == L':' && ParsedURL.pszSuffix[1] == L':') // It begins from "::"
51 {
52 CComPtr<IShellFolder> psfDesktop;
53 hr = SHGetDesktopFolder(&psfDesktop);
54 if (SUCCEEDED(hr))
55 {
56 CComPtr<IBindCtx> pBindCtx;
57 hr = ::CreateBindCtx(0, &pBindCtx);
58 if (SUCCEEDED(hr))
59 {
60 BIND_OPTS BindOps = { sizeof(BindOps) };
61 BindOps.grfMode = STGM_CREATE;
62 pBindCtx->SetBindOptions(&BindOps);
63 hr = psfDesktop->ParseDisplayName(hwndOwner, pBindCtx,
64 (LPWSTR)ParsedURL.pszSuffix,
65 pchEaten, ppidl, &attrs);
66 }
67 }
68 }
69 else
70 {
71 csidl = Shell_ParseSpecialFolder(ParsedURL.pszSuffix, &pch, &cch);
72 if (csidl == -1)
73 {
74 ERR("\n");
75 return hr;
76 }
77
78 CComHeapPtr<ITEMIDLIST> pidlLocation;
79 hr = SHGetFolderLocation(hwndOwner, (csidl | CSIDL_FLAG_CREATE), NULL, 0, &pidlLocation);
81 return hr;
82
83 if (pch && *pch)
84 {
85 CComPtr<IShellFolder> psfFolder;
86 hr = SHBindToObject(NULL, pidlLocation, IID_PPV_ARG(IShellFolder, &psfFolder));
87 if (SUCCEEDED(hr))
88 {
89 CComHeapPtr<ITEMIDLIST> pidlNew;
90 hr = psfFolder->ParseDisplayName(hwndOwner, pbc, pch, pchEaten, &pidlNew, &attrs);
91 if (SUCCEEDED(hr))
92 {
93 hr = SHILCombine(pidlLocation, pidlNew, ppidl);
94 if (pchEaten)
95 *pchEaten += cch;
96 }
97 }
98 }
99 else
100 {
101 if (attrs)
102 hr = SHGetNameAndFlagsW(pidlLocation, 0, NULL, 0, &attrs);
103
104 if (SUCCEEDED(hr))
105 {
106 if (pchEaten)
107 *pchEaten = cch;
108 *ppidl = pidlLocation.Detach();
109 }
110 }
111 }
112
113 // FIXME: SHWindowsPolicy
114 if (SUCCEEDED(hr) && (attrs & SFGAO_STREAM) &&
115 !BindCtx_ContainsObject(pbc, STR_PARSE_SHELL_PROTOCOL_TO_FILE_OBJECTS))
116 {
117 ILFree(*ppidl);
118 *ppidl = NULL;
120 }
121
122 if (pdwAttributes)
123 *pdwAttributes = attrs;
124
125 // FIXME: SHWindowsPolicy
128
129 return hr;
130}
131
134 HWND hwndOwner,
135 LPBC pbc,
136 LPOLESTR lpszDisplayName,
137 DWORD *pchEaten,
138 PIDLIST_RELATIVE *ppidl,
139 DWORD *pdwAttributes)
140{
141 FIXME("\n");
142 return E_NOTIMPL; // FIXME
143}
144
145/*
146CDesktopFolder should create two file system folders internally, one representing the
147user's desktop folder, and the other representing the common desktop folder. It should
148also create a CRegFolder to represent the virtual items that exist only in the registry.
149The CRegFolder is aggregated by the CDesktopFolder, and queries for the CLSID_IShellFolder,
150CLSID_IShellFolder2, or CLSID_IShellIconOverlay interfaces prefer the CRegFolder
151implementation.
152The CDesktopFolderEnum class should create two enumerators, one for each of the file
153system folders, and enumerate the contents of each folder. Since the CRegFolder
154implementation of IShellFolder::EnumObjects enumerates the virtual items, the
155CDesktopFolderEnum is only responsible for returning the physical items.
156CDesktopFolderEnum is incorrect where it filters My Computer from the enumeration
157if the new start menu is used. The CDesktopViewCallback is responsible for filtering
158it from the view by handling the IncludeObject query to return S_FALSE. The enumerator
159always shows My Computer.
160*/
161
162/* Undocumented functions from shdocvw */
163extern "C" HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl);
164
165static const WCHAR ClassicStartMenuW[] = L"SOFTWARE\\Microsoft\\Windows\\"
166 L"CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu";
167
168static INT
170{
171 DWORD Result, dwResult;
172 dwResult = sizeof(DWORD);
173
174 if (RegGetValueW(HKEY_CURRENT_USER, /* FIXME use NewStartPanel when activated */
176 iid,
178 NULL,
179 &Result,
180 &dwResult) != ERROR_SUCCESS)
181 {
182 return -1;
183 }
184
185 return Result;
186}
187
189{
190 GUID const *clsid = _ILGetGUIDPointer (pidl);
191 if (!clsid)
192 return -1;
193
194 WCHAR pwszGuid[CHARS_IN_GUID];
195 SHELL32_GUIDToStringW(*clsid, pwszGuid);
196 return IsNamespaceExtensionHidden(pwszGuid);
197}
198
200 public CEnumIDListBase
201{
202 private:
203// CComPtr fDesktopEnumerator;
204// CComPtr fCommonDesktopEnumerator;
205 public:
206
208 {
209 DWORD dwResult;
210 HKEY hkey;
211 DWORD j = 0, dwVal, Val, dwType, dwIID;
212 LONG r;
213 WCHAR iid[50];
214 LPITEMIDLIST pidl;
215
216 dwResult = RegOpenKeyExW(hKeyRoot, ClassicStartMenuW, 0, KEY_READ, &hkey);
217 if (dwResult != ERROR_SUCCESS)
218 return;
219
220 while(1)
221 {
222 dwVal = sizeof(Val);
223 dwIID = sizeof(iid) / sizeof(WCHAR);
224
225 r = RegEnumValueW(hkey, j++, iid, &dwIID, NULL, &dwType, (LPBYTE)&Val, &dwVal);
226 if (r != ERROR_SUCCESS)
227 break;
228
229 if (Val == 0 && dwType == REG_DWORD)
230 {
231 pidl = _ILCreateGuidFromStrW(iid);
232 if (pidl != NULL)
233 {
234 if (!HasItemWithCLSID(pidl))
235 AddToEnumList(pidl);
236 else
237 SHFree(pidl);
238 }
239 }
240 }
241 RegCloseKey(hkey);
242 }
243
244 HRESULT WINAPI Initialize(DWORD dwFlags,IEnumIDList * pRegEnumerator, IEnumIDList *pDesktopEnumerator, IEnumIDList *pCommonDesktopEnumerator)
245 {
246 BOOL ret = TRUE;
247 LPITEMIDLIST pidl;
248
249 static const WCHAR MyDocumentsClassString[] = L"{450D8FBA-AD25-11D0-98A8-0800361B1103}";
250 static const WCHAR InternetClassString[] = L"{871C5380-42A0-1069-A2EA-08002B30309D}";
251
252 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
253
254 /* enumerate the root folders */
255 if (dwFlags & SHCONTF_FOLDERS)
256 {
258 if (IsNamespaceExtensionHidden(MyDocumentsClassString) < 1)
260 if (IsNamespaceExtensionHidden(InternetClassString) < 1)
262
263 DWORD dwFetched;
264 while((S_OK == pRegEnumerator->Next(1, &pidl, &dwFetched)) && dwFetched)
265 {
266 if (IsNamespaceExtensionHidden(pidl) < 1)
267 {
268 if (!HasItemWithCLSID(pidl))
269 AddToEnumList(pidl);
270 else
271 SHFree(pidl);
272 }
273 }
276 }
277
278 /* Enumerate the items in the two fs folders */
279 AppendItemsFromEnumerator(pDesktopEnumerator);
280 AppendItemsFromEnumerator(pCommonDesktopEnumerator);
281
282 return ret ? S_OK : E_FAIL;
283 }
284
285
287 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
289};
290
291int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll);
292
294 SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
295 SFGAO_STORAGEANCESTOR | SFGAO_HASPROPSHEET | SFGAO_STORAGE;
297 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
298 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_CANLINK;
300 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
301 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_CANLINK;
302
304 sPathTarget(NULL),
305 pidlRoot(NULL)
306{
307}
308
310{
311}
312
314{
315 WCHAR szMyPath[MAX_PATH];
316 HRESULT hr;
317
318 /* Create the root pidl */
320 if (!pidlRoot)
321 return E_OUTOFMEMORY;
322
323 /* Create the inner fs folder */
325 &CLSID_ShellFSFolder,
329 return hr;
330
331 /* Create the inner shared fs folder. Dont fail on failure. */
333 &CLSID_ShellFSFolder,
337 return hr;
338
339 /* Create the inner reg folder */
340 hr = CRegFolder_CreateInstance(&CLSID_ShellDesktop,
341 pidlRoot,
342 L"",
343 L"Desktop",
346 return hr;
347
348 /* Cache the path to the user desktop directory */
350 return E_UNEXPECTED;
351
352 sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR));
353 if (!sPathTarget)
354 return E_OUTOFMEMORY;
355
356 wcscpy(sPathTarget, szMyPath);
357 return S_OK;
358}
359
361{
362 WCHAR szFileName[MAX_PATH];
363
364 if (_ILIsSpecialFolder(pidl))
365 return m_regFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
366
367 lstrcpynW(szFileName, sPathTarget, MAX_PATH - 1);
368 PathAddBackslashW(szFileName);
369 int cLen = wcslen(szFileName);
370
371 if (!_ILSimpleGetTextW(pidl, szFileName + cLen, MAX_PATH - cLen))
372 return E_FAIL;
373
375 return m_SharedDesktopFSFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
376 else
377 return m_DesktopFSFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
378}
379
381 HWND hwndOwner,
382 LPBC pbc,
383 LPOLESTR lpszDisplayName,
384 DWORD *pchEaten,
385 PIDLIST_RELATIVE *ppidl,
386 DWORD *pdwAttributes)
387{
388 if (pchEaten)
389 *pchEaten = 0;
390
391 CComHeapPtr<ITEMIDLIST> pidlParent;
392 BOOL bPath = FALSE;
393 WCHAR wch = *lpszDisplayName;
394 if (((L'A' <= wch && wch <= L'Z') || (L'a' <= wch && wch <= L'z')) &&
395 (lpszDisplayName[1] == L':'))
396 {
397 // "C:..."
398 bPath = TRUE;
399 pidlParent.Attach(_ILCreateMyComputer());
400 }
401 else if (PathIsUNCW(lpszDisplayName)) // "\\\\..."
402 {
403 bPath = TRUE;
404 pidlParent.Attach(_ILCreateNetwork());
405 }
406
407 if (bPath)
408 {
409 if (!pidlParent)
410 return E_OUTOFMEMORY;
411
412 CComPtr<IShellFolder> pParentFolder;
413 SHBindToObject(NULL, pidlParent, IID_PPV_ARG(IShellFolder, &pParentFolder));
414
415 CComHeapPtr<ITEMIDLIST> pidlChild;
416 HRESULT hr = pParentFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName,
417 pchEaten, &pidlChild, pdwAttributes);
418 if (FAILED(hr))
419 return hr;
420
421 *ppidl = ILCombine(pidlParent, pidlChild);
422 return (*ppidl ? S_OK : E_OUTOFMEMORY);
423 }
424
425 if (!UrlIsW(lpszDisplayName, URLIS_URL) || SHSkipJunctionBinding(pbc, NULL))
426 return E_INVALIDARG;
427
428 // Now lpszDisplayName is a URL
429 PARSEDURLW ParsedURL = { sizeof(ParsedURL) };
430 ::ParseURLW(lpszDisplayName, &ParsedURL);
431
432 switch (ParsedURL.nScheme)
433 {
434 case URL_SCHEME_FILE: // "file:..."
435 {
436 // Convert "file://..." to a normal path
438 DWORD cchPath = _countof(szPath);
439 HRESULT hr = PathCreateFromUrlW(lpszDisplayName, szPath, &cchPath, 0);
441 return hr;
442
443 CComPtr<IShellFolder> psfDesktop;
444 hr = SHGetDesktopFolder(&psfDesktop);
446 return hr;
447
448 // Parse by desktop folder
449 return psfDesktop->ParseDisplayName(hwndOwner, pbc, szPath, pchEaten, ppidl,
450 pdwAttributes);
451 }
452 case URL_SCHEME_HTTP: // "http:..."
453 case URL_SCHEME_HTTPS: // "https:..."
454 {
455 if (!BindCtx_ContainsObject(pbc, STR_PARSE_PREFER_FOLDER_BROWSING))
456 return E_INVALIDARG;
457
458 return HttpUrlParseDisplayName(hwndOwner,
459 pbc,
460 lpszDisplayName,
461 pchEaten,
462 ppidl,
463 pdwAttributes);
464 }
465 case URL_SCHEME_SHELL: // "shell:..."
466 {
467 return ShellUrlParseDisplayName(hwndOwner,
468 pbc,
469 lpszDisplayName,
470 pchEaten,
471 ppidl,
472 pdwAttributes);
473 }
476 {
477 WARN("We don't support 'ms-shell-rooted:' and 'ms-shell-idlist:' schemes\n");
478 break;
479 }
480 default:
481 {
482 TRACE("Scheme: %u\n", ParsedURL.nScheme);
483 break;
484 }
485 }
486
487 return E_INVALIDARG;
488}
489
490/**************************************************************************
491 * CDesktopFolder::ParseDisplayName
492 *
493 * NOTES
494 * "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and "" binds
495 * to MyComputer
496 */
498 HWND hwndOwner,
499 LPBC pbc,
500 LPOLESTR lpszDisplayName,
501 DWORD *pchEaten,
502 PIDLIST_RELATIVE *ppidl,
503 DWORD *pdwAttributes)
504{
505 TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
506 this, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName),
507 pchEaten, ppidl, pdwAttributes);
508
509 if (!ppidl)
510 return E_INVALIDARG;
511
512 *ppidl = NULL;
513
514 if (!lpszDisplayName)
515 return E_INVALIDARG;
516
517 if (!*lpszDisplayName)
518 {
519 *ppidl = _ILCreateMyComputer();
520 return (*ppidl ? S_OK : E_OUTOFMEMORY);
521 }
522
523 if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
524 {
525 return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl,
526 pdwAttributes);
527 }
528
529 HRESULT hr = _ParseDisplayNameByParent(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl,
530 pdwAttributes);
531 if (SUCCEEDED(hr))
532 {
533 if (BindCtx_ContainsObject(pbc, STR_PARSE_TRANSLATE_ALIASES))
534 {
535 CComHeapPtr<ITEMIDLIST> pidlAlias;
536 if (SUCCEEDED(Shell_TranslateIDListAlias(*ppidl, NULL, &pidlAlias, 0xFFFF)))
537 {
538 ILFree(*ppidl);
539 *ppidl = pidlAlias.Detach();
540 }
541 }
542
543 TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
544 return hr;
545 }
546
548 return hr;
549
550 if (BindCtx_ContainsObject(pbc, STR_DONT_PARSE_RELATIVE))
551 return E_INVALIDARG;
552
553 if (SHIsFileSysBindCtx(pbc, NULL) == S_OK)
554 return hr;
555
556 BIND_OPTS BindOps = { sizeof(BindOps) };
558 if (pbc && SUCCEEDED(pbc->GetBindOptions(&BindOps)) && (BindOps.grfMode & STGM_CREATE))
559 {
560 BindOps.grfMode &= ~STGM_CREATE;
561 bCreate = TRUE;
562 pbc->SetBindOptions(&BindOps);
563 }
564
566 {
567 hr = m_DesktopFSFolder->ParseDisplayName(hwndOwner,
568 pbc,
569 lpszDisplayName,
570 pchEaten,
571 ppidl,
572 pdwAttributes);
573 }
574
576 {
577 hr = m_SharedDesktopFSFolder->ParseDisplayName(hwndOwner,
578 pbc,
579 lpszDisplayName,
580 pchEaten,
581 ppidl,
582 pdwAttributes);
583 }
584
586 {
587 BindOps.grfMode |= STGM_CREATE;
588 pbc->SetBindOptions(&BindOps);
589 hr = m_DesktopFSFolder->ParseDisplayName(hwndOwner,
590 pbc,
591 lpszDisplayName,
592 pchEaten,
593 ppidl,
594 pdwAttributes);
595 }
596
597 TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
598
599 return hr;
600}
601
602/**************************************************************************
603 * CDesktopFolder::EnumObjects
604 */
605HRESULT WINAPI CDesktopFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
606{
607 CComPtr<IEnumIDList> pRegEnumerator;
608 CComPtr<IEnumIDList> pDesktopEnumerator;
609 CComPtr<IEnumIDList> pCommonDesktopEnumerator;
610 HRESULT hr;
611
612 hr = m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
613 if (FAILED(hr))
614 ERR("EnumObjects for reg folder failed\n");
615
616 hr = m_DesktopFSFolder->EnumObjects(hwndOwner, dwFlags, &pDesktopEnumerator);
617 if (FAILED(hr))
618 ERR("EnumObjects for desktop fs folder failed\n");
619
620 hr = m_SharedDesktopFSFolder->EnumObjects(hwndOwner, dwFlags, &pCommonDesktopEnumerator);
621 if (FAILED(hr))
622 ERR("EnumObjects for shared desktop fs folder failed\n");
623
624 return ShellObjectCreatorInit<CDesktopFolderEnum>(dwFlags,pRegEnumerator, pDesktopEnumerator, pCommonDesktopEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
625}
626
627/**************************************************************************
628 * CDesktopFolder::BindToObject
629 */
632 LPBC pbcReserved,
633 REFIID riid,
634 LPVOID *ppvOut)
635{
636 if (!pidl)
637 return E_INVALIDARG;
638
639 CComPtr<IShellFolder2> psf;
640 HRESULT hr = _GetSFFromPidl(pidl, &psf);
642 return hr;
643
644 return psf->BindToObject(pidl, pbcReserved, riid, ppvOut);
645}
646
647/**************************************************************************
648 * CDesktopFolder::BindToStorage
649 */
652 LPBC pbcReserved,
653 REFIID riid,
654 LPVOID *ppvOut)
655{
656 FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n",
657 this, pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
658
659 *ppvOut = NULL;
660 return E_NOTIMPL;
661}
662
663/**************************************************************************
664 * CDesktopFolder::CompareIDs
665 */
667{
668 bool bIsDesktopFolder1, bIsDesktopFolder2;
669
670 if (!pidl1 || !pidl2)
671 {
672 ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
673 return E_INVALIDARG;
674 }
675
676 bIsDesktopFolder1 = _ILIsDesktop(pidl1);
677 bIsDesktopFolder2 = _ILIsDesktop(pidl2);
678 if (bIsDesktopFolder1 || bIsDesktopFolder2)
679 return MAKE_COMPARE_HRESULT(bIsDesktopFolder1 - bIsDesktopFolder2);
680
681 if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
682 return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
683
684 return m_DesktopFSFolder->CompareIDs(lParam, pidl1, pidl2);
685}
686
687/**************************************************************************
688 * CDesktopFolder::CreateViewObject
689 */
691 HWND hwndOwner,
692 REFIID riid,
693 LPVOID *ppvOut)
694{
696
697 TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
698 this, hwndOwner, shdebugstr_guid (&riid), ppvOut);
699
700 if (!ppvOut)
701 return hr;
702
703 *ppvOut = NULL;
704
705 if (IsEqualIID (riid, IID_IDropTarget))
706 {
707 hr = m_DesktopFSFolder->CreateViewObject(hwndOwner, riid, ppvOut);
708 }
709 else if (IsEqualIID (riid, IID_IContextMenu))
710 {
711 HKEY hKeys[16];
712 UINT cKeys = 0;
713 AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
714
715 DEFCONTEXTMENU dcm;
716 dcm.hwnd = hwndOwner;
717 dcm.pcmcb = this;
718 dcm.pidlFolder = pidlRoot;
719 dcm.psf = this;
720 dcm.cidl = 0;
721 dcm.apidl = NULL;
722 dcm.cKeys = cKeys;
723 dcm.aKeys = hKeys;
725 hr = SHCreateDefaultContextMenu (&dcm, riid, ppvOut);
726 }
727 else if (IsEqualIID (riid, IID_IShellView))
728 {
729 SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
730 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
731 }
732 TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
733 return hr;
734}
735
736/**************************************************************************
737 * CDesktopFolder::GetAttributesOf
738 */
740 UINT cidl,
742 DWORD *rgfInOut)
743{
744 HRESULT hr = S_OK;
745
746 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
747 this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
748
749 if (cidl && !apidl)
750 return E_INVALIDARG;
751
752 if (*rgfInOut == 0)
753 *rgfInOut = ~0;
754
755 if(cidl == 0)
756 *rgfInOut &= dwDesktopAttributes;
757 else
758 {
759 /* TODO: always add SFGAO_CANLINK */
760 for (UINT i = 0; i < cidl; ++i)
761 {
762 pdump(*apidl);
763 if (_ILIsDesktop(*apidl))
764 *rgfInOut &= dwDesktopAttributes;
765 else if (_ILIsMyComputer(apidl[i]))
766 *rgfInOut &= dwMyComputerAttributes;
767 else if (_ILIsNetHood(apidl[i]))
768 *rgfInOut &= dwMyNetPlacesAttributes;
769 else if (_ILIsFolder(apidl[i]) || _ILIsValue(apidl[i]) || _ILIsSpecialFolder(apidl[i]))
770 {
771 CComPtr<IShellFolder2> psf;
772 HRESULT hr = _GetSFFromPidl(apidl[i], &psf);
774 continue;
775
776 psf->GetAttributesOf(1, &apidl[i], rgfInOut);
777 }
778 else
779 ERR("Got an unknown pidl type!!!\n");
780 }
781 }
782 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
783 *rgfInOut &= ~SFGAO_VALIDATE;
784
785 TRACE("-- result=0x%08x\n", *rgfInOut);
786
787 return hr;
788}
789
790/**************************************************************************
791 * CDesktopFolder::GetUIObjectOf
792 *
793 * PARAMETERS
794 * HWND hwndOwner, //[in ] Parent window for any output
795 * UINT cidl, //[in ] array size
796 * LPCITEMIDLIST* apidl, //[in ] simple pidl array
797 * REFIID riid, //[in ] Requested Interface
798 * UINT* prgfInOut, //[ ] reserved
799 * LPVOID* ppvObject) //[out] Resulting Interface
800 *
801 */
803 HWND hwndOwner,
804 UINT cidl,
806 REFIID riid,
807 UINT *prgfInOut,
808 LPVOID *ppvOut)
809{
810 LPVOID pObj = NULL;
812
813 TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
814 this, hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
815
816 if (!ppvOut)
817 return hr;
818 *ppvOut = NULL;
819
820 BOOL self = IsSelf(cidl, apidl);
821 if (cidl == 1 && !_ILIsSpecialFolder(apidl[0]) && !self)
822 {
823 CComPtr<IShellFolder2> psf;
824 HRESULT hr = _GetSFFromPidl(apidl[0], &psf);
826 return hr;
827
828 return psf->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut);
829 }
830
831 if (IsEqualIID (riid, IID_IContextMenu))
832 {
833 // FIXME: m_regFolder vs AddFSClassKeysToArray is incorrect when the selection includes both regitems and FS items
834 if (!self && cidl > 0 && _ILIsSpecialFolder(apidl[0]))
835 {
836 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
837 }
838 else
839 {
840 /* Do not use the context menu of the CFSFolder here. */
841 /* We need to pass a pointer of the CDesktopFolder so as the data object that the context menu gets is rooted to the desktop */
842 /* Otherwise operations like that involve items from both user and shared desktop will not work */
843 HKEY hKeys[16];
844 UINT cKeys = 0;
845 if (self)
846 {
847 AddClsidKeyToArray(CLSID_ShellDesktop, hKeys, &cKeys);
848 AddClassKeyToArray(L"Folder", hKeys, &cKeys);
849 }
850 else if (cidl > 0)
851 {
852 AddFSClassKeysToArray(cidl, apidl, hKeys, &cKeys);
853 }
854
855 DEFCONTEXTMENU dcm;
856 dcm.hwnd = hwndOwner;
857 dcm.pcmcb = this;
858 dcm.pidlFolder = pidlRoot;
859 dcm.psf = this;
860 dcm.cidl = cidl;
861 dcm.apidl = apidl;
862 dcm.cKeys = cKeys;
863 dcm.aKeys = hKeys;
865 hr = SHCreateDefaultContextMenu (&dcm, riid, &pObj);
866 }
867 }
868 else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
869 {
870 hr = IDataObject_Constructor( hwndOwner, pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
871 }
872 else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
873 {
874 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
875 }
876 else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
877 {
878 CComPtr<IShellFolder> psfChild;
879 hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
881 return hr;
882
883 return psfChild->CreateViewObject(NULL, riid, ppvOut);
884 }
885 else
887
888 if (SUCCEEDED(hr) && !pObj)
890
891 *ppvOut = pObj;
892 TRACE ("(%p)->hr=0x%08x\n", this, hr);
893 return hr;
894}
895
896/**************************************************************************
897 * CDesktopFolder::GetDisplayNameOf
898 *
899 * NOTES
900 * special case: pidl = null gives desktop-name back
901 */
903{
904 TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
905 pdump (pidl);
906
907 if (!strRet)
908 return E_INVALIDARG;
909
910 if (!_ILIsPidlSimple (pidl))
911 {
912 return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
913 }
914 else if (_ILIsDesktop(pidl))
915 {
917 return SHSetStrRet(strRet, sPathTarget);
918 else
919 return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
920 }
921
922 /* file system folder or file rooted at the desktop */
923 CComPtr<IShellFolder2> psf;
924 HRESULT hr = _GetSFFromPidl(pidl, &psf);
926 return hr;
927
928 return psf->GetDisplayNameOf(pidl, dwFlags, strRet);
929}
930
931/**************************************************************************
932 * CDesktopFolder::SetNameOf
933 * Changes the name of a file object or subfolder, possibly changing its item
934 * identifier in the process.
935 *
936 * PARAMETERS
937 * HWND hwndOwner, //[in ] Owner window for output
938 * LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
939 * LPCOLESTR lpszName, //[in ] the items new display name
940 * DWORD dwFlags, //[in ] SHGNO formatting flags
941 * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
942 */
944 HWND hwndOwner,
945 PCUITEMID_CHILD pidl, /* simple pidl */
946 LPCOLESTR lpName,
948 PITEMID_CHILD *pPidlOut)
949{
950 CComPtr<IShellFolder2> psf;
951 HRESULT hr = _GetSFFromPidl(pidl, &psf);
953 return hr;
954
955 return psf->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
956}
957
959{
960 FIXME ("(%p)\n", this);
961 return E_NOTIMPL;
962}
963
965{
966 FIXME ("(%p)\n", this);
967 return E_NOTIMPL;
968}
969
971{
972 TRACE ("(%p)\n", this);
973
974 if (pSort)
975 *pSort = 0;
976 if (pDisplay)
977 *pDisplay = 0;
978
979 return S_OK;
980}
981
983{
984 HRESULT hr;
985 TRACE ("(%p)\n", this);
986
987 if (!pcsFlags)
988 return E_INVALIDARG;
989
990 hr = CFSFolder::GetDefaultFSColumnState(iColumn, *pcsFlags);
991 /*
992 // CDesktopFolder may override the flags if desired (future)
993 switch(iColumn)
994 {
995 case SHFSF_COL_FATTS:
996 *pcsFlags &= ~SHCOLSTATE_ONBYDEFAULT;
997 break;
998 }
999 */
1000 return hr;
1001}
1002
1004 PCUITEMID_CHILD pidl,
1005 const SHCOLUMNID *pscid,
1006 VARIANT *pv)
1007{
1008 FIXME ("(%p)\n", this);
1009
1010 return E_NOTIMPL;
1011}
1012
1013/*************************************************************************
1014 * Column info functions.
1015 * CFSFolder.h provides defaults for us.
1016 */
1018{
1019 /* CDesktopFolder may override the flags and/or name if desired */
1020 return CFSFolder::GetFSColumnDetails(iColumn, sd);
1021}
1022
1024 PCUITEMID_CHILD pidl,
1025 UINT iColumn,
1026 SHELLDETAILS *psd)
1027{
1028 if (!psd)
1029 return E_INVALIDARG;
1030
1031 if (!pidl)
1032 {
1033 return GetColumnDetails(iColumn, *psd);
1034 }
1035
1036 CComPtr<IShellFolder2> psf;
1037 HRESULT hr = _GetSFFromPidl(pidl, &psf);
1039 return hr;
1040
1041 hr = psf->GetDetailsOf(pidl, iColumn, psd);
1043 return hr;
1044
1045 return hr;
1046}
1047
1049{
1050 FIXME ("(%p)\n", this);
1051 return E_NOTIMPL;
1052}
1053
1055{
1056 TRACE ("(%p)\n", this);
1057
1058 if (!lpClassId)
1059 return E_POINTER;
1060
1061 *lpClassId = CLSID_ShellDesktop;
1062
1063 return S_OK;
1064}
1065
1067{
1068 TRACE ("(%p)->(%p)\n", this, pidl);
1069
1070 if (!pidl)
1071 return S_OK;
1072
1073 return E_INVALIDARG;
1074}
1075
1077{
1078 TRACE ("(%p)->(%p)\n", this, pidl);
1079
1080 if (!pidl)
1081 return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
1082 *pidl = ILClone (pidlRoot);
1083 return S_OK;
1084}
1085
1087{
1088 enum { IDC_PROPERTIES };
1089 if (uMsg == DFM_INVOKECOMMAND && wParam == (pdtobj ? DFM_CMD_PROPERTIES : IDC_PROPERTIES))
1090 {
1091 return SHELL_ExecuteControlPanelCPL(hwndOwner, L"desk.cpl") ? S_OK : E_FAIL;
1092 }
1093 else if (uMsg == DFM_MERGECONTEXTMENU && !pdtobj) // Add Properties item when called for directory background
1094 {
1095 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1096 HMENU hpopup = CreatePopupMenu();
1098 pqcminfo->idCmdFirst = Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1099 DestroyMenu(hpopup);
1100 return S_OK;
1101 }
1102 return SHELL32_DefaultContextMenuCallBack(psf, pdtobj, uMsg);
1103}
1104
1105/*************************************************************************
1106 * SHGetDesktopFolder [SHELL32.@]
1107 */
1109{
1110 HRESULT hres = S_OK;
1111 TRACE("\n");
1112
1113 if(!psf) return E_INVALIDARG;
1114 *psf = NULL;
1115 hres = CDesktopFolder::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellFolder, psf));
1116
1117 TRACE("-- %p->(%p)\n",psf, *psf);
1118 return hres;
1119}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4372
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv)
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
static INT IsNamespaceExtensionHidden(const WCHAR *iid)
HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl)
Definition: shdocvw_main.c:506
static const DWORD dwMyComputerAttributes
static const WCHAR ClassicStartMenuW[]
static BOOL IsSelf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl)
static const DWORD dwDesktopAttributes
static DWORD dwMyNetPlacesAttributes
int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll)
Definition: shlfileop.cpp:203
static HRESULT SHELL32_CoCreateInitSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidlChild, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: CFindFolder.cpp:13
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:865
HWND hWnd
Definition: settings.c:17
#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 STDMETHODIMP
Definition: basetyps.h:43
#define FIXME(fmt,...)
Definition: debug.h:114
#define WARN(fmt,...)
Definition: debug.h:115
#define ERR(fmt,...)
Definition: debug.h:113
#define RegCloseKey(hKey)
Definition: registry.h:49
HRESULT WINAPI Initialize(DWORD dwFlags, IEnumIDList *pRegEnumerator, IEnumIDList *pDesktopEnumerator, IEnumIDList *pCommonDesktopEnumerator)
void AddItemsFromClassicStartMenuKey(HKEY hKeyRoot)
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
CComPtr< IShellFolder2 > m_SharedDesktopFSFolder
STDMETHOD() BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
HRESULT WINAPI FinalConstruct()
STDMETHOD() Initialize(PCIDLIST_ABSOLUTE pidl) override
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
STDMETHOD() CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
STDMETHOD() GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) override
STDMETHOD() SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
STDMETHOD() GetDefaultSearchGUID(GUID *pguid) override
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() MapColumnToSCID(UINT column, SHCOLUMNID *pscid) override
STDMETHOD() GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
STDMETHOD() BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) override
HRESULT _GetSFFromPidl(LPCITEMIDLIST pidl, IShellFolder2 **psf)
CComPtr< IShellFolder2 > m_DesktopFSFolder
STDMETHODIMP HttpUrlParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
STDMETHOD() ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override
STDMETHOD() GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
STDMETHOD() GetCurFolder(PIDLIST_ABSOLUTE *pidl) override
STDMETHOD() GetClassID(CLSID *lpClassId) override
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
LPITEMIDLIST pidlRoot
STDMETHOD() GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
CComPtr< IShellFolder2 > m_regFolder
STDMETHODIMP ShellUrlParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
HRESULT _ParseDisplayNameByParent(HWND hwndOwner, LPBC pbc, LPOLESTR pszPath, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
static HRESULT GetColumnDetails(UINT iColumn, SHELLDETAILS &sd)
BOOL HasItemWithCLSID(LPITEMIDLIST pidl)
BOOL AddToEnumList(LPITEMIDLIST pidl)
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
static HRESULT GetDefaultFSColumnState(UINT iColumn, SHCOLSTATEF &csFlags)
Definition: CFSFolder.cpp:551
static HRESULT GetFSColumnDetails(UINT iColumn, SHELLDETAILS &sd)
Definition: CFSFolder.cpp:541
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define CHARS_IN_GUID
#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
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDC_PROPERTIES
Definition: resource.h:32
#define GET_SHGDN_RELATION(dwFlags)
Definition: precomp.h:53
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
#define GET_SHGDN_FOR(dwFlags)
Definition: precomp.h:52
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2830
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
#define MAX_PATH
Definition: compat.h:34
#define lstrcpynW
Definition: compat.h:738
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
#define RRF_RT_DWORD
Definition: driver.c:581
#define SHELL_ExecuteControlPanelCPL(hwnd, cpl)
Definition: precomp.h:154
EXTERN_C INT Shell_ParseSpecialFolder(_In_ LPCWSTR pszStart, _Out_ LPWSTR *ppch, _Out_ INT *pcch)
Definition: shellpath.c:1859
HRESULT SHGetNameAndFlagsW(_In_ LPCITEMIDLIST pidl, _In_ DWORD dwFlags, _Out_opt_ LPWSTR pszText, _In_ UINT cchBuf, _Inout_opt_ DWORD *pdwAttributes)
Definition: utils.cpp:289
BOOL BindCtx_ContainsObject(_In_ IBindCtx *pBindCtx, _In_ LPCWSTR pszName)
Definition: utils.cpp:120
HRESULT SHIsFileSysBindCtx(_In_ IBindCtx *pBindCtx, _Out_opt_ WIN32_FIND_DATAW *pFindData)
Definition: utils.cpp:153
BOOL Shell_FailForceReturn(_In_ HRESULT hr)
Definition: utils.cpp:170
EXTERN_C HRESULT SHBindToObject(_In_opt_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ REFIID riid, _Out_ void **ppvObj)
Definition: utils.cpp:220
HRESULT SHELL32_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdo, UINT msg)
Definition: shlfolder.cpp:522
HRESULT Shell_TranslateIDListAlias(_In_ LPCITEMIDLIST pidl, _In_ HANDLE hToken, _Out_ LPITEMIDLIST *ppidlAlias, _In_ DWORD dwFlags)
Definition: utils.cpp:111
BOOL SHSkipJunctionBinding(_In_ IBindCtx *pbc, _In_ CLSID *pclsid)
Definition: utils.cpp:141
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3150
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3092
HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwReserved)
Definition: path.c:3355
BOOL WINAPI PathIsUNCW(LPCWSTR lpszPath)
Definition: path.c:2266
HRESULT WINAPI ParseURLW(LPCWSTR x, PARSEDURLW *y)
Definition: url.c:197
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
Definition: url.c:1933
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
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
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 GLint GLint j
Definition: glfuncs.h:250
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
REFIID riid
Definition: atlbase.h:39
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] PITEMID_CHILD *rgelt, [out] ULONG *pceltFetched)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_w
Definition: kernel32.h:32
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define END_COM_MAP()
Definition: atlcom.h:592
#define pch(ap)
Definition: match.c:418
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LPCWSTR szPath
Definition: env.c:37
static HICON
Definition: imagelist.c:84
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
HRESULT hres
Definition: protocol.c:465
static const WCHAR sd[]
Definition: suminfo.c:286
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
HICON hIcon
Definition: msconfig.c:44
REFCLSID clsid
Definition: msctf.c:82
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define DWORD
Definition: nt_native.h:44
#define L(x)
Definition: ntvdm.h:50
#define STGM_CREATE
Definition: objbase.h:926
interface IBindCtx * LPBC
Definition: objfwd.h:18
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
const GUID IID_IDataObject
#define PathAddBackslashW
Definition: pathcch.h:301
long LONG
Definition: pedump.c:60
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1646
LPITEMIDLIST _ILCreateIExplore(void)
Definition: pidl.c:1658
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:940
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:712
LPITEMIDLIST _ILCreateDesktop(void)
Definition: pidl.c:1635
LPITEMIDLIST _ILCreateNetwork(void)
Definition: pidl.c:1710
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2015
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1970
BOOL _ILIsNetHood(LPCITEMIDLIST pidl)
Definition: pidl.c:1948
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID)
Definition: pidl.c:1766
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2292
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2024
LPITEMIDLIST _ILCreateMyDocuments(void)
Definition: pidl.c:1652
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2074
static BOOL _ILIsEmpty(LPCITEMIDLIST pidl)
Definition: pidl.h:255
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define REG_DWORD
Definition: sdbapi.c:596
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define CSIDL_FLAG_CREATE
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:607
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:206
void AddFSClassKeysToArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:299
static __inline int SHELL32_GUIDToStringW(REFGUID guid, LPWSTR str)
Definition: shfldr.h:99
LSTATUS AddClsidKeyToArray(REFCLSID clsid, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:292
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:277
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
HRESULT hr
Definition: shlfolder.c:183
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
#define CSIDL_COMMON_DESKTOPDIRECTORY
Definition: shlobj.h:2190
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1519
#define CSIDL_DESKTOPDIRECTORY
Definition: shlobj.h:2181
#define MM_ADDSEPARATOR
Definition: shlobj.h:2521
struct _SFV_CREATE SFV_CREATE
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2605
@ URL_SCHEME_MSSHELLROOTED
Definition: shlwapi.h:1165
@ URL_SCHEME_HTTPS
Definition: shlwapi.h:1157
@ URL_SCHEME_MSSHELLIDLIST
Definition: shlwapi.h:1166
@ URL_SCHEME_HTTP
Definition: shlwapi.h:1148
@ URL_SCHEME_FILE
Definition: shlwapi.h:1155
@ URL_SCHEME_SHELL
Definition: shlwapi.h:1158
@ URLIS_URL
Definition: shlwapi.h:1191
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
DWORD SHCOLSTATEF
Definition: shtypes.idl:142
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
IContextMenuCB * pcmcb
Definition: shlobj.h:2543
IShellFolder * psf
Definition: shlobj.h:2545
IUnknown * punkAssociationInfo
Definition: shlobj.h:2548
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2547
const HKEY * aKeys
Definition: shlobj.h:2550
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2544
HMENU hmenu
Definition: shlobj.h:1389
UINT idCmdLast
Definition: shlobj.h:1392
UINT idCmdFirst
Definition: shlobj.h:1391
UINT indexMenu
Definition: shlobj.h:1390
LPCWSTR pszSuffix
Definition: shlwapi.h:1435
UINT nScheme
Definition: shlwapi.h:1437
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int ret
int codepage
Definition: win_iconv.c:156
#define GetFileAttributes
Definition: winbase.h:3815
_In_ LPCSTR lpName
Definition: winbase.h:2789
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define E_UNEXPECTED
Definition: winerror.h:2456
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define E_POINTER
Definition: winerror.h:2365
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define MFS_ENABLED
Definition: winuser.h:750
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MFT_STRING
Definition: winuser.h:746
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
#define IID_PPV_ARG(Itype, ppType)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185