ReactOS 0.4.15-dev-5672-gf73ac17
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
15static HRESULT SHELL32_GetCLSIDForDirectory(LPCWSTR pwszDir, LPCWSTR KeyName, CLSID* pclsidFolder);
16
17
19{
20 HKEY hkey;
21
23 DWORD dwSize = sizeof(FullName);
24 wsprintf(FullName, L"%s\\%s", pExtension, KeyName);
25
27 if (!res)
28 return hkey;
29
31 if (res)
32 {
33 WARN("Failed to get progid for extension %S (%x), error %d\n", pExtension, pExtension, res);
34 return NULL;
35 }
36
37 wcscat(FullName, L"\\");
39
40 hkey = NULL;
42 if (res)
43 WARN("Could not open key %S for extension %S\n", KeyName, pExtension);
44
45 return hkey;
46}
47
49{
50 if (!_ILIsValue(pidl))
51 {
52 ERR("Invalid pidl!\n");
53 return NULL;
54 }
55
56 FileStructW* pDataW = _ILGetFileStructW(pidl);
57 if (!pDataW)
58 {
59 ERR("Invalid pidl!\n");
60 return NULL;
61 }
62
63 LPWSTR pExtension = PathFindExtensionW(pDataW->wszName);
64 if (!pExtension || *pExtension == UNICODE_NULL)
65 {
66 WARN("No extension for %S!\n", pDataW->wszName);
67 return NULL;
68 }
69 return pExtension;
70}
71
73{
74 HKEY hkeyProgId = OpenKeyFromFileType(pExtension, KeyName);
75 if (!hkeyProgId)
76 {
77 WARN("OpenKeyFromFileType failed for key %S\n", KeyName);
78 return S_FALSE;
79 }
80
81 WCHAR wszCLSIDValue[CHARS_IN_GUID];
82 DWORD dwSize = sizeof(wszCLSIDValue);
83 LONG res = RegGetValueW(hkeyProgId, NULL, NULL, RRF_RT_REG_SZ, NULL, wszCLSIDValue, &dwSize);
84 RegCloseKey(hkeyProgId);
85 if (res)
86 {
87 ERR("OpenKeyFromFileType succeeded but RegGetValueW failed\n");
88 return S_FALSE;
89 }
90
91#if 0
92 {
94 L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved",
95 wszCLSIDValue,
97 NULL,
98 NULL,
99 NULL);
100 if (res != ERROR_SUCCESS)
101 {
102 ERR("DropHandler extension %S not approved\n", wszName);
103 return E_ACCESSDENIED;
104 }
105 }
106#endif
107
109 L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Blocked",
110 wszCLSIDValue,
112 NULL,
113 NULL,
115 {
116 ERR("Extension %S not approved\n", wszCLSIDValue);
117 return E_ACCESSDENIED;
118 }
119
120 HRESULT hres = CLSIDFromString (wszCLSIDValue, pclsid);
122 return hres;
123
124 return S_OK;
125}
126
128{
129 LPWSTR pExtension = ExtensionFromPidl(pidl);
130 if (!pExtension)
131 return S_FALSE;
132
133 return GetCLSIDForFileTypeFromExtension(pExtension, KeyName, pclsid);
134}
135
136static HRESULT
138{
139 if (!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
157static BOOL
158getShellClassInfo(LPCWSTR Entry, LPWSTR pszValue, DWORD cchValueLen, LPCWSTR IniFile)
159{
160 return GetPrivateProfileStringW(L".ShellClassInfo", Entry, NULL, pszValue, cchValueLen, IniFile);
161}
162
163static 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
236Quit:
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/*
336CFileSysEnum should do an initial FindFirstFile and do a FindNextFile as each file is
337returned by Next. When the enumerator is created, it can do numerous additional operations
338including formatting a drive, reconnecting a network share drive, and requesting a disk
339be inserted in a removable drive.
340*/
341
342
344 public CEnumIDListBase
345{
346private:
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
440public:
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);
463 return hr;
464
465 /* FIXME: UNSAFE CRAP */
466 PathAddBackslashW(szFindPattern);
467
468 hr = StringCchCatW(szFindPattern, _countof(szFindPattern), L"*.*");
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
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)
504};
505
506
507/***********************************************************************
508 * IShellFolder implementation
509 */
510
512{
513 m_pclsid = &CLSID_ShellFSFolder;
517}
518
520{
521 TRACE("-- destroying IShellFolder(%p)\n", this);
522
525}
526
527
528static 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;
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 {
636 DWORD dwSize = sizeof(dwAttributes);
638
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
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,
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*/
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 */
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);
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*/
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: /* Attributes */
991 return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
992 case 5: /* Comments */
993 result = 0;
994 break;
995 }
996
997 if (result == 0)
998 return SHELL32_CompareChildren(this, lParam, pidl1, pidl2);
999
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;
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;
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;
1288 }
1289
1290 if (!doHide)
1291 {
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
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 */
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
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);
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 */
1424 else
1425 lstrcpynW(szDest, lpName, MAX_PATH);
1426
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 */
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: /* attributes */
1546 break;
1547 case 5: /* FIXME: comments */
1548 psd->str.cStr[0] = 0;
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
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));
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{
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);
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));
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);
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);
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;
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 {
1814 // Create an data object
1815 CComHeapPtr<ITEMID_CHILD> pidlChild(ILClone(ILFindLastID(m_pidlRoot)));
1816 CComHeapPtr<ITEMIDLIST> pidlParent(ILClone(m_pidlRoot));
1817 ILRemoveLastID(pidlParent);
1818
1819 CComPtr<IDataObject> pDataObj;
1820 HRESULT hr = SHCreateDataObject(pidlParent, 1, &pidlChild, NULL, IID_PPV_ARG(IDataObject, &pDataObj));
1821 if (!FAILED_UNEXPECTEDLY(hr))
1822 {
1823 // Ask for a title to display
1824 CComHeapPtr<WCHAR> wszName;
1825 if (!FAILED_UNEXPECTEDLY(SHGetNameFromIDList(m_pidlRoot, SIGDN_PARENTRELATIVEPARSING, &wszName)))
1826 {
1827 BOOL bSuccess = SH_ShowPropertiesDialog(wszName, pDataObj);
1828 if (!bSuccess)
1829 ERR("SH_ShowPropertiesDialog failed\n");
1830 }
1831 }
1832 }
1833 else if (uMsg == DFM_MERGECONTEXTMENU)
1834 {
1835 QCMINFO *pqcminfo = (QCMINFO *)lParam;
1836 HMENU hpopup = CreatePopupMenu();
1838 Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu++, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
1839 DestroyMenu(hpopup);
1840 }
1841
1842 return S_OK;
1843 }
1844
1846 return S_OK;
1847
1848 return Shell_DefaultContextMenuCallBack(this, pdtobj);
1849}
1850
1852{
1853 // create stream from file
1854 HRESULT hr;
1855 CComPtr<IStream> pStream;
1857 FALSE, NULL, &pStream);
1858 if (FAILED(hr))
1859 return NULL;
1860
1861 // load the picture
1862 HBITMAP hbm = NULL;
1863 CComPtr<IPicture> pPicture;
1864 OleLoadPicture(pStream, 0, FALSE, IID_IPicture, (LPVOID *)&pPicture);
1865
1866 // get the bitmap handle
1867 if (pPicture)
1868 {
1869 pPicture->get_Handle((OLE_HANDLE *)&hbm);
1870
1871 // copy the bitmap handle
1873 }
1874
1875 return hbm;
1876}
1877
1879{
1880 if (data == NULL)
1881 {
1882 return E_POINTER;
1883 }
1884 if (data->cbSize != sizeof(*data))
1885 {
1886 // NOTE: You have to set the cbData member before SFVM_GET_CUSTOMVIEWINFO call.
1887 return E_INVALIDARG;
1888 }
1889
1890 data->hbmBack = NULL;
1891 data->clrText = CLR_INVALID;
1892 data->clrTextBack = CLR_INVALID;
1893
1895
1896 // does the folder exists?
1898 {
1899 return E_INVALIDARG;
1900 }
1901
1902 // don't use custom view in network path for security
1904 {
1905 return E_ACCESSDENIED;
1906 }
1907
1908 // build the ini file path
1910 PathAppend(szIniFile, L"desktop.ini");
1911
1912 static LPCWSTR TheGUID = L"{BE098140-A513-11D0-A3A4-00C04FD706EC}";
1913 static LPCWSTR Space = L" \t\n\r\f\v";
1914
1915 // get info from ini file
1916 WCHAR szImage[MAX_PATH], szText[64];
1917
1918 // load the image
1919 szImage[0] = UNICODE_NULL;
1920 GetPrivateProfileStringW(TheGUID, L"IconArea_Image", L"", szImage, _countof(szImage), szIniFile);
1921 if (szImage[0])
1922 {
1923 StrTrimW(szImage, Space);
1924 if (PathIsRelativeW(szImage))
1925 {
1926 PathAppendW(szPath, szImage);
1927 StringCchCopyW(szImage, _countof(szImage), szPath);
1928 }
1929 data->hbmBack = DoLoadPicture(szImage);
1930 }
1931
1932 // load the text color
1933 szText[0] = UNICODE_NULL;
1934 GetPrivateProfileStringW(TheGUID, L"IconArea_Text", L"", szText, _countof(szText), szIniFile);
1935 if (szText[0])
1936 {
1937 StrTrimW(szText, Space);
1938
1939 LPWSTR pchEnd = NULL;
1940 COLORREF cr = (wcstol(szText, &pchEnd, 0) & 0xFFFFFF);
1941
1942 if (pchEnd && !*pchEnd)
1943 data->clrText = cr;
1944 }
1945
1946 // load the text background color
1947 szText[0] = UNICODE_NULL;
1948 GetPrivateProfileStringW(TheGUID, L"IconArea_TextBackground", L"", szText, _countof(szText), szIniFile);
1949 if (szText[0])
1950 {
1951 StrTrimW(szText, Space);
1952
1953 LPWSTR pchEnd = NULL;
1954 COLORREF cr = (wcstol(szText, &pchEnd, 0) & 0xFFFFFF);
1955
1956 if (pchEnd && !*pchEnd)
1957 data->clrTextBack = cr;
1958 }
1959
1960 if (data->hbmBack != NULL || data->clrText != CLR_INVALID || data->clrTextBack != CLR_INVALID)
1961 return S_OK;
1962
1963 return E_FAIL;
1964}
1965
1967{
1969 switch (uMsg)
1970 {
1973 break;
1974 }
1975 return hr;
1976}
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3931
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv)
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
HRESULT CFSDropTarget_CreateInstance(LPWSTR sPathTarget, REFIID riid, LPVOID *ppvOut)
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
HRESULT WINAPI SHCreateDataObject(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pdtInner, REFIID riid, void **ppv)
#define SFVM_GET_CUSTOMVIEWINFO
DWORD dwFileAttributes
UINT cchMax
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define IDI_SHELL_FOLDER
Definition: treeview.c:36
#define IDS_PROPERTIES
Definition: resource.h:101
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
#define RegCloseKey(hKey)
Definition: registry.h:47
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
BOOL AddToEnumList(LPITEMIDLIST pidl)
virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
Definition: CFSFolder.cpp:1101
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid)
Definition: CFSFolder.cpp:1462
virtual HRESULT WINAPI GetFolderTargetInfo(PERSIST_FOLDER_TARGET_INFO *ppfti)
Definition: CFSFolder.cpp:1699
virtual HRESULT WINAPI CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CFSFolder.cpp:1804
HRESULT _CreateShellExtInstance(const CLSID *pclsid, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1773
DWORD m_bGroupPolicyActive
Definition: CFSFolder.h:31
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1006
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
Definition: CFSFolder.cpp:1500
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
Definition: CFSFolder.cpp:1474
HRESULT _GetIconHandler(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1757
LPWSTR m_sPathTarget
Definition: CFSFolder.h:27
HRESULT _GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1729
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
Definition: CFSFolder.cpp:1556
virtual HRESULT WINAPI InitializeEx(IBindCtx *pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO *ppfti)
Definition: CFSFolder.cpp:1629
const CLSID * m_pclsid
Definition: CFSFolder.h:24
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:928
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:840
virtual HRESULT WINAPI GetClassID(CLSID *lpClassId)
Definition: CFSFolder.cpp:1566
HRESULT WINAPI GetCustomViewInfo(ULONG unknown, SFVM_CUSTOMVIEWINFO_DATA *data)
Definition: CFSFolder.cpp:1878
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
Definition: CFSFolder.cpp:824
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
Definition: CFSFolder.cpp:730
LPITEMIDLIST m_pidlRoot
Definition: CFSFolder.h:29
virtual HRESULT WINAPI MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CFSFolder.cpp:1966
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
Definition: CFSFolder.cpp:1487
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: CFSFolder.cpp:1339
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum)
Definition: CFSFolder.cpp:1468
virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE *pidl)
Definition: CFSFolder.cpp:1613
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
Definition: CFSFolder.cpp:945
virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidl)
Definition: CFSFolder.cpp:1584
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1181
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
Definition: CFSFolder.cpp:1508
HRESULT _CreateExtensionUIObject(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1706
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
Definition: CFSFolder.cpp:1397
HRESULT _AddFindResult(LPWSTR sParentDir, const WIN32_FIND_DATAW &FindData, DWORD dwFlags)
Definition: CFSFolder.cpp:347
HRESULT WINAPI Initialize(LPWSTR sPathTarget, DWORD dwFlags)
Definition: CFSFolder.cpp:450
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 GET_SHGDN_RELATION(dwFlags)
Definition: precomp.h:53
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
#define GET_SHGDN_FOR(dwFlags)
Definition: precomp.h:52
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1091
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1965
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3291
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4259
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4121
UINT uFlags
Definition: api.c:59
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define wcsicmp
Definition: compat.h:15
#define lstrcpynW
Definition: compat.h:738
static const WCHAR *const ext[]
Definition: module.c:53
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
BOOL WINAPI MoveFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName)
Definition: move.c:1104
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
UINT WINAPI GetPrivateProfileIntW(LPCWSTR section, LPCWSTR entry, INT def_val, LPCWSTR filename)
Definition: profile.c:1297
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
Definition: profile.c:1142
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
HRESULT WINAPI OleLoadPicture(LPSTREAM lpstream, LONG lSize, BOOL fRunmode, REFIID riid, LPVOID *ppvObj)
Definition: olepicture.c:2344
#define RRF_RT_REG_DWORD
Definition: driver.c:578
#define RRF_RT_REG_SZ
Definition: driver.c:575
BOOL SHELL_FS_HideExtension(LPCWSTR szPath)
Definition: CFSFolder.cpp:1272
static HRESULT SHELL32_GetCLSIDForDirectory(LPCWSTR pwszDir, LPCWSTR KeyName, CLSID *pclsidFolder)
Definition: CFSFolder.cpp:579
#define GENERICSHELLVIEWCOLUMNS
Definition: CFSFolder.cpp:537
static BOOL getShellClassInfo(LPCWSTR Entry, LPWSTR pszValue, DWORD cchValueLen, LPCWSTR IniFile)
Definition: CFSFolder.cpp:158
LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path)
Definition: CFSFolder.cpp:546
#define SUPER_HIDDEN
static HRESULT getIconLocationForFolder(IShellFolder *psf, PCITEMID_CHILD pidl, UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
Definition: CFSFolder.cpp:164
HRESULT SHELL32_GetFSItemAttributes(IShellFolder *psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes)
Definition: CFSFolder.cpp:599
static HRESULT getDefaultIconLocation(LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT uFlags)
Definition: CFSFolder.cpp:137
HRESULT GetCLSIDForFileTypeFromExtension(LPWSTR pExtension, LPCWSTR KeyName, CLSID *pclsid)
Definition: CFSFolder.cpp:72
static const shvheader GenericSFHeader[]
Definition: CFSFolder.cpp:528
HRESULT GetCLSIDForFileType(PCUIDLIST_RELATIVE pidl, LPCWSTR KeyName, CLSID *pclsid)
Definition: CFSFolder.cpp:127
void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags)
Definition: CFSFolder.cpp:1316
HRESULT CFSExtractIcon_CreateInstance(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID iid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:240
static HBITMAP DoLoadPicture(LPCWSTR pszFileName)
Definition: CFSFolder.cpp:1851
HKEY OpenKeyFromFileType(LPWSTR pExtension, LPCWSTR KeyName)
Definition: CFSFolder.cpp:18
LPWSTR ExtensionFromPidl(PCUIDLIST_RELATIVE pidl)
Definition: CFSFolder.cpp:48
HRESULT WINAPI Shell_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdtobj)
Definition: shlfolder.cpp:462
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:3061
HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode, DWORD dwAttributes, BOOL bCreate, IStream *lpTemplate, IStream **lppStream)
Definition: istream.c:401
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:294
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:823
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:126
VOID WINAPI PathUnquoteSpacesW(LPWSTR lpszPath)
Definition: path.c:1034
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1722
LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
Definition: path.c:194
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1092
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1578
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:1869
static BOOLEAN bSuccess
Definition: drive.cpp:433
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
BOOL SH_ShowPropertiesDialog(LPCWSTR pwszPath, IDataObject *pDataObj)
Definition: fprop.cpp:83
FxAutoRegKey hKey
Status
Definition: gdiplustypes.h:25
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint res
Definition: glext.h:9613
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:866
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
_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
HRESULT GetObjectParam([in] LPOLESTR pszKey, [out] IUnknown **ppunk)
HRESULT GetFindData([out] WIN32_FIND_DATAW *pfd)
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 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:542
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:562
#define END_COM_MAP()
Definition: atlcom.h:553
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LPCWSTR szPath
Definition: env.c:37
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static HBITMAP
Definition: button.c:44
HRESULT hres
Definition: protocol.c:465
static HANDLE ULONG_PTR dwData
Definition: file.c:35
static WCHAR szElement[]
Definition: domdoc.c:1171
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:60
REFCLSID clsid
Definition: msctf.c:82
unsigned int UINT
Definition: ndis.h:50
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define KEY_READ
Definition: nt_native.h:1023
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define DWORD
Definition: nt_native.h:44
#define UNICODE_NULL
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
#define L(x)
Definition: ntvdm.h:50
#define STGM_READ
Definition: objbase.h:917
interface IBindCtx * LPBC
Definition: objfwd.h:18
const GUID IID_IPicture
const GUID IID_IDataObject
#define LOWORD(l)
Definition: pedump.c:82
long LONG
Definition: pedump.c:60
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:189
BOOL _ILGetFileDate(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2422
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2606
HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName)
Definition: pidl.c:1423
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2187
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
Definition: pidl.c:212
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1337
DWORD _ILGetFileSize(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2466
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2361
HRESULT _ILCreateFromPathW(LPCWSTR szPath, LPITEMIDLIST *ppidl)
Definition: pidl.c:1789
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1976
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1294
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:91
void _ILGetFileType(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2533
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:1985
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1964
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2487
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2107
LPITEMIDLIST _ILCreateFromFindDataW(const WIN32_FIND_DATAW *wfd)
Definition: pidl.c:1741
#define PT_FOLDER
Definition: pidl.h:94
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define LVCFMT_RIGHT
Definition: commctrl.h:2599
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define strcmpW(s1, s2)
Definition: unicode.h:38
#define sprintfW
Definition: unicode.h:58
WCHAR classname[128]
Definition: startup.c:15
TCHAR szIniFile[]
Definition: scrnsave.c:28
_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:288
#define __SHFreeAndNil(ptr)
Definition: shell32_main.h:136
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) DECLSPEC_HIDDEN
Definition: shellord.c:116
#define CSIDL_FLAG_CREATE
#define STATUS_SUCCESS
Definition: shellext.h:65
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:561
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:160
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:198
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:216
void AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:268
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:239
HRESULT SHELL32_ParseNextElement(IShellFolder2 *psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST *pidlInOut, LPOLESTR szNext, DWORD *pEaten, DWORD *pdwAttributes)
Definition: shlfolder.cpp:71
void AddFSClassKeysToArray(PCUITEMID_CHILD pidl, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:282
LPCWSTR GetNextElementW(LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut)
Definition: shlfolder.cpp:44
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
HRESULT hr
Definition: shlfolder.c:183
static IFileSystemBindData fsbd
Definition: shlfolder.c:4674
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:1742
#define SHCNE_RENAMEFOLDER
Definition: shlobj.h:1759
#define SHCNF_PATHW
Definition: shlobj.h:1777
#define MM_ADDSEPARATOR
Definition: shlobj.h:2380
struct _SFV_CREATE SFV_CREATE
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2464
LSTATUS WINAPI SHRegGetValueW(_In_ HKEY hkey, _In_opt_ LPCWSTR pszSubKey, _In_opt_ LPCWSTR pszValue, _In_ SRRF srrfFlags, _Out_opt_ LPDWORD pdwType, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID pvData, _Inout_opt_ LPDWORD pcbData)
#define PathIsNetworkPath
Definition: shlwapi.h:1101
#define PathAppend
Definition: shlwapi.h:801
#define IDI_SHELL_EXE
Definition: shresdef.h:532
#define IDS_SHV_COLUMN_SIZE
Definition: shresdef.h:52
#define IDS_SHV_COLUMN_MODIFIED
Definition: shresdef.h:54
#define IDI_SHELL_DOCUMENT
Definition: shresdef.h:530
#define IDS_SHV_COLUMN_COMMENTS
Definition: shresdef.h:69
#define IDS_SHV_COLUMN_ATTRIBUTES
Definition: shresdef.h:55
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
@ STRRET_CSTR
Definition: shtypes.idl:87
@ STRRET_WSTR
Definition: shtypes.idl:85
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
@ SHCOLSTATE_TYPE_DATE
Definition: shtypes.idl:123
@ SHCOLSTATE_TYPE_STR
Definition: shtypes.idl:121
@ SHCOLSTATE_ONBYDEFAULT
Definition: shtypes.idl:125
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:68
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
IContextMenuCB * pcmcb
Definition: shlobj.h:2402
IShellFolder * psf
Definition: shlobj.h:2404
IUnknown * punkAssociationInfo
Definition: shlobj.h:2407
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2406
const HKEY * aKeys
Definition: shlobj.h:2409
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2403
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:1315
UINT idCmdLast
Definition: shlobj.h:1318
UINT idCmdFirst
Definition: shlobj.h:1317
UINT indexMenu
Definition: shlobj.h:1316
char cStr[MAX_PATH]
Definition: shtypes.idl:98
UINT uType
Definition: shtypes.idl:93
LPWSTR pOleStr
Definition: shtypes.idl:96
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
#define ILGDN_FORPARSING
Definition: undocshell.h:68
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:1670
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
_In_ LPCSTR lpName
Definition: winbase.h:2776
_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 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 CLR_INVALID
Definition: wingdi.h:883
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_CREATEDIBSECTION
Definition: winuser.h:1092
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1956
#define wsprintf
Definition: winuser.h:5855
#define MFS_ENABLED
Definition: winuser.h:745
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MFT_STRING
Definition: winuser.h:741
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
_In_ PSTRING FullName
Definition: rtlfuncs.h:1648
#define IID_PPV_ARG(Itype, ppType)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185