ReactOS 0.4.16-dev-329-g9223134
CRegFolder.cpp
Go to the documentation of this file.
1/*
2 * ReactOS Shell
3 *
4 * Copyright 2016 Giannis Adamopoulos
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 Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 * The required-regitem design is based on the research by Geoff Chappell
21 * https://www.geoffchappell.com/studies/windows/shell/shell32/classes/regfolder.htm
22 */
23
24#include <precomp.h>
25
27
28#define DEFAULTSORTORDERINDEX 0x80 // The default for registry items according to Geoff Chappell
29
32
34{
35 return type == PT_CONTROLS_NEWREGITEM ? 14 : 4;
36}
37
39{
40#if 1 // FIXME: CControlPanelFolder is not ready for this yet
41 if (type == PT_CONTROLS_NEWREGITEM)
42 type = PT_CONTROLS_OLDREGITEM;
43#endif
45 const UINT cb = offset + sizeof(CLSID), cbTotal = cb + sizeof(WORD);
46 LPITEMIDLIST pidl = (LPITEMIDLIST)SHAlloc(cbTotal);
47 if (pidl)
48 {
49 ZeroMemory(pidl, cbTotal); // Note: This also initializes the terminator WORD
50 pidl->mkid.cb = cb;
51 pidl->mkid.abID[0] = type;
52 pidl->mkid.abID[1] = order;
53 *(CLSID*)(SIZE_T(pidl) + offset) = clsid;
54 }
55 return pidl;
56}
57
59{
61 return SUCCEEDED(CLSIDFromString(clsidstr, &clsid)) ? CreateRegItem(type, clsid) : NULL;
62}
63
65{
66 WCHAR xriid[CHARS_IN_GUID];
67 StringFromGUID2(*riid, xriid, _countof(xriid));
68 return StringCchPrintfW(KeyName, KeySize, RegPath, xriid);
69}
70
72{
74 wcscpy(Path, L"CLSID\\");
75 StringFromGUID2(clsid, Path + 6, 39);
76 if (SubKey)
77 {
78 wcscpy(Path + 6 + 38, L"\\");
79 wcscpy(Path + 6 + 39, SubKey);
80 }
82}
83
85{
86 return SHELL_QueryCLSIDValue(clsid, L"ShellFolder", Value, NULL, NULL) == ERROR_SUCCESS;
87}
88
90{
92
94 {
95 m_pInfo = pInfo;
96 }
97
98 const CLSID* IsRegItem(LPCITEMIDLIST pidl) const
99 {
100 if (pidl && pidl->mkid.cb >= sizeof(WORD) + 1 + 1 + sizeof(GUID))
101 {
102 if (pidl->mkid.abID[0] == m_pInfo->PidlType)
103 return (CLSID*)(SIZE_T(pidl) + GetCLSIDOffset());
104 if (pidl->mkid.abID[0] == PT_CONTROLS_OLDREGITEM)
105 return (CLSID*)(SIZE_T(pidl) + GetRegItemCLSIDOffset(PT_CONTROLS_OLDREGITEM));
106 }
107 if (const IID* pIID = _ILGetGUIDPointer(pidl))
108 {
109 FIXME("Unexpected GUID PIDL type %#x\n", pidl->mkid.abID[0]);
110 return pIID; // FIXME: Remove this when all folders have been fixed
111 }
112 return NULL;
113 }
114
116 {
117 const REQUIREDREGITEM &item = GetAt(i);
118 return CreateRegItem(GetPidlType(), item.clsid, item.Order);
119 }
120
125 const REQUIREDREGITEM& GetAt(size_t i) const { return m_pInfo->Items[i]; }
126};
127
129{
130 CComPtr<IDefaultExtractIconInit> initIcon;
131 HRESULT hr;
132 GUID const * riid;
133 int icon_idx;
134 WCHAR wTemp[MAX_PATH];
135
137 if (FAILED(hr))
138 return hr;
139
140 if (_ILIsDesktop(pidl))
141 {
142 initIcon->SetNormalIcon(swShell32Name, -IDI_SHELL_DESKTOP);
143 return initIcon->QueryInterface(iid, ppvOut);
144 }
145
146 riid = _ILGetGUIDPointer(pidl);
147 if (!riid)
148 return E_FAIL;
149
150 /* Choose a correct icon for Recycle Bin (full or empty) */
151 const WCHAR* iconname = NULL;
152 if (_ILIsBitBucket(pidl))
153 {
154 CComPtr<IEnumIDList> EnumIDList;
156
157 CComPtr<IShellFolder2> psfRecycleBin;
158 CComPtr<IShellFolder> psfDesktop;
159 hr = SHGetDesktopFolder(&psfDesktop);
160
161 if (SUCCEEDED(hr))
162 hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder2, &psfRecycleBin));
163 if (SUCCEEDED(hr))
164 hr = psfRecycleBin->EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &EnumIDList);
165
166 ULONG itemcount;
167 LPITEMIDLIST pidl = NULL;
168 if (SUCCEEDED(hr) && (hr = EnumIDList->Next(1, &pidl, &itemcount)) == S_OK)
169 {
170 CoTaskMemFree(pidl);
171 iconname = L"Full";
172 } else {
173 iconname = L"Empty";
174 }
175 }
176
177 /* Prepare registry path for loading icons of My Computer and other shell extensions */
179
181 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s",
182 riid);
184 return hr;
185
186 /* Load icon for the current user */
187 BOOL ret = HCU_GetIconW(KeyName, wTemp, iconname, _countof(wTemp), &icon_idx);
188 if (!ret)
189 {
190 /* Failed, load default system-wide icon */
191 hr = FormatGUIDKey(KeyName, _countof(KeyName), L"CLSID\\%s", riid);
193 return hr;
194
195 ret = HCR_GetIconW(KeyName, wTemp, iconname, _countof(wTemp), &icon_idx);
196 }
197
198 if (ret)
199 {
200 /* Success, set loaded icon */
201 initIcon->SetNormalIcon(wTemp, icon_idx);
202 }
203 else
204 {
205 /* Everything has failed, set blank paper icon */
206 WARN("Failed to load an icon for the item, setting blank icon\n");
207 initIcon->SetNormalIcon(swShell32Name, IDI_SHELL_DOCUMENT - 1);
208 }
209
210 return initIcon->QueryInterface(iid, ppvOut);
211}
212
214 public CEnumIDListBase,
215 public CRegFolderInfo
216{
218 public:
220 HRESULT AddItemsFromKey(IShellFolder *pSF, HKEY hkey_root, LPCWSTR szRepPath);
221
222 const CLSID* GetPidlClsid(PCUITEMID_CHILD pidl) { return IsRegItem(pidl); }
223 BOOL HasItemWithCLSID(LPCITEMIDLIST pidl) { return HasItemWithCLSIDImpl<CRegFolderEnum>(pidl); }
224
226 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
228};
229
231{
234 if (!(dwFlags & SHCONTF_FOLDERS))
235 return S_OK;
236
239 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\%s\\Namespace",
240 pInfo->pszEnumKeyName);
242 return hr;
243
244 // First add the required items and then the items from the registry
246 for (size_t i = 0; i < GetRequiredItemsCount(); ++i)
247 {
248 LPITEMIDLIST pidl = CreateItem(i);
249 if (pidl && SHELL_IncludeItemInFolderEnum(pSF, pidl, query, m_SHCTF))
250 AddToEnumList(pidl);
251 else
252 ILFree(pidl);
253 }
256 return S_OK;
257}
258
260{
262 HKEY hkey;
263
264 if (RegOpenKeyW(hkey_root, szRepPath, &hkey) != ERROR_SUCCESS)
265 return S_FALSE;
266
267 for (int idx = 0; ; idx++)
268 {
269 if (RegEnumKeyW(hkey, idx, name, MAX_PATH) != ERROR_SUCCESS)
270 break;
271
272 /* If the name of the key is not a guid try to get the default value of the key */
273 if (name[0] != L'{')
274 {
275 DWORD dwSize = sizeof(name);
277 }
278
279 if (*name == '{')
280 {
282 {
285 AddToEnumList(pidl);
286 else
287 ILFree(pidl);
288 }
289 }
290 }
291 RegCloseKey(hkey);
292
293 return S_OK;
294}
295
296/*
297 * These columns try to map to CFSFolder's columns because the CDesktopFolder
298 * displays CFSFolder and CRegFolder items in the same view.
299 */
301{
307
309 public CComObjectRootEx<CComMultiThreadModelNoCS>,
310 public IShellFolder2,
311 public CRegFolderInfo
312{
313 private:
314 IShellFolder *m_pOuterFolder; // Not ref-counted
315 CComHeapPtr<ITEMIDLIST> m_pidlRoot;
316
319
320 public:
321 CRegFolder();
322 ~CRegFolder();
324
326 {
327 const CLSID* const pCLSID = IsRegItem(pidl);
328 for (size_t i = 0; pCLSID && i < GetRequiredItemsCount(); ++i)
329 {
330 const REQUIREDREGITEM &item = GetAt(i);
331 if (item.clsid == *pCLSID)
332 return &item;
333 }
334 return NULL;
335 }
336
337 // IShellFolder
338 STDMETHOD(ParseDisplayName)(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes) override;
339 STDMETHOD(EnumObjects)(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override;
340 STDMETHOD(BindToObject)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
341 STDMETHOD(BindToStorage)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
343 STDMETHOD(CreateViewObject)(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override;
344 STDMETHOD(GetAttributesOf)(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override;
345 STDMETHOD(GetUIObjectOf)(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) override;
347 STDMETHOD(SetNameOf)(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override;
348
349 /* ShellFolder2 */
350 STDMETHOD(GetDefaultSearchGUID)(GUID *pguid) override;
351 STDMETHOD(EnumSearches)(IEnumExtraSearch **ppenum) override;
352 STDMETHOD(GetDefaultColumn)(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override;
353 STDMETHOD(GetDefaultColumnState)(UINT iColumn, DWORD *pcsFlags) override;
354 STDMETHOD(GetDetailsEx)(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override;
355 STDMETHOD(GetDetailsOf)(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override;
356 STDMETHOD(MapColumnToSCID)(UINT column, SHCOLUMNID *pscid) override;
357
359
361
363 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
364 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
366};
367
369{
370}
371
373{
374}
375
377{
379 m_pOuterFolder = pInit->psfOuter;
380
381 m_pidlRoot.Attach(ILClone(pidlRoot));
382 if (!m_pidlRoot)
383 return E_OUTOFMEMORY;
384
385 return S_OK;
386}
387
389{
390 DWORD dwAttributes = *pdwAttributes;
391
392 /* First try to get them from the registry */
393 if (!HCR_GetFolderAttributes(pidl, pdwAttributes))
394 {
395 /* We couldn't get anything */
396 *pdwAttributes = 0;
397 }
398
399 /* Items have more attributes when on desktop */
401 {
402 *pdwAttributes |= (dwAttributes & (SFGAO_CANLINK|SFGAO_CANDELETE|SFGAO_CANRENAME|SFGAO_HASPROPSHEET));
403 }
404
405 /* In any case, links can be created */
406 *pdwAttributes |= (dwAttributes & SFGAO_CANLINK);
407 return S_OK;
408}
409
411{
413 if (IsEqualGUID(clsid, CLSID_Printers))
414 return TRUE;
415 if (IsEqualGUID(clsid, CLSID_NetworkConnections))
416 return TRUE;
417 FIXME("Check registry\n");
418 return TRUE;
419}
420
422 ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
423{
424 if (!ppidl)
425 return E_INVALIDARG;
426
427 *ppidl = NULL;
428
429 if (!lpszDisplayName)
430 return E_INVALIDARG;
431
432 if (lpszDisplayName[0] != L':' || lpszDisplayName[1] != L':')
433 {
434 FIXME("What should we do here?\n");
435 return E_FAIL;
436 }
437
438 LPWSTR pch, pchNextOfComma = NULL;
439 for (pch = &lpszDisplayName[2]; *pch && *pch != L'\\'; ++pch)
440 {
441 if (*pch == L',' && !pchNextOfComma)
442 pchNextOfComma = pch + 1;
443 }
444
445 CLSID clsid;
446 if (!GUIDFromStringW(&lpszDisplayName[2], &clsid))
447 return CO_E_CLASSSTRING;
448
449 if (pchNextOfComma)
450 {
451 FIXME("Delegate folder\n");
452 return E_FAIL;
453 }
454
455 CComHeapPtr<ITEMIDLIST> pidlTemp(CreateRegItem(GetPidlType(), clsid));
456 if (!pidlTemp)
457 return E_OUTOFMEMORY;
458
459 if (!_IsInNameSpace(pidlTemp) && !(BindCtx_GetMode(pbc, 0) & STGM_CREATE))
460 return E_INVALIDARG;
461
462 *ppidl = pidlTemp.Detach();
463
464 if (!*pch)
465 {
466 if (pdwAttributes && *pdwAttributes)
467 GetGuidItemAttributes(*ppidl, pdwAttributes);
468
469 return S_OK;
470 }
471
472 HRESULT hr = SHELL32_ParseNextElement(this, hwndOwner, pbc, ppidl, pch + 1, pchEaten,
473 pdwAttributes);
474 if (FAILED(hr))
475 {
476 ILFree(*ppidl);
477 *ppidl = NULL;
478 }
479 return hr;
480}
481
482HRESULT WINAPI CRegFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
483{
484 return ShellObjectCreatorInit<CRegFolderEnum>(m_pInfo, m_pOuterFolder, dwFlags,
485 IID_PPV_ARG(IEnumIDList, ppEnumIDList));
486}
487
489{
490 CComPtr<IPersistFolder> pFolder;
491 HRESULT hr;
492
493 if (!ppvOut || !pidl || !pidl->mkid.cb)
494 return E_INVALIDARG;
495
496 *ppvOut = NULL;
497
498 GUID *pGUID = _ILGetGUIDPointer(pidl);
499 if (!pGUID)
500 {
501 ERR("CRegFolder::BindToObject called for non guid item!\n");
502 return E_INVALIDARG;
503 }
504
505 hr = SHELL32_BindToSF(m_pidlRoot, NULL, pidl, pGUID, riid, ppvOut);
507 return hr;
508
509 return S_OK;
510}
511
513{
514 return E_NOTIMPL;
515}
516
518{
519 if (!pidl1 || !pidl2 || pidl1->mkid.cb == 0 || pidl2->mkid.cb == 0)
520 {
521 ERR("Got an empty pidl!\n");
522 return E_INVALIDARG;
523 }
524
525 GUID const *clsid1 = _ILGetGUIDPointer (pidl1);
526 GUID const *clsid2 = _ILGetGUIDPointer (pidl2);
527
528 if (!clsid1 && !clsid2)
529 {
530 ERR("Got no guid pidl!\n");
531 return E_INVALIDARG;
532 }
533 else if (clsid1 && clsid2)
534 {
535 if (memcmp(clsid1, clsid2, sizeof(GUID)) == 0)
536 return SHELL32_CompareChildren(this, lParam, pidl1, pidl2);
537
538 return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
539 }
540
541 /* Guid folders come first compared to everything else */
542 /* And Drives come before folders in My Computer */
544 return MAKE_COMPARE_HRESULT(clsid1 ? 1 : -1);
545 else
546 return MAKE_COMPARE_HRESULT(clsid1 ? -1 : 1);
547}
548
550{
551 return E_NOTIMPL;
552}
553
555{
556 if (!rgfInOut || !cidl || !apidl)
557 return E_INVALIDARG;
558
559 if (*rgfInOut == 0)
560 *rgfInOut = ~0;
561
562 while(cidl > 0 && *apidl)
563 {
564 if (_ILIsSpecialFolder(*apidl))
565 GetGuidItemAttributes(*apidl, rgfInOut);
566 else
567 ERR("Got unknown pidl\n");
568 apidl++;
569 cidl--;
570 }
571
572 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
573 *rgfInOut &= ~SFGAO_VALIDATE;
574
575 return S_OK;
576}
577
579 REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
580{
581 LPVOID pObj = NULL;
583
584 if (!ppvOut)
585 return hr;
586
587 *ppvOut = NULL;
588
589 if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
590 {
591 hr = CGuidItemExtractIcon_CreateInstance(apidl[0], riid, &pObj);
592 }
593 else if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
594 {
595 if (!_ILGetGUIDPointer (apidl[0]))
596 {
597 ERR("Got non guid item!\n");
598 return E_FAIL;
599 }
600
601 hr = CRegItemContextMenu_CreateInstance(m_pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), (IContextMenu**)&pObj);
602 }
603 else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
604 {
605 hr = IDataObject_Constructor (hwndOwner, m_pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
606 }
607 else
608 {
610 }
611
612 *ppvOut = pObj;
613 return hr;
614
615}
616
618{
619 if (!strRet || (!_ILIsSpecialFolder(pidl) && pidl != NULL))
620 return E_INVALIDARG;
621
622 if (!pidl || !pidl->mkid.cb)
623 {
625 {
627 {
628 TRACE("GDNO returning INFOLDER instead of %#x\n", GET_SHGDN_RELATION(dwFlags));
629 }
630 LPWSTR pszPath = (LPWSTR)CoTaskMemAlloc((2 + 38 + 1) * sizeof(WCHAR));
631 if (!pszPath)
632 return E_OUTOFMEMORY;
633 /* parsing name like ::{...} */
634 pszPath[0] = ':';
635 pszPath[1] = ':';
636 SHELL32_GUIDToStringW(m_pInfo->clsid, &pszPath[2]);
637 strRet->uType = STRRET_WSTR;
638 strRet->pOleStr = pszPath;
639 return S_OK;
640 }
641 else
642 {
643 BOOL bRet;
644 WCHAR wstrName[MAX_PATH+1];
645 bRet = HCR_GetClassNameW(m_pInfo->clsid, wstrName, MAX_PATH);
646 if (!bRet)
647 return E_FAIL;
648
649 return SHSetStrRet(strRet, wstrName);
650 }
651 }
652
653 HRESULT hr;
654 GUID const *clsid = _ILGetGUIDPointer (pidl);
655
656 /* First of all check if we need to query the name from the child item */
659 {
660 int bWantsForParsing = FALSE;
661
662 /*
663 * We can only get a filesystem path from a shellfolder if the
664 * value WantsFORPARSING in CLSID\\{...}\\shellfolder exists.
665 *
666 * Exception: The MyComputer folder doesn't have this key,
667 * but any other filesystem backed folder it needs it.
668 */
669 if (IsEqualIID (*clsid, CLSID_MyComputer))
670 {
671 bWantsForParsing = TRUE;
672 }
673 else
674 {
675 HKEY hkeyClass;
676 if (HCR_RegOpenClassIDKey(*clsid, &hkeyClass))
677 {
678 LONG res = SHGetValueW(hkeyClass, L"Shellfolder", L"WantsForParsing", NULL, NULL, NULL);
679 bWantsForParsing = (res == ERROR_SUCCESS);
680 RegCloseKey(hkeyClass);
681 }
682 }
683
684 if (bWantsForParsing)
685 {
686 /*
687 * we need the filesystem path to the destination folder.
688 * Only the folder itself can know it
689 */
690 return SHELL32_GetDisplayNameOfChild (this, pidl, dwFlags, strRet);
691 }
692 }
693
694 /* Allocate the buffer for the result */
695 SIZE_T cchPath = MAX_PATH + 1;
696 LPWSTR pszPath = (LPWSTR)CoTaskMemAlloc(cchPath * sizeof(WCHAR));
697 if (!pszPath)
698 return E_OUTOFMEMORY;
699
700 hr = S_OK;
701
703 {
704 SIZE_T pathlen = 0;
705 PWCHAR pItemName = pszPath; // GET_SHGDN_RELATION(dwFlags) == SHGDN_INFOLDER
707 {
708 hr = StringCchCopyW(pszPath, cchPath, GetParsingPath());
709 if (SUCCEEDED(hr))
710 {
711 pathlen = wcslen(pszPath);
712 pItemName = &pszPath[pathlen];
713 if (pathlen)
714 {
715 if (++pathlen < cchPath)
716 *pItemName++ = L'\\';
717 else
719 }
720 }
721 }
722
723 if (SUCCEEDED(hr) && pathlen + 2 + 38 + 1 < cchPath)
724 {
725 /* parsing name like ::{...} */
726 pItemName[0] = L':';
727 pItemName[1] = L':';
728 SHELL32_GUIDToStringW(*clsid, &pItemName[2]);
729 }
730 else
731 {
733 }
734 }
735 else
736 {
737 /* user friendly name */
738 if (!HCR_GetClassNameW(*clsid, pszPath, cchPath))
739 hr = E_FAIL;
740 }
741
742 if (SUCCEEDED(hr))
743 {
744 strRet->uType = STRRET_WSTR;
745 strRet->pOleStr = pszPath;
746 }
747 else
748 {
749 CoTaskMemFree(pszPath);
750 }
751
752 return hr;
753}
754
755HRESULT WINAPI CRegFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, /* simple pidl */
756 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
757{
758 GUID const *clsid = _ILGetGUIDPointer (pidl);
759 LPOLESTR pStr;
760 HRESULT hr;
761 WCHAR szName[100];
762
763 if (!clsid)
764 {
765 ERR("Pidl is not reg item!\n");
766 return E_FAIL;
767 }
768
769 hr = StringFromCLSID(*clsid, &pStr);
771 return hr;
772
773 swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);
774
775 DWORD cbData = (wcslen(lpName) + 1) * sizeof(WCHAR);
777
778 CoTaskMemFree(pStr);
779
780 if (res == ERROR_SUCCESS)
781 {
782 return pPidlOut ? SHILClone(pidl, pPidlOut) : S_OK;
783 }
784
785 return E_FAIL;
786}
787
788
790{
791 return E_NOTIMPL;
792}
793
795{
796 return E_NOTIMPL;
797}
798
800{
801 if (pSort)
802 *pSort = 0;
803 if (pDisplay)
804 *pDisplay = 0;
805
806 return S_OK;
807}
808
810{
811 if (iColumn >= REGFOLDERCOLUMNCOUNT)
812 return E_INVALIDARG;
814 return S_OK;
815}
816
818{
819 return E_NOTIMPL;
820}
821
823{
824 if (!psd)
825 return E_INVALIDARG;
826
827 if (!pidl)
828 {
829 TRACE("CRegFolder has no column info\n");
830 return E_INVALIDARG;
831 }
832
833 GUID const *clsid = _ILGetGUIDPointer (pidl);
834
835 if (!clsid)
836 {
837 ERR("Pidl is not reg item!\n");
838 return E_INVALIDARG;
839 }
840
841 switch(iColumn)
842 {
843 case COL_NAME:
844 return GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
845 case COL_TYPE:
846 return SHSetStrRet(&psd->str, IDS_SYSTEMFOLDER);
847 case COL_INFOTIP:
848 HKEY hKey;
850 return SHSetStrRet(&psd->str, "");
851
852 psd->str.cStr[0] = 0x00;
853 psd->str.uType = STRRET_CSTR;
854 RegLoadMUIStringA(hKey, "InfoTip", psd->str.cStr, MAX_PATH, NULL, 0, NULL);
856 return S_OK;
857 default:
858 /* Return an empty string when we area asked for a column we don't support.
859 Only the regfolder is supposed to do this as it supports less columns compared to other folder
860 and its contents are supposed to be presented alongside items that support more columns. */
861 return SHSetStrRet(&psd->str, "");
862 }
863 return E_FAIL;
864}
865
867{
868 return E_NOTIMPL;
869}
870
873{
875 return SHELL32_DefaultContextMenuCallBack(psf, pdtobj, uMsg);
876
877 PIDLIST_ABSOLUTE pidlFolder;
878 PUITEMID_CHILD *apidl;
879 UINT cidl;
880 HRESULT hr = SH_GetApidlFromDataObject(pdtobj, &pidlFolder, &apidl, &cidl);
882 return hr;
883
884 const CLSID* pCLSID;
885 CRegFolder *pRegFolder = static_cast<CRegFolder*>(psf);
886 const REQUIREDREGITEM* pRequired = pRegFolder->IsRequiredItem(apidl[0]);
887 if (pRequired && pRequired->pszCpl)
888 {
890 wsprintfW(buf, L"%hs", const_cast<LPCSTR>(pRequired->pszCpl));
892 }
893#if 0 // Should never happen, CDesktopFolder.cpp handles this
894 else if (_ILIsDesktop(pidlFolder) && _ILIsDesktop(apidl[0]))
895 {
897 }
898#endif
899 else if ((pCLSID = pRegFolder->IsRegItem(apidl[0])) != NULL)
900 {
901 if (CLSID_MyDocuments != *pCLSID)
902 {
904 }
905 else
906 {
907 FIXME("ROS MyDocs must implement IShellPropSheetExt\n");
908 hr = S_FALSE; // Just display the filesystem properties
909 }
910 }
911 else
912 {
913 hr = S_FALSE; // Tell the caller to run the default action
914 }
915
916 SHFree(pidlFolder);
917 _ILFreeaPidl(apidl, cidl);
918 return hr;
919}
920
923{
924 HKEY hKeys[3];
925 UINT cKeys = 0;
926
927 const GUID *pGuid = _ILGetGUIDPointer(apidl[0]);
928 if (pGuid)
929 {
930 WCHAR key[sizeof("CLSID\\") + 38];
931 wcscpy(key, L"CLSID\\");
932 StringFromGUID2(*pGuid, &key[6], 39);
933 AddClassKeyToArray(key, hKeys, &cKeys);
934 }
935
936 // FIXME: CRegFolder should be aggregated by its outer folder and should
937 // provide the attributes for all required non-registry folders.
938 // It currently does not so we have to ask the outer folder ourself so
939 // that we get the correct attributes for My Computer etc.
940 CComPtr<IShellFolder> pOuterSF;
941 SHBindToObject(NULL, pidlFolder, IID_PPV_ARG(IShellFolder, &pOuterSF));
942
943 SFGAOF att = (psf && cidl) ? SHGetAttributes(pOuterSF ? pOuterSF.p : psf, apidl[0], SFGAO_FOLDER) : 0;
944 if ((att & SFGAO_FOLDER) && (!pGuid || !HasCLSIDShellFolderValue(*pGuid, L"HideFolderVerbs")))
945 AddClassKeyToArray(L"Folder", hKeys, &cKeys);
946
947 return CDefFolderMenu_Create2(pidlFolder, hwnd, cidl, apidl, psf, RegFolderContextMenuCallback, cKeys, hKeys, ppcm);
948}
949
950/* In latest windows version this is exported but it takes different arguments! */
952{
953 return ShellObjectCreatorInit<CRegFolder>(pInit, pidlRoot, riid, ppv);
954}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI CDefFolderMenu_Create2(PCIDLIST_ABSOLUTE pidlFolder, HWND hwnd, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IShellFolder *psf, LPFNDFMCALLBACK lpfn, UINT nKeys, const HKEY *ahkeyClsKeys, IContextMenu **ppcm)
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
static HRESULT CALLBACK RegFolderContextMenuCallback(IShellFolder *psf, HWND hwnd, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CRegFolder.cpp:871
static HRESULT CRegItemContextMenu_CreateInstance(PCIDLIST_ABSOLUTE pidlFolder, HWND hwnd, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IShellFolder *psf, IContextMenu **ppcm)
Definition: CRegFolder.cpp:921
static UINT GetRegItemCLSIDOffset(PIDLTYPE type)
Definition: CRegFolder.cpp:33
HRESULT CGuidItemExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID iid, LPVOID *ppvOut)
Definition: CRegFolder.cpp:128
REGFOLDERCOLUMNINDEX
Definition: CRegFolder.cpp:301
@ REGFOLDERCOLUMNCOUNT
Definition: CRegFolder.cpp:305
@ COL_INFOTIP
Definition: CRegFolder.cpp:304
@ COL_NAME
Definition: CRegFolder.cpp:302
@ COL_TYPE
Definition: CRegFolder.cpp:303
static DWORD SHELL_QueryCLSIDValue(_In_ REFCLSID clsid, _In_opt_ LPCWSTR SubKey, _In_opt_ LPCWSTR Value, _In_opt_ PVOID pData, _In_opt_ PDWORD pSize)
Definition: CRegFolder.cpp:71
HRESULT CRegFolder_CreateInstance(PREGFOLDERINITDATA pInit, LPCITEMIDLIST pidlRoot, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:951
HRESULT FormatGUIDKey(LPWSTR KeyName, SIZE_T KeySize, LPCWSTR RegPath, const GUID *riid)
Definition: CRegFolder.cpp:64
static bool HasCLSIDShellFolderValue(REFCLSID clsid, LPCWSTR Value)
Definition: CRegFolder.cpp:84
static LPITEMIDLIST CreateRegItem(PIDLTYPE type, REFCLSID clsid, BYTE order=0)
Definition: CRegFolder.cpp:38
@ PT_COMPUTER_REGITEM
Definition: ItemIDList.cpp:14
PRTL_UNICODE_STRING_BUFFER Path
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#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 STDMETHOD(m)
Definition: basetyps.h:62
#define RegCloseKey(hKey)
Definition: registry.h:49
BOOL AddToEnumList(LPITEMIDLIST pidl)
const CLSID * GetPidlClsid(PCUITEMID_CHILD pidl)
Definition: CRegFolder.cpp:222
HRESULT AddItemsFromKey(IShellFolder *pSF, HKEY hkey_root, LPCWSTR szRepPath)
Definition: CRegFolder.cpp:259
HRESULT Initialize(const REGFOLDERINFO *pInfo, IShellFolder *pSF, DWORD dwFlags)
Definition: CRegFolder.cpp:230
BOOL HasItemWithCLSID(LPCITEMIDLIST pidl)
Definition: CRegFolder.cpp:223
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
Definition: CRegFolder.cpp:794
STDMETHOD() MapColumnToSCID(UINT column, SHCOLUMNID *pscid) override
Definition: CRegFolder.cpp:866
STDMETHOD() GetDefaultSearchGUID(GUID *pguid) override
Definition: CRegFolder.cpp:789
BOOL _IsInNameSpace(_In_ LPCITEMIDLIST pidl)
Definition: CRegFolder.cpp:410
STDMETHOD() CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
Definition: CRegFolder.cpp:517
STDMETHOD() GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
Definition: CRegFolder.cpp:817
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
Definition: CRegFolder.cpp:549
const REQUIREDREGITEM * IsRequiredItem(LPCITEMIDLIST pidl) const
Definition: CRegFolder.cpp:325
STDMETHOD() SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
Definition: CRegFolder.cpp:755
STDMETHOD() GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
Definition: CRegFolder.cpp:799
CComHeapPtr< ITEMIDLIST > m_pidlRoot
Definition: CRegFolder.cpp:315
STDMETHOD() ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes) override
Definition: CRegFolder.cpp:421
STDMETHOD() GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) override
Definition: CRegFolder.cpp:809
STDMETHOD() BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
Definition: CRegFolder.cpp:488
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
Definition: CRegFolder.cpp:482
HRESULT WINAPI Initialize(PREGFOLDERINITDATA pInit, LPCITEMIDLIST pidlRoot)
Definition: CRegFolder.cpp:376
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
Definition: CRegFolder.cpp:617
STDMETHOD() GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
Definition: CRegFolder.cpp:822
IShellFolder * m_pOuterFolder
Definition: CRegFolder.cpp:314
HRESULT GetGuidItemAttributes(LPCITEMIDLIST pidl, LPDWORD pdwAttributes)
Definition: CRegFolder.cpp:388
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
Definition: CRegFolder.cpp:554
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
Definition: CRegFolder.cpp:578
STDMETHOD() BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
Definition: CRegFolder.cpp:512
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define CHARS_IN_GUID
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#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
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
#define GET_SHGDN_RELATION(dwFlags)
Definition: precomp.h:53
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
#define GET_SHGDN_FOR(dwFlags)
Definition: precomp.h:52
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegLoadMUIStringA(IN HKEY hKey, IN LPCSTR pszValue OPTIONAL, OUT LPSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCSTR pszDirectory OPTIONAL)
Definition: reg.c:5268
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2393
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
#define RRF_RT_REG_SZ
Definition: driver.c:575
#define SHELL_ExecuteControlPanelCPL(hwnd, cpl)
Definition: precomp.h:185
DWORD SHGetAttributes(_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwAttributes)
Definition: utils.cpp:279
DWORD BindCtx_GetMode(_In_ IBindCtx *pbc, _In_ DWORD dwDefault)
Definition: utils.cpp:161
EXTERN_C HRESULT SHBindToObject(_In_opt_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ REFIID riid, _Out_ void **ppvObj)
Definition: utils.cpp:253
HRESULT SHELL32_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdo, UINT msg)
Definition: shlfolder.cpp:525
HRESULT SHILClone(_In_opt_ LPCITEMIDLIST pidl, _Outptr_ LPITEMIDLIST *ppidl)
Definition: utils.cpp:46
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
Definition: reg.c:1306
#define swprintf
Definition: precomp.h:40
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
PWDFDEVICE_INIT pInit
FxAutoRegKey hKey
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint res
Definition: glext.h:9613
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
GLintptr offset
Definition: glext.h:5920
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
ULONG SFGAOF
Definition: shobjidl.idl:222
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT SHELL32_ShowShellExtensionProperties(const CLSID *pClsid, IDataObject *pDO)
Definition: item_prop.cpp:153
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define END_COM_MAP()
Definition: atlcom.h:592
#define pch(ap)
Definition: match.c:418
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static IParseDisplayName ParseDisplayName
Definition: moniker.c:816
static LPOLESTR
Definition: stg_prop.c:27
static SHCONTF
Definition: ordinal.c:64
static ATOM item
Definition: dde.c:856
REFCLSID clsid
Definition: msctf.c:82
IID CLSID
Definition: mstsclib_i.c:62
unsigned int UINT
Definition: ndis.h:50
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define L(x)
Definition: ntvdm.h:50
#define STGM_CREATE
Definition: objbase.h:926
interface IBindCtx * LPBC
Definition: objfwd.h:18
const GUID IID_IDataObject
BOOL WINAPI GUIDFromStringW(_In_ PCWSTR psz, _Out_ LPGUID pguid)
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1042
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2102
BOOL _ILIsBitBucket(LPCITEMIDLIST pidl)
Definition: pidl.c:2091
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl)
Definition: pidl.c:2651
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2402
BYTE PIDLTYPE
Definition: pidl.h:132
static const WCHAR szName[]
Definition: powrprof.c:45
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#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)
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:422
BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
Definition: classes.c:590
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:314
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:619
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:196
#define SHFSF_COL_COMMENT
Definition: shfldr.h:48
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:234
#define IS_SHGDN_FOR_PARSING(flags)
Definition: shfldr.h:77
#define SHFSF_COL_NAME
Definition: shfldr.h:43
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:252
static __inline int SHELL32_GUIDToStringW(REFGUID guid, LPWSTR str)
Definition: shfldr.h:141
static SFGAOF SHELL_CreateFolderEnumItemAttributeQuery(SHCONTF Flags, BOOL ForRegItem)
Definition: shfldr.h:81
#define SHFSF_COL_TYPE
Definition: shfldr.h:45
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:311
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:275
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE *ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
Definition: shlfolder.cpp:402
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
Definition: classes.c:253
BOOL SHELL_IncludeItemInFolderEnum(IShellFolder *pSF, PCUITEMID_CHILD pidl, SFGAOF Query, SHCONTF Flags)
Definition: shlfolder.cpp:41
HRESULT SHELL32_ParseNextElement(IShellFolder2 *psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST *pidlInOut, LPOLESTR szNext, DWORD *pEaten, DWORD *pdwAttributes)
Definition: shlfolder.cpp:107
HRESULT hr
Definition: shlfolder.c:183
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2612
#define IDS_SYSTEMFOLDER
Definition: shresdef.h:352
#define IDI_SHELL_DESKTOP
Definition: shresdef.h:587
#define IDI_SHELL_DOCUMENT
Definition: shresdef.h:553
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
ITEMID_CHILD UNALIGNED * PUITEMID_CHILD
Definition: shtypes.idl:68
@ STRRET_CSTR
Definition: shtypes.idl:87
@ STRRET_WSTR
Definition: shtypes.idl:85
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
@ SHCOLSTATE_TYPE_STR
Definition: shtypes.idl:121
@ SHCOLSTATE_ONBYDEFAULT
Definition: shtypes.idl:125
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
void InitializeFolderInfo(const REGFOLDERINFO *pInfo)
Definition: CRegFolder.cpp:93
const CLSID * IsRegItem(LPCITEMIDLIST pidl) const
Definition: CRegFolder.cpp:98
const REQUIREDREGITEM & GetAt(size_t i) const
Definition: CRegFolder.cpp:125
UINT GetRequiredItemsCount() const
Definition: CRegFolder.cpp:124
LPITEMIDLIST CreateItem(size_t i) const
Definition: CRegFolder.cpp:115
const REGFOLDERINFO * m_pInfo
Definition: CRegFolder.cpp:91
PIDLTYPE GetPidlType() const
Definition: CRegFolder.cpp:123
LPCWSTR GetParsingPath() const
Definition: CRegFolder.cpp:121
UINT GetCLSIDOffset() const
Definition: CRegFolder.cpp:122
STRRET str
Definition: shtypes.idl:108
const REQUIREDREGITEM * Items
Definition: shfldr.h:61
REFCLSID clsid
Definition: shfldr.h:62
LPCWSTR pszParsingPath
Definition: shfldr.h:63
LPCWSTR pszEnumKeyName
Definition: shfldr.h:64
BYTE Count
Definition: shfldr.h:60
PIDLTYPE PidlType
Definition: shfldr.h:59
LPCSTR pszCpl
Definition: shfldr.h:53
char cStr[MAX_PATH]
Definition: shtypes.idl:98
UINT uType
Definition: shtypes.idl:93
LPWSTR pOleStr
Definition: shtypes.idl:96
Definition: copy.c:22
Definition: name.c:39
#define max(a, b)
Definition: svc.c:63
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
DWORD dwAttributes
Definition: vdmdbg.h:34
int ret
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
#define ZeroMemory
Definition: winbase.h:1737
_In_ LPCSTR lpName
Definition: winbase.h:2814
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
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 HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define CO_E_CLASSSTRING
Definition: winerror.h:2806
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RRF_RT_ANY
Definition: winreg.h:64
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
static void Initialize()
Definition: xlate.c:212
#define IID_PPV_ARG(Itype, ppType)
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193