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