ReactOS 0.4.15-dev-7931-gfd331f1
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
26
29 HWND hwndOwner,
30 LPBC pbc,
31 LPOLESTR lpszDisplayName,
32 DWORD *pchEaten,
33 PIDLIST_RELATIVE *ppidl,
34 DWORD *pdwAttributes)
35{
36 LPWSTR pch;
37 INT cch, csidl;
39 PARSEDURLW ParsedURL = { sizeof(ParsedURL) };
40
41 ::ParseURLW(lpszDisplayName, &ParsedURL);
42
43 DWORD attrs = (pdwAttributes ? *pdwAttributes : 0) | SFGAO_STREAM;
44 if (ParsedURL.pszSuffix[0] == L':' && ParsedURL.pszSuffix[1] == L':') // It begins from "::"
45 {
46 CComPtr<IShellFolder> psfDesktop;
47 hr = SHGetDesktopFolder(&psfDesktop);
48 if (SUCCEEDED(hr))
49 {
50 CComPtr<IBindCtx> pBindCtx;
51 hr = ::CreateBindCtx(0, &pBindCtx);
52 if (SUCCEEDED(hr))
53 {
54 BIND_OPTS BindOps = { sizeof(BindOps) };
55 BindOps.grfMode = STGM_CREATE;
56 pBindCtx->SetBindOptions(&BindOps);
57 hr = psfDesktop->ParseDisplayName(hwndOwner, pBindCtx,
58 (LPWSTR)ParsedURL.pszSuffix,
59 pchEaten, ppidl, &attrs);
60 }
61 }
62 }
63 else
64 {
65 csidl = Shell_ParseSpecialFolder(ParsedURL.pszSuffix, &pch, &cch);
66 if (csidl == -1)
67 {
68 ERR("\n");
69 return hr;
70 }
71
72 CComHeapPtr<ITEMIDLIST> pidlLocation;
73 hr = SHGetFolderLocation(hwndOwner, (csidl | CSIDL_FLAG_CREATE), NULL, 0, &pidlLocation);
75 return hr;
76
77 if (pch && *pch)
78 {
79 CComPtr<IShellFolder> psfFolder;
80 hr = SHBindToObject(NULL, pidlLocation, IID_PPV_ARG(IShellFolder, &psfFolder));
81 if (SUCCEEDED(hr))
82 {
83 CComHeapPtr<ITEMIDLIST> pidlNew;
84 hr = psfFolder->ParseDisplayName(hwndOwner, pbc, pch, pchEaten, &pidlNew, &attrs);
85 if (SUCCEEDED(hr))
86 {
87 hr = SHILCombine(pidlLocation, pidlNew, ppidl);
88 if (pchEaten)
89 *pchEaten += cch;
90 }
91 }
92 }
93 else
94 {
95 if (attrs)
96 hr = SHGetNameAndFlagsW(pidlLocation, 0, NULL, 0, &attrs);
97
98 if (SUCCEEDED(hr))
99 {
100 if (pchEaten)
101 *pchEaten = cch;
102 *ppidl = pidlLocation.Detach();
103 }
104 }
105 }
106
107 // FIXME: SHWindowsPolicy
108 if (SUCCEEDED(hr) && (attrs & SFGAO_STREAM) &&
109 !BindCtx_ContainsObject(pbc, STR_PARSE_SHELL_PROTOCOL_TO_FILE_OBJECTS))
110 {
111 ILFree(*ppidl);
112 *ppidl = NULL;
114 }
115
116 if (pdwAttributes)
117 *pdwAttributes = attrs;
118
119 // FIXME: SHWindowsPolicy
122
123 return hr;
124}
125
128 HWND hwndOwner,
129 LPBC pbc,
130 LPOLESTR lpszDisplayName,
131 DWORD *pchEaten,
132 PIDLIST_RELATIVE *ppidl,
133 DWORD *pdwAttributes)
134{
135 FIXME("\n");
136 return E_NOTIMPL; // FIXME
137}
138
139/*
140CDesktopFolder should create two file system folders internally, one representing the
141user's desktop folder, and the other representing the common desktop folder. It should
142also create a CRegFolder to represent the virtual items that exist only in the registry.
143The CRegFolder is aggregated by the CDesktopFolder, and queries for the CLSID_IShellFolder,
144CLSID_IShellFolder2, or CLSID_IShellIconOverlay interfaces prefer the CRegFolder
145implementation.
146The CDesktopFolderEnum class should create two enumerators, one for each of the file
147system folders, and enumerate the contents of each folder. Since the CRegFolder
148implementation of IShellFolder::EnumObjects enumerates the virtual items, the
149CDesktopFolderEnum is only responsible for returning the physical items.
150CDesktopFolderEnum is incorrect where it filters My Computer from the enumeration
151if the new start menu is used. The CDesktopViewCallback is responsible for filtering
152it from the view by handling the IncludeObject query to return S_FALSE. The enumerator
153always shows My Computer.
154*/
155
156/* Undocumented functions from shdocvw */
157extern "C" HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl);
158
159static const WCHAR ClassicStartMenuW[] = L"SOFTWARE\\Microsoft\\Windows\\"
160 L"CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu";
161
162static INT
164{
165 DWORD Result, dwResult;
166 dwResult = sizeof(DWORD);
167
168 if (RegGetValueW(HKEY_CURRENT_USER, /* FIXME use NewStartPanel when activated */
170 iid,
172 NULL,
173 &Result,
174 &dwResult) != ERROR_SUCCESS)
175 {
176 return -1;
177 }
178
179 return Result;
180}
181
183{
184 GUID const *clsid = _ILGetGUIDPointer (pidl);
185 if (!clsid)
186 return -1;
187
188 WCHAR pwszGuid[CHARS_IN_GUID];
189 SHELL32_GUIDToStringW(*clsid, pwszGuid);
190 return IsNamespaceExtensionHidden(pwszGuid);
191}
192
194 public CEnumIDListBase
195{
196 private:
197// CComPtr fDesktopEnumerator;
198// CComPtr fCommonDesktopEnumerator;
199 public:
200
202 {
203 DWORD dwResult;
204 HKEY hkey;
205 DWORD j = 0, dwVal, Val, dwType, dwIID;
206 LONG r;
207 WCHAR iid[50];
208 LPITEMIDLIST pidl;
209
210 dwResult = RegOpenKeyExW(hKeyRoot, ClassicStartMenuW, 0, KEY_READ, &hkey);
211 if (dwResult != ERROR_SUCCESS)
212 return;
213
214 while(1)
215 {
216 dwVal = sizeof(Val);
217 dwIID = sizeof(iid) / sizeof(WCHAR);
218
219 r = RegEnumValueW(hkey, j++, iid, &dwIID, NULL, &dwType, (LPBYTE)&Val, &dwVal);
220 if (r != ERROR_SUCCESS)
221 break;
222
223 if (Val == 0 && dwType == REG_DWORD)
224 {
225 pidl = _ILCreateGuidFromStrW(iid);
226 if (pidl != NULL)
227 {
228 if (!HasItemWithCLSID(pidl))
229 AddToEnumList(pidl);
230 else
231 SHFree(pidl);
232 }
233 }
234 }
235 RegCloseKey(hkey);
236 }
237
238 HRESULT WINAPI Initialize(DWORD dwFlags,IEnumIDList * pRegEnumerator, IEnumIDList *pDesktopEnumerator, IEnumIDList *pCommonDesktopEnumerator)
239 {
240 BOOL ret = TRUE;
241 LPITEMIDLIST pidl;
242
243 static const WCHAR MyDocumentsClassString[] = L"{450D8FBA-AD25-11D0-98A8-0800361B1103}";
244 static const WCHAR InternetClassString[] = L"{871C5380-42A0-1069-A2EA-08002B30309D}";
245
246 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
247
248 /* enumerate the root folders */
249 if (dwFlags & SHCONTF_FOLDERS)
250 {
252 if (IsNamespaceExtensionHidden(MyDocumentsClassString) < 1)
254 if (IsNamespaceExtensionHidden(InternetClassString) < 1)
256
257 DWORD dwFetched;
258 while((S_OK == pRegEnumerator->Next(1, &pidl, &dwFetched)) && dwFetched)
259 {
260 if (IsNamespaceExtensionHidden(pidl) < 1)
261 {
262 if (!HasItemWithCLSID(pidl))
263 AddToEnumList(pidl);
264 else
265 SHFree(pidl);
266 }
267 }
270 }
271
272 /* Enumerate the items in the two fs folders */
273 AppendItemsFromEnumerator(pDesktopEnumerator);
274 AppendItemsFromEnumerator(pCommonDesktopEnumerator);
275
276 return ret ? S_OK : E_FAIL;
277 }
278
279
281 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
283};
284
285int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll);
286
287static const shvheader DesktopSFHeader[] = {
294};
295
296#define DESKTOPSHELLVIEWCOLUMNS 6
297
299 SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
300 SFGAO_STORAGEANCESTOR | SFGAO_HASPROPSHEET | SFGAO_STORAGE;
302 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
303 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_CANLINK;
305 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
306 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_CANLINK;
307
309 sPathTarget(NULL),
310 pidlRoot(NULL)
311{
312}
313
315{
316}
317
319{
320 WCHAR szMyPath[MAX_PATH];
321 HRESULT hr;
322
323 /* Create the root pidl */
325 if (!pidlRoot)
326 return E_OUTOFMEMORY;
327
328 /* Create the inner fs folder */
330 &CLSID_ShellFSFolder,
334 return hr;
335
336 /* Create the inner shared fs folder. Dont fail on failure. */
338 &CLSID_ShellFSFolder,
342 return hr;
343
344 /* Create the inner reg folder */
345 hr = CRegFolder_CreateInstance(&CLSID_ShellDesktop,
346 pidlRoot,
347 L"",
348 L"Desktop",
351 return hr;
352
353 /* Cache the path to the user desktop directory */
355 return E_UNEXPECTED;
356
357 sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR));
358 if (!sPathTarget)
359 return E_OUTOFMEMORY;
360
361 wcscpy(sPathTarget, szMyPath);
362 return S_OK;
363}
364
366{
367 WCHAR szFileName[MAX_PATH];
368
369 if (_ILIsSpecialFolder(pidl))
370 return m_regFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
371
372 lstrcpynW(szFileName, sPathTarget, MAX_PATH - 1);
373 PathAddBackslashW(szFileName);
374 int cLen = wcslen(szFileName);
375
376 if (!_ILSimpleGetTextW(pidl, szFileName + cLen, MAX_PATH - cLen))
377 return E_FAIL;
378
380 return m_SharedDesktopFSFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
381 else
382 return m_DesktopFSFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
383}
384
386 HWND hwndOwner,
387 LPBC pbc,
388 LPOLESTR lpszDisplayName,
389 DWORD *pchEaten,
390 PIDLIST_RELATIVE *ppidl,
391 DWORD *pdwAttributes)
392{
393 if (pchEaten)
394 *pchEaten = 0;
395
396 CComHeapPtr<ITEMIDLIST> pidlParent;
397 BOOL bPath = FALSE;
398 WCHAR wch = *lpszDisplayName;
399 if (((L'A' <= wch && wch <= L'Z') || (L'a' <= wch && wch <= L'z')) &&
400 (lpszDisplayName[1] == L':'))
401 {
402 // "C:..."
403 bPath = TRUE;
404 pidlParent.Attach(_ILCreateMyComputer());
405 }
406 else if (PathIsUNCW(lpszDisplayName)) // "\\\\..."
407 {
408 bPath = TRUE;
409 pidlParent.Attach(_ILCreateNetwork());
410 }
411
412 if (bPath)
413 {
414 if (!pidlParent)
415 return E_OUTOFMEMORY;
416
417 CComPtr<IShellFolder> pParentFolder;
418 SHBindToObject(NULL, pidlParent, IID_PPV_ARG(IShellFolder, &pParentFolder));
419
420 CComHeapPtr<ITEMIDLIST> pidlChild;
421 HRESULT hr = pParentFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName,
422 pchEaten, &pidlChild, pdwAttributes);
423 if (FAILED(hr))
424 return hr;
425
426 *ppidl = ILCombine(pidlParent, pidlChild);
427 return (*ppidl ? S_OK : E_OUTOFMEMORY);
428 }
429
430 if (!UrlIsW(lpszDisplayName, URLIS_URL) || SHSkipJunctionBinding(pbc, NULL))
431 return E_INVALIDARG;
432
433 // Now lpszDisplayName is a URL
434 PARSEDURLW ParsedURL = { sizeof(ParsedURL) };
435 ::ParseURLW(lpszDisplayName, &ParsedURL);
436
437 switch (ParsedURL.nScheme)
438 {
439 case URL_SCHEME_FILE: // "file:..."
440 {
441 // Convert "file://..." to a normal path
443 DWORD cchPath = _countof(szPath);
444 HRESULT hr = PathCreateFromUrlW(lpszDisplayName, szPath, &cchPath, 0);
446 return hr;
447
448 CComPtr<IShellFolder> psfDesktop;
449 hr = SHGetDesktopFolder(&psfDesktop);
451 return hr;
452
453 // Parse by desktop folder
454 return psfDesktop->ParseDisplayName(hwndOwner, pbc, szPath, pchEaten, ppidl,
455 pdwAttributes);
456 }
457 case URL_SCHEME_HTTP: // "http:..."
458 case URL_SCHEME_HTTPS: // "https:..."
459 {
460 if (!BindCtx_ContainsObject(pbc, STR_PARSE_PREFER_FOLDER_BROWSING))
461 return E_INVALIDARG;
462
463 return HttpUrlParseDisplayName(hwndOwner,
464 pbc,
465 lpszDisplayName,
466 pchEaten,
467 ppidl,
468 pdwAttributes);
469 }
470 case URL_SCHEME_SHELL: // "shell:..."
471 {
472 return ShellUrlParseDisplayName(hwndOwner,
473 pbc,
474 lpszDisplayName,
475 pchEaten,
476 ppidl,
477 pdwAttributes);
478 }
481 {
482 WARN("We don't support 'ms-shell-rooted:' and 'ms-shell-idlist:' schemes\n");
483 break;
484 }
485 default:
486 {
487 TRACE("Scheme: %u\n", ParsedURL.nScheme);
488 break;
489 }
490 }
491
492 return E_INVALIDARG;
493}
494
495/**************************************************************************
496 * CDesktopFolder::ParseDisplayName
497 *
498 * NOTES
499 * "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and "" binds
500 * to MyComputer
501 */
503 HWND hwndOwner,
504 LPBC pbc,
505 LPOLESTR lpszDisplayName,
506 DWORD *pchEaten,
507 PIDLIST_RELATIVE *ppidl,
508 DWORD *pdwAttributes)
509{
510 TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
511 this, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName),
512 pchEaten, ppidl, pdwAttributes);
513
514 if (!ppidl)
515 return E_INVALIDARG;
516
517 *ppidl = NULL;
518
519 if (!lpszDisplayName)
520 return E_INVALIDARG;
521
522 if (!*lpszDisplayName)
523 {
524 *ppidl = _ILCreateMyComputer();
525 return (*ppidl ? S_OK : E_OUTOFMEMORY);
526 }
527
528 if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
529 {
530 return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl,
531 pdwAttributes);
532 }
533
534 HRESULT hr = _ParseDisplayNameByParent(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl,
535 pdwAttributes);
536 if (SUCCEEDED(hr))
537 {
538 if (BindCtx_ContainsObject(pbc, STR_PARSE_TRANSLATE_ALIASES))
539 {
540 CComHeapPtr<ITEMIDLIST> pidlAlias;
541 if (SUCCEEDED(Shell_TranslateIDListAlias(*ppidl, NULL, &pidlAlias, 0xFFFF)))
542 {
543 ILFree(*ppidl);
544 *ppidl = pidlAlias.Detach();
545 }
546 }
547
548 TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
549 return hr;
550 }
551
553 return hr;
554
555 if (BindCtx_ContainsObject(pbc, STR_DONT_PARSE_RELATIVE))
556 return E_INVALIDARG;
557
558 if (SHIsFileSysBindCtx(pbc, NULL) == S_OK)
559 return hr;
560
561 BIND_OPTS BindOps = { sizeof(BindOps) };
563 if (pbc && SUCCEEDED(pbc->GetBindOptions(&BindOps)) && (BindOps.grfMode & STGM_CREATE))
564 {
565 BindOps.grfMode &= ~STGM_CREATE;
566 bCreate = TRUE;
567 pbc->SetBindOptions(&BindOps);
568 }
569
571 {
572 hr = m_DesktopFSFolder->ParseDisplayName(hwndOwner,
573 pbc,
574 lpszDisplayName,
575 pchEaten,
576 ppidl,
577 pdwAttributes);
578 }
579
581 {
582 hr = m_SharedDesktopFSFolder->ParseDisplayName(hwndOwner,
583 pbc,
584 lpszDisplayName,
585 pchEaten,
586 ppidl,
587 pdwAttributes);
588 }
589
591 {
592 BindOps.grfMode |= STGM_CREATE;
593 pbc->SetBindOptions(&BindOps);
594 hr = m_DesktopFSFolder->ParseDisplayName(hwndOwner,
595 pbc,
596 lpszDisplayName,
597 pchEaten,
598 ppidl,
599 pdwAttributes);
600 }
601
602 TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
603
604 return hr;
605}
606
607/**************************************************************************
608 * CDesktopFolder::EnumObjects
609 */
610HRESULT WINAPI CDesktopFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
611{
612 CComPtr<IEnumIDList> pRegEnumerator;
613 CComPtr<IEnumIDList> pDesktopEnumerator;
614 CComPtr<IEnumIDList> pCommonDesktopEnumerator;
615 HRESULT hr;
616
617 hr = m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
618 if (FAILED(hr))
619 ERR("EnumObjects for reg folder failed\n");
620
621 hr = m_DesktopFSFolder->EnumObjects(hwndOwner, dwFlags, &pDesktopEnumerator);
622 if (FAILED(hr))
623 ERR("EnumObjects for desktop fs folder failed\n");
624
625 hr = m_SharedDesktopFSFolder->EnumObjects(hwndOwner, dwFlags, &pCommonDesktopEnumerator);
626 if (FAILED(hr))
627 ERR("EnumObjects for shared desktop fs folder failed\n");
628
629 return ShellObjectCreatorInit<CDesktopFolderEnum>(dwFlags,pRegEnumerator, pDesktopEnumerator, pCommonDesktopEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
630}
631
632/**************************************************************************
633 * CDesktopFolder::BindToObject
634 */
637 LPBC pbcReserved,
638 REFIID riid,
639 LPVOID *ppvOut)
640{
641 if (!pidl)
642 return E_INVALIDARG;
643
644 CComPtr<IShellFolder2> psf;
645 HRESULT hr = _GetSFFromPidl(pidl, &psf);
647 return hr;
648
649 return psf->BindToObject(pidl, pbcReserved, riid, ppvOut);
650}
651
652/**************************************************************************
653 * CDesktopFolder::BindToStorage
654 */
657 LPBC pbcReserved,
658 REFIID riid,
659 LPVOID *ppvOut)
660{
661 FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n",
662 this, pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
663
664 *ppvOut = NULL;
665 return E_NOTIMPL;
666}
667
668/**************************************************************************
669 * CDesktopFolder::CompareIDs
670 */
672{
673 bool bIsDesktopFolder1, bIsDesktopFolder2;
674
675 if (!pidl1 || !pidl2)
676 {
677 ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
678 return E_INVALIDARG;
679 }
680
681 bIsDesktopFolder1 = _ILIsDesktop(pidl1);
682 bIsDesktopFolder2 = _ILIsDesktop(pidl2);
683 if (bIsDesktopFolder1 || bIsDesktopFolder2)
684 return MAKE_COMPARE_HRESULT(bIsDesktopFolder1 - bIsDesktopFolder2);
685
686 if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
687 return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
688
689 return m_DesktopFSFolder->CompareIDs(lParam, pidl1, pidl2);
690}
691
692/**************************************************************************
693 * CDesktopFolder::CreateViewObject
694 */
696 HWND hwndOwner,
697 REFIID riid,
698 LPVOID *ppvOut)
699{
701
702 TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
703 this, hwndOwner, shdebugstr_guid (&riid), ppvOut);
704
705 if (!ppvOut)
706 return hr;
707
708 *ppvOut = NULL;
709
710 if (IsEqualIID (riid, IID_IDropTarget))
711 {
712 hr = m_DesktopFSFolder->CreateViewObject(hwndOwner, riid, ppvOut);
713 }
714 else if (IsEqualIID (riid, IID_IContextMenu))
715 {
716 HKEY hKeys[16];
717 UINT cKeys = 0;
718 AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
719
720 DEFCONTEXTMENU dcm;
721 dcm.hwnd = hwndOwner;
722 dcm.pcmcb = this;
723 dcm.pidlFolder = pidlRoot;
724 dcm.psf = this;
725 dcm.cidl = 0;
726 dcm.apidl = NULL;
727 dcm.cKeys = cKeys;
728 dcm.aKeys = hKeys;
730 hr = SHCreateDefaultContextMenu (&dcm, riid, ppvOut);
731 }
732 else if (IsEqualIID (riid, IID_IShellView))
733 {
734 SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
735 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
736 }
737 TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
738 return hr;
739}
740
741/**************************************************************************
742 * CDesktopFolder::GetAttributesOf
743 */
745 UINT cidl,
747 DWORD *rgfInOut)
748{
749 HRESULT hr = S_OK;
750
751 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
752 this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
753
754 if (cidl && !apidl)
755 return E_INVALIDARG;
756
757 if (*rgfInOut == 0)
758 *rgfInOut = ~0;
759
760 if(cidl == 0)
761 *rgfInOut &= dwDesktopAttributes;
762 else
763 {
764 /* TODO: always add SFGAO_CANLINK */
765 for (UINT i = 0; i < cidl; ++i)
766 {
767 pdump(*apidl);
768 if (_ILIsDesktop(*apidl))
769 *rgfInOut &= dwDesktopAttributes;
770 else if (_ILIsMyComputer(apidl[i]))
771 *rgfInOut &= dwMyComputerAttributes;
772 else if (_ILIsNetHood(apidl[i]))
773 *rgfInOut &= dwMyNetPlacesAttributes;
774 else if (_ILIsFolder(apidl[i]) || _ILIsValue(apidl[i]) || _ILIsSpecialFolder(apidl[i]))
775 {
776 CComPtr<IShellFolder2> psf;
777 HRESULT hr = _GetSFFromPidl(apidl[i], &psf);
779 continue;
780
781 psf->GetAttributesOf(1, &apidl[i], rgfInOut);
782 }
783 else
784 ERR("Got an unknown pidl type!!!\n");
785 }
786 }
787 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
788 *rgfInOut &= ~SFGAO_VALIDATE;
789
790 TRACE("-- result=0x%08x\n", *rgfInOut);
791
792 return hr;
793}
794
795/**************************************************************************
796 * CDesktopFolder::GetUIObjectOf
797 *
798 * PARAMETERS
799 * HWND hwndOwner, //[in ] Parent window for any output
800 * UINT cidl, //[in ] array size
801 * LPCITEMIDLIST* apidl, //[in ] simple pidl array
802 * REFIID riid, //[in ] Requested Interface
803 * UINT* prgfInOut, //[ ] reserved
804 * LPVOID* ppvObject) //[out] Resulting Interface
805 *
806 */
808 HWND hwndOwner,
809 UINT cidl,
811 REFIID riid,
812 UINT *prgfInOut,
813 LPVOID *ppvOut)
814{
815 LPVOID pObj = NULL;
817
818 TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
819 this, hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
820
821 if (!ppvOut)
822 return hr;
823
824 *ppvOut = NULL;
825
826 if (cidl == 1 && !_ILIsSpecialFolder(apidl[0]))
827 {
828 CComPtr<IShellFolder2> psf;
829 HRESULT hr = _GetSFFromPidl(apidl[0], &psf);
831 return hr;
832
833 return psf->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut);
834 }
835
836 if (IsEqualIID (riid, IID_IContextMenu))
837 {
838 if (cidl > 0 && _ILIsSpecialFolder(apidl[0]))
839 {
840 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
841 }
842 else
843 {
844 /* Do not use the context menu of the CFSFolder here. */
845 /* We need to pass a pointer of the CDesktopFolder so as the data object that the context menu gets is rooted to the desktop */
846 /* Otherwise operations like that involve items from both user and shared desktop will not work */
847 HKEY hKeys[16];
848 UINT cKeys = 0;
849 if (cidl > 0)
850 {
851 AddFSClassKeysToArray(cidl, apidl, hKeys, &cKeys);
852 }
853
854 DEFCONTEXTMENU dcm;
855 dcm.hwnd = hwndOwner;
856 dcm.pcmcb = this;
857 dcm.pidlFolder = pidlRoot;
858 dcm.psf = this;
859 dcm.cidl = cidl;
860 dcm.apidl = apidl;
861 dcm.cKeys = cKeys;
862 dcm.aKeys = hKeys;
864 hr = SHCreateDefaultContextMenu (&dcm, riid, &pObj);
865 }
866 }
867 else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
868 {
869 hr = IDataObject_Constructor( hwndOwner, pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
870 }
871 else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
872 {
873 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
874 }
875 else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
876 {
877 CComPtr<IShellFolder> psfChild;
878 hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
880 return hr;
881
882 return psfChild->CreateViewObject(NULL, riid, ppvOut);
883 }
884 else
886
887 if (SUCCEEDED(hr) && !pObj)
889
890 *ppvOut = pObj;
891 TRACE ("(%p)->hr=0x%08x\n", this, hr);
892 return hr;
893}
894
895/**************************************************************************
896 * CDesktopFolder::GetDisplayNameOf
897 *
898 * NOTES
899 * special case: pidl = null gives desktop-name back
900 */
902{
903 TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
904 pdump (pidl);
905
906 if (!strRet)
907 return E_INVALIDARG;
908
909 if (!_ILIsPidlSimple (pidl))
910 {
911 return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
912 }
913 else if (_ILIsDesktop(pidl))
914 {
916 return SHSetStrRet(strRet, sPathTarget);
917 else
918 return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
919 }
920
921 /* file system folder or file rooted at the desktop */
922 CComPtr<IShellFolder2> psf;
923 HRESULT hr = _GetSFFromPidl(pidl, &psf);
925 return hr;
926
927 return psf->GetDisplayNameOf(pidl, dwFlags, strRet);
928}
929
930/**************************************************************************
931 * CDesktopFolder::SetNameOf
932 * Changes the name of a file object or subfolder, possibly changing its item
933 * identifier in the process.
934 *
935 * PARAMETERS
936 * HWND hwndOwner, //[in ] Owner window for output
937 * LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
938 * LPCOLESTR lpszName, //[in ] the items new display name
939 * DWORD dwFlags, //[in ] SHGNO formatting flags
940 * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
941 */
943 HWND hwndOwner,
944 PCUITEMID_CHILD pidl, /* simple pidl */
945 LPCOLESTR lpName,
947 PITEMID_CHILD *pPidlOut)
948{
949 CComPtr<IShellFolder2> psf;
950 HRESULT hr = _GetSFFromPidl(pidl, &psf);
952 return hr;
953
954 return psf->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
955}
956
958{
959 FIXME ("(%p)\n", this);
960 return E_NOTIMPL;
961}
962
964{
965 FIXME ("(%p)\n", this);
966 return E_NOTIMPL;
967}
968
970{
971 TRACE ("(%p)\n", this);
972
973 if (pSort)
974 *pSort = 0;
975 if (pDisplay)
976 *pDisplay = 0;
977
978 return S_OK;
979}
980
982{
983 TRACE ("(%p)\n", this);
984
985 if (!pcsFlags || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
986 return E_INVALIDARG;
987
988 *pcsFlags = DesktopSFHeader[iColumn].pcsFlags;
989
990 return S_OK;
991}
992
994 PCUITEMID_CHILD pidl,
995 const SHCOLUMNID *pscid,
996 VARIANT *pv)
997{
998 FIXME ("(%p)\n", this);
999
1000 return E_NOTIMPL;
1001}
1002
1004 PCUITEMID_CHILD pidl,
1005 UINT iColumn,
1006 SHELLDETAILS *psd)
1007{
1008 if (!psd || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
1009 return E_INVALIDARG;
1010
1011 if (!pidl)
1012 {
1013 psd->fmt = DesktopSFHeader[iColumn].fmt;
1014 psd->cxChar = DesktopSFHeader[iColumn].cxChar;
1015 return SHSetStrRet(&psd->str, DesktopSFHeader[iColumn].colnameid);
1016 }
1017
1018 CComPtr<IShellFolder2> psf;
1019 HRESULT hr = _GetSFFromPidl(pidl, &psf);
1021 return hr;
1022
1023 hr = psf->GetDetailsOf(pidl, iColumn, psd);
1025 return hr;
1026
1027 return hr;
1028}
1029
1031{
1032 FIXME ("(%p)\n", this);
1033 return E_NOTIMPL;
1034}
1035
1037{
1038 TRACE ("(%p)\n", this);
1039
1040 if (!lpClassId)
1041 return E_POINTER;
1042
1043 *lpClassId = CLSID_ShellDesktop;
1044
1045 return S_OK;
1046}
1047
1049{
1050 TRACE ("(%p)->(%p)\n", this, pidl);
1051
1052 if (!pidl)
1053 return S_OK;
1054
1055 return E_INVALIDARG;
1056}
1057
1059{
1060 TRACE ("(%p)->(%p)\n", this, pidl);
1061
1062 if (!pidl)
1063 return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
1064 *pidl = ILClone (pidlRoot);
1065 return S_OK;
1066}
1067
1069{
1070 if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
1071 return S_OK;
1072
1073 /* no data object means no selection */
1074 if (!pdtobj)
1075 {
1076 if (uMsg == DFM_INVOKECOMMAND && wParam == 0)
1077 {
1078 if (32 >= (UINT_PTR)ShellExecuteW(hwndOwner, L"open", L"rundll32.exe",
1079 L"shell32.dll,Control_RunDLL desk.cpl", NULL, SW_SHOWNORMAL))
1080 {
1081 return E_FAIL;
1082 }
1083 return S_OK;
1084 }
1085 else if (uMsg == DFM_MERGECONTEXTMENU)
1086 {
1087 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1088 HMENU hpopup = CreatePopupMenu();
1090 Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu, pqcminfo->idCmdFirst++, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1091 DestroyMenu(hpopup);
1092 }
1093
1094 return S_OK;
1095 }
1096
1098 return S_OK;
1099
1100 return Shell_DefaultContextMenuCallBack(this, pdtobj);
1101}
1102
1103/*************************************************************************
1104 * SHGetDesktopFolder [SHELL32.@]
1105 */
1107{
1108 HRESULT hres = S_OK;
1109 TRACE("\n");
1110
1111 if(!psf) return E_INVALIDARG;
1112 *psf = NULL;
1113 hres = CDesktopFolder::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellFolder, psf));
1114
1115 TRACE("-- %p->(%p)\n",psf, *psf);
1116 return hres;
1117}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3855
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv)
HRESULT WINAPI 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
#define DESKTOPSHELLVIEWCOLUMNS
static const WCHAR ClassicStartMenuW[]
static const shvheader DesktopSFHeader[]
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:866
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:111
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
#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)
BOOL HasItemWithCLSID(LPITEMIDLIST pidl)
BOOL AddToEnumList(LPITEMIDLIST pidl)
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
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 IDS_SHV_COLUMN_TYPE
Definition: resource.h:75
#define IDS_SHV_COLUMN_NAME
Definition: resource.h:74
#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
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:279
HRESULT SHBindToObject(_In_opt_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ REFIID riid, _Out_ void **ppvObj)
Definition: utils.cpp:205
HRESULT WINAPI Shell_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdtobj)
Definition: shlfolder.cpp:497
BOOL BindCtx_ContainsObject(_In_ IBindCtx *pBindCtx, _In_ LPCWSTR pszName)
Definition: utils.cpp:106
HRESULT SHIsFileSysBindCtx(_In_ IBindCtx *pBindCtx, _Out_opt_ WIN32_FIND_DATAW *pFindData)
Definition: utils.cpp:139
BOOL Shell_FailForceReturn(_In_ HRESULT hr)
Definition: utils.cpp:156
HRESULT Shell_TranslateIDListAlias(_In_ LPCITEMIDLIST pidl, _In_ HANDLE hToken, _Out_ LPITEMIDLIST *ppidlAlias, _In_ DWORD dwFlags)
Definition: utils.cpp:97
BOOL SHSkipJunctionBinding(_In_ IBindCtx *pbc, _In_ CLSID *pclsid)
Definition: utils.cpp:127
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:3124
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 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 __int3264 UINT_PTR
Definition: mstsclib_h.h:274
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:1657
LPITEMIDLIST _ILCreateIExplore(void)
Definition: pidl.c:1669
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:938
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:712
LPITEMIDLIST _ILCreateDesktop(void)
Definition: pidl.c:1646
LPITEMIDLIST _ILCreateNetwork(void)
Definition: pidl.c:1713
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2020
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1975
BOOL _ILIsNetHood(LPCITEMIDLIST pidl)
Definition: pidl.c:1953
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID)
Definition: pidl.c:1769
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2369
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2029
LPITEMIDLIST _ILCreateMyDocuments(void)
Definition: pidl.c:1663
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2151
#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
#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:579
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:292
static __inline int SHELL32_GUIDToStringW(REFGUID guid, LPWSTR str)
Definition: shfldr.h:85
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)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2402
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:2182
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1511
#define CSIDL_DESKTOPDIRECTORY
Definition: shlobj.h:2173
#define MM_ADDSEPARATOR
Definition: shlobj.h:2513
struct _SFV_CREATE SFV_CREATE
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2597
@ 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
#define IDS_SHV_COLUMN_SIZE
Definition: shresdef.h:52
#define IDS_SHV_COLUMN_MODIFIED
Definition: shresdef.h:54
#define IDS_SHV_COLUMN_COMMENTS
Definition: shresdef.h:69
#define IDS_SHV_COLUMN_ATTRIBUTES
Definition: shresdef.h:55
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
@ SHCOLSTATE_TYPE_DATE
Definition: shtypes.idl:123
@ 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
IContextMenuCB * pcmcb
Definition: shlobj.h:2535
IShellFolder * psf
Definition: shlobj.h:2537
IUnknown * punkAssociationInfo
Definition: shlobj.h:2540
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2539
const HKEY * aKeys
Definition: shlobj.h:2542
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2536
STRRET str
Definition: shtypes.idl:108
HMENU hmenu
Definition: shlobj.h:1381
UINT idCmdLast
Definition: shlobj.h:1384
UINT idCmdFirst
Definition: shlobj.h:1383
UINT indexMenu
Definition: shlobj.h:1382
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
#define SW_SHOWNORMAL
Definition: winuser.h:770
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