ReactOS  0.4.13-dev-259-g5ca9c9c
CMergedFolder.cpp
Go to the documentation of this file.
1 /*
2  * Shell Menu Site
3  *
4  * Copyright 2014 David Quintana
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 #include "shellmenu.h"
21 #include <atlwin.h>
22 #include <shlwapi_undoc.h>
23 
24 #include "CMergedFolder.h"
25 
27 
29 {
35 };
36 
38  public CComObjectRootEx<CComMultiThreadModelNoCS>,
39  public IEnumIDList
40 {
41 
42 private:
43  CComPtr<IShellFolder> m_UserLocalFolder;
44  CComPtr<IShellFolder> m_AllUSersFolder;
45 
48 
52 
53 public:
55  virtual ~CEnumMergedFolder();
56 
59 
61  COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
62  END_COM_MAP()
63 
65 
66  static int CALLBACK s_DsaDeleteCallback(void *pItem, void *pData);
67 
68  HRESULT SetSources(IShellFolder * userLocal, IShellFolder * allUSers);
69  HRESULT Begin(HWND hwndOwner, SHCONTF flags);
70  HRESULT FindPidlInList(HWND hwndOwner, LPCITEMIDLIST pcidl, LocalPidlInfo * pinfo);
71  HRESULT FindByName(HWND hwndOwner, LPCWSTR strParsingName, LocalPidlInfo * pinfo);
72 
74  ULONG celt,
75  LPITEMIDLIST *rgelt,
76  ULONG *pceltFetched);
77 
78  virtual HRESULT STDMETHODCALLTYPE Skip(ULONG celt);
80  virtual HRESULT STDMETHODCALLTYPE Clone(IEnumIDList **ppenum);
81 };
82 
87  m_Flags(0),
88  m_hDsa(NULL),
89  m_hDsaIndex(0),
90  m_hDsaCount(0)
91 {
92 }
93 
95 {
97 }
98 
100 {
101  ILFree(info->pidl);
102  if (info->pidl2)
103  ILFree(info->pidl2);
104  CoTaskMemFree((LPVOID)info->parseName);
105  return 0;
106 }
107 
109 {
111  LocalPidlInfo * item = (LocalPidlInfo*) pItem;
112  return mf->DsaDeleteCallback(item);
113 }
114 
116 {
117  m_UserLocalFolder = userLocal;
118  m_AllUSersFolder = allUSers;
119 
120  TRACE("SetSources %p %p\n", userLocal, allUSers);
121  return S_OK;
122 }
123 
125 {
126  HRESULT hr;
127  LPITEMIDLIST pidl = NULL;
128 
129  if (m_hDsa && m_HwndOwner == hwndOwner && m_Flags == flags)
130  {
131  return Reset();
132  }
133 
134  TRACE("Search conditions changed, recreating list...\n");
135 
136  CComPtr<IEnumIDList> userLocal;
137  CComPtr<IEnumIDList> allUsers;
138 
139  hr = m_UserLocalFolder->EnumObjects(hwndOwner, flags, &userLocal);
140  if (FAILED_UNEXPECTEDLY(hr))
141  return hr;
142  hr = m_AllUSersFolder->EnumObjects(hwndOwner, flags, &allUsers);
143  if (FAILED_UNEXPECTEDLY(hr))
144  return hr;
145 
146  if (!m_hDsa)
147  {
148  m_hDsa = DSA_Create(sizeof(LocalPidlInfo), 10);
149  }
150 
153  m_hDsaCount = 0;
154 
155  // The sources are not ordered so load all of the items for the user folder first
156  TRACE("Loading Local entries...\n");
157  for (;;)
158  {
159  hr = userLocal->Next(1, &pidl, NULL);
160  if (FAILED_UNEXPECTEDLY(hr))
161  return hr;
162 
163  if (hr == S_FALSE)
164  break;
165 
166  LPWSTR name;
167  STRRET str = { STRRET_WSTR };
168  hr = m_UserLocalFolder->GetDisplayNameOf(pidl, SHGDN_FORPARSING | SHGDN_INFOLDER, &str);
169  if (FAILED(hr))
170  return hr;
171  StrRetToStrW(&str, pidl, &name);
172 
173  LocalPidlInfo info = {
174  FALSE,
176  ILClone(pidl),
177  NULL,
178  name
179  };
180 
181  ILFree(pidl);
182 
183  TRACE("Inserting item %d with name %S\n", m_hDsaCount, name);
185  TRACE("New index: %d\n", idx);
186 
187  m_hDsaCount++;
188  }
189 
190  // Then load the items for the common folder
191  TRACE("Loading Common entries...\n");
192  for (;;)
193  {
194  hr = allUsers->Next(1, &pidl, NULL);
195  if (FAILED_UNEXPECTEDLY(hr))
196  return hr;
197 
198  if (hr == S_FALSE)
199  break;
200 
201  LPWSTR name;
202  STRRET str = { STRRET_WSTR };
203  hr = m_AllUSersFolder->GetDisplayNameOf(pidl, SHGDN_FORPARSING | SHGDN_INFOLDER, &str);
204  if (FAILED(hr))
205  return hr;
206  StrRetToStrW(&str, pidl, &name);
207 
208  LocalPidlInfo info = {
209  FALSE,
211  ILClone(pidl),
212  NULL,
213  name
214  };
215 
216  ILFree(pidl);
217 
218  // Try to find an existing entry with the same name, and makr it as shared.
219  // FIXME: This is sub-optimal, a hash table would be a lot more efficient.
220  BOOL bShared = FALSE;
221  for (int i = 0; i < (int)m_hDsaCount; i++)
222  {
224 
226  pInfo->parseName, lstrlenW(pInfo->parseName),
227  info.parseName, lstrlenW(info.parseName));
228 
229  if (order == CSTR_EQUAL)
230  {
231  TRACE("Item name already exists! Marking '%S' as shared ...\n", name);
232  bShared = TRUE;
233  pInfo->shared = TRUE;
234  pInfo->pidl2 = info.pidl;
236  break;
237  }
238  }
239 
240  // If an entry was not found, add a new one for this item
241  if (!bShared)
242  {
243  TRACE("Inserting item %d with name %S\n", m_hDsaCount, name);
245  TRACE("New index: %d\n", idx);
246 
247  m_hDsaCount++;
248  }
249  }
250 
251  m_HwndOwner = hwndOwner;
252  m_Flags = flags;
253 
254  return Reset();
255 }
256 
258 {
259  HRESULT hr;
260 
261  if (!m_hDsa)
262  {
263  Begin(hwndOwner, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS);
264  }
265 
266  TRACE("Searching for pidl { cb=%d } in a list of %d items\n", pcidl->mkid.cb, m_hDsaCount);
267 
268  for (int i = 0; i < (int)m_hDsaCount; i++)
269  {
271  if (!pInfo)
272  return E_FAIL;
273 
274  TRACE("Comparing with item at %d with parent %p and pidl { cb=%d }\n", i, pInfo->parent, pInfo->pidl->mkid.cb);
275 
276  hr = pInfo->parent->CompareIDs(0, pInfo->pidl, pcidl);
277  if (FAILED_UNEXPECTEDLY(hr))
278  return hr;
279 
280  if (hr == S_OK)
281  {
282  *pinfo = *pInfo;
283  return S_OK;
284  }
285  else
286  {
287  TRACE("Comparison returned %d\n", (int) (short) (hr & 0xFFFF));
288  }
289  }
290 
291  TRACE("Pidl not found\n");
293 }
294 
296 {
297  if (!m_hDsa)
298  {
299  Begin(hwndOwner, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS);
300  }
301 
302  TRACE("Searching for '%S' in a list of %d items\n", strParsingName, m_hDsaCount);
303 
304  for (int i = 0; i < (int) m_hDsaCount; i++)
305  {
307  if (!pInfo)
308  return E_FAIL;
309 
311  pInfo->parseName, lstrlenW(pInfo->parseName),
312  strParsingName, lstrlenW(strParsingName));
313  switch (order)
314  {
315  case CSTR_EQUAL:
316  *pinfo = *pInfo;
317  return S_OK;
318  default:
319  continue;
320  }
321  }
322 
323  TRACE("Pidl not found\n");
325 }
326 
328  ULONG celt,
329  LPITEMIDLIST *rgelt,
330  ULONG *pceltFetched)
331 {
332  if (pceltFetched)
333  *pceltFetched = 0;
334 
335  if (m_hDsaIndex == m_hDsaCount)
336  return S_FALSE;
337 
338  for (int i = 0; i < (int)celt;)
339  {
341  if (!tinfo)
342  return E_FAIL;
343 
344  LocalPidlInfo info = *tinfo;
345 
346  TRACE("Returning next item at %d with parent %p and pidl { cb=%d }\n", m_hDsaIndex, info.parent, info.pidl->mkid.cb);
347 
348  // FIXME: ILClone shouldn't be needed here! This should be causing leaks
349  if (rgelt) rgelt[i] = ILClone(info.pidl);
350  i++;
351 
352  m_hDsaIndex++;
353  if (m_hDsaIndex == m_hDsaCount)
354  {
355  if (pceltFetched)
356  *pceltFetched = i;
357  return (i == (int)celt) ? S_OK : S_FALSE;
358  }
359  }
360 
361  if (pceltFetched) *pceltFetched = celt;
362  return S_OK;
363 }
364 
366 {
367  return Next(celt, NULL, NULL);
368 }
369 
371 {
372  m_hDsaIndex = 0;
373  return S_OK;
374 }
375 
377  IEnumIDList **ppenum)
378 {
380  return E_NOTIMPL;
381 }
382 
383 //-----------------------------------------------------------------------------
384 // CMergedFolder
385 
387  m_UserLocal(NULL),
388  m_AllUsers(NULL),
389  m_EnumSource(NULL),
390  m_UserLocalPidl(NULL),
391  m_AllUsersPidl(NULL),
392  m_shellPidl(NULL)
393 {
394 }
395 
397 {
400 }
401 
402 // IAugmentedShellFolder2
404 {
405  if (lpGuid)
406  {
407  TRACE("FIXME: No idea how to handle the GUID\n");
408  return E_NOTIMPL;
409  }
410 
411  TRACE("AddNameSpace %p %p\n", m_UserLocal.p, m_AllUsers.p);
412 
413  // FIXME: Use a DSA to store the list of merged namespaces, together with their related info (psf, pidl, ...)
414  // For now, assume only 2 will ever be used, and ignore all the other data.
415  if (!m_UserLocal)
416  {
417  m_UserLocal = psf;
418  m_UserLocalPidl = ILClone(pcidl);
419  return S_OK;
420  }
421 
422  if (m_AllUsers)
423  return E_FAIL;
424 
425  m_AllUsers = psf;
426  m_AllUsersPidl = ILClone(pcidl);
427 
428  m_EnumSource = new CComObject<CEnumMergedFolder>();
429  return m_EnumSource->SetSources(m_UserLocal, m_AllUsers);
430 }
431 
433 {
435  return E_NOTIMPL;
436 }
437 
439 {
441  return E_NOTIMPL;
442 }
443 
445 {
447  return E_NOTIMPL;
448 }
449 
451 {
453  return E_NOTIMPL;
454 }
455 
456 // IShellFolder
458  HWND hwndOwner,
459  LPBC pbcReserved,
460  LPOLESTR lpszDisplayName,
461  ULONG *pchEaten,
462  LPITEMIDLIST *ppidl,
463  ULONG *pdwAttributes)
464 {
465  HRESULT hr;
467 
468  if (!ppidl)
469  return E_FAIL;
470 
471  if (pchEaten)
472  *pchEaten = 0;
473 
474  if (pdwAttributes)
475  *pdwAttributes = 0;
476 
477  TRACE("ParseDisplayName name=%S\n", lpszDisplayName);
478 
479  hr = m_EnumSource->FindByName(hwndOwner, lpszDisplayName, &info);
480  if (FAILED(hr))
481  {
483  }
484 
485  *ppidl = ILClone(info.pidl);
486 
487  if (pchEaten)
488  *pchEaten = lstrlenW(info.parseName);
489 
490  if (pdwAttributes)
491  *pdwAttributes = info.parent->GetAttributesOf(1, (LPCITEMIDLIST*)ppidl, pdwAttributes);
492 
493  return S_OK;
494 }
495 
497  HWND hwndOwner,
498  SHCONTF grfFlags,
499  IEnumIDList **ppenumIDList)
500 {
501  TRACE("EnumObjects\n");
502  HRESULT hr = m_EnumSource->QueryInterface(IID_PPV_ARG(IEnumIDList, ppenumIDList));
503  if (FAILED_UNEXPECTEDLY(hr))
504  return hr;
505  return m_EnumSource->Begin(hwndOwner, grfFlags);
506 }
507 
509  LPCITEMIDLIST pidl,
510  LPBC pbcReserved,
511  REFIID riid,
512  void **ppvOut)
513 {
515  HRESULT hr;
516 
517  hr = m_EnumSource->FindPidlInList(NULL, pidl, &info);
518  if (FAILED_UNEXPECTEDLY(hr))
519  return hr;
520 
521  TRACE("BindToObject shared = %d\n", info.shared);
522 
523  if (!info.shared)
524  return info.parent->BindToObject(info.pidl, pbcReserved, riid, ppvOut);
525 
526  if (riid != IID_IShellFolder)
527  return E_FAIL;
528 
529  // Construct a child MergedFolder and return it
530  CComPtr<IShellFolder> fld1;
531  CComPtr<IShellFolder> fld2;
532 
533  // In shared folders, the user one takes precedence over the common one, so it will always be on pidl1
534  hr = m_UserLocal->BindToObject(info.pidl, pbcReserved, IID_PPV_ARG(IShellFolder, &fld1));
535  if (FAILED_UNEXPECTEDLY(hr))
536  return hr;
537 
538  hr = m_AllUsers->BindToObject(info.pidl2, pbcReserved, IID_PPV_ARG(IShellFolder, &fld2));
539  if (FAILED_UNEXPECTEDLY(hr))
540  return hr;
541 
542  CComPtr<IAugmentedShellFolder> pasf;
543  hr = CMergedFolder_CreateInstance(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
544  if (FAILED_UNEXPECTEDLY(hr))
545  return hr;
546 
547  hr = pasf->QueryInterface(riid, ppvOut);
548  if (FAILED_UNEXPECTEDLY(hr))
549  return hr;
550 
551  hr = pasf->AddNameSpace(NULL, fld1, info.pidl, 0xFF00);
552  if (FAILED_UNEXPECTEDLY(hr))
553  return hr;
554 
555  hr = pasf->AddNameSpace(NULL, fld2, info.pidl2, 0x0000);
556  if (FAILED_UNEXPECTEDLY(hr))
557  return hr;
558 
559  return hr;
560 }
561 
563  LPCITEMIDLIST pidl,
564  LPBC pbcReserved,
565  REFIID riid,
566  void **ppvObj)
567 {
569  return E_NOTIMPL;
570 }
571 
573  LPARAM lParam,
574  LPCITEMIDLIST pidl1,
575  LPCITEMIDLIST pidl2)
576 {
577  TRACE("CompareIDs\n");
578  return m_UserLocal->CompareIDs(lParam, pidl1, pidl2);
579 }
580 
582  HWND hwndOwner,
583  REFIID riid,
584  void **ppvOut)
585 {
587  return E_NOTIMPL;
588 }
589 
591  UINT cidl,
592  PCUITEMID_CHILD_ARRAY apidl,
593  SFGAOF *rgfInOut)
594 {
596  HRESULT hr;
597 
598  TRACE("GetAttributesOf\n");
599 
600  for (int i = 0; i < (int)cidl; i++)
601  {
602  LPCITEMIDLIST pidl = apidl[i];
603 
604  hr = m_EnumSource->FindPidlInList(NULL, pidl, &info);
605  if (FAILED_UNEXPECTEDLY(hr))
606  return hr;
607 
608  pidl = info.pidl;
609 
610  SFGAOF * pinOut1 = rgfInOut ? rgfInOut + i : NULL;
611 
612  hr = info.parent->GetAttributesOf(1, &pidl, pinOut1);
613 
614  if (FAILED_UNEXPECTEDLY(hr))
615  return hr;
616  }
617 
618  return S_OK;
619 }
620 
622  HWND hwndOwner,
623  UINT cidl,
624  PCUITEMID_CHILD_ARRAY apidl,
625  REFIID riid,
626  UINT *prgfInOut,
627  void **ppvOut)
628 {
630  HRESULT hr;
631 
632  TRACE("GetUIObjectOf\n");
633 
634  for (int i = 0; i < (int)cidl; i++)
635  {
636  LPCITEMIDLIST pidl = apidl[i];
637 
638  TRACE("Processing GetUIObjectOf item %d of %u...\n", i, cidl);
639 
640  hr = m_EnumSource->FindPidlInList(hwndOwner, pidl, &info);
641  if (FAILED_UNEXPECTEDLY(hr))
642  return hr;
643 
644  pidl = info.pidl;
645 
646  TRACE("FindPidlInList succeeded with parent %p and pidl { db=%d }\n", info.parent, info.pidl->mkid.cb);
647 
648  UINT * pinOut1 = prgfInOut ? prgfInOut+i : NULL;
649  void** ppvOut1 = ppvOut ? ppvOut + i : NULL;
650 
651  hr = info.parent->GetUIObjectOf(hwndOwner, 1, &pidl, riid, pinOut1, ppvOut1);
652 
653  if (FAILED_UNEXPECTEDLY(hr))
654  return hr;
655  }
656 
657  return S_OK;
658 }
659 
661  LPCITEMIDLIST pidl,
662  SHGDNF uFlags,
663  STRRET *lpName)
664 {
666  HRESULT hr;
667 
668  TRACE("GetDisplayNameOf\n");
669 
670  hr = m_EnumSource->FindPidlInList(NULL, pidl, &info);
671  if (FAILED_UNEXPECTEDLY(hr))
672  return hr;
673 
674  hr = info.parent->GetDisplayNameOf(info.pidl, uFlags, lpName);
675 
676  if (FAILED_UNEXPECTEDLY(hr))
677  return hr;
678  return S_OK;
679 }
680 
682  HWND hwnd,
683  LPCITEMIDLIST pidl,
684  LPCOLESTR lpszName,
685  SHGDNF uFlags,
686  LPITEMIDLIST *ppidlOut)
687 {
689  return E_NOTIMPL;
690 }
691 
692 // IPersist
694 {
696  return E_NOTIMPL;
697 }
698 
699 // IPersistFolder
701 {
702  m_shellPidl = ILClone(pidl);
703  return S_OK;
704 }
705 
706 // IPersistFolder2
708 {
709  if (pidl)
710  *pidl = m_shellPidl;
711  return S_OK;
712 }
713 
714 // IShellFolder2
716  GUID *lpguid)
717 {
719  return E_NOTIMPL;
720 }
721 
723  IEnumExtraSearch **ppenum)
724 {
726  return E_NOTIMPL;
727 }
728 
731  ULONG *pSort,
732  ULONG *pDisplay)
733 {
735  return E_NOTIMPL;
736 }
737 
739  UINT iColumn,
740  SHCOLSTATEF *pcsFlags)
741 {
743  return E_NOTIMPL;
744 }
745 
747  LPCITEMIDLIST pidl,
748  const SHCOLUMNID *pscid,
749  VARIANT *pv)
750 {
752  HRESULT hr;
753 
754  TRACE("GetDetailsEx\n");
755 
756  hr = m_EnumSource->FindPidlInList(NULL, pidl, &info);
757  if (FAILED_UNEXPECTEDLY(hr))
758  return hr;
759 
760  CComPtr<IShellFolder2> parent2;
761  hr = info.parent->QueryInterface(IID_PPV_ARG(IShellFolder2, &parent2));
762  if (FAILED_UNEXPECTEDLY(hr))
763  return hr;
764 
765  hr = parent2->GetDetailsEx(info.pidl, pscid, pv);
766  if (FAILED_UNEXPECTEDLY(hr))
767  return hr;
768  return S_OK;
769 }
770 
772  LPCITEMIDLIST pidl,
773  UINT iColumn,
774  SHELLDETAILS *psd)
775 {
777  HRESULT hr;
778 
779  TRACE("GetDetailsOf\n");
780 
781  hr = m_EnumSource->FindPidlInList(NULL, pidl, &info);
782  if (FAILED_UNEXPECTEDLY(hr))
783  return hr;
784 
785  CComPtr<IShellFolder2> parent2;
786  hr = info.parent->QueryInterface(IID_PPV_ARG(IShellFolder2, &parent2));
787  if (FAILED_UNEXPECTEDLY(hr))
788  return hr;
789 
790  hr = parent2->GetDetailsOf(info.pidl, iColumn, psd);
791 
792  if (FAILED_UNEXPECTEDLY(hr))
793  return hr;
794  return S_OK;
795 }
796 
798  UINT iColumn,
799  SHCOLUMNID *pscid)
800 {
802  return E_NOTIMPL;
803 }
804 
805 // IAugmentedShellFolder3
807 {
809  return E_NOTIMPL;
810 }
811 
812 extern "C"
814 {
815  return ShellObjectCreator<CMergedFolder>(riid, ppv);
816 }
virtual HRESULT STDMETHODCALLTYPE Reset()
virtual HRESULT STDMETHODCALLTYPE GetDefaultSearchGUID(GUID *lpguid)
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
virtual HRESULT STDMETHODCALLTYPE GetCurFolder(LPITEMIDLIST *pidl)
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
virtual HRESULT STDMETHODCALLTYPE GetDefaultColumnState(UINT iColumn, SHCOLSTATEF *pcsFlags)
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT Begin(HWND hwndOwner, SHCONTF flags)
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
interface IBindCtx * LPBC
Definition: objfwd.h:18
virtual HRESULT STDMETHODCALLTYPE Clone(IEnumIDList **ppenum)
IShellFolder * parent
REFIID riid
Definition: precomp.h:44
WINE_DEFAULT_DEBUG_CHANNEL(CMergedFolder)
virtual HRESULT STDMETHODCALLTYPE GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, SFGAOF *rgfInOut)
VOID WINAPI DSA_EnumCallback(HDSA hdsa, PFNDSAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dsa.c:397
CComPtr< IShellFolder > m_UserLocal
Definition: CMergedFolder.h:63
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
HRESULT FindPidlInList(HWND hwndOwner, LPCITEMIDLIST pcidl, LocalPidlInfo *pinfo)
#define CALLBACK
Definition: compat.h:27
_In_ LPCSTR lpName
Definition: winbase.h:2729
virtual HRESULT STDMETHODCALLTYPE EnumNameSpace(ULONG dwUnknown, PULONG lpUnknown)
REFIID LPVOID * ppv
Definition: atlbase.h:39
virtual HRESULT STDMETHODCALLTYPE UnWrapIDList(LPCITEMIDLIST pcidl, LONG lUnknown, IShellFolder **ppsf, LPITEMIDLIST *ppidl1, LPITEMIDLIST *ppidl2, LONG *lpUnknown)
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
virtual HRESULT STDMETHODCALLTYPE SetNameOf(HWND hwnd, LPCITEMIDLIST pidl, LPCOLESTR lpszName, SHGDNF uFlags, LPITEMIDLIST *ppidlOut)
#define NORM_IGNORECASE
Definition: winnls.h:173
UINT uFlags
Definition: api.c:60
virtual HRESULT STDMETHODCALLTYPE Next(ULONG celt, LPITEMIDLIST *rgelt, ULONG *pceltFetched)
static LPOLESTR
Definition: stg_prop.c:27
#define lstrlenW
Definition: compat.h:407
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
DWORD SHCONTF
Definition: shobjidl.idl:182
virtual HRESULT STDMETHODCALLTYPE CreateViewObject(HWND hwndOwner, REFIID riid, void **ppvOut)
struct _test_info info[]
Definition: SetCursorPos.c:19
HRESULT CompareIDs([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
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
CComPtr< IShellFolder > m_AllUsers
Definition: CMergedFolder.h:64
Definition: dsa.c:44
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
unsigned int idx
Definition: utils.c:41
#define S_FALSE
Definition: winerror.h:2357
const WCHAR * str
LPITEMIDLIST m_shellPidl
Definition: CMergedFolder.h:69
smooth NULL
Definition: ftsmooth.c:416
HDSA WINAPI DSA_Create(INT nSize, INT nGrow)
Definition: dsa.c:71
virtual HRESULT STDMETHODCALLTYPE GetDefaultColumn(DWORD dwReserved, ULONG *pSort, ULONG *pDisplay)
LONG_PTR LPARAM
Definition: windef.h:208
LPITEMIDLIST m_UserLocalPidl
Definition: CMergedFolder.h:67
#define CMergedFolder_CreateInstance
Definition: shellmenu.h:93
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
HRESULT WINAPI RSHELL_CMergedFolder_CreateInstance(REFIID riid, LPVOID *ppv)
virtual HRESULT STDMETHODCALLTYPE GetDetailsOf(LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS *psd)
virtual HRESULT STDMETHODCALLTYPE GetDisplayNameOf(LPCITEMIDLIST pidl, SHGDNF uFlags, STRRET *lpName)
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
Definition: lang.c:2275
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
#define TRACE(s)
Definition: solgame.cpp:4
CComPtr< IShellFolder > m_AllUSersFolder
virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidl)
HRESULT FindByName(HWND hwndOwner, LPCWSTR strParsingName, LocalPidlInfo *pinfo)
BOOL WINAPI DSA_DeleteAllItems(HDSA hdsa)
Definition: dsa.c:367
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
#define WINAPI
Definition: msvc.h:8
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT SetSources(IShellFolder *userLocal, IShellFolder *allUSers)
GLbitfield flags
Definition: glext.h:7161
virtual HRESULT STDMETHODCALLTYPE GetDetailsEx(LPCITEMIDLIST pidl, const SHCOLUMNID *pscid, VARIANT *pv)
DWORD SHCOLSTATEF
Definition: shtypes.idl:142
virtual HRESULT STDMETHODCALLTYPE Skip(ULONG celt)
#define DSA_APPEND
Definition: commctrl.h:4758
#define CSTR_EQUAL
Definition: winnls.h:453
LPITEMIDLIST pidl
CComPtr< CEnumMergedFolder > m_EnumSource
Definition: CMergedFolder.h:65
SFGAO_STORAGEANCESTOR typedef ULONG SFGAOF
Definition: shobjidl.idl:213
void WINAPI DSA_DestroyCallback(HDSA hdsa, PFNDSAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dsa.c:432
virtual HRESULT STDMETHODCALLTYPE EnumObjects(HWND hwndOwner, SHCONTF grfFlags, IEnumIDList **ppenumIDList)
#define S_OK
Definition: intsafe.h:59
static ATOM item
Definition: dde.c:856
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
virtual HRESULT STDMETHODCALLTYPE BindToObject(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvOut)
#define E_NOTIMPL
Definition: ddrawi.h:99
virtual HRESULT STDMETHODCALLTYPE CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
virtual HRESULT STDMETHODCALLTYPE AddNameSpace(LPGUID lpGuid, IShellFolder *psf, LPCITEMIDLIST pcidl, ULONG dwUnknown)
LPVOID WINAPI DSA_GetItemPtr(HDSA hdsa, INT nIndex)
Definition: dsa.c:162
virtual HRESULT STDMETHODCALLTYPE MapColumnToSCID(UINT iColumn, SHCOLUMNID *pscid)
LPITEMIDLIST m_AllUsersPidl
Definition: CMergedFolder.h:68
unsigned int * PULONG
Definition: retypes.h:1
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *lpClassId)
unsigned int UINT
Definition: ndis.h:50
virtual HRESULT STDMETHODCALLTYPE ParseDisplayName(HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName, ULONG *pchEaten, LPITEMIDLIST *ppidl, ULONG *pdwAttributes)
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
virtual HRESULT STDMETHODCALLTYPE EnumSearches(IEnumExtraSearch **ppenum)
Definition: name.c:36
virtual HRESULT STDMETHODCALLTYPE QueryNameSpace2(ULONG, QUERYNAMESPACEINFO *)
virtual ~CMergedFolder()
unsigned int ULONG
Definition: retypes.h:1
LPITEMIDLIST pidl2
#define UNIMPLEMENTED
Definition: debug.h:114
virtual ~CEnumMergedFolder()
virtual HRESULT STDMETHODCALLTYPE BindToStorage(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvObj)
#define END_COM_MAP()
Definition: atlcom.h:552
INT WINAPI DSA_InsertItem(HDSA hdsa, INT nIndex, LPVOID pSrc)
Definition: dsa.c:251
WCHAR * LPWSTR
Definition: xmlstorage.h:184
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
int DsaDeleteCallback(LocalPidlInfo *info)
virtual HRESULT STDMETHODCALLTYPE QueryNameSpace(ULONG dwUnknown, LPGUID lpGuid, IShellFolder **ppsf)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
static int CALLBACK s_DsaDeleteCallback(void *pItem, void *pData)
virtual HRESULT STDMETHODCALLTYPE GetNameSpaceID(LPCITEMIDLIST pcidl, LPGUID lpGuid)
LPARAM lParam
Definition: combotst.c:139
static SHCONTF
Definition: ordinal.c:61
virtual HRESULT STDMETHODCALLTYPE GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, void **ppvOut)
LCID WINAPI GetThreadLocale(void)
Definition: lang.c:1449
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
CComPtr< IShellFolder > m_UserLocalFolder
HRESULT WINAPI StrRetToStrW(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPWSTR *ppszName)
Definition: string.c:1623
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
DWORD SHGDNF
Definition: shobjidl.idl:169
GLuint const GLchar * name
Definition: glext.h:6031