ReactOS 0.4.15-dev-7931-gfd331f1
CFSFolder.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: shell32
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: file system folder
5 * COPYRIGHT: Copyright 1997 Marcus Meissner
6 * Copyright 1998, 1999, 2002 Juergen Schmied
7 * Copyright 2019-2024 Katayama Hirofumi MZ
8 * Copyright 2020 Mark Jansen (mark.jansen@reactos.org)
9 */
10
11#include <precomp.h>
12
14
15static HRESULT SHELL32_GetCLSIDForDirectory(LPCWSTR pwszDir, LPCWSTR KeyName, CLSID* pclsidFolder);
16
17
19{
20 HKEY hkey;
21
23 DWORD dwSize = sizeof(FullName);
24 wsprintf(FullName, L"%s\\%s", pExtension, KeyName);
25
27 if (!res)
28 return hkey;
29
31 if (res)
32 {
33 WARN("Failed to get progid for extension %S (%x), error %d\n", pExtension, pExtension, res);
34 return NULL;
35 }
36
37 wcscat(FullName, L"\\");
39
40 hkey = NULL;
42 if (res)
43 WARN("Could not open key %S for extension %S\n", KeyName, pExtension);
44
45 return hkey;
46}
47
49{
50 if (!_ILIsValue(pidl))
51 {
52 ERR("Invalid pidl!\n");
53 return NULL;
54 }
55
56 FileStructW* pDataW = _ILGetFileStructW(pidl);
57 if (!pDataW)
58 {
59 ERR("Invalid pidl!\n");
60 return NULL;
61 }
62
63 LPWSTR pExtension = PathFindExtensionW(pDataW->wszName);
64 if (!pExtension || *pExtension == UNICODE_NULL)
65 {
66 WARN("No extension for %S!\n", pDataW->wszName);
67 return NULL;
68 }
69 return pExtension;
70}
71
73{
74 HKEY hkeyProgId = OpenKeyFromFileType(pExtension, KeyName);
75 if (!hkeyProgId)
76 {
77 WARN("OpenKeyFromFileType failed for key %S\n", KeyName);
78 return S_FALSE;
79 }
80
81 WCHAR wszCLSIDValue[CHARS_IN_GUID];
82 DWORD dwSize = sizeof(wszCLSIDValue);
83 LONG res = RegGetValueW(hkeyProgId, NULL, NULL, RRF_RT_REG_SZ, NULL, wszCLSIDValue, &dwSize);
84 RegCloseKey(hkeyProgId);
85 if (res)
86 {
87 ERR("OpenKeyFromFileType succeeded but RegGetValueW failed\n");
88 return S_FALSE;
89 }
90
91#if 0
92 {
94 L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved",
95 wszCLSIDValue,
97 NULL,
98 NULL,
99 NULL);
100 if (res != ERROR_SUCCESS)
101 {
102 ERR("DropHandler extension %S not approved\n", wszName);
103 return E_ACCESSDENIED;
104 }
105 }
106#endif
107
109 L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Blocked",
110 wszCLSIDValue,
112 NULL,
113 NULL,
115 {
116 ERR("Extension %S not approved\n", wszCLSIDValue);
117 return E_ACCESSDENIED;
118 }
119
120 HRESULT hres = CLSIDFromString (wszCLSIDValue, pclsid);
122 return hres;
123
124 return S_OK;
125}
126
128{
129 LPWSTR pExtension = ExtensionFromPidl(pidl);
130 if (!pExtension)
131 return S_FALSE;
132
133 return GetCLSIDForFileTypeFromExtension(pExtension, KeyName, pclsid);
134}
135
136static HRESULT
138{
139 if (!HLM_GetIconW(IDI_SHELL_FOLDER - 1, szIconFile, cchMax, piIndex))
140 {
141 if (!HCR_GetIconW(L"Folder", szIconFile, NULL, cchMax, piIndex))
142 {
143 StringCchCopyW(szIconFile, cchMax, swShell32Name);
144 *piIndex = -IDI_SHELL_FOLDER;
145 }
146 }
147
148 if (uFlags & GIL_OPENICON)
149 {
150 // next icon
151 if (*piIndex < 0)
152 (*piIndex)--;
153 else
154 (*piIndex)++;
155 }
156
157 return S_OK;
158}
159
160static BOOL
161getShellClassInfo(LPCWSTR Entry, LPWSTR pszValue, DWORD cchValueLen, LPCWSTR IniFile)
162{
163 return GetPrivateProfileStringW(L".ShellClassInfo", Entry, NULL, pszValue, cchValueLen, IniFile);
164}
165
166static HRESULT
168 LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
169{
170 DWORD dwFileAttrs;
171 WCHAR wszPath[MAX_PATH];
172 WCHAR wszIniFullPath[MAX_PATH];
173
174 if (uFlags & GIL_DEFAULTICON)
175 goto Quit;
176
177 // get path
178 if (!ILGetDisplayNameExW(psf, pidl, wszPath, 0))
179 goto Quit;
180 if (!PathIsDirectoryW(wszPath))
181 goto Quit;
182
183 // read-only or system folder?
184 dwFileAttrs = _ILGetFileAttributes(ILFindLastID(pidl), NULL, 0);
185 if ((dwFileAttrs & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_READONLY)) == 0)
186 goto Quit;
187
188 // build the full path of ini file
189 StringCchCopyW(wszIniFullPath, _countof(wszIniFullPath), wszPath);
190 PathAppendW(wszIniFullPath, L"desktop.ini");
191
192 WCHAR wszValue[MAX_PATH], wszTemp[MAX_PATH];
193 if (getShellClassInfo(L"IconFile", wszValue, _countof(wszValue), wszIniFullPath))
194 {
195 // wszValue --> wszTemp
196 ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp));
197
198 // wszPath + wszTemp --> wszPath
199 if (PathIsRelativeW(wszTemp))
200 PathAppendW(wszPath, wszTemp);
201 else
202 StringCchCopyW(wszPath, _countof(wszPath), wszTemp);
203
204 // wszPath --> szIconFile
205 GetFullPathNameW(wszPath, cchMax, szIconFile, NULL);
206
207 *piIndex = GetPrivateProfileIntW(L".ShellClassInfo", L"IconIndex", 0, wszIniFullPath);
208 return S_OK;
209 }
210 else if (getShellClassInfo(L"CLSID", wszValue, _countof(wszValue), wszIniFullPath) &&
211 HCR_GetIconW(wszValue, szIconFile, NULL, cchMax, piIndex))
212 {
213 return S_OK;
214 }
215 else if (getShellClassInfo(L"CLSID2", wszValue, _countof(wszValue), wszIniFullPath) &&
216 HCR_GetIconW(wszValue, szIconFile, NULL, cchMax, piIndex))
217 {
218 return S_OK;
219 }
220 else if (getShellClassInfo(L"IconResource", wszValue, _countof(wszValue), wszIniFullPath))
221 {
222 // wszValue --> wszTemp
223 ExpandEnvironmentStringsW(wszValue, wszTemp, _countof(wszTemp));
224
225 // parse the icon location
226 *piIndex = PathParseIconLocationW(wszTemp);
227
228 // wszPath + wszTemp --> wszPath
229 if (PathIsRelativeW(wszTemp))
230 PathAppendW(wszPath, wszTemp);
231 else
232 StringCchCopyW(wszPath, _countof(wszPath), wszTemp);
233
234 // wszPath --> szIconFile
235 GetFullPathNameW(wszPath, cchMax, szIconFile, NULL);
236 return S_OK;
237 }
238
239Quit:
240 return getDefaultIconLocation(szIconFile, cchMax, piIndex, uFlags);
241}
242
244{
245 CComPtr<IDefaultExtractIconInit> initIcon;
246 HRESULT hr;
247 int icon_idx = 0;
248 UINT flags = 0; // FIXME: Use it!
249 WCHAR wTemp[MAX_PATH] = L"";
250
252 if (FAILED(hr))
253 return hr;
254
255 if (_ILIsFolder (pidl))
256 {
258 pidl, 0, wTemp, _countof(wTemp),
259 &icon_idx,
260 &flags)))
261 {
262 initIcon->SetNormalIcon(wTemp, icon_idx);
263 // FIXME: if/when getIconLocationForFolder does something for
264 // GIL_FORSHORTCUT, code below should be uncommented. and
265 // the following line removed.
266 initIcon->SetShortcutIcon(wTemp, icon_idx);
267 }
269 pidl, GIL_DEFAULTICON, wTemp, _countof(wTemp),
270 &icon_idx,
271 &flags)))
272 {
273 initIcon->SetDefaultIcon(wTemp, icon_idx);
274 }
275 // if (SUCCEEDED(getIconLocationForFolder(psf,
276 // pidl, GIL_FORSHORTCUT, wTemp, _countof(wTemp),
277 // &icon_idx,
278 // &flags)))
279 // {
280 // initIcon->SetShortcutIcon(wTemp, icon_idx);
281 // }
283 pidl, GIL_OPENICON, wTemp, _countof(wTemp),
284 &icon_idx,
285 &flags)))
286 {
287 initIcon->SetOpenIcon(wTemp, icon_idx);
288 }
289 }
290 else
291 {
292 LPWSTR pExtension = ExtensionFromPidl(pidl);
293 HKEY hkey = pExtension ? OpenKeyFromFileType(pExtension, L"DefaultIcon") : NULL;
294 if (!hkey)
295 WARN("Could not open DefaultIcon key!\n");
296
297 DWORD dwSize = sizeof(wTemp);
298 if (hkey && !SHQueryValueExW(hkey, NULL, NULL, NULL, wTemp, &dwSize))
299 {
300 WCHAR sNum[5];
301 if (ParseFieldW (wTemp, 2, sNum, 5))
302 icon_idx = _wtoi(sNum);
303 else
304 icon_idx = 0; /* sometimes the icon number is missing */
305 ParseFieldW (wTemp, 1, wTemp, MAX_PATH);
306 PathUnquoteSpacesW(wTemp);
307
308 if (!wcscmp(L"%1", wTemp)) /* icon is in the file */
309 {
310 ILGetDisplayNameExW(psf, pidl, wTemp, ILGDN_FORPARSING);
311 icon_idx = 0;
312
313 INT ret = PrivateExtractIconsW(wTemp, 0, 0, 0, NULL, NULL, 0, 0);
314 if (ret <= 0)
315 {
316 StringCbCopyW(wTemp, sizeof(wTemp), swShell32Name);
317 if (lstrcmpiW(pExtension, L".exe") == 0 || lstrcmpiW(pExtension, L".scr") == 0)
318 icon_idx = -IDI_SHELL_EXE;
319 else
320 icon_idx = -IDI_SHELL_DOCUMENT;
321 }
322 }
323
324 initIcon->SetNormalIcon(wTemp, icon_idx);
325 }
326 else
327 {
328 initIcon->SetNormalIcon(swShell32Name, 0);
329 }
330
331 if (hkey)
332 RegCloseKey(hkey);
333 }
334
335 return initIcon->QueryInterface(iid, ppvOut);
336}
337
338/*
339CFileSysEnum should do an initial FindFirstFile and do a FindNextFile as each file is
340returned by Next. When the enumerator is created, it can do numerous additional operations
341including formatting a drive, reconnecting a network share drive, and requesting a disk
342be inserted in a removable drive.
343*/
344
345
347 public CEnumIDListBase
348{
349private:
351 {
352#define SUPER_HIDDEN (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)
353
354 // Does it need special handling because it is hidden?
355 if (FindData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
356 {
357 DWORD dwHidden = FindData.dwFileAttributes & SUPER_HIDDEN;
358
359 // Is it hidden, but are we not asked to include hidden?
360 if (dwHidden == FILE_ATTRIBUTE_HIDDEN && !(dwFlags & SHCONTF_INCLUDEHIDDEN))
361 return S_OK;
362
363 // Is it a system file, but are we not asked to include those?
364 if (dwHidden == SUPER_HIDDEN && !(dwFlags & SHCONTF_INCLUDESUPERHIDDEN))
365 return S_OK;
366 }
367
368 BOOL bDirectory = (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
369
370 HRESULT hr;
371 if (bDirectory)
372 {
373 // Skip the current and parent directory nodes
374 if (!strcmpW(FindData.cFileName, L".") || !strcmpW(FindData.cFileName, L".."))
375 return S_OK;
376
377 // Does this directory need special handling?
378 if ((FindData.dwFileAttributes & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_READONLY)) != 0)
379 {
380 WCHAR Tmp[MAX_PATH];
381 CLSID clsidFolder;
382
383 PathCombineW(Tmp, sParentDir, FindData.cFileName);
384
385 hr = SHELL32_GetCLSIDForDirectory(Tmp, L"CLSID", &clsidFolder);
386 if (SUCCEEDED(hr))
387 {
388 ERR("Got CLSID override for '%S'\n", Tmp);
389 }
390 }
391 }
392 else
393 {
394 CLSID clsidFile;
395 LPWSTR pExtension = PathFindExtensionW(FindData.cFileName);
396 if (pExtension)
397 {
398 // FIXME: Cache this?
399 hr = GetCLSIDForFileTypeFromExtension(pExtension, L"CLSID", &clsidFile);
400 if (hr == S_OK)
401 {
402 HKEY hkey;
403 hr = SHRegGetCLSIDKeyW(clsidFile, L"ShellFolder", FALSE, FALSE, &hkey);
404 if (SUCCEEDED(hr))
405 {
406 ::RegCloseKey(hkey);
407
408 // This should be presented as directory!
409 bDirectory = TRUE;
410 TRACE("Treating '%S' as directory!\n", FindData.cFileName);
411 }
412 }
413 }
414 }
415
416 LPITEMIDLIST pidl = NULL;
417 if (bDirectory)
418 {
419 if (dwFlags & SHCONTF_FOLDERS)
420 {
421 TRACE("(%p)-> (folder=%s)\n", this, debugstr_w(FindData.cFileName));
422 pidl = _ILCreateFromFindDataW(&FindData);
423 }
424 }
425 else
426 {
427 if (dwFlags & SHCONTF_NONFOLDERS)
428 {
429 TRACE("(%p)-> (file =%s)\n", this, debugstr_w(FindData.cFileName));
430 pidl = _ILCreateFromFindDataW(&FindData);
431 }
432 }
433
434 if (pidl && !AddToEnumList(pidl))
435 {
437 return E_FAIL;
438 }
439
440 return S_OK;
441 }
442
443public:
445 {
446
447 }
448
450 {
451 }
452
454 {
455 TRACE("(%p)->(path=%s flags=0x%08x)\n", this, debugstr_w(sPathTarget), dwFlags);
456
457 if (!sPathTarget || !sPathTarget[0])
458 {
459 WARN("No path for CFileSysEnum, empty result!\n");
460 return S_FALSE;
461 }
462
463 WCHAR szFindPattern[MAX_PATH];
464 HRESULT hr = StringCchCopyW(szFindPattern, _countof(szFindPattern), sPathTarget);
466 return hr;
467
468 /* FIXME: UNSAFE CRAP */
469 PathAddBackslashW(szFindPattern);
470
471 hr = StringCchCatW(szFindPattern, _countof(szFindPattern), L"*.*");
473 return hr;
474
475
476 WIN32_FIND_DATAW FindData;
477 HANDLE hFind = FindFirstFileW(szFindPattern, &FindData);
478 if (hFind == INVALID_HANDLE_VALUE)
480
481 do
482 {
483 hr = _AddFindResult(sPathTarget, FindData, dwFlags);
484
486 break;
487
488 } while(FindNextFileW(hFind, &FindData));
489
490 if (SUCCEEDED(hr))
491 {
492 DWORD dwError = GetLastError();
493 if (dwError != ERROR_NO_MORE_FILES)
494 {
495 hr = HRESULT_FROM_WIN32(dwError);
497 }
498 }
499 TRACE("(%p)->(hr=0x%08x)\n", this, hr);
500 FindClose(hFind);
501 return hr;
502 }
503
505 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
507};
508
509
510/***********************************************************************
511 * IShellFolder implementation
512 */
513
515{
516 m_pclsid = &CLSID_ShellFSFolder;
520}
521
523{
524 TRACE("-- destroying IShellFolder(%p)\n", this);
525
528}
529
530
531static const shvheader GenericSFHeader[] = {
538};
539
540#define GENERICSHELLVIEWCOLUMNS 6
541
543{
544 WCHAR wszCLSIDValue[CHARS_IN_GUID];
545 WCHAR wszDesktopIni[MAX_PATH];
546
547 StringCchCopyW(wszDesktopIni, MAX_PATH, pwszDir);
548 StringCchCatW(wszDesktopIni, MAX_PATH, L"\\desktop.ini");
549
550 if (GetPrivateProfileStringW(L".ShellClassInfo",
551 KeyName,
552 L"",
553 wszCLSIDValue,
555 wszDesktopIni))
556 {
557 return CLSIDFromString(wszCLSIDValue, pclsidFolder);
558 }
559 return E_FAIL;
560}
561
563{
564 DWORD dwFileAttributes, dwShellAttributes;
565
566 if (!_ILIsFolder(pidl) && !_ILIsValue(pidl))
567 {
568 ERR("Got wrong type of pidl!\n");
569 *pdwAttributes &= SFGAO_CANLINK;
570 return S_OK;
571 }
572
574
575 /* Set common attributes */
576 dwShellAttributes = SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_CANLINK | SFGAO_CANRENAME | SFGAO_CANDELETE |
577 SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSTEM;
578
579 BOOL bDirectory = (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
580
581 if (!bDirectory)
582 {
583 // https://git.reactos.org/?p=reactos.git;a=blob;f=dll/shellext/zipfldr/res/zipfldr.rgs;hb=032b5aacd233cd7b83ab6282aad638c161fdc400#l9
584 WCHAR szFileName[MAX_PATH];
585 LPWSTR pExtension;
586
587 if (_ILSimpleGetTextW(pidl, szFileName, _countof(szFileName)) && (pExtension = PathFindExtensionW(szFileName)))
588 {
589 CLSID clsidFile;
590 // FIXME: Cache this?
591 HRESULT hr = GetCLSIDForFileTypeFromExtension(pExtension, L"CLSID", &clsidFile);
592 if (hr == S_OK)
593 {
594 HKEY hkey;
595 hr = SHRegGetCLSIDKeyW(clsidFile, L"ShellFolder", FALSE, FALSE, &hkey);
596 if (SUCCEEDED(hr))
597 {
599 DWORD dwSize = sizeof(dwAttributes);
601
603 if (Status == STATUS_SUCCESS)
604 {
605 TRACE("Augmenting '%S' with dwAttributes=0x%x\n", szFileName, dwAttributes);
606 dwShellAttributes |= dwAttributes;
607 }
608 ::RegCloseKey(hkey);
609
610 // This should be presented as directory!
611 bDirectory = TRUE;
612 TRACE("Treating '%S' as directory!\n", szFileName);
613 }
614 }
615 }
616 }
617
618 // This is a directory
619 if (bDirectory)
620 {
621 dwShellAttributes |= (SFGAO_FOLDER | /*SFGAO_HASSUBFOLDER |*/ SFGAO_STORAGE);
622
623 // Is this a real directory?
625 {
626 dwShellAttributes |= (SFGAO_FILESYSANCESTOR | SFGAO_STORAGEANCESTOR);
627 }
628 }
629 else
630 {
631 dwShellAttributes |= SFGAO_STREAM;
632 }
633
635 dwShellAttributes |= SFGAO_HIDDEN;
636
638 dwShellAttributes |= SFGAO_READONLY;
639
640 if (SFGAO_LINK & *pdwAttributes)
641 {
642 char ext[MAX_PATH];
643
644 if (_ILGetExtension(pidl, ext, MAX_PATH) && !lstrcmpiA(ext, "lnk"))
645 dwShellAttributes |= SFGAO_LINK;
646 }
647
648 if (SFGAO_HASSUBFOLDER & *pdwAttributes)
649 {
650 CComPtr<IShellFolder> psf2;
651 if (SUCCEEDED(psf->BindToObject(pidl, 0, IID_PPV_ARG(IShellFolder, &psf2))))
652 {
653 CComPtr<IEnumIDList> pEnumIL;
654 if (SUCCEEDED(psf2->EnumObjects(0, SHCONTF_FOLDERS, &pEnumIL)))
655 {
656 if (pEnumIL->Skip(1) == S_OK)
657 dwShellAttributes |= SFGAO_HASSUBFOLDER;
658 }
659 }
660 }
661
662 *pdwAttributes = dwShellAttributes;
663
664 TRACE ("-- 0x%08x\n", *pdwAttributes);
665 return S_OK;
666}
667
669 _In_ LPOLESTR lpszDisplayName,
670 _Out_ WIN32_FIND_DATAW *pFind,
671 _Out_ LPITEMIDLIST *ppidl)
672{
673 HRESULT hr;
674 LPWSTR pchNext = lpszDisplayName;
675
676 *ppidl = NULL;
677
678 LPITEMIDLIST pidl;
679 for (hr = S_OK; SUCCEEDED(hr); hr = SHILAppend(pidl, ppidl))
680 {
681 hr = Shell_NextElement(&pchNext, pFind->cFileName, _countof(pFind->cFileName), FALSE);
682 if (hr != S_OK)
683 break;
684
685 if (pchNext)
686 pFind->dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
687
688 pidl = _ILCreateFromFindDataW(pFind);
689 if (!pidl)
690 {
692 break;
693 }
694 }
695
696 if (SUCCEEDED(hr))
697 return S_OK;
698
699 if (*ppidl)
700 {
701 ILFree(*ppidl);
702 *ppidl = NULL;
703 }
704
705 return hr;
706}
707
709{
712 PathAppendW(szPath, pszName);
713
714 HANDLE hFind = ::FindFirstFileW(szPath, pFind);
715 if (hFind == INVALID_HANDLE_VALUE)
716 return FALSE;
717
718 ::FindClose(hFind);
719 return TRUE;
720}
721
723{
724 *ppidl = NULL;
725
726 if (PathIsDosDevice(pszName))
728
729 WIN32_FIND_DATAW FindData = { 0 };
730
731 HRESULT hr = S_OK;
732 if (attrs == ULONG_MAX) // Invalid attributes
733 {
734 if (!_GetFindDataFromName(pszName, &FindData))
736 }
737 else // Pretend as an item of attrs
738 {
739 StringCchCopyW(FindData.cFileName, _countof(FindData.cFileName), pszName);
740 FindData.dwFileAttributes = attrs;
741 }
742
743 if (FAILED(hr))
744 return hr;
745
746 *ppidl = _ILCreateFromFindDataW(&FindData);
747 if (!*ppidl)
748 return E_OUTOFMEMORY;
749
750 return S_OK;
751}
752
753/**************************************************************************
754* CFSFolder::ParseDisplayName {SHELL32}
755*
756* Parse a display name.
757*
758* PARAMS
759* hwndOwner [in] Parent window for any message's
760* pbc [in] optional FileSystemBindData context
761* lpszDisplayName [in] Unicode displayname.
762* pchEaten [out] (unicode) characters processed
763* ppidl [out] complex pidl to item
764* pdwAttributes [out] items attributes
765*
766* NOTES
767* Every folder tries to parse only its own (the leftmost) pidl and creates a
768* subfolder to evaluate the remaining parts.
769* Now we can parse into namespaces implemented by shell extensions
770*
771* Behaviour on win98: lpszDisplayName=NULL -> crash
772* lpszDisplayName="" -> returns mycoputer-pidl
773*
774* FIXME
775* pdwAttributes is not set
776* pchEaten is not set like in windows
777*/
779 LPBC pbc,
780 LPOLESTR lpszDisplayName,
781 DWORD *pchEaten, PIDLIST_RELATIVE *ppidl,
782 DWORD *pdwAttributes)
783{
784 TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
785 this, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
786 pchEaten, ppidl, pdwAttributes);
787
788 if (!ppidl)
789 return E_INVALIDARG;
790
791 *ppidl = NULL;
792
793 if (!lpszDisplayName)
794 return E_INVALIDARG;
795
796 HRESULT hr;
797 WIN32_FIND_DATAW FindData;
798 if (SHIsFileSysBindCtx(pbc, &FindData) == S_OK)
799 {
800 CComHeapPtr<ITEMIDLIST> pidlTemp;
801 hr = _ParseSimple(lpszDisplayName, &FindData, &pidlTemp);
802 if (SUCCEEDED(hr) && pdwAttributes && *pdwAttributes)
803 {
804 LPCITEMIDLIST pidlLast = ILFindLastID(pidlTemp);
805 GetAttributesOf(1, &pidlLast, pdwAttributes);
806 }
807
808 if (SUCCEEDED(hr))
809 *ppidl = pidlTemp.Detach();
810 }
811 else
812 {
813 INT cchElement = lstrlenW(lpszDisplayName) + 1;
814 LPWSTR pszElement = (LPWSTR)alloca(cchElement * sizeof(WCHAR));
815 LPWSTR pchNext = lpszDisplayName;
816 hr = Shell_NextElement(&pchNext, pszElement, cchElement, TRUE);
817 if (FAILED(hr))
818 return hr;
819
820 hr = _CreateIDListFromName(pszElement, ULONG_MAX, pbc, ppidl);
821 if (FAILED(hr))
822 {
823 if (pchNext) // Is there the next element?
824 {
825 // pszElement seems like a directory
826 if (_GetFindDataFromName(pszElement, &FindData) &&
827 (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
828 {
829 hr = _CreateIDListFromName(pszElement, FILE_ATTRIBUTE_DIRECTORY, pbc, ppidl);
830 }
831 }
832 else
833 {
834 // pszElement seems like a non-directory
837 (BindCtx_GetMode(pbc, 0) & STGM_CREATE))
838 {
839 // Pretend like a normal file
840 hr = _CreateIDListFromName(pszElement, FILE_ATTRIBUTE_NORMAL, pbc, ppidl);
841 }
842 }
843 }
844
845 if (SUCCEEDED(hr))
846 {
847 if (pchNext) // Is there next?
848 {
849 CComPtr<IShellFolder> psfChild;
850 hr = BindToObject(*ppidl, pbc, IID_PPV_ARG(IShellFolder, &psfChild));
851 if (FAILED(hr))
852 return hr;
853
854 DWORD chEaten;
855 CComHeapPtr<ITEMIDLIST> pidlChild;
856 hr = psfChild->ParseDisplayName(hwndOwner, pbc, pchNext, &chEaten, &pidlChild,
857 pdwAttributes);
858
859 // Append pidlChild to ppidl
860 if (SUCCEEDED(hr))
861 hr = SHILAppend(pidlChild.Detach(), ppidl);
862 }
863 else if (pdwAttributes && *pdwAttributes)
864 {
865 GetAttributesOf(1, (LPCITEMIDLIST*)ppidl, pdwAttributes);
866 }
867 }
868 }
869
870 TRACE("(%p)->(-- pidl=%p ret=0x%08x)\n", this, ppidl ? *ppidl : 0, hr);
871
872 return hr;
873}
874
875/**************************************************************************
876* CFSFolder::EnumObjects
877* PARAMETERS
878* HWND hwndOwner, //[in ] Parent Window
879* DWORD grfFlags, //[in ] SHCONTF enumeration mask
880* LPENUMIDLIST* ppenumIDList //[out] IEnumIDList interface
881*/
883 HWND hwndOwner,
885 LPENUMIDLIST *ppEnumIDList)
886{
887 return ShellObjectCreatorInit<CFileSysEnum>(m_sPathTarget, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
888}
889
890/**************************************************************************
891* CFSFolder::BindToObject
892* PARAMETERS
893* LPCITEMIDLIST pidl, //[in ] relative pidl to open
894* LPBC pbc, //[in ] optional FileSystemBindData context
895* REFIID riid, //[in ] Initial Interface
896* LPVOID* ppvObject //[out] Interface*
897*/
900 LPBC pbc,
901 REFIID riid,
902 LPVOID * ppvOut)
903{
904 TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", this, pidl, pbc,
905 shdebugstr_guid(&riid), ppvOut);
906
907 CComPtr<IShellFolder> pSF;
908 HRESULT hr;
909
910 if (!m_pidlRoot || !ppvOut || !pidl || !pidl->mkid.cb)
911 {
912 ERR("CFSFolder::BindToObject: Invalid parameters\n");
913 return E_INVALIDARG;
914 }
915
916 /* Get the pidl data */
917 FileStruct* pData = &_ILGetDataPointer(pidl)->u.file;
918 FileStructW* pDataW = _ILGetFileStructW(pidl);
919
920 if (!pDataW)
921 {
922 ERR("CFSFolder::BindToObject: Invalid pidl!\n");
923 return E_INVALIDARG;
924 }
925
926 *ppvOut = NULL;
927
928 /* Create the target folder info */
930 pfti.dwAttributes = -1;
931 pfti.csidl = -1;
933
934 /* Get the CLSID to bind to */
935 CLSID clsidFolder;
936 if (_ILIsFolder(pidl))
937 {
938 if ((pData->uFileAttribs & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_READONLY)) != 0)
939 {
940 hr = SHELL32_GetCLSIDForDirectory(pfti.szTargetParsingName, L"CLSID", &clsidFolder);
941
942 if (SUCCEEDED(hr))
943 {
944 /* We got a GUID from a desktop.ini, let's try it */
945 hr = SHELL32_BindToSF(m_pidlRoot, &pfti, pidl, &clsidFolder, riid, ppvOut);
946 if (SUCCEEDED(hr))
947 {
948 TRACE("-- returning (%p) %08x, (%s)\n", *ppvOut, hr, wine_dbgstr_guid(&clsidFolder));
949 return hr;
950 }
951
952 /* Something went wrong, re-try it with a normal ShellFSFolder */
953 ERR("CFSFolder::BindToObject: %s failed to bind, using fallback (0x%08x)\n", wine_dbgstr_guid(&clsidFolder), hr);
954 }
955 }
956 /* No system folder or the custom class failed */
957 clsidFolder = CLSID_ShellFSFolder;
958 }
959 else
960 {
961 hr = GetCLSIDForFileType(pidl, L"CLSID", &clsidFolder);
962 if (hr == S_FALSE)
964 if (hr != S_OK)
965 return hr;
966 }
967
968 hr = SHELL32_BindToSF(m_pidlRoot, &pfti, pidl, &clsidFolder, riid, ppvOut);
970 return hr;
971
972 TRACE ("-- returning (%p) %08x\n", *ppvOut, hr);
973
974 return S_OK;
975
976}
977
978/**************************************************************************
979* CFSFolder::BindToStorage
980* PARAMETERS
981* LPCITEMIDLIST pidl, //[in ] complex pidl to store
982* LPBC pbc, //[in ] reserved
983* REFIID riid, //[in ] Initial storage interface
984* LPVOID* ppvObject //[out] Interface* returned
985*/
988 LPBC pbcReserved,
989 REFIID riid,
990 LPVOID *ppvOut)
991{
992 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this, pidl, pbcReserved,
993 shdebugstr_guid (&riid), ppvOut);
994
995 *ppvOut = NULL;
996 return E_NOTIMPL;
997}
998
999/**************************************************************************
1000* CFSFolder::CompareIDs
1001*/
1002
1004 PCUIDLIST_RELATIVE pidl1,
1005 PCUIDLIST_RELATIVE pidl2)
1006{
1007 LPPIDLDATA pData1 = _ILGetDataPointer(pidl1);
1008 LPPIDLDATA pData2 = _ILGetDataPointer(pidl2);
1009 FileStructW* pDataW1 = _ILGetFileStructW(pidl1);
1010 FileStructW* pDataW2 = _ILGetFileStructW(pidl2);
1011 BOOL bIsFolder1 = _ILIsFolder(pidl1);
1012 BOOL bIsFolder2 = _ILIsFolder(pidl2);
1013 LPWSTR pExtension1, pExtension2;
1014
1015 if (!pDataW1 || !pDataW2 || LOWORD(lParam) >= GENERICSHELLVIEWCOLUMNS)
1016 return E_INVALIDARG;
1017
1018 /* When sorting between a File and a Folder, the Folder gets sorted first */
1019 if (bIsFolder1 != bIsFolder2)
1020 {
1021 return MAKE_COMPARE_HRESULT(bIsFolder1 ? -1 : 1);
1022 }
1023
1024 int result;
1025 switch (LOWORD(lParam))
1026 {
1027 case 0: /* Name */
1028 result = wcsicmp(pDataW1->wszName, pDataW2->wszName);
1029 break;
1030 case 1: /* Type */
1031 pExtension1 = PathFindExtensionW(pDataW1->wszName);
1032 pExtension2 = PathFindExtensionW(pDataW2->wszName);
1033 result = wcsicmp(pExtension1, pExtension2);
1034 break;
1035 case 2: /* Size */
1036 if (pData1->u.file.dwFileSize > pData2->u.file.dwFileSize)
1037 result = 1;
1038 else if (pData1->u.file.dwFileSize < pData2->u.file.dwFileSize)
1039 result = -1;
1040 else
1041 result = 0;
1042 break;
1043 case 3: /* Modified */
1044 result = pData1->u.file.uFileDate - pData2->u.file.uFileDate;
1045 if (result == 0)
1046 result = pData1->u.file.uFileTime - pData2->u.file.uFileTime;
1047 break;
1048 case 4: /* Attributes */
1049 return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
1050 case 5: /* Comments */
1051 result = 0;
1052 break;
1053 }
1054
1055 if (result == 0)
1056 return SHELL32_CompareChildren(this, lParam, pidl1, pidl2);
1057
1059}
1060
1061/**************************************************************************
1062* CFSFolder::CreateViewObject
1063*/
1065 REFIID riid, LPVOID * ppvOut)
1066{
1067 CComPtr<IShellView> pShellView;
1069
1070 TRACE ("(%p)->(hwnd=%p,%s,%p)\n", this, hwndOwner, shdebugstr_guid (&riid),
1071 ppvOut);
1072
1073 if (ppvOut)
1074 {
1075 *ppvOut = NULL;
1076
1077 BOOL bIsDropTarget = IsEqualIID (riid, IID_IDropTarget);
1078 BOOL bIsShellView = !bIsDropTarget && IsEqualIID (riid, IID_IShellView);
1079
1080 if (bIsDropTarget || bIsShellView)
1081 {
1082 DWORD dwDirAttributes = _ILGetFileAttributes(ILFindLastID(m_pidlRoot), NULL, 0);
1083
1084 if ((dwDirAttributes & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_READONLY)) != 0)
1085 {
1086 CLSID clsidFolder;
1087 hr = SHELL32_GetCLSIDForDirectory(m_sPathTarget, L"UICLSID", &clsidFolder);
1088 if (SUCCEEDED(hr))
1089 {
1090 CComPtr<IPersistFolder> spFolder;
1091 hr = SHCoCreateInstance(NULL, &clsidFolder, NULL, IID_PPV_ARG(IPersistFolder, &spFolder));
1092 if (!FAILED_UNEXPECTEDLY(hr))
1093 {
1094 hr = spFolder->Initialize(m_pidlRoot);
1095
1096 if (!FAILED_UNEXPECTEDLY(hr))
1097 {
1098 hr = spFolder->QueryInterface(riid, ppvOut);
1099 }
1100 }
1101 }
1102 else
1103 {
1104 // No desktop.ini, or no UICLSID present, continue as if nothing happened
1105 hr = E_INVALIDARG;
1106 }
1107 }
1108 }
1109
1110 if (!SUCCEEDED(hr))
1111 {
1112 // No UICLSID handler found, continue to the default handlers
1113 if (bIsDropTarget)
1114 {
1116 }
1117 else if (IsEqualIID (riid, IID_IContextMenu))
1118 {
1119 HKEY hKeys[16];
1120 UINT cKeys = 0;
1121 AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
1122
1123 DEFCONTEXTMENU dcm;
1124 dcm.hwnd = hwndOwner;
1125 dcm.pcmcb = this;
1126 dcm.pidlFolder = m_pidlRoot;
1127 dcm.psf = this;
1128 dcm.cidl = 0;
1129 dcm.apidl = NULL;
1130 dcm.cKeys = cKeys;
1131 dcm.aKeys = hKeys;
1133 hr = SHCreateDefaultContextMenu (&dcm, riid, ppvOut);
1134 }
1135 else if (bIsShellView)
1136 {
1137 SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this, NULL, this};
1138 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
1139 }
1140 else
1141 {
1142 hr = E_INVALIDARG;
1143 }
1144 }
1145 }
1146 TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
1147 return hr;
1148}
1149
1150/**************************************************************************
1151* CFSFolder::GetAttributesOf
1152*
1153* PARAMETERS
1154* UINT cidl, //[in ] num elements in pidl array
1155* LPCITEMIDLIST* apidl, //[in ] simple pidl array
1156* ULONG* rgfInOut) //[out] result array
1157*
1158*/
1160 PCUITEMID_CHILD_ARRAY apidl, DWORD * rgfInOut)
1161{
1162 HRESULT hr = S_OK;
1163
1164 if (!rgfInOut)
1165 return E_INVALIDARG;
1166 if (cidl && !apidl)
1167 return E_INVALIDARG;
1168
1169 if (*rgfInOut == 0)
1170 *rgfInOut = ~0;
1171
1172 if(cidl == 0)
1173 {
1175
1176 if (_ILIsFolder(rpidl) || _ILIsValue(rpidl))
1177 {
1178 SHELL32_GetFSItemAttributes(this, rpidl, rgfInOut);
1179 }
1180 else if (_ILIsDrive(rpidl))
1181 {
1182 IShellFolder *psfParent = NULL;
1184 if(SUCCEEDED(hr))
1185 {
1186 hr = psfParent->GetAttributesOf(1, &rpidl, (SFGAOF*)rgfInOut);
1187 psfParent->Release();
1188 }
1189 }
1190 else
1191 {
1192 ERR("Got and unknown pidl!\n");
1193 }
1194 }
1195 else
1196 {
1197 while (cidl > 0 && *apidl)
1198 {
1199 pdump(*apidl);
1200 if(_ILIsFolder(*apidl) || _ILIsValue(*apidl))
1201 SHELL32_GetFSItemAttributes(this, *apidl, rgfInOut);
1202 else
1203 ERR("Got an unknown type of pidl!!!\n");
1204 apidl++;
1205 cidl--;
1206 }
1207 }
1208 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
1209 *rgfInOut &= ~SFGAO_VALIDATE;
1210
1211 TRACE("-- result=0x%08x\n", *rgfInOut);
1212
1213 return hr;
1214}
1215
1216/**************************************************************************
1217* CFSFolder::GetUIObjectOf
1218*
1219* PARAMETERS
1220* HWND hwndOwner, //[in ] Parent window for any output
1221* UINT cidl, //[in ] array size
1222* LPCITEMIDLIST* apidl, //[in ] simple pidl array
1223* REFIID riid, //[in ] Requested Interface
1224* UINT* prgfInOut, //[ ] reserved
1225* LPVOID* ppvObject) //[out] Resulting Interface
1226*
1227* NOTES
1228* This function gets asked to return "view objects" for one or more (multiple
1229* select) items:
1230* The viewobject typically is an COM object with one of the following
1231* interfaces:
1232* IExtractIcon,IDataObject,IContextMenu
1233* In order to support icon positions in the default Listview your DataObject
1234* must implement the SetData method (in addition to GetData :) - the shell
1235* passes a barely documented "Icon positions" structure to SetData when the
1236* drag starts, and GetData's it if the drop is in another explorer window that
1237* needs the positions.
1238*/
1240 UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
1241 REFIID riid, UINT * prgfInOut,
1242 LPVOID * ppvOut)
1243{
1244 LPVOID pObj = NULL;
1246
1247 TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
1248 this, hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
1249
1250 if (ppvOut)
1251 {
1252 *ppvOut = NULL;
1253
1254 if (cidl == 1 && _ILIsValue(apidl[0]))
1255 {
1256 hr = _CreateExtensionUIObject(apidl[0], riid, ppvOut);
1257 if(hr != S_FALSE)
1258 return hr;
1259 }
1260
1261 if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1))
1262 {
1263 HKEY hKeys[16];
1264 UINT cKeys = 0;
1265 AddFSClassKeysToArray(cidl, apidl, hKeys, &cKeys);
1266
1267 DEFCONTEXTMENU dcm;
1268 dcm.hwnd = hwndOwner;
1269 dcm.pcmcb = this;
1270 dcm.pidlFolder = m_pidlRoot;
1271 dcm.psf = this;
1272 dcm.cidl = cidl;
1273 dcm.apidl = apidl;
1274 dcm.cKeys = cKeys;
1275 dcm.aKeys = hKeys;
1277 hr = SHCreateDefaultContextMenu (&dcm, riid, &pObj);
1278 }
1279 else if (IsEqualIID (riid, IID_IDataObject))
1280 {
1281 if (cidl >= 1)
1282 {
1283 hr = IDataObject_Constructor (hwndOwner, m_pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
1284 }
1285 else
1286 {
1287 hr = E_INVALIDARG;
1288 }
1289 }
1290 else if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID (riid, IID_IExtractIconW)) && (cidl == 1))
1291 {
1292 if (_ILIsValue(apidl[0]))
1293 hr = _GetIconHandler(apidl[0], riid, (LPVOID*)&pObj);
1294 if (hr != S_OK)
1295 hr = CFSExtractIcon_CreateInstance(this, apidl[0], riid, &pObj);
1296 }
1297 else if (IsEqualIID (riid, IID_IDropTarget))
1298 {
1299 /* only interested in attempting to bind to shell folders, not files (except exe), so if we fail, rebind to root */
1300 if (cidl != 1 || FAILED(hr = this->_GetDropTarget(apidl[0], (LPVOID*) &pObj)))
1301 {
1303 }
1304 }
1305 else
1306 hr = E_NOINTERFACE;
1307
1308 if (SUCCEEDED(hr) && !pObj)
1309 hr = E_OUTOFMEMORY;
1310
1311 *ppvOut = pObj;
1312 }
1313 TRACE("(%p)->hr=0x%08x\n", this, hr);
1314 return hr;
1315}
1316
1317/******************************************************************************
1318 * SHELL_FS_HideExtension [Internal]
1319 *
1320 * Query the registry if the filename extension of a given path should be
1321 * hidden.
1322 *
1323 * PARAMS
1324 * szPath [I] Relative or absolute path of a file
1325 *
1326 * RETURNS
1327 * TRUE, if the filename's extension should be hidden
1328 * FALSE, otherwise.
1329 */
1331{
1332 HKEY hKey;
1333 DWORD dwData, dwDataSize = sizeof(DWORD);
1334 BOOL doHide = FALSE; /* The default value is FALSE (win98 at least) */
1335 LONG lError;
1336
1337 lError = RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
1338 0, NULL, 0, KEY_ALL_ACCESS, NULL,
1339 &hKey, NULL);
1340 if (lError == ERROR_SUCCESS)
1341 {
1342 lError = RegQueryValueExW(hKey, L"HideFileExt", NULL, NULL, (LPBYTE)&dwData, &dwDataSize);
1343 if (lError == ERROR_SUCCESS)
1344 doHide = dwData;
1346 }
1347
1348 if (!doHide)
1349 {
1351 if (*DotExt != 0)
1352 {
1354 LONG classlen = sizeof(classname);
1355 lError = RegQueryValueW(HKEY_CLASSES_ROOT, DotExt, classname, &classlen);
1356 if (lError == ERROR_SUCCESS)
1357 {
1359 if (lError == ERROR_SUCCESS)
1360 {
1361 lError = RegQueryValueExW(hKey, L"NeverShowExt", NULL, NULL, NULL, NULL);
1362 if (lError == ERROR_SUCCESS)
1363 doHide = TRUE;
1364
1366 }
1367 }
1368 }
1369 }
1370
1371 return doHide;
1372}
1373
1375{
1376 /*FIXME: MSDN also mentions SHGDN_FOREDITING which is not yet handled. */
1377 if (!(dwFlags & SHGDN_FORPARSING) &&
1378 ((dwFlags & SHGDN_INFOLDER) || (dwFlags == SHGDN_NORMAL))) {
1379 if (SHELL_FS_HideExtension(szPath) && szPath[0] != '.')
1381 }
1382}
1383
1384/**************************************************************************
1385* CFSFolder::GetDisplayNameOf
1386* Retrieves the display name for the specified file object or subfolder
1387*
1388* PARAMETERS
1389* LPCITEMIDLIST pidl, //[in ] complex pidl to item
1390* DWORD dwFlags, //[in ] SHGNO formatting flags
1391* LPSTRRET lpName) //[out] Returned display name
1392*
1393* FIXME
1394* if the name is in the pidl the ret value should be a STRRET_OFFSET
1395*/
1396
1398 DWORD dwFlags, LPSTRRET strRet)
1399{
1400 if (!strRet)
1401 return E_INVALIDARG;
1402
1403 /* If it is a complex pidl, let the child handle it */
1404 if (!_ILIsPidlSimple (pidl)) /* complex pidl */
1405 {
1406 return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
1407 }
1408 else if (pidl && !pidl->mkid.cb) /* empty pidl */
1409 {
1410 /* If it is an empty pidl return only the path of the folder */
1414 {
1415 return SHSetStrRet(strRet, m_sPathTarget);
1416 }
1417 return E_INVALIDARG;
1418 }
1419
1420 int len = 0;
1421 LPWSTR pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
1422 if (!pszPath)
1423 return E_OUTOFMEMORY;
1424
1428 {
1429 lstrcpynW(pszPath, m_sPathTarget, MAX_PATH);
1430 PathAddBackslashW(pszPath);
1431 len = wcslen(pszPath);
1432 }
1433 _ILSimpleGetTextW(pidl, pszPath + len, MAX_PATH + 1 - len);
1435
1436 strRet->uType = STRRET_WSTR;
1437 strRet->pOleStr = pszPath;
1438
1439 TRACE ("-- (%p)->(%s)\n", this, strRet->uType == STRRET_CSTR ? strRet->cStr : debugstr_w(strRet->pOleStr));
1440 return S_OK;
1441}
1442
1443/**************************************************************************
1444* CFSFolder::SetNameOf
1445* Changes the name of a file object or subfolder, possibly changing its item
1446* identifier in the process.
1447*
1448* PARAMETERS
1449* HWND hwndOwner, //[in ] Owner window for output
1450* LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
1451* LPCOLESTR lpszName, //[in ] the items new display name
1452* DWORD dwFlags, //[in ] SHGNO formatting flags
1453* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
1454*/
1456 HWND hwndOwner,
1457 PCUITEMID_CHILD pidl,
1458 LPCOLESTR lpName,
1459 DWORD dwFlags,
1460 PITEMID_CHILD *pPidlOut)
1461{
1462 WCHAR szSrc[MAX_PATH + 1], szDest[MAX_PATH + 1];
1463 BOOL bIsFolder = _ILIsFolder (ILFindLastID (pidl));
1464
1465 TRACE ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", this, hwndOwner, pidl,
1466 debugstr_w (lpName), dwFlags, pPidlOut);
1467
1468 FileStructW* pDataW = _ILGetFileStructW(pidl);
1469 if (!pDataW)
1470 {
1471 ERR("Got garbage pidl:\n");
1472 pdump_always(pidl);
1473 return E_INVALIDARG;
1474 }
1475
1476 /* build source path */
1477 PathCombineW(szSrc, m_sPathTarget, pDataW->wszName);
1478
1479 /* build destination path */
1482 else
1483 lstrcpynW(szDest, lpName, MAX_PATH);
1484
1486 WCHAR *ext = PathFindExtensionW(szSrc);
1487 if(*ext != '\0') {
1488 INT len = wcslen(szDest);
1489 lstrcpynW(szDest + len, ext, MAX_PATH - len);
1490 }
1491 }
1492
1493 TRACE ("src=%s dest=%s\n", debugstr_w(szSrc), debugstr_w(szDest));
1494 if (!wcscmp(szSrc, szDest))
1495 {
1496 /* src and destination is the same */
1497 HRESULT hr = S_OK;
1498 if (pPidlOut)
1499 hr = _ILCreateFromPathW(szDest, pPidlOut);
1500
1501 return hr;
1502 }
1503
1504 if (MoveFileW (szSrc, szDest))
1505 {
1506 HRESULT hr = S_OK;
1507
1508 if (pPidlOut)
1509 hr = _ILCreateFromPathW(szDest, pPidlOut);
1510
1512 SHCNF_PATHW, szSrc, szDest);
1513
1514 return hr;
1515 }
1516
1517 return E_FAIL;
1518}
1519
1521{
1522 FIXME ("(%p)\n", this);
1523 return E_NOTIMPL;
1524}
1525
1527{
1528 FIXME ("(%p)\n", this);
1529 return E_NOTIMPL;
1530}
1531
1533 ULONG * pSort, ULONG * pDisplay)
1534{
1535 TRACE ("(%p)\n", this);
1536
1537 if (pSort)
1538 *pSort = 0;
1539 if (pDisplay)
1540 *pDisplay = 0;
1541
1542 return S_OK;
1543}
1544
1546 DWORD * pcsFlags)
1547{
1548 TRACE ("(%p)\n", this);
1549
1550 if (!pcsFlags || iColumn >= GENERICSHELLVIEWCOLUMNS)
1551 return E_INVALIDARG;
1552
1553 *pcsFlags = GenericSFHeader[iColumn].pcsFlags;
1554
1555 return S_OK;
1556}
1557
1559 const SHCOLUMNID * pscid, VARIANT * pv)
1560{
1561 FIXME ("(%p)\n", this);
1562
1563 return E_NOTIMPL;
1564}
1565
1567 UINT iColumn, SHELLDETAILS * psd)
1568{
1569 HRESULT hr = E_FAIL;
1570
1571 TRACE ("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
1572
1573 if (!psd || iColumn >= GENERICSHELLVIEWCOLUMNS)
1574 return E_INVALIDARG;
1575
1576 if (!pidl)
1577 {
1578 /* the header titles */
1579 psd->fmt = GenericSFHeader[iColumn].fmt;
1580 psd->cxChar = GenericSFHeader[iColumn].cxChar;
1581 return SHSetStrRet(&psd->str, GenericSFHeader[iColumn].colnameid);
1582 }
1583 else
1584 {
1585 hr = S_OK;
1586 psd->str.uType = STRRET_CSTR;
1587 /* the data from the pidl */
1588 switch (iColumn)
1589 {
1590 case 0: /* name */
1592 break;
1593 case 1: /* type */
1594 _ILGetFileType(pidl, psd->str.cStr, MAX_PATH);
1595 break;
1596 case 2: /* size */
1597 _ILGetFileSize(pidl, psd->str.cStr, MAX_PATH);
1598 break;
1599 case 3: /* date */
1600 _ILGetFileDate(pidl, psd->str.cStr, MAX_PATH);
1601 break;
1602 case 4: /* attributes */
1604 break;
1605 case 5: /* FIXME: comments */
1606 psd->str.cStr[0] = 0;
1607 break;
1608 }
1609 }
1610
1611 return hr;
1612}
1613
1615 SHCOLUMNID * pscid)
1616{
1617 FIXME ("(%p)\n", this);
1618 return E_NOTIMPL;
1619}
1620
1621/************************************************************************
1622 * CFSFolder::GetClassID
1623 */
1625{
1626 TRACE ("(%p)\n", this);
1627
1628 if (!lpClassId)
1629 return E_POINTER;
1630
1631 *lpClassId = *m_pclsid;
1632
1633 return S_OK;
1634}
1635
1636/************************************************************************
1637 * CFSFolder::Initialize
1638 *
1639 * NOTES
1640 * m_sPathTarget is not set. Don't know how to handle in a non rooted environment.
1641 */
1643{
1644 WCHAR wszTemp[MAX_PATH];
1645
1646 TRACE ("(%p)->(%p)\n", this, pidl);
1647
1648 SHFree(m_pidlRoot); /* free the old pidl */
1649 m_pidlRoot = ILClone (pidl); /* set my pidl */
1650
1653
1654 /* set my path */
1655 if (SHGetPathFromIDListW (pidl, wszTemp))
1656 {
1657 int len = wcslen(wszTemp);
1658 m_sPathTarget = (WCHAR *)SHAlloc((len + 1) * sizeof(WCHAR));
1659 if (!m_sPathTarget)
1660 return E_OUTOFMEMORY;
1661 memcpy(m_sPathTarget, wszTemp, (len + 1) * sizeof(WCHAR));
1662 }
1663
1664 TRACE ("--(%p)->(%s)\n", this, debugstr_w(m_sPathTarget));
1665 return S_OK;
1666}
1667
1668/**************************************************************************
1669 * CFSFolder::GetCurFolder
1670 */
1672{
1673 TRACE ("(%p)->(%p)\n", this, pidl);
1674
1675 if (!pidl)
1676 return E_POINTER;
1677
1678 *pidl = ILClone(m_pidlRoot);
1679 return S_OK;
1680}
1681
1682/**************************************************************************
1683 * CFSFolder::InitializeEx
1684 *
1685 * FIXME: error handling
1686 */
1688 const PERSIST_FOLDER_TARGET_INFO * ppfti)
1689{
1690 WCHAR wszTemp[MAX_PATH];
1691
1692 TRACE("(%p)->(%p,%p,%p)\n", this, pbc, pidlRootx, ppfti);
1693 if (ppfti)
1694 TRACE("--%p %s %s 0x%08x 0x%08x\n",
1696 debugstr_w (ppfti->szNetworkProvider), ppfti->dwAttributes,
1697 ppfti->csidl);
1698
1699 pdump (pidlRootx);
1700 if (ppfti && ppfti->pidlTargetFolder)
1701 pdump(ppfti->pidlTargetFolder);
1702
1703 if (m_pidlRoot)
1704 __SHFreeAndNil(&m_pidlRoot); /* free the old */
1705 if (m_sPathTarget)
1707
1708 /*
1709 * Root path and pidl
1710 */
1711 m_pidlRoot = ILClone(pidlRootx);
1712
1713 /*
1714 * the target folder is spezified in csidl OR pidlTargetFolder OR
1715 * szTargetParsingName
1716 */
1717 if (ppfti)
1718 {
1719 if (ppfti->csidl != -1)
1720 {
1721 if (SHGetSpecialFolderPathW(0, wszTemp, ppfti->csidl,
1722 ppfti->csidl & CSIDL_FLAG_CREATE)) {
1723 int len = wcslen(wszTemp);
1724 m_sPathTarget = (WCHAR *)SHAlloc((len + 1) * sizeof(WCHAR));
1725 if (!m_sPathTarget)
1726 return E_OUTOFMEMORY;
1727 memcpy(m_sPathTarget, wszTemp, (len + 1) * sizeof(WCHAR));
1728 }
1729 }
1730 else if (ppfti->szTargetParsingName[0])
1731 {
1732 int len = wcslen(ppfti->szTargetParsingName);
1733 m_sPathTarget = (WCHAR *)SHAlloc((len + 1) * sizeof(WCHAR));
1734 if (!m_sPathTarget)
1735 return E_OUTOFMEMORY;
1737 (len + 1) * sizeof(WCHAR));
1738 }
1739 else if (ppfti->pidlTargetFolder)
1740 {
1741 if (SHGetPathFromIDListW(ppfti->pidlTargetFolder, wszTemp))
1742 {
1743 int len = wcslen(wszTemp);
1744 m_sPathTarget = (WCHAR *)SHAlloc((len + 1) * sizeof(WCHAR));
1745 if (!m_sPathTarget)
1746 return E_OUTOFMEMORY;
1747 memcpy(m_sPathTarget, wszTemp, (len + 1) * sizeof(WCHAR));
1748 }
1749 }
1750 }
1751
1752 TRACE("--(%p)->(target=%s)\n", this, debugstr_w(m_sPathTarget));
1754 return (m_sPathTarget) ? S_OK : E_FAIL;
1755}
1756
1758{
1759 FIXME("(%p)->(%p)\n", this, ppfti);
1760 ZeroMemory(ppfti, sizeof (*ppfti));
1761 return E_NOTIMPL;
1762}
1763
1765{
1767
1768 sprintfW(buf, L"ShellEx\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
1769 riid.Data1, riid.Data2, riid.Data3,
1770 riid.Data4[0], riid.Data4[1], riid.Data4[2], riid.Data4[3],
1771 riid.Data4[4], riid.Data4[5], riid.Data4[6], riid.Data4[7]);
1772
1773 CLSID clsid;
1774 HRESULT hr;
1775
1776 hr = GetCLSIDForFileType(pidl, buf, &clsid);
1777 if (hr != S_OK)
1778 return hr;
1779
1780 hr = _CreateShellExtInstance(&clsid, pidl, riid, ppvOut);
1782 return hr;
1783
1784 return S_OK;
1785}
1786
1788{
1789 HRESULT hr;
1790
1791 TRACE("CFSFolder::_GetDropTarget entered\n");
1792
1793 if (_ILIsFolder (pidl))
1794 {
1795 CComPtr<IShellFolder> psfChild;
1796 hr = this->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, &psfChild));
1798 return hr;
1799
1800 return psfChild->CreateViewObject(NULL, IID_IDropTarget, ppvOut);
1801 }
1802
1803 CLSID clsid;
1804 hr = GetCLSIDForFileType(pidl, L"shellex\\DropHandler", &clsid);
1805 if (hr != S_OK)
1806 return hr;
1807
1808 hr = _CreateShellExtInstance(&clsid, pidl, IID_IDropTarget, ppvOut);
1810 return S_FALSE;
1811
1812 return S_OK;
1813}
1814
1816{
1817 CLSID clsid;
1818 HRESULT hr;
1819
1820 hr = GetCLSIDForFileType(pidl, L"shellex\\IconHandler", &clsid);
1821 if (hr != S_OK)
1822 return hr;
1823
1824 hr = _CreateShellExtInstance(&clsid, pidl, riid, ppvOut);
1826 return S_FALSE;
1827
1828 return S_OK;
1829}
1830
1832{
1833 HRESULT hr;
1834 WCHAR wszPath[MAX_PATH];
1835
1836 FileStructW* pDataW = _ILGetFileStructW(pidl);
1837 if (!pDataW)
1838 {
1839 ERR("Got garbage pidl\n");
1840 pdump_always(pidl);
1841 return E_INVALIDARG;
1842 }
1843
1844 PathCombineW(wszPath, m_sPathTarget, pDataW->wszName);
1845
1846 CComPtr<IPersistFile> pp;
1849 return hr;
1850
1851 pp->Load(wszPath, 0);
1852
1853 hr = pp->QueryInterface(riid, ppvOut);
1854 if (hr != S_OK)
1855 {
1856 ERR("Failed to query for interface IID_IShellExtInit hr %x pclsid %s\n", hr, wine_dbgstr_guid(pclsid));
1857 return hr;
1858 }
1859 return hr;
1860}
1861
1863{
1864 if (uMsg != DFM_MERGECONTEXTMENU && uMsg != DFM_INVOKECOMMAND)
1865 return S_OK;
1866
1867 /* no data object means no selection */
1868 if (!pdtobj)
1869 {
1870 if (uMsg == DFM_INVOKECOMMAND && wParam == 0)
1871 {
1872 // Create an data object
1873 CComHeapPtr<ITEMID_CHILD> pidlChild(ILClone(ILFindLastID(m_pidlRoot)));
1874 CComHeapPtr<ITEMIDLIST> pidlParent(ILClone(m_pidlRoot));
1875 ILRemoveLastID(pidlParent);
1876
1877 CComPtr<IDataObject> pDataObj;
1878 HRESULT hr = SHCreateDataObject(pidlParent, 1, &pidlChild, NULL, IID_PPV_ARG(IDataObject, &pDataObj));
1879 if (!FAILED_UNEXPECTEDLY(hr))
1880 {
1881 // Ask for a title to display
1882 CComHeapPtr<WCHAR> wszName;
1883 if (!FAILED_UNEXPECTEDLY(SHGetNameFromIDList(m_pidlRoot, SIGDN_PARENTRELATIVEPARSING, &wszName)))
1884 {
1885 BOOL bSuccess = SH_ShowPropertiesDialog(wszName, pDataObj);
1886 if (!bSuccess)
1887 ERR("SH_ShowPropertiesDialog failed\n");
1888 }
1889 }
1890 }
1891 else if (uMsg == DFM_MERGECONTEXTMENU)
1892 {
1893 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1894 HMENU hpopup = CreatePopupMenu();
1896 Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu++, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1897 DestroyMenu(hpopup);
1898 }
1899
1900 return S_OK;
1901 }
1902
1904 return S_OK;
1905
1906 return Shell_DefaultContextMenuCallBack(this, pdtobj);
1907}
1908
1910{
1911 // create stream from file
1912 HRESULT hr;
1913 CComPtr<IStream> pStream;
1915 FALSE, NULL, &pStream);
1916 if (FAILED(hr))
1917 return NULL;
1918
1919 // load the picture
1920 HBITMAP hbm = NULL;
1921 CComPtr<IPicture> pPicture;
1922 OleLoadPicture(pStream, 0, FALSE, IID_IPicture, (LPVOID *)&pPicture);
1923
1924 // get the bitmap handle
1925 if (pPicture)
1926 {
1927 pPicture->get_Handle((OLE_HANDLE *)&hbm);
1928
1929 // copy the bitmap handle
1931 }
1932
1933 return hbm;
1934}
1935
1937{
1938 if (data == NULL)
1939 {
1940 return E_POINTER;
1941 }
1942 if (data->cbSize != sizeof(*data))
1943 {
1944 // NOTE: You have to set the cbData member before SFVM_GET_CUSTOMVIEWINFO call.
1945 return E_INVALIDARG;
1946 }
1947
1948 data->hbmBack = NULL;
1949 data->clrText = CLR_INVALID;
1950 data->clrTextBack = CLR_INVALID;
1951
1953
1954 // does the folder exists?
1956 {
1957 return E_INVALIDARG;
1958 }
1959
1960 // don't use custom view in network path for security
1962 {
1963 return E_ACCESSDENIED;
1964 }
1965
1966 // build the ini file path
1968 PathAppend(szIniFile, L"desktop.ini");
1969
1970 static LPCWSTR TheGUID = L"{BE098140-A513-11D0-A3A4-00C04FD706EC}";
1971 static LPCWSTR Space = L" \t\n\r\f\v";
1972
1973 // get info from ini file
1974 WCHAR szImage[MAX_PATH], szText[64];
1975
1976 // load the image
1977 szImage[0] = UNICODE_NULL;
1978 GetPrivateProfileStringW(TheGUID, L"IconArea_Image", L"", szImage, _countof(szImage), szIniFile);
1979 if (szImage[0])
1980 {
1981 StrTrimW(szImage, Space);
1982 if (PathIsRelativeW(szImage))
1983 {
1984 PathAppendW(szPath, szImage);
1985 StringCchCopyW(szImage, _countof(szImage), szPath);
1986 }
1987 data->hbmBack = DoLoadPicture(szImage);
1988 }
1989
1990 // load the text color
1991 szText[0] = UNICODE_NULL;
1992 GetPrivateProfileStringW(TheGUID, L"IconArea_Text", L"", szText, _countof(szText), szIniFile);
1993 if (szText[0])
1994 {
1995 StrTrimW(szText, Space);
1996
1997 LPWSTR pchEnd = NULL;
1998 COLORREF cr = (wcstol(szText, &pchEnd, 0) & 0xFFFFFF);
1999
2000 if (pchEnd && !*pchEnd)
2001 data->clrText = cr;
2002 }
2003
2004 // load the text background color
2005 szText[0] = UNICODE_NULL;
2006 GetPrivateProfileStringW(TheGUID, L"IconArea_TextBackground", L"", szText, _countof(szText), szIniFile);
2007 if (szText[0])
2008 {
2009 StrTrimW(szText, Space);
2010
2011 LPWSTR pchEnd = NULL;
2012 COLORREF cr = (wcstol(szText, &pchEnd, 0) & 0xFFFFFF);
2013
2014 if (pchEnd && !*pchEnd)
2015 data->clrTextBack = cr;
2016 }
2017
2018 if (data->hbmBack != NULL || data->clrText != CLR_INVALID || data->clrTextBack != CLR_INVALID)
2019 return S_OK;
2020
2021 return E_FAIL;
2022}
2023
2025{
2027 switch (uMsg)
2028 {
2031 break;
2032 }
2033 return hr;
2034}
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3855
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv)
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
HRESULT CFSDropTarget_CreateInstance(LPWSTR sPathTarget, REFIID riid, LPVOID *ppvOut)
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
HRESULT WINAPI SHCreateDataObject(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pdtInner, REFIID riid, void **ppv)
#define SFVM_GET_CUSTOMVIEWINFO
DWORD dwFileAttributes
UINT cchMax
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define IDI_SHELL_FOLDER
Definition: treeview.c:36
#define IDS_PROPERTIES
Definition: resource.h:102
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
#define RegCloseKey(hKey)
Definition: registry.h:49
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
BOOL AddToEnumList(LPITEMIDLIST pidl)
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
Definition: CFSFolder.cpp:1397
STDMETHOD() CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) override
Definition: CFSFolder.cpp:1862
STDMETHOD() Initialize(PCIDLIST_ABSOLUTE pidl) override
Definition: CFSFolder.cpp:1642
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
Definition: CFSFolder.cpp:882
HRESULT _CreateShellExtInstance(const CLSID *pclsid, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1831
STDMETHOD() SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
Definition: CFSFolder.cpp:1455
DWORD m_bGroupPolicyActive
Definition: CFSFolder.h:31
HRESULT _GetIconHandler(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1815
LPWSTR m_sPathTarget
Definition: CFSFolder.h:27
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
Definition: CFSFolder.cpp:1159
STDMETHOD() CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
Definition: CFSFolder.cpp:1003
STDMETHOD() GetCurFolder(PIDLIST_ABSOLUTE *pidl) override
Definition: CFSFolder.cpp:1671
BOOL _GetFindDataFromName(_In_ LPCWSTR pszName, _Out_ WIN32_FIND_DATAW *pFind)
Definition: CFSFolder.cpp:708
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
Definition: CFSFolder.cpp:1239
HRESULT _GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1787
HRESULT _CreateIDListFromName(LPCWSTR pszName, DWORD attrs, IBindCtx *pbc, LPITEMIDLIST *ppidl)
Definition: CFSFolder.cpp:722
STDMETHOD() MapColumnToSCID(UINT column, SHCOLUMNID *pscid) override
Definition: CFSFolder.cpp:1614
HRESULT _ParseSimple(_In_ LPOLESTR lpszDisplayName, _Out_ WIN32_FIND_DATAW *pFind, _Out_ LPITEMIDLIST *ppidl)
Definition: CFSFolder.cpp:668
const CLSID * m_pclsid
Definition: CFSFolder.h:24
STDMETHOD() BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
Definition: CFSFolder.cpp:986
STDMETHOD() ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override
Definition: CFSFolder.cpp:778
STDMETHOD() InitializeEx(IBindCtx *pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO *ppfti) override
Definition: CFSFolder.cpp:1687
STDMETHOD() GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) override
Definition: CFSFolder.cpp:1545
HRESULT WINAPI GetCustomViewInfo(ULONG unknown, SFVM_CUSTOMVIEWINFO_DATA *data)
Definition: CFSFolder.cpp:1936
STDMETHOD() MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) override
Definition: CFSFolder.cpp:2024
LPITEMIDLIST m_pidlRoot
Definition: CFSFolder.h:29
STDMETHOD() GetFolderTargetInfo(PERSIST_FOLDER_TARGET_INFO *ppfti) override
Definition: CFSFolder.cpp:1757
STDMETHOD() GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
Definition: CFSFolder.cpp:1558
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
Definition: CFSFolder.cpp:1526
STDMETHOD() GetDefaultSearchGUID(GUID *pguid) override
Definition: CFSFolder.cpp:1520
STDMETHOD() GetClassID(CLSID *lpClassId) override
Definition: CFSFolder.cpp:1624
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
Definition: CFSFolder.cpp:1064
STDMETHOD() GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
Definition: CFSFolder.cpp:1532
STDMETHOD() BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
Definition: CFSFolder.cpp:898
HRESULT _CreateExtensionUIObject(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1764
STDMETHOD() GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
Definition: CFSFolder.cpp:1566
HRESULT _AddFindResult(LPWSTR sParentDir, const WIN32_FIND_DATAW &FindData, DWORD dwFlags)
Definition: CFSFolder.cpp:350
HRESULT WINAPI Initialize(LPWSTR sPathTarget, DWORD dwFlags)
Definition: CFSFolder.cpp:453
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define CHARS_IN_GUID
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
void pdump_always(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:319
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:311
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:428
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDS_SHV_COLUMN_TYPE
Definition: resource.h:75
#define IDS_SHV_COLUMN_NAME
Definition: resource.h:74
#define GET_SHGDN_RELATION(dwFlags)
Definition: precomp.h:53
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
#define GET_SHGDN_FOR(dwFlags)
Definition: precomp.h:52
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4241
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
UINT uFlags
Definition: api.c:59
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define wcsicmp
Definition: compat.h:15
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
static const WCHAR *const ext[]
Definition: module.c:53
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
BOOL WINAPI MoveFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName)
Definition: move.c:1104
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
UINT WINAPI GetPrivateProfileIntW(LPCWSTR section, LPCWSTR entry, INT def_val, LPCWSTR filename)
Definition: profile.c:1297
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
Definition: profile.c:1142
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
HRESULT WINAPI OleLoadPicture(LPSTREAM lpstream, LONG lSize, BOOL fRunmode, REFIID riid, LPVOID *ppvObj)
Definition: olepicture.c:2344
#define RRF_RT_REG_DWORD
Definition: driver.c:578
#define RRF_RT_REG_SZ
Definition: driver.c:575
BOOL SHELL_FS_HideExtension(LPCWSTR szPath)
Definition: CFSFolder.cpp:1330
static HRESULT SHELL32_GetCLSIDForDirectory(LPCWSTR pwszDir, LPCWSTR KeyName, CLSID *pclsidFolder)
Definition: CFSFolder.cpp:542
#define GENERICSHELLVIEWCOLUMNS
Definition: CFSFolder.cpp:540
static BOOL getShellClassInfo(LPCWSTR Entry, LPWSTR pszValue, DWORD cchValueLen, LPCWSTR IniFile)
Definition: CFSFolder.cpp:161
#define SUPER_HIDDEN
static HRESULT getIconLocationForFolder(IShellFolder *psf, PCITEMID_CHILD pidl, UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
Definition: CFSFolder.cpp:167
HRESULT SHELL32_GetFSItemAttributes(IShellFolder *psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes)
Definition: CFSFolder.cpp:562
static HRESULT getDefaultIconLocation(LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT uFlags)
Definition: CFSFolder.cpp:137
HRESULT GetCLSIDForFileTypeFromExtension(LPWSTR pExtension, LPCWSTR KeyName, CLSID *pclsid)
Definition: CFSFolder.cpp:72
static const shvheader GenericSFHeader[]
Definition: CFSFolder.cpp:531
HRESULT GetCLSIDForFileType(PCUIDLIST_RELATIVE pidl, LPCWSTR KeyName, CLSID *pclsid)
Definition: CFSFolder.cpp:127
void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags)
Definition: CFSFolder.cpp:1374
HRESULT CFSExtractIcon_CreateInstance(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID iid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:243
static HBITMAP DoLoadPicture(LPCWSTR pszFileName)
Definition: CFSFolder.cpp:1909
HKEY OpenKeyFromFileType(LPWSTR pExtension, LPCWSTR KeyName)
Definition: CFSFolder.cpp:18
LPWSTR ExtensionFromPidl(PCUIDLIST_RELATIVE pidl)
Definition: CFSFolder.cpp:48
DWORD BindCtx_GetMode(_In_ IBindCtx *pbc, _In_ DWORD dwDefault)
Definition: utils.cpp:114
HRESULT WINAPI Shell_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdtobj)
Definition: shlfolder.cpp:497
HRESULT SHIsFileSysBindCtx(_In_ IBindCtx *pBindCtx, _Out_opt_ WIN32_FIND_DATAW *pFindData)
Definition: utils.cpp:139
HRESULT SHILAppend(_Inout_ LPITEMIDLIST pidl, _Inout_ LPITEMIDLIST *ppidl)
Definition: utils.cpp:59
BOOL PathIsDosDevice(_In_ LPCWSTR pszName)
Definition: utils.cpp:38
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
HRESULT WINAPI SHCoCreateInstance(LPCWSTR aclsid, const CLSID *clsid, LPUNKNOWN pUnkOuter, REFIID refiid, LPVOID *ppv)
Definition: shellole.c:105
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3092
HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode, DWORD dwAttributes, BOOL bCreate, IStream *lpTemplate, IStream **lppStream)
Definition: istream.c:401
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:823
VOID WINAPI PathUnquoteSpacesW(LPWSTR lpszPath)
Definition: path.c:1034
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1723
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1092
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1579
HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID, LPCWSTR, BOOL, BOOL, PHKEY)
Definition: reg.c:2422
DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1461
BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim)
Definition: string.c:1877
static BOOLEAN bSuccess
Definition: drive.cpp:433
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
BOOL SH_ShowPropertiesDialog(LPCWSTR pwszPath, IDataObject *pDataObj)
Definition: fprop.cpp:83
FxAutoRegKey hKey
Status
Definition: gdiplustypes.h:25
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint res
Definition: glext.h:9613
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define ULONG_MAX
Definition: limits.h:44
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
REFIID riid
Definition: atlbase.h:39
ULONG SFGAOF
Definition: shobjidl.idl:228
HRESULT BindToObject([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
HRESULT GetAttributesOf([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_w
Definition: kernel32.h:32
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define END_COM_MAP()
Definition: atlcom.h:592
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
#define alloca
Definition: malloc.h:357
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LPCWSTR szPath
Definition: env.c:37
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static HBITMAP
Definition: button.c:44
HRESULT hres
Definition: protocol.c:465
static HANDLE ULONG_PTR dwData
Definition: file.c:35
static LPOLESTR
Definition: stg_prop.c:27
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
REFCLSID clsid
Definition: msctf.c:82
unsigned int UINT
Definition: ndis.h:50
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define KEY_READ
Definition: nt_native.h:1023
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define DWORD
Definition: nt_native.h:44
#define UNICODE_NULL
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
#define L(x)
Definition: ntvdm.h:50
#define STGM_CREATE
Definition: objbase.h:926
#define STGM_READ
Definition: objbase.h:917
interface IBindCtx * LPBC
Definition: objfwd.h:18
const GUID IID_IPicture
const GUID IID_IDataObject
#define PathCombineW
Definition: pathcch.h:317
#define PathAddBackslashW
Definition: pathcch.h:301
#define PathAppendW
Definition: pathcch.h:309
#define LOWORD(l)
Definition: pedump.c:82
long LONG
Definition: pedump.c:60
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:938
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:198
BOOL _ILGetFileDate(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2466
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2650
HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName)
Definition: pidl.c:1467
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2231
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
Definition: pidl.c:221
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1361
DWORD _ILGetFileSize(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2510
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2405
HRESULT _ILCreateFromPathW(LPCWSTR szPath, LPITEMIDLIST *ppidl)
Definition: pidl.c:1833
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2020
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1353
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:100
void _ILGetFileType(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2577
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2029
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2008
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2531
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2151
LPITEMIDLIST _ILCreateFromFindDataW(const WIN32_FIND_DATAW *wfd)
Definition: pidl.c:1785
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define LVCFMT_RIGHT
Definition: commctrl.h:2599
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define strcmpW(s1, s2)
Definition: unicode.h:38
#define sprintfW
Definition: unicode.h:58
WCHAR classname[128]
Definition: startup.c:15
TCHAR szIniFile[]
Definition: scrnsave.c:29
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:291
#define __SHFreeAndNil(ptr)
Definition: shell32_main.h:146
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) DECLSPEC_HIDDEN
Definition: shellord.c:117
#define CSIDL_FLAG_CREATE
#define STATUS_SUCCESS
Definition: shellext.h:65
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:579
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:168
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:206
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:224
void AddFSClassKeysToArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:292
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:277
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:247
HRESULT Shell_NextElement(_Inout_ LPWSTR *ppch, _Out_ LPWSTR pszOut, _In_ INT cchOut, _In_ BOOL bValidate)
Definition: shlfolder.cpp:30
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
HRESULT hr
Definition: shlfolder.c:183
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
#define SHCNE_RENAMEITEM
Definition: shlobj.h:1875
#define SHCNE_RENAMEFOLDER
Definition: shlobj.h:1892
#define SHCNF_PATHW
Definition: shlobj.h:1910
#define MM_ADDSEPARATOR
Definition: shlobj.h:2513
struct _SFV_CREATE SFV_CREATE
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2597
LSTATUS WINAPI SHRegGetValueW(_In_ HKEY hkey, _In_opt_ LPCWSTR pszSubKey, _In_opt_ LPCWSTR pszValue, _In_ SRRF srrfFlags, _Out_opt_ LPDWORD pdwType, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID pvData, _Inout_opt_ LPDWORD pcbData)
#define PathIsNetworkPath
Definition: shlwapi.h:1101
#define PathAppend
Definition: shlwapi.h:801
#define IDI_SHELL_EXE
Definition: shresdef.h:553
#define IDS_SHV_COLUMN_SIZE
Definition: shresdef.h:52
#define IDS_SHV_COLUMN_MODIFIED
Definition: shresdef.h:54
#define IDI_SHELL_DOCUMENT
Definition: shresdef.h:551
#define IDS_SHV_COLUMN_COMMENTS
Definition: shresdef.h:69
#define IDS_SHV_COLUMN_ATTRIBUTES
Definition: shresdef.h:55
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
@ 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_DATE
Definition: shtypes.idl:123
@ SHCOLSTATE_TYPE_STR
Definition: shtypes.idl:121
@ SHCOLSTATE_ONBYDEFAULT
Definition: shtypes.idl:125
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:68
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
IContextMenuCB * pcmcb
Definition: shlobj.h:2535
IShellFolder * psf
Definition: shlobj.h:2537
IUnknown * punkAssociationInfo
Definition: shlobj.h:2540
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2539
const HKEY * aKeys
Definition: shlobj.h:2542
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2536
base of all file and directory entries
Definition: entries.h:83
WCHAR wszName[1]
Definition: shlfolder.c:1555
STRRET str
Definition: shtypes.idl:108
HMENU hmenu
Definition: shlobj.h:1381
UINT idCmdLast
Definition: shlobj.h:1384
UINT idCmdFirst
Definition: shlobj.h:1383
UINT indexMenu
Definition: shlobj.h:1382
char cStr[MAX_PATH]
Definition: shtypes.idl:98
UINT uType
Definition: shtypes.idl:93
LPWSTR pOleStr
Definition: shtypes.idl:96
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
#define ILGDN_FORPARSING
Definition: undocshell.h:70
DWORD dwAttributes
Definition: vdmdbg.h:34
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44
int ret
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ LPCSTR lpName
Definition: winbase.h:2789
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define E_ACCESSDENIED
Definition: winerror.h:2849
#define ERROR_NO_MORE_FILES
Definition: winerror.h:121
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define E_POINTER
Definition: winerror.h:2365
#define ERROR_BAD_DEVICE
Definition: winerror.h:703
#define CLR_INVALID
Definition: wingdi.h:883
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define IMAGE_BITMAP
Definition: winuser.h:211
UINT WINAPI PrivateExtractIconsW(_In_reads_(MAX_PATH) LPCWSTR szFileName, _In_ int nIconIndex, _In_ int cxIcon, _In_ int cyIcon, _Out_writes_opt_(nIcons) HICON *phicon, _Out_writes_opt_(nIcons) UINT *piconid, _In_ UINT nIcons, _In_ UINT flags)
#define LR_CREATEDIBSECTION
Definition: winuser.h:1098
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1987
#define wsprintf
Definition: winuser.h:5865
#define MFS_ENABLED
Definition: winuser.h:750
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MFT_STRING
Definition: winuser.h:746
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
_In_ PSTRING FullName
Definition: rtlfuncs.h:1648
#define IID_PPV_ARG(Itype, ppType)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185