ReactOS 0.4.16-dev-106-g10b08aa
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
31{
32 { CLSID_MyComputer, "sysdm.cpl", 0x50 },
33 { CLSID_NetworkPlaces, "ncpa.cpl", 0x58 },
34 { CLSID_Internet, "inetcpl.cpl", 0x68 },
35};
37{
38 PT_DESKTOP_REGITEM,
40 CLSID_ShellDesktop,
41 L"",
42 L"Desktop",
43};
44
46{
47 return cidl == 0 || (cidl == 1 && apidl && _ILIsEmpty(apidl[0]));
48}
49
50static const CLSID* IsRegItem(PCUITEMID_CHILD pidl)
51{
52 if (pidl && pidl->mkid.cb == 2 + 2 + sizeof(CLSID) && pidl->mkid.abID[0] == PT_GUID)
53 return (const CLSID*)(&pidl->mkid.abID[2]);
54 return NULL;
55}
56
59 HWND hwndOwner,
60 LPBC pbc,
61 LPOLESTR lpszDisplayName,
62 DWORD *pchEaten,
63 PIDLIST_RELATIVE *ppidl,
64 DWORD *pdwAttributes)
65{
66 LPWSTR pch;
67 INT cch, csidl;
69 PARSEDURLW ParsedURL = { sizeof(ParsedURL) };
70
71 ::ParseURLW(lpszDisplayName, &ParsedURL);
72
73 DWORD attrs = (pdwAttributes ? *pdwAttributes : 0) | SFGAO_STREAM;
74 if (ParsedURL.pszSuffix[0] == L':' && ParsedURL.pszSuffix[1] == L':') // It begins from "::"
75 {
76 CComPtr<IShellFolder> psfDesktop;
77 hr = SHGetDesktopFolder(&psfDesktop);
78 if (SUCCEEDED(hr))
79 {
80 CComPtr<IBindCtx> pBindCtx;
81 hr = ::CreateBindCtx(0, &pBindCtx);
82 if (SUCCEEDED(hr))
83 {
84 BIND_OPTS BindOps = { sizeof(BindOps) };
85 BindOps.grfMode = STGM_CREATE;
86 pBindCtx->SetBindOptions(&BindOps);
87 hr = psfDesktop->ParseDisplayName(hwndOwner, pBindCtx,
88 (LPWSTR)ParsedURL.pszSuffix,
89 pchEaten, ppidl, &attrs);
90 }
91 }
92 }
93 else
94 {
95 csidl = Shell_ParseSpecialFolder(ParsedURL.pszSuffix, &pch, &cch);
96 if (csidl == -1)
97 {
98 ERR("\n");
99 return hr;
100 }
101
102 CComHeapPtr<ITEMIDLIST> pidlLocation;
103 hr = SHGetFolderLocation(hwndOwner, (csidl | CSIDL_FLAG_CREATE), NULL, 0, &pidlLocation);
105 return hr;
106
107 if (pch && *pch)
108 {
109 CComPtr<IShellFolder> psfFolder;
110 hr = SHBindToObject(NULL, pidlLocation, IID_PPV_ARG(IShellFolder, &psfFolder));
111 if (SUCCEEDED(hr))
112 {
113 CComHeapPtr<ITEMIDLIST> pidlNew;
114 hr = psfFolder->ParseDisplayName(hwndOwner, pbc, pch, pchEaten, &pidlNew, &attrs);
115 if (SUCCEEDED(hr))
116 {
117 hr = SHILCombine(pidlLocation, pidlNew, ppidl);
118 if (pchEaten)
119 *pchEaten += cch;
120 }
121 }
122 }
123 else
124 {
125 if (attrs)
126 hr = SHGetNameAndFlagsW(pidlLocation, 0, NULL, 0, &attrs);
127
128 if (SUCCEEDED(hr))
129 {
130 if (pchEaten)
131 *pchEaten = cch;
132 *ppidl = pidlLocation.Detach();
133 }
134 }
135 }
136
137 // FIXME: SHWindowsPolicy
138 if (SUCCEEDED(hr) && (attrs & SFGAO_STREAM) &&
139 !BindCtx_ContainsObject(pbc, STR_PARSE_SHELL_PROTOCOL_TO_FILE_OBJECTS))
140 {
141 ILFree(*ppidl);
142 *ppidl = NULL;
144 }
145
146 if (pdwAttributes)
147 *pdwAttributes = attrs;
148
149 // FIXME: SHWindowsPolicy
152
153 return hr;
154}
155
158 HWND hwndOwner,
159 LPBC pbc,
160 LPOLESTR lpszDisplayName,
161 DWORD *pchEaten,
162 PIDLIST_RELATIVE *ppidl,
163 DWORD *pdwAttributes)
164{
165 FIXME("\n");
166 return E_NOTIMPL; // FIXME
167}
168
169/*
170CDesktopFolder should create two file system folders internally, one representing the
171user's desktop folder, and the other representing the common desktop folder. It should
172also create a CRegFolder to represent the virtual items that exist only in the registry.
173The CRegFolder is aggregated by the CDesktopFolder, and queries for the CLSID_IShellFolder,
174CLSID_IShellFolder2, or CLSID_IShellIconOverlay interfaces prefer the CRegFolder
175implementation.
176The CDesktopFolderEnum class should create two enumerators, one for each of the file
177system folders, and enumerate the contents of each folder. Since the CRegFolder
178implementation of IShellFolder::EnumObjects enumerates the virtual items, the
179CDesktopFolderEnum is only responsible for returning the physical items.
180CDesktopFolderViewCB is responsible for filtering hidden regitems.
181The enumerator always shows My Computer.
182*/
183
184/* Undocumented functions from shdocvw */
185extern "C" HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl);
186
188 public CEnumIDListBase
189{
190 private:
191// CComPtr fDesktopEnumerator;
192// CComPtr fCommonDesktopEnumerator;
193 public:
194
196 IEnumIDList *pDesktopEnumerator, IEnumIDList *pCommonDesktopEnumerator)
197 {
198 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
199
200 AppendItemsFromEnumerator(pRegEnumerator);
201
202 /* Enumerate the items in the two fs folders */
203 AppendItemsFromEnumerator(pDesktopEnumerator);
204 AppendItemsFromEnumerator(pCommonDesktopEnumerator);
205
206 return S_OK;
207 }
208
210 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
212};
213
214int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll);
215
217 SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
218 SFGAO_STORAGEANCESTOR | SFGAO_HASPROPSHEET | SFGAO_STORAGE;
220 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
221 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_CANLINK;
223 SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
224 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_CANLINK;
225
227 sPathTarget(NULL),
228 pidlRoot(NULL)
229{
230}
231
233{
234}
235
237{
238 WCHAR szMyPath[MAX_PATH];
239 HRESULT hr;
240
241 /* Create the root pidl */
243 if (!pidlRoot)
244 return E_OUTOFMEMORY;
245
246 /* Create the inner fs folder */
248 &CLSID_ShellFSFolder,
252 return hr;
253
254 /* Create the inner shared fs folder. Dont fail on failure. */
256 &CLSID_ShellFSFolder,
260 return hr;
261
262 /* Create the inner reg folder */
263 REGFOLDERINITDATA RegInit = { static_cast<IShellFolder*>(this), &g_RegFolderInfo };
264 hr = CRegFolder_CreateInstance(&RegInit,
265 pidlRoot,
268 return hr;
269
270 /* Cache the path to the user desktop directory */
272 return E_UNEXPECTED;
273
274 sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR));
275 if (!sPathTarget)
276 return E_OUTOFMEMORY;
277
278 wcscpy(sPathTarget, szMyPath);
279 return S_OK;
280}
281
283{
284 WCHAR szFileName[MAX_PATH];
285
286 if (_ILIsSpecialFolder(pidl))
287 return m_regFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
288
289 lstrcpynW(szFileName, sPathTarget, MAX_PATH - 1);
290 PathAddBackslashW(szFileName);
291 int cLen = wcslen(szFileName);
292
293 if (!_ILSimpleGetTextW(pidl, szFileName + cLen, MAX_PATH - cLen))
294 return E_FAIL;
295
297 return m_SharedDesktopFSFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
298 else
299 return m_DesktopFSFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
300}
301
303 HWND hwndOwner,
304 LPBC pbc,
305 LPOLESTR lpszDisplayName,
306 DWORD *pchEaten,
307 PIDLIST_RELATIVE *ppidl,
308 DWORD *pdwAttributes)
309{
310 if (pchEaten)
311 *pchEaten = 0;
312
313 CComHeapPtr<ITEMIDLIST> pidlParent;
314 BOOL bPath = FALSE;
315 WCHAR wch = *lpszDisplayName;
316 if (((L'A' <= wch && wch <= L'Z') || (L'a' <= wch && wch <= L'z')) &&
317 (lpszDisplayName[1] == L':'))
318 {
319 // "C:..."
320 bPath = TRUE;
321 pidlParent.Attach(_ILCreateMyComputer());
322 }
323 else if (PathIsUNCW(lpszDisplayName)) // "\\\\..."
324 {
325 bPath = TRUE;
326 pidlParent.Attach(_ILCreateNetwork());
327 }
328
329 if (bPath)
330 {
331 if (!pidlParent)
332 return E_OUTOFMEMORY;
333
334 CComPtr<IShellFolder> pParentFolder;
335 SHBindToObject(NULL, pidlParent, IID_PPV_ARG(IShellFolder, &pParentFolder));
336
337 CComHeapPtr<ITEMIDLIST> pidlChild;
338 HRESULT hr = pParentFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName,
339 pchEaten, &pidlChild, pdwAttributes);
340 if (FAILED(hr))
341 return hr;
342
343 *ppidl = ILCombine(pidlParent, pidlChild);
344 return (*ppidl ? S_OK : E_OUTOFMEMORY);
345 }
346
347 if (!UrlIsW(lpszDisplayName, URLIS_URL) || SHSkipJunctionBinding(pbc, NULL))
348 return E_INVALIDARG;
349
350 // Now lpszDisplayName is a URL
351 PARSEDURLW ParsedURL = { sizeof(ParsedURL) };
352 ::ParseURLW(lpszDisplayName, &ParsedURL);
353
354 switch (ParsedURL.nScheme)
355 {
356 case URL_SCHEME_FILE: // "file:..."
357 {
358 // Convert "file://..." to a normal path
360 DWORD cchPath = _countof(szPath);
361 HRESULT hr = PathCreateFromUrlW(lpszDisplayName, szPath, &cchPath, 0);
363 return hr;
364
365 CComPtr<IShellFolder> psfDesktop;
366 hr = SHGetDesktopFolder(&psfDesktop);
368 return hr;
369
370 // Parse by desktop folder
371 return psfDesktop->ParseDisplayName(hwndOwner, pbc, szPath, pchEaten, ppidl,
372 pdwAttributes);
373 }
374 case URL_SCHEME_HTTP: // "http:..."
375 case URL_SCHEME_HTTPS: // "https:..."
376 {
377 if (!BindCtx_ContainsObject(pbc, STR_PARSE_PREFER_FOLDER_BROWSING))
378 return E_INVALIDARG;
379
380 return HttpUrlParseDisplayName(hwndOwner,
381 pbc,
382 lpszDisplayName,
383 pchEaten,
384 ppidl,
385 pdwAttributes);
386 }
387 case URL_SCHEME_SHELL: // "shell:..."
388 {
389 return ShellUrlParseDisplayName(hwndOwner,
390 pbc,
391 lpszDisplayName,
392 pchEaten,
393 ppidl,
394 pdwAttributes);
395 }
398 {
399 WARN("We don't support 'ms-shell-rooted:' and 'ms-shell-idlist:' schemes\n");
400 break;
401 }
402 default:
403 {
404 TRACE("Scheme: %u\n", ParsedURL.nScheme);
405 break;
406 }
407 }
408
409 return E_INVALIDARG;
410}
411
412/**************************************************************************
413 * CDesktopFolder::ParseDisplayName
414 *
415 * NOTES
416 * "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and "" binds
417 * to MyComputer
418 */
420 HWND hwndOwner,
421 LPBC pbc,
422 LPOLESTR lpszDisplayName,
423 DWORD *pchEaten,
424 PIDLIST_RELATIVE *ppidl,
425 DWORD *pdwAttributes)
426{
427 TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
428 this, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName),
429 pchEaten, ppidl, pdwAttributes);
430
431 if (!ppidl)
432 return E_INVALIDARG;
433
434 *ppidl = NULL;
435
436 if (!lpszDisplayName)
437 return E_INVALIDARG;
438
439 if (!*lpszDisplayName)
440 {
441 *ppidl = _ILCreateMyComputer();
442 return (*ppidl ? S_OK : E_OUTOFMEMORY);
443 }
444
445 if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
446 {
447 return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl,
448 pdwAttributes);
449 }
450
451 HRESULT hr = _ParseDisplayNameByParent(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl,
452 pdwAttributes);
453 if (SUCCEEDED(hr))
454 {
455 if (BindCtx_ContainsObject(pbc, STR_PARSE_TRANSLATE_ALIASES))
456 {
457 CComHeapPtr<ITEMIDLIST> pidlAlias;
458 if (SUCCEEDED(Shell_TranslateIDListAlias(*ppidl, NULL, &pidlAlias, 0xFFFF)))
459 {
460 ILFree(*ppidl);
461 *ppidl = pidlAlias.Detach();
462 }
463 }
464
465 TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
466 return hr;
467 }
468
470 return hr;
471
472 if (BindCtx_ContainsObject(pbc, STR_DONT_PARSE_RELATIVE))
473 return E_INVALIDARG;
474
475 if (SHIsFileSysBindCtx(pbc, NULL) == S_OK)
476 return hr;
477
478 BIND_OPTS BindOps = { sizeof(BindOps) };
480 if (pbc && SUCCEEDED(pbc->GetBindOptions(&BindOps)) && (BindOps.grfMode & STGM_CREATE))
481 {
482 BindOps.grfMode &= ~STGM_CREATE;
483 bCreate = TRUE;
484 pbc->SetBindOptions(&BindOps);
485 }
486
488 {
489 hr = m_DesktopFSFolder->ParseDisplayName(hwndOwner,
490 pbc,
491 lpszDisplayName,
492 pchEaten,
493 ppidl,
494 pdwAttributes);
495 }
496
498 {
499 hr = m_SharedDesktopFSFolder->ParseDisplayName(hwndOwner,
500 pbc,
501 lpszDisplayName,
502 pchEaten,
503 ppidl,
504 pdwAttributes);
505 }
506
508 {
509 BindOps.grfMode |= STGM_CREATE;
510 pbc->SetBindOptions(&BindOps);
511 hr = m_DesktopFSFolder->ParseDisplayName(hwndOwner,
512 pbc,
513 lpszDisplayName,
514 pchEaten,
515 ppidl,
516 pdwAttributes);
517 }
518
519 TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
520
521 return hr;
522}
523
524/**************************************************************************
525 * CDesktopFolder::EnumObjects
526 */
527HRESULT WINAPI CDesktopFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
528{
529 CComPtr<IEnumIDList> pRegEnumerator;
530 CComPtr<IEnumIDList> pDesktopEnumerator;
531 CComPtr<IEnumIDList> pCommonDesktopEnumerator;
532 HRESULT hr;
533
534 hr = m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
535 if (FAILED(hr))
536 ERR("EnumObjects for reg folder failed\n");
537
538 hr = m_DesktopFSFolder->EnumObjects(hwndOwner, dwFlags, &pDesktopEnumerator);
539 if (FAILED(hr))
540 ERR("EnumObjects for desktop fs folder failed\n");
541
542 hr = m_SharedDesktopFSFolder->EnumObjects(hwndOwner, dwFlags, &pCommonDesktopEnumerator);
543 if (FAILED(hr))
544 ERR("EnumObjects for shared desktop fs folder failed\n");
545
546 return ShellObjectCreatorInit<CDesktopFolderEnum>(m_regFolder, dwFlags, pRegEnumerator, pDesktopEnumerator,
547 pCommonDesktopEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
548}
549
550/**************************************************************************
551 * CDesktopFolder::BindToObject
552 */
555 LPBC pbcReserved,
556 REFIID riid,
557 LPVOID *ppvOut)
558{
559 if (!pidl)
560 return E_INVALIDARG;
561
562 CComPtr<IShellFolder2> psf;
563 HRESULT hr = _GetSFFromPidl(pidl, &psf);
565 return hr;
566
567 return psf->BindToObject(pidl, pbcReserved, riid, ppvOut);
568}
569
570/**************************************************************************
571 * CDesktopFolder::BindToStorage
572 */
575 LPBC pbcReserved,
576 REFIID riid,
577 LPVOID *ppvOut)
578{
579 FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n",
580 this, pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
581
582 *ppvOut = NULL;
583 return E_NOTIMPL;
584}
585
586/**************************************************************************
587 * CDesktopFolder::CompareIDs
588 */
590{
591 bool bIsDesktopFolder1, bIsDesktopFolder2;
592
593 if (!pidl1 || !pidl2)
594 {
595 ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
596 return E_INVALIDARG;
597 }
598
599 bIsDesktopFolder1 = _ILIsDesktop(pidl1);
600 bIsDesktopFolder2 = _ILIsDesktop(pidl2);
601 if (bIsDesktopFolder1 || bIsDesktopFolder2)
602 return MAKE_COMPARE_HRESULT(bIsDesktopFolder1 - bIsDesktopFolder2);
603
604 if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
605 return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
606
607 return m_DesktopFSFolder->CompareIDs(lParam, pidl1, pidl2);
608}
609
610/**************************************************************************
611 * CDesktopFolder::CreateViewObject
612 */
614 HWND hwndOwner,
615 REFIID riid,
616 LPVOID *ppvOut)
617{
619
620 TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
621 this, hwndOwner, shdebugstr_guid (&riid), ppvOut);
622
623 if (!ppvOut)
624 return hr;
625
626 *ppvOut = NULL;
627
628 if (IsEqualIID (riid, IID_IDropTarget))
629 {
630 hr = m_DesktopFSFolder->CreateViewObject(hwndOwner, riid, ppvOut);
631 }
632 else if (IsEqualIID (riid, IID_IContextMenu))
633 {
634 HKEY hKeys[16];
635 UINT cKeys = 0;
636 AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
637
638 DEFCONTEXTMENU dcm;
639 dcm.hwnd = hwndOwner;
640 dcm.pcmcb = this;
641 dcm.pidlFolder = pidlRoot;
642 dcm.psf = this;
643 dcm.cidl = 0;
644 dcm.apidl = NULL;
645 dcm.cKeys = cKeys;
646 dcm.aKeys = hKeys;
648 hr = SHCreateDefaultContextMenu (&dcm, riid, ppvOut);
649 }
650 else if (IsEqualIID (riid, IID_IShellView))
651 {
652 CComPtr<CDesktopFolderViewCB> sfviewcb;
653 if (SUCCEEDED(hr = ShellObjectCreator(sfviewcb)))
654 {
655 SFV_CREATE create = { sizeof(create), this, NULL, sfviewcb };
657 if (SUCCEEDED(hr))
658 sfviewcb->Initialize((IShellView*)*ppvOut);
659 }
660 }
661 TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
662 return hr;
663}
664
665/**************************************************************************
666 * CDesktopFolder::GetAttributesOf
667 */
669 UINT cidl,
671 DWORD *rgfInOut)
672{
673 HRESULT hr = S_OK;
674
675 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
676 this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
677
678 if (cidl && !apidl)
679 return E_INVALIDARG;
680
681 if (*rgfInOut == 0)
682 *rgfInOut = ~0;
683
684 if(cidl == 0)
685 *rgfInOut &= dwDesktopAttributes;
686 else
687 {
688 /* TODO: always add SFGAO_CANLINK */
689 for (UINT i = 0; i < cidl; ++i)
690 {
691 pdump(*apidl);
692 if (_ILIsDesktop(*apidl))
693 *rgfInOut &= dwDesktopAttributes;
694 else if (_ILIsMyComputer(apidl[i]))
695 *rgfInOut &= dwMyComputerAttributes;
696 else if (_ILIsNetHood(apidl[i]))
697 *rgfInOut &= dwMyNetPlacesAttributes;
698 else if (_ILIsFolder(apidl[i]) || _ILIsValue(apidl[i]) || _ILIsSpecialFolder(apidl[i]))
699 {
700 CComPtr<IShellFolder2> psf;
701 HRESULT hr = _GetSFFromPidl(apidl[i], &psf);
703 continue;
704
705 psf->GetAttributesOf(1, &apidl[i], rgfInOut);
706 }
707 else
708 ERR("Got an unknown pidl type!!!\n");
709 }
710 }
711 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
712 *rgfInOut &= ~SFGAO_VALIDATE;
713
714 TRACE("-- result=0x%08x\n", *rgfInOut);
715
716 return hr;
717}
718
719/**************************************************************************
720 * CDesktopFolder::GetUIObjectOf
721 *
722 * PARAMETERS
723 * HWND hwndOwner, //[in ] Parent window for any output
724 * UINT cidl, //[in ] array size
725 * LPCITEMIDLIST* apidl, //[in ] simple pidl array
726 * REFIID riid, //[in ] Requested Interface
727 * UINT* prgfInOut, //[ ] reserved
728 * LPVOID* ppvObject) //[out] Resulting Interface
729 *
730 */
732 HWND hwndOwner,
733 UINT cidl,
735 REFIID riid,
736 UINT *prgfInOut,
737 LPVOID *ppvOut)
738{
739 LPVOID pObj = NULL;
741
742 TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
743 this, hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
744
745 if (!ppvOut)
746 return hr;
747 *ppvOut = NULL;
748
749 BOOL self = IsSelf(cidl, apidl);
750 if (cidl == 1 && !_ILIsSpecialFolder(apidl[0]) && !self)
751 {
752 CComPtr<IShellFolder2> psf;
753 HRESULT hr = _GetSFFromPidl(apidl[0], &psf);
755 return hr;
756
757 return psf->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut);
758 }
759
760 if (IsEqualIID (riid, IID_IContextMenu))
761 {
762 // FIXME: m_regFolder vs AddFSClassKeysToArray is incorrect when the selection includes both regitems and FS items
763 if (!self && cidl > 0 && _ILIsSpecialFolder(apidl[0]))
764 {
765 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
766 }
767 else
768 {
769 /* Do not use the context menu of the CFSFolder here. */
770 /* We need to pass a pointer of the CDesktopFolder so as the data object that the context menu gets is rooted to the desktop */
771 /* Otherwise operations like that involve items from both user and shared desktop will not work */
772 HKEY hKeys[16];
773 UINT cKeys = 0;
774 if (self)
775 {
776 AddClsidKeyToArray(CLSID_ShellDesktop, hKeys, &cKeys);
777 AddClassKeyToArray(L"Folder", hKeys, &cKeys);
778 }
779 else if (cidl > 0)
780 {
781 AddFSClassKeysToArray(cidl, apidl, hKeys, &cKeys);
782 }
783
784 DEFCONTEXTMENU dcm;
785 dcm.hwnd = hwndOwner;
786 dcm.pcmcb = this;
787 dcm.pidlFolder = pidlRoot;
788 dcm.psf = this;
789 dcm.cidl = cidl;
790 dcm.apidl = apidl;
791 dcm.cKeys = cKeys;
792 dcm.aKeys = hKeys;
794 hr = SHCreateDefaultContextMenu (&dcm, riid, &pObj);
795 }
796 }
797 else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
798 {
799 hr = IDataObject_Constructor( hwndOwner, pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
800 }
801 else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
802 {
803 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
804 }
805 else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
806 {
807 CComPtr<IShellFolder> psfChild;
808 hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
810 return hr;
811
812 return psfChild->CreateViewObject(NULL, riid, ppvOut);
813 }
814 else
816
817 if (SUCCEEDED(hr) && !pObj)
819
820 *ppvOut = pObj;
821 TRACE ("(%p)->hr=0x%08x\n", this, hr);
822 return hr;
823}
824
825/**************************************************************************
826 * CDesktopFolder::GetDisplayNameOf
827 *
828 * NOTES
829 * special case: pidl = null gives desktop-name back
830 */
832{
833 TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
834 pdump (pidl);
835
836 if (!strRet)
837 return E_INVALIDARG;
838
839 if (!_ILIsPidlSimple (pidl))
840 {
841 return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
842 }
843 else if (_ILIsDesktop(pidl))
844 {
846 return SHSetStrRet(strRet, sPathTarget);
847 else
848 return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
849 }
850
851 /* file system folder or file rooted at the desktop */
852 CComPtr<IShellFolder2> psf;
853 HRESULT hr = _GetSFFromPidl(pidl, &psf);
855 return hr;
856
857 return psf->GetDisplayNameOf(pidl, dwFlags, strRet);
858}
859
860/**************************************************************************
861 * CDesktopFolder::SetNameOf
862 * Changes the name of a file object or subfolder, possibly changing its item
863 * identifier in the process.
864 *
865 * PARAMETERS
866 * HWND hwndOwner, //[in ] Owner window for output
867 * LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
868 * LPCOLESTR lpszName, //[in ] the items new display name
869 * DWORD dwFlags, //[in ] SHGNO formatting flags
870 * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
871 */
873 HWND hwndOwner,
874 PCUITEMID_CHILD pidl, /* simple pidl */
875 LPCOLESTR lpName,
877 PITEMID_CHILD *pPidlOut)
878{
879 CComPtr<IShellFolder2> psf;
880 HRESULT hr = _GetSFFromPidl(pidl, &psf);
882 return hr;
883
884 return psf->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
885}
886
888{
889 FIXME ("(%p)\n", this);
890 return E_NOTIMPL;
891}
892
894{
895 FIXME ("(%p)\n", this);
896 return E_NOTIMPL;
897}
898
900{
901 TRACE ("(%p)\n", this);
902
903 if (pSort)
904 *pSort = 0;
905 if (pDisplay)
906 *pDisplay = 0;
907
908 return S_OK;
909}
910
912{
913 HRESULT hr;
914 TRACE ("(%p)\n", this);
915
916 if (!pcsFlags)
917 return E_INVALIDARG;
918
919 hr = CFSFolder::GetDefaultFSColumnState(iColumn, *pcsFlags);
920 /*
921 // CDesktopFolder may override the flags if desired (future)
922 switch(iColumn)
923 {
924 case SHFSF_COL_FATTS:
925 *pcsFlags &= ~SHCOLSTATE_ONBYDEFAULT;
926 break;
927 }
928 */
929 return hr;
930}
931
933 PCUITEMID_CHILD pidl,
934 const SHCOLUMNID *pscid,
935 VARIANT *pv)
936{
937 FIXME ("(%p)\n", this);
938
939 return E_NOTIMPL;
940}
941
942/*************************************************************************
943 * Column info functions.
944 * CFSFolder.h provides defaults for us.
945 */
947{
948 /* CDesktopFolder may override the flags and/or name if desired */
949 return CFSFolder::GetFSColumnDetails(iColumn, sd);
950}
951
953 PCUITEMID_CHILD pidl,
954 UINT iColumn,
955 SHELLDETAILS *psd)
956{
957 if (!psd)
958 return E_INVALIDARG;
959
960 if (!pidl)
961 {
962 return GetColumnDetails(iColumn, *psd);
963 }
964
965 CComPtr<IShellFolder2> psf;
966 HRESULT hr = _GetSFFromPidl(pidl, &psf);
968 return hr;
969
970 hr = psf->GetDetailsOf(pidl, iColumn, psd);
972 return hr;
973
974 return hr;
975}
976
978{
979 FIXME ("(%p)\n", this);
980 return E_NOTIMPL;
981}
982
984{
985 TRACE ("(%p)\n", this);
986
987 if (!lpClassId)
988 return E_POINTER;
989
990 *lpClassId = CLSID_ShellDesktop;
991
992 return S_OK;
993}
994
996{
997 TRACE ("(%p)->(%p)\n", this, pidl);
998
999 if (!pidl)
1000 return S_OK;
1001
1002 return E_INVALIDARG;
1003}
1004
1006{
1007 TRACE ("(%p)->(%p)\n", this, pidl);
1008
1009 if (!pidl)
1010 return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
1011 *pidl = ILClone (pidlRoot);
1012 return S_OK;
1013}
1014
1016{
1017 enum { IDC_PROPERTIES };
1018 if (uMsg == DFM_INVOKECOMMAND && wParam == (pdtobj ? DFM_CMD_PROPERTIES : IDC_PROPERTIES))
1019 {
1020 return SHELL_ExecuteControlPanelCPL(hwndOwner, L"desk.cpl") ? S_OK : E_FAIL;
1021 }
1022 else if (uMsg == DFM_MERGECONTEXTMENU && !pdtobj) // Add Properties item when called for directory background
1023 {
1024 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1025 HMENU hpopup = CreatePopupMenu();
1027 pqcminfo->idCmdFirst = Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1028 DestroyMenu(hpopup);
1029 return S_OK;
1030 }
1031 return SHELL32_DefaultContextMenuCallBack(psf, pdtobj, uMsg);
1032}
1033
1034/*************************************************************************
1035 * CDesktopFolderViewCB
1036 */
1037
1039{
1041 return SUCCEEDED(psv->GetCurrentInfo(&settings)) && (settings.fFlags & FWF_DESKTOP);
1042}
1043
1045{
1046 enum { Uninitialized = 0, NotHosted, IsHosted };
1047 C_ASSERT(Uninitialized == 0);
1048 if (m_IsProgmanHosted == Uninitialized)
1050 return m_IsProgmanHosted == IsHosted;
1051}
1052
1054{
1055 const CLSID* pClsid;
1056 if (IsProgmanHostedBrowser() && (pClsid = IsRegItem(pidlItem)) != NULL)
1057 {
1058 const BOOL NewStart = SHELL_GetSetting(SSF_STARTPANELON, fStartPanelOn);
1059 LPCWSTR SubKey = NewStart ? L"HideDesktopIcons\\NewStartPanel" : L"HideDesktopIcons\\ClassicStartMenu";
1060 return SHELL32_IsShellFolderNamespaceItemHidden(SubKey, *pClsid) ? S_FALSE : S_OK;
1061 }
1062 return S_OK;
1063}
1064
1066{
1067 switch (uMsg)
1068 {
1069 case SFVM_VIEWRELEASE:
1071 return S_OK;
1072 }
1073 return E_NOTIMPL;
1074}
1075
1076/*************************************************************************
1077 * SHGetDesktopFolder [SHELL32.@]
1078 */
1080{
1081 HRESULT hres = S_OK;
1082 TRACE("\n");
1083
1084 if(!psf) return E_INVALIDARG;
1085 *psf = NULL;
1086 hres = CDesktopFolder::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellFolder, psf));
1087
1088 TRACE("-- %p->(%p)\n",psf, *psf);
1089 return hres;
1090}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
static const REGFOLDERINFO g_RegFolderInfo
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4659
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv)
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl)
Definition: shdocvw_main.c:503
static const DWORD dwMyComputerAttributes
static const CLSID * IsRegItem(PCUITEMID_CHILD pidl)
BOOL SHELL32_IsShellFolderNamespaceItemHidden(LPCWSTR SubKey, REFCLSID Clsid)
static const REGFOLDERINFO g_RegFolderInfo
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:204
static const REQUIREDREGITEM g_RequiredItems[]
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(PREGFOLDERINITDATA pInit, LPCITEMIDLIST pidlRoot, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:943
#define SFVM_VIEWRELEASE
struct mke2fs_defaults settings[]
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 FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define IDS_PROPERTIES
Definition: resource.h:102
#define STDMETHODIMP
Definition: basetyps.h:43
HRESULT WINAPI Initialize(IShellFolder *pRegFolder, SHCONTF dwFlags, IEnumIDList *pRegEnumerator, IEnumIDList *pDesktopEnumerator, IEnumIDList *pCommonDesktopEnumerator)
STDMETHOD() MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) override
IShellView * m_pShellView
STDMETHOD() ShouldShow(IShellFolder *psf, PCIDLIST_ABSOLUTE pidlFolder, PCUITEMID_CHILD pidlItem) override
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)
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
static HRESULT GetDefaultFSColumnState(UINT iColumn, SHCOLSTATEF &csFlags)
Definition: CFSFolder.cpp:559
static HRESULT GetFSColumnDetails(UINT iColumn, SHELLDETAILS &sd)
Definition: CFSFolder.cpp:549
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#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:427
#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 DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
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 SHELL_ExecuteControlPanelCPL(hwnd, cpl)
Definition: precomp.h:156
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:550
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
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
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
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
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
REFIID riid
Definition: atlbase.h:39
HRESULT GetCurrentInfo([out] LPFOLDERSETTINGS lpfs)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define C_ASSERT(e)
Definition: intsafe.h:73
#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:80
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
HRESULT hres
Definition: protocol.c:465
static const struct access_res create[16]
Definition: package.c:7505
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
static SHCONTF
Definition: ordinal.c:64
HICON hIcon
Definition: msconfig.c:44
unsigned int UINT
Definition: ndis.h:50
#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
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1652
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:946
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:718
LPITEMIDLIST _ILCreateDesktop(void)
Definition: pidl.c:1641
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1998
LPITEMIDLIST _ILCreateNetwork(void)
Definition: pidl.c:1716
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2021
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1976
BOOL _ILIsNetHood(LPCITEMIDLIST pidl)
Definition: pidl.c:1954
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2030
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2080
#define PT_GUID
Definition: pidl.h:87
static BOOL _ILIsEmpty(LPCITEMIDLIST pidl)
Definition: pidl.h:267
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
_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:621
#define SHELL_GetSetting(pss, ssf, field)
Definition: shellutils.h:828
#define IS_SHGDN_DESKTOPABSOLUTEPARSING(flags)
Definition: shfldr.h:78
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:234
void AddFSClassKeysToArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:327
LSTATUS AddClsidKeyToArray(REFCLSID clsid, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:320
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:305
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:2197
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1520
#define CSIDL_DESKTOPDIRECTORY
Definition: shlobj.h:2188
#define SSF_STARTPANELON
Definition: shlobj.h:1625
#define MM_ADDSEPARATOR
Definition: shlobj.h:2528
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2612
@ 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
@ FWF_DESKTOP
Definition: shobjidl.idl:647
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:2550
IShellFolder * psf
Definition: shlobj.h:2552
IUnknown * punkAssociationInfo
Definition: shlobj.h:2555
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2554
const HKEY * aKeys
Definition: shlobj.h:2557
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2551
HMENU hmenu
Definition: shlobj.h:1390
UINT idCmdLast
Definition: shlobj.h:1393
UINT idCmdFirst
Definition: shlobj.h:1392
UINT indexMenu
Definition: shlobj.h:1391
LPCWSTR pszSuffix
Definition: shlwapi.h:1435
UINT nScheme
Definition: shlwapi.h:1437
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
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 S_FALSE
Definition: winerror.h:2357
#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
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define MFS_ENABLED
Definition: winuser.h:753
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MFT_STRING
Definition: winuser.h:749
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#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