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