ReactOS  0.4.13-dev-249-gcba1a2f
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 
27 /*
28 CDesktopFolder should create two file system folders internally, one representing the
29 user's desktop folder, and the other representing the common desktop folder. It should
30 also create a CRegFolder to represent the virtual items that exist only in the registry.
31 The CRegFolder is aggregated by the CDesktopFolder, and queries for the CLSID_IShellFolder,
32 CLSID_IShellFolder2, or CLSID_IShellIconOverlay interfaces prefer the CRegFolder
33 implementation.
34 The CDesktopFolderEnum class should create two enumerators, one for each of the file
35 system folders, and enumerate the contents of each folder. Since the CRegFolder
36 implementation of IShellFolder::EnumObjects enumerates the virtual items, the
37 CDesktopFolderEnum is only responsible for returning the physical items.
38 CDesktopFolderEnum is incorrect where it filters My Computer from the enumeration
39 if the new start menu is used. The CDesktopViewCallback is responsible for filtering
40 it from the view by handling the IncludeObject query to return S_FALSE. The enumerator
41 always shows My Computer.
42 */
43 
44 /* Undocumented functions from shdocvw */
45 extern "C" HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl);
46 
47 static const WCHAR ClassicStartMenuW[] = L"SOFTWARE\\Microsoft\\Windows\\"
48  L"CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu";
49 
50 static INT
52 {
53  DWORD Result, dwResult;
54  dwResult = sizeof(DWORD);
55 
56  if (RegGetValueW(HKEY_CURRENT_USER, /* FIXME use NewStartPanel when activated */
58  iid,
60  NULL,
61  &Result,
62  &dwResult) != ERROR_SUCCESS)
63  {
64  return -1;
65  }
66 
67  return Result;
68 }
69 
71 {
72  GUID const *clsid = _ILGetGUIDPointer (pidl);
73  if (!clsid)
74  return -1;
75 
76  WCHAR pwszGuid[CHARS_IN_GUID];
77  SHELL32_GUIDToStringW(*clsid, pwszGuid);
78  return IsNamespaceExtensionHidden(pwszGuid);
79 }
80 
82  public CEnumIDListBase
83 {
84  private:
85 // CComPtr fDesktopEnumerator;
86 // CComPtr fCommonDesktopEnumerator;
87  public:
88 
90  {
91  DWORD dwResult;
92  HKEY hkey;
93  DWORD j = 0, dwVal, Val, dwType, dwIID;
94  LONG r;
95  WCHAR iid[50];
96  LPITEMIDLIST pidl;
97 
98  dwResult = RegOpenKeyExW(hKeyRoot, ClassicStartMenuW, 0, KEY_READ, &hkey);
99  if (dwResult != ERROR_SUCCESS)
100  return;
101 
102  while(1)
103  {
104  dwVal = sizeof(Val);
105  dwIID = sizeof(iid) / sizeof(WCHAR);
106 
107  r = RegEnumValueW(hkey, j++, iid, &dwIID, NULL, &dwType, (LPBYTE)&Val, &dwVal);
108  if (r != ERROR_SUCCESS)
109  break;
110 
111  if (Val == 0 && dwType == REG_DWORD)
112  {
113  pidl = _ILCreateGuidFromStrW(iid);
114  if (pidl != NULL)
115  {
116  if (!HasItemWithCLSID(pidl))
117  AddToEnumList(pidl);
118  else
119  SHFree(pidl);
120  }
121  }
122  }
123  RegCloseKey(hkey);
124  }
125 
126  HRESULT WINAPI Initialize(DWORD dwFlags,IEnumIDList * pRegEnumerator, IEnumIDList *pDesktopEnumerator, IEnumIDList *pCommonDesktopEnumerator)
127  {
128  BOOL ret = TRUE;
129  LPITEMIDLIST pidl;
130 
131  static const WCHAR MyDocumentsClassString[] = L"{450D8FBA-AD25-11D0-98A8-0800361B1103}";
132 
133  TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
134 
135  /* enumerate the root folders */
136  if (dwFlags & SHCONTF_FOLDERS)
137  {
139  if (IsNamespaceExtensionHidden(MyDocumentsClassString) < 1)
141 
142  DWORD dwFetched;
143  while((S_OK == pRegEnumerator->Next(1, &pidl, &dwFetched)) && dwFetched)
144  {
145  if (IsNamespaceExtensionHidden(pidl) < 1)
146  {
147  if (!HasItemWithCLSID(pidl))
148  AddToEnumList(pidl);
149  else
150  SHFree(pidl);
151  }
152  }
155  }
156 
157  /* Enumerate the items in the two fs folders */
158  AppendItemsFromEnumerator(pDesktopEnumerator);
159  AppendItemsFromEnumerator(pCommonDesktopEnumerator);
160 
161  return ret ? S_OK : E_FAIL;
162  }
163 
164 
166  COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
167  END_COM_MAP()
168 };
169 
170 int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll);
171 
172 static const shvheader DesktopSFHeader[] = {
179 };
180 
181 #define DESKTOPSHELLVIEWCOLUMNS 6
182 
184  SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
185  SFGAO_STORAGEANCESTOR | SFGAO_HASPROPSHEET | SFGAO_STORAGE;
187  SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
188  SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_CANLINK;
190  SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
191  SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_CANLINK;
192 
194  sPathTarget(NULL),
195  pidlRoot(NULL)
196 {
197 }
198 
200 {
201 }
202 
204 {
205  WCHAR szMyPath[MAX_PATH];
206  HRESULT hr;
207 
208  /* Create the root pidl */
210  if (!pidlRoot)
211  return E_OUTOFMEMORY;
212 
213  /* Create the inner fs folder */
215  &CLSID_ShellFSFolder,
218  if (FAILED_UNEXPECTEDLY(hr))
219  return hr;
220 
221  /* Create the inner shared fs folder. Dont fail on failure. */
223  &CLSID_ShellFSFolder,
226  if (FAILED_UNEXPECTEDLY(hr))
227  return hr;
228 
229  /* Create the inner reg folder */
230  hr = CRegFolder_CreateInstance(&CLSID_ShellDesktop,
231  pidlRoot,
232  L"",
233  L"Desktop",
235  if (FAILED_UNEXPECTEDLY(hr))
236  return hr;
237 
238  /* Cache the path to the user desktop directory */
240  return E_UNEXPECTED;
241 
242  sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR));
243  if (!sPathTarget)
244  return E_OUTOFMEMORY;
245 
246  wcscpy(sPathTarget, szMyPath);
247  return S_OK;
248 }
249 
251 {
252  WCHAR szFileName[MAX_PATH];
253 
254  if (_ILIsSpecialFolder(pidl))
255  return m_regFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
256 
257  lstrcpynW(szFileName, sPathTarget, MAX_PATH - 1);
258  PathAddBackslashW(szFileName);
259  int cLen = wcslen(szFileName);
260 
261  if (!_ILSimpleGetTextW(pidl, szFileName + cLen, MAX_PATH - cLen))
262  return E_FAIL;
263 
264  if (GetFileAttributes(szFileName) == INVALID_FILE_ATTRIBUTES)
265  return m_SharedDesktopFSFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
266  else
267  return m_DesktopFSFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
268 }
269 
270 /**************************************************************************
271  * CDesktopFolder::ParseDisplayName
272  *
273  * NOTES
274  * "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and "" binds
275  * to MyComputer
276  */
278  HWND hwndOwner,
279  LPBC pbc,
280  LPOLESTR lpszDisplayName,
281  DWORD *pchEaten,
282  PIDLIST_RELATIVE *ppidl,
283  DWORD *pdwAttributes)
284 {
285  LPCWSTR szNext = NULL;
286  LPITEMIDLIST pidlTemp = NULL;
287  PARSEDURLW urldata;
288  HRESULT hr = S_OK;
289 
290  TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
291  this, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName),
292  pchEaten, ppidl, pdwAttributes);
293 
294  if (!ppidl)
295  return E_INVALIDARG;
296 
297  *ppidl = NULL;
298 
299  if (!lpszDisplayName)
300  return E_INVALIDARG;
301 
302  if (pchEaten)
303  *pchEaten = 0; /* strange but like the original */
304 
305  urldata.cbSize = sizeof(urldata);
306 
307  if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
308  {
309  return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes);
310  }
311  else if (PathGetDriveNumberW (lpszDisplayName) >= 0)
312  {
313  /* it's a filesystem path with a drive. Let MyComputer/UnixDosFolder parse it */
314  pidlTemp = _ILCreateMyComputer ();
315  szNext = lpszDisplayName;
316  }
317  else if (PathIsUNCW(lpszDisplayName))
318  {
319  pidlTemp = _ILCreateNetwork();
320  szNext = lpszDisplayName;
321  }
322  else if( (pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName)) )
323  {
324  *ppidl = pidlTemp;
325  return S_OK;
326  }
327  else if (SUCCEEDED(ParseURLW(lpszDisplayName, &urldata)))
328  {
329  if (urldata.nScheme == URL_SCHEME_SHELL) /* handle shell: urls */
330  {
331  TRACE ("-- shell url: %s\n", debugstr_w(urldata.pszSuffix));
332  pidlTemp = _ILCreateGuidFromStrW(urldata.pszSuffix + 2);
333  }
334  else
335  return IEParseDisplayNameWithBCW(CP_ACP, lpszDisplayName, pbc, ppidl);
336  }
337  else
338  {
339  if (*lpszDisplayName)
340  {
341  /* it's a filesystem path on the desktop. Let a FSFolder parse it */
342  hr = m_DesktopFSFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes);
343  if (SUCCEEDED(hr))
344  return hr;
345 
346  return m_SharedDesktopFSFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes);
347  }
348  else
349  pidlTemp = _ILCreateMyComputer();
350 
351  szNext = NULL;
352  }
353 
354  if (SUCCEEDED(hr) && pidlTemp)
355  {
356  if (szNext && *szNext)
357  {
358  hr = SHELL32_ParseNextElement(this, hwndOwner, pbc,
359  &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
360  }
361  else
362  {
363  if (pdwAttributes && *pdwAttributes)
364  {
365  GetAttributesOf(1, &pidlTemp, pdwAttributes);
366  }
367  }
368  }
369 
370  if (SUCCEEDED(hr))
371  *ppidl = pidlTemp;
372  else
373  *ppidl = NULL;
374 
375  TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
376 
377  return hr;
378 }
379 
380 /**************************************************************************
381  * CDesktopFolder::EnumObjects
382  */
383 HRESULT WINAPI CDesktopFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
384 {
385  CComPtr<IEnumIDList> pRegEnumerator;
386  CComPtr<IEnumIDList> pDesktopEnumerator;
387  CComPtr<IEnumIDList> pCommonDesktopEnumerator;
388  HRESULT hr;
389 
390  hr = m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
391  if (FAILED(hr))
392  ERR("EnumObjects for reg folder failed\n");
393 
394  hr = m_DesktopFSFolder->EnumObjects(hwndOwner, dwFlags, &pDesktopEnumerator);
395  if (FAILED(hr))
396  ERR("EnumObjects for desktop fs folder failed\n");
397 
398  hr = m_SharedDesktopFSFolder->EnumObjects(hwndOwner, dwFlags, &pCommonDesktopEnumerator);
399  if (FAILED(hr))
400  ERR("EnumObjects for shared desktop fs folder failed\n");
401 
402  return ShellObjectCreatorInit<CDesktopFolderEnum>(dwFlags,pRegEnumerator, pDesktopEnumerator, pCommonDesktopEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
403 }
404 
405 /**************************************************************************
406  * CDesktopFolder::BindToObject
407  */
409  PCUIDLIST_RELATIVE pidl,
410  LPBC pbcReserved,
411  REFIID riid,
412  LPVOID *ppvOut)
413 {
414  if (!pidl)
415  return E_INVALIDARG;
416 
417  CComPtr<IShellFolder2> psf;
418  HRESULT hr = _GetSFFromPidl(pidl, &psf);
419  if (FAILED_UNEXPECTEDLY(hr))
420  return hr;
421 
422  return psf->BindToObject(pidl, pbcReserved, riid, ppvOut);
423 }
424 
425 /**************************************************************************
426  * CDesktopFolder::BindToStorage
427  */
429  PCUIDLIST_RELATIVE pidl,
430  LPBC pbcReserved,
431  REFIID riid,
432  LPVOID *ppvOut)
433 {
434  FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n",
435  this, pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
436 
437  *ppvOut = NULL;
438  return E_NOTIMPL;
439 }
440 
441 /**************************************************************************
442  * CDesktopFolder::CompareIDs
443  */
445 {
446  bool bIsDesktopFolder1, bIsDesktopFolder2;
447 
448  if (!pidl1 || !pidl2)
449  {
450  ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
451  return E_INVALIDARG;
452  }
453 
454  bIsDesktopFolder1 = _ILIsDesktop(pidl1);
455  bIsDesktopFolder2 = _ILIsDesktop(pidl2);
456  if (bIsDesktopFolder1 || bIsDesktopFolder2)
457  return MAKE_COMPARE_HRESULT(bIsDesktopFolder1 - bIsDesktopFolder2);
458 
459  if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
460  return m_regFolder->CompareIDs(lParam, pidl1, pidl2);
461 
462  return m_DesktopFSFolder->CompareIDs(lParam, pidl1, pidl2);
463 }
464 
465 /**************************************************************************
466  * CDesktopFolder::CreateViewObject
467  */
469  HWND hwndOwner,
470  REFIID riid,
471  LPVOID *ppvOut)
472 {
474 
475  TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
476  this, hwndOwner, shdebugstr_guid (&riid), ppvOut);
477 
478  if (!ppvOut)
479  return hr;
480 
481  *ppvOut = NULL;
482 
483  if (IsEqualIID (riid, IID_IDropTarget))
484  {
485  hr = m_DesktopFSFolder->CreateViewObject(hwndOwner, riid, ppvOut);
486  }
487  else if (IsEqualIID (riid, IID_IContextMenu))
488  {
489  HKEY hKeys[16];
490  UINT cKeys = 0;
491  AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
492 
493  DEFCONTEXTMENU dcm;
494  dcm.hwnd = hwndOwner;
495  dcm.pcmcb = this;
496  dcm.pidlFolder = pidlRoot;
497  dcm.psf = this;
498  dcm.cidl = 0;
499  dcm.apidl = NULL;
500  dcm.cKeys = cKeys;
501  dcm.aKeys = hKeys;
503  hr = SHCreateDefaultContextMenu (&dcm, riid, ppvOut);
504  }
505  else if (IsEqualIID (riid, IID_IShellView))
506  {
507  SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
508  hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
509  }
510  TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
511  return hr;
512 }
513 
514 /**************************************************************************
515  * CDesktopFolder::GetAttributesOf
516  */
518  UINT cidl,
519  PCUITEMID_CHILD_ARRAY apidl,
520  DWORD *rgfInOut)
521 {
522  HRESULT hr = S_OK;
523 
524  TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
525  this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
526 
527  if (cidl && !apidl)
528  return E_INVALIDARG;
529 
530  if (*rgfInOut == 0)
531  *rgfInOut = ~0;
532 
533  if(cidl == 0)
534  *rgfInOut &= dwDesktopAttributes;
535  else
536  {
537  /* TODO: always add SFGAO_CANLINK */
538  for (UINT i = 0; i < cidl; ++i)
539  {
540  pdump(*apidl);
541  if (_ILIsDesktop(*apidl))
542  *rgfInOut &= dwDesktopAttributes;
543  else if (_ILIsMyComputer(apidl[i]))
544  *rgfInOut &= dwMyComputerAttributes;
545  else if (_ILIsNetHood(apidl[i]))
546  *rgfInOut &= dwMyNetPlacesAttributes;
547  else if (_ILIsFolder(apidl[i]) || _ILIsValue(apidl[i]) || _ILIsSpecialFolder(apidl[i]))
548  {
549  CComPtr<IShellFolder2> psf;
550  HRESULT hr = _GetSFFromPidl(apidl[i], &psf);
551  if (FAILED_UNEXPECTEDLY(hr))
552  continue;
553 
554  psf->GetAttributesOf(1, &apidl[i], rgfInOut);
555  }
556  else
557  ERR("Got an unknown pidl type!!!\n");
558  }
559  }
560  /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
561  *rgfInOut &= ~SFGAO_VALIDATE;
562 
563  TRACE("-- result=0x%08x\n", *rgfInOut);
564 
565  return hr;
566 }
567 
568 /**************************************************************************
569  * CDesktopFolder::GetUIObjectOf
570  *
571  * PARAMETERS
572  * HWND hwndOwner, //[in ] Parent window for any output
573  * UINT cidl, //[in ] array size
574  * LPCITEMIDLIST* apidl, //[in ] simple pidl array
575  * REFIID riid, //[in ] Requested Interface
576  * UINT* prgfInOut, //[ ] reserved
577  * LPVOID* ppvObject) //[out] Resulting Interface
578  *
579  */
581  HWND hwndOwner,
582  UINT cidl,
583  PCUITEMID_CHILD_ARRAY apidl,
584  REFIID riid,
585  UINT *prgfInOut,
586  LPVOID *ppvOut)
587 {
588  LPVOID pObj = NULL;
590 
591  TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
592  this, hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
593 
594  if (!ppvOut)
595  return hr;
596 
597  *ppvOut = NULL;
598 
599  if (cidl == 1 && !_ILIsSpecialFolder(apidl[0]))
600  {
601  CComPtr<IShellFolder2> psf;
602  HRESULT hr = _GetSFFromPidl(apidl[0], &psf);
603  if (FAILED_UNEXPECTEDLY(hr))
604  return hr;
605 
606  return psf->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut);
607  }
608 
609  if (IsEqualIID (riid, IID_IContextMenu))
610  {
611  if (_ILIsSpecialFolder(apidl[0]))
612  {
613  hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
614  }
615  else
616  {
617  /* Do not use the context menu of the CFSFolder here. */
618  /* We need to pass a pointer of the CDesktopFolder so as the data object that the context menu gets is rooted to the desktop */
619  /* Otherwise operations like that involve items from both user and shared desktop will not work */
620  HKEY hKeys[16];
621  UINT cKeys = 0;
622  AddFSClassKeysToArray(apidl[0], hKeys, &cKeys);
623 
624  DEFCONTEXTMENU dcm;
625  dcm.hwnd = hwndOwner;
626  dcm.pcmcb = this;
627  dcm.pidlFolder = pidlRoot;
628  dcm.psf = this;
629  dcm.cidl = cidl;
630  dcm.apidl = apidl;
631  dcm.cKeys = cKeys;
632  dcm.aKeys = hKeys;
634  hr = SHCreateDefaultContextMenu (&dcm, riid, &pObj);
635  }
636  }
637  else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
638  {
639  hr = IDataObject_Constructor( hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj);
640  }
641  else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
642  {
643  hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
644  }
645  else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
646  {
647  CComPtr<IShellFolder> psfChild;
648  hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, &psfChild));
649  if (FAILED_UNEXPECTEDLY(hr))
650  return hr;
651 
652  return psfChild->CreateViewObject(NULL, riid, ppvOut);
653  }
654  else
655  hr = E_NOINTERFACE;
656 
657  if (SUCCEEDED(hr) && !pObj)
658  hr = E_OUTOFMEMORY;
659 
660  *ppvOut = pObj;
661  TRACE ("(%p)->hr=0x%08x\n", this, hr);
662  return hr;
663 }
664 
665 /**************************************************************************
666  * CDesktopFolder::GetDisplayNameOf
667  *
668  * NOTES
669  * special case: pidl = null gives desktop-name back
670  */
672 {
673  TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
674  pdump (pidl);
675 
676  if (!strRet)
677  return E_INVALIDARG;
678 
679  if (!_ILIsPidlSimple (pidl))
680  {
681  return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
682  }
683  else if (_ILIsDesktop(pidl))
684  {
686  return SHSetStrRet(strRet, sPathTarget);
687  else
688  return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
689  }
690 
691  /* file system folder or file rooted at the desktop */
692  CComPtr<IShellFolder2> psf;
693  HRESULT hr = _GetSFFromPidl(pidl, &psf);
694  if (FAILED_UNEXPECTEDLY(hr))
695  return hr;
696 
697  return psf->GetDisplayNameOf(pidl, dwFlags, strRet);
698 }
699 
700 /**************************************************************************
701  * CDesktopFolder::SetNameOf
702  * Changes the name of a file object or subfolder, possibly changing its item
703  * identifier in the process.
704  *
705  * PARAMETERS
706  * HWND hwndOwner, //[in ] Owner window for output
707  * LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
708  * LPCOLESTR lpszName, //[in ] the items new display name
709  * DWORD dwFlags, //[in ] SHGNO formatting flags
710  * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
711  */
713  HWND hwndOwner,
714  PCUITEMID_CHILD pidl, /* simple pidl */
715  LPCOLESTR lpName,
716  DWORD dwFlags,
717  PITEMID_CHILD *pPidlOut)
718 {
719  CComPtr<IShellFolder2> psf;
720  HRESULT hr = _GetSFFromPidl(pidl, &psf);
721  if (FAILED_UNEXPECTEDLY(hr))
722  return hr;
723 
724  return psf->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
725 }
726 
728 {
729  FIXME ("(%p)\n", this);
730  return E_NOTIMPL;
731 }
732 
734 {
735  FIXME ("(%p)\n", this);
736  return E_NOTIMPL;
737 }
738 
740 {
741  TRACE ("(%p)\n", this);
742 
743  if (pSort)
744  *pSort = 0;
745  if (pDisplay)
746  *pDisplay = 0;
747 
748  return S_OK;
749 }
750 
752 {
753  TRACE ("(%p)\n", this);
754 
755  if (!pcsFlags || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
756  return E_INVALIDARG;
757 
758  *pcsFlags = DesktopSFHeader[iColumn].pcsFlags;
759 
760  return S_OK;
761 }
762 
764  PCUITEMID_CHILD pidl,
765  const SHCOLUMNID *pscid,
766  VARIANT *pv)
767 {
768  FIXME ("(%p)\n", this);
769 
770  return E_NOTIMPL;
771 }
772 
774  PCUITEMID_CHILD pidl,
775  UINT iColumn,
776  SHELLDETAILS *psd)
777 {
778  if (!psd || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
779  return E_INVALIDARG;
780 
781  if (!pidl)
782  {
783  psd->fmt = DesktopSFHeader[iColumn].fmt;
784  psd->cxChar = DesktopSFHeader[iColumn].cxChar;
785  return SHSetStrRet(&psd->str, DesktopSFHeader[iColumn].colnameid);
786  }
787 
788  CComPtr<IShellFolder2> psf;
789  HRESULT hr = _GetSFFromPidl(pidl, &psf);
790  if (FAILED_UNEXPECTEDLY(hr))
791  return hr;
792 
793  hr = psf->GetDetailsOf(pidl, iColumn, psd);
794  if (FAILED_UNEXPECTEDLY(hr))
795  return hr;
796 
797  return hr;
798 }
799 
801 {
802  FIXME ("(%p)\n", this);
803  return E_NOTIMPL;
804 }
805 
807 {
808  TRACE ("(%p)\n", this);
809 
810  if (!lpClassId)
811  return E_POINTER;
812 
813  *lpClassId = CLSID_ShellDesktop;
814 
815  return S_OK;
816 }
817 
819 {
820  TRACE ("(%p)->(%p)\n", this, pidl);
821 
822  if (!pidl)
823  return S_OK;
824 
825  return E_INVALIDARG;
826 }
827 
829 {
830  TRACE ("(%p)->(%p)\n", this, pidl);
831 
832  if (!pidl)
833  return E_INVALIDARG; /* xp doesn't have this check and crashes on NULL */
834  *pidl = ILClone (pidlRoot);
835  return S_OK;
836 }
837 
839 {
840  if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
841  return S_OK;
842 
843  /* no data object means no selection */
844  if (!pdtobj)
845  {
846  if (uMsg == DFM_INVOKECOMMAND && wParam == 0)
847  {
848  if (32 >= (UINT_PTR)ShellExecuteW(hwndOwner, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL))
849  return E_FAIL;
850  return S_OK;
851  }
852  else if (uMsg == DFM_MERGECONTEXTMENU)
853  {
854  QCMINFO *pqcminfo = (QCMINFO *)lParam;
855  HMENU hpopup = CreatePopupMenu();
857  Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu++, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
858  DestroyMenu(hpopup);
859  }
860 
861  return S_OK;
862  }
863 
864  if (uMsg != DFM_INVOKECOMMAND || wParam != DFM_CMD_PROPERTIES)
865  return S_OK;
866 
867  return Shell_DefaultContextMenuCallBack(this, pdtobj);
868 }
869 
870 /*************************************************************************
871  * SHGetDesktopFolder [SHELL32.@]
872  */
874 {
875  HRESULT hres = S_OK;
876  TRACE("\n");
877 
878  if(!psf) return E_INVALIDARG;
879  *psf = NULL;
880  hres = CDesktopFolder::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellFolder, psf));
881 
882  TRACE("-- %p->(%p)\n",psf, *psf);
883  return hres;
884 }
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1975
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
#define IDS_SHV_COLUMN_COMMENTS
Definition: shresdef.h:61
UINT idCmdLast
Definition: shlobj.h:1309
static const DWORD dwDesktopAttributes
static HICON
Definition: imagelist.c:84
#define MFT_STRING
Definition: winuser.h:741
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
#define E_NOINTERFACE
Definition: winerror.h:2364
LPITEMIDLIST _ILCreateDesktop(void)
Definition: pidl.c:1588
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:857
HRESULT WINAPI Initialize(DWORD dwFlags, IEnumIDList *pRegEnumerator, IEnumIDList *pDesktopEnumerator, IEnumIDList *pCommonDesktopEnumerator)
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
const HKEY * aKeys
Definition: shlobj.h:2348
interface IBindCtx * LPBC
Definition: objfwd.h:18
#define CSIDL_COMMON_DESKTOPDIRECTORY
Definition: shlobj.h:2027
#define GET_SHGDN_RELATION(dwFlags)
Definition: precomp.h:53
BOOL HasItemWithCLSID(LPITEMIDLIST pidl)
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] LPITEMIDLIST *rgelt, [out] ULONG *pceltFetched)
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1906
#define KEY_READ
Definition: nt_native.h:1023
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
BOOL _ILIsNetHood(LPCITEMIDLIST pidl)
Definition: pidl.c:1895
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
BOOL AddToEnumList(LPITEMIDLIST pidl)
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
#define CP_ACP
Definition: compat.h:99
DWORD cbSize
Definition: shlwapi.h:1432
HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl)
Definition: shdocvw_main.c:471
#define HKEY_CURRENT_USER
Definition: winreg.h:11
HRESULT WINAPI Shell_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdtobj)
Definition: shlfolder.cpp:450
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv)
#define CHARS_IN_GUID
void AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:267
#define LVCFMT_RIGHT
Definition: commctrl.h:2571
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
IContextMenuCB * pcmcb
Definition: shlobj.h:2341
_In_ LPCSTR lpName
Definition: winbase.h:2729
HWND hWnd
Definition: settings.c:17
HMENU hmenu
Definition: shlobj.h:1306
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
#define LVCFMT_LEFT
Definition: commctrl.h:2570
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
virtual HRESULT WINAPI Initialize(LPCITEMIDLIST pidl)
void AddItemsFromClassicStartMenuKey(HKEY hKeyRoot)
const GUID IID_IDataObject
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:380
UINT_PTR WPARAM
Definition: windef.h:207
LPCWSTR pszSuffix
Definition: shlwapi.h:1435
#define IDS_PROPERTIES
Definition: resource.h:101
CComPtr< IShellFolder2 > m_DesktopFSFolder
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
static LPOLESTR
Definition: stg_prop.c:27
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, IDataObject **dataObject)
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3446
static const WCHAR ClassicStartMenuW[]
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
#define DWORD
Definition: nt_native.h:44
STRRET str
Definition: shtypes.idl:108
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
#define IDS_SHV_COLUMN_TYPE
Definition: resource.h:75
#define lstrcpynW
Definition: compat.h:397
#define IDS_SHV_COLUMN_SIZE
Definition: shresdef.h:44
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
IShellFolder * psf
Definition: shlobj.h:2343
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define MFS_ENABLED
Definition: winuser.h:745
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define GET_SHGDN_FOR(dwFlags)
Definition: precomp.h:52
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
int codepage
Definition: win_iconv.c:156
#define E_INVALIDARG
Definition: ddrawi.h:101
#define DESKTOPSHELLVIEWCOLUMNS
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1951
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:2867
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
smooth NULL
Definition: ftsmooth.c:416
HRESULT SHELL32_CoCreateInitSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidlChild, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:121
_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:426
LONG_PTR LPARAM
Definition: windef.h:208
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
UINT indexMenu
Definition: shlobj.h:1307
CComPtr< IShellFolder2 > m_SharedDesktopFSFolder
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:197
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2082
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum)
struct _SFV_CREATE SFV_CREATE
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1599
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
#define RRF_RT_DWORD
Definition: driver.c:581
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
HRESULT SHELL32_ParseNextElement(IShellFolder2 *psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST *pidlInOut, LPOLESTR szNext, DWORD *pEaten, DWORD *pdwAttributes)
Definition: shlfolder.cpp:70
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID)
Definition: pidl.c:1711
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
HRESULT CRegFolder_CreateInstance(const GUID *pGuid, LPCITEMIDLIST pidlRoot, LPCWSTR lpszPath, LPCWSTR lpszEnumKeyName, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:759
int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll)
Definition: shlfileop.cpp:208
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
#define TRACE(s)
Definition: solgame.cpp:4
virtual HRESULT WINAPI GetCurFolder(LPITEMIDLIST *pidl)
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT hres
Definition: protocol.c:465
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MM_ADDSEPARATOR
Definition: shlobj.h:2319
LONG HRESULT
Definition: typedefs.h:77
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2300
LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path)
Definition: CFSFolder.cpp:460
UINT idCmdFirst
Definition: shlobj.h:1308
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2389
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
static __inline int SHELL32_GUIDToStringW(REFGUID guid, LPWSTR str)
Definition: shfldr.h:81
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI GetClassID(CLSID *lpClassId)
UINT nScheme
Definition: shlwapi.h:1437
int ret
HRESULT WINAPI ParseURLW(LPCWSTR x, PARSEDURLW *y)
Definition: url.c:197
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
REFCLSID clsid
Definition: msctf.c:84
static const WCHAR L[]
Definition: oid.c:1250
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:1960
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
WINE_DEFAULT_DEBUG_CHANNEL(shell)
#define IDS_SHV_COLUMN_MODIFIED
Definition: shresdef.h:46
#define GetFileAttributes
Definition: winbase.h:3629
BOOL WINAPI DestroyMenu(_In_ HMENU)
static INT IsNamespaceExtensionHidden(const WCHAR *iid)
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
#define ERR(fmt,...)
Definition: debug.h:109
LPITEMIDLIST _ILCreateNetwork(void)
Definition: pidl.c:1655
#define S_OK
Definition: intsafe.h:59
#define SW_SHOWNORMAL
Definition: winuser.h:764
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:2566
static const DWORD dwMyComputerAttributes
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
HICON hIcon
Definition: msconfig.c:44
void AddFSClassKeysToArray(PCUITEMID_CHILD pidl, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:281
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
static const shvheader DesktopSFHeader[]
#define E_NOTIMPL
Definition: ddrawi.h:99
LPITEMIDLIST pidlRoot
static DWORD dwMyNetPlacesAttributes
unsigned int UINT
Definition: ndis.h:50
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
CComPtr< IShellFolder2 > m_regFolder
int WINAPI PathGetDriveNumberW(const WCHAR *path)
Definition: path.c:548
#define E_UNEXPECTED
Definition: winerror.h:2456
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2236
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
IUnknown * punkAssociationInfo
Definition: shlobj.h:2346
HRESULT _GetSFFromPidl(LPCITEMIDLIST pidl, IShellFolder2 **psf)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define CSIDL_DESKTOPDIRECTORY
Definition: shlobj.h:2018
#define END_COM_MAP()
Definition: atlcom.h:552
#define IDS_SHV_COLUMN_NAME
Definition: resource.h:74
BOOL WINAPI PathIsUNCW(LPCWSTR lpszPath)
Definition: path.c:2245
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPITEMIDLIST _ILCreateMyDocuments(void)
Definition: pidl.c:1605
virtual HRESULT WINAPI CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define E_POINTER
Definition: winerror.h:2365
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2345
#define REG_DWORD
Definition: sdbapi.c:596
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
HRESULT WINAPI FinalConstruct()
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2342
LPARAM lParam
Definition: combotst.c:139
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define IDS_SHV_COLUMN_ATTRIBUTES
Definition: shresdef.h:47
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12