3 * Virtual Desktop Folder
5 * Copyright 1997 Marcus Meissner
6 * Copyright 1998, 1999, 2002 Juergen Schmied
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "wine/port.h"
32 #define NONAMELESSUNION
33 #define NONAMELESSSTRUCT
45 #include "enumidlist.h"
47 #include "undocshell.h"
48 #include "shell32_main.h"
51 #include "shellfolder.h"
52 #include "wine/debug.h"
56 WINE_DEFAULT_DEBUG_CHANNEL (shell
);
58 /***********************************************************************
59 * Desktopfolder implementation
63 IShellFolder2Vtbl
*lpVtbl
;
68 /* both paths are parsible from the desktop */
69 LPSTR sPathTarget
; /* complete path to target used for enumeration and ChangeNotify */
70 LPITEMIDLIST pidlRoot
; /* absolute pidl */
72 int dwAttributes
; /* attributes returned by GetAttributesOf FIXME: use it */
74 UINT cfShellIDList
; /* clipboardformat for IDropTarget */
75 BOOL fAcceptFmt
; /* flag for pending Drop */
78 #define _IUnknown_(This) (IShellFolder*)&(This->lpVtbl)
79 #define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
81 static struct IShellFolder2Vtbl vt_MCFldr_ShellFolder2
;
83 static shvheader DesktopSFHeader
[] = {
84 {IDS_SHV_COLUMN1
, SHCOLSTATE_TYPE_STR
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_RIGHT
, 15},
85 {IDS_SHV_COLUMN2
, SHCOLSTATE_TYPE_STR
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_RIGHT
, 10},
86 {IDS_SHV_COLUMN3
, SHCOLSTATE_TYPE_STR
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_RIGHT
, 10},
87 {IDS_SHV_COLUMN4
, SHCOLSTATE_TYPE_DATE
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_RIGHT
, 12},
88 {IDS_SHV_COLUMN5
, SHCOLSTATE_TYPE_STR
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_RIGHT
, 5}
91 #define DESKTOPSHELLVIEWCOLUMNS 5
93 /**************************************************************************
94 * ISF_Desktop_Constructor
96 HRESULT WINAPI
ISF_Desktop_Constructor (
97 IUnknown
* pUnkOuter
, REFIID riid
, LPVOID
* ppv
)
100 char szMyPath
[MAX_PATH
];
102 TRACE ("unkOut=%p %s\n", pUnkOuter
, shdebugstr_guid (riid
));
107 return CLASS_E_NOAGGREGATION
;
109 if (!SHGetSpecialFolderPathA (0, szMyPath
, CSIDL_DESKTOPDIRECTORY
, TRUE
))
112 sf
= (IGenericSFImpl
*) LocalAlloc (GMEM_ZEROINIT
, sizeof (IGenericSFImpl
));
114 return E_OUTOFMEMORY
;
117 sf
->lpVtbl
= &vt_MCFldr_ShellFolder2
;
118 sf
->pidlRoot
= _ILCreateDesktop (); /* my qualified pidl */
119 sf
->sPathTarget
= SHAlloc (strlen (szMyPath
) + 1);
120 lstrcpyA (sf
->sPathTarget
, szMyPath
);
122 if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf
), riid
, ppv
)))
124 IUnknown_Release (_IUnknown_ (sf
));
125 return E_NOINTERFACE
;
128 TRACE ("--(%p)\n", sf
);
132 /**************************************************************************
133 * ISF_Desktop_fnQueryInterface
135 * NOTES supports not IPersist/IPersistFolder
137 static HRESULT WINAPI
ISF_Desktop_fnQueryInterface(
138 IShellFolder2
* iface
, REFIID riid
, LPVOID
* ppvObj
)
140 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
142 TRACE ("(%p)->(%s,%p)\n", This
, shdebugstr_guid (riid
), ppvObj
);
146 if (IsEqualIID (riid
, &IID_IUnknown
) ||
147 IsEqualIID (riid
, &IID_IShellFolder
) ||
148 IsEqualIID (riid
, &IID_IShellFolder2
))
155 IUnknown_AddRef ((IUnknown
*) (*ppvObj
));
156 TRACE ("-- Interface: (%p)->(%p)\n", ppvObj
, *ppvObj
);
159 TRACE ("-- Interface: E_NOINTERFACE\n");
160 return E_NOINTERFACE
;
163 static ULONG WINAPI
ISF_Desktop_fnAddRef (IShellFolder2
* iface
)
165 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
166 ULONG refCount
= InterlockedIncrement(&This
->ref
);
168 TRACE ("(%p)->(count=%lu)\n", This
, refCount
- 1);
173 static ULONG WINAPI
ISF_Desktop_fnRelease (IShellFolder2
* iface
)
175 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
176 ULONG refCount
= InterlockedDecrement(&This
->ref
);
178 TRACE ("(%p)->(count=%lu)\n", This
, refCount
+ 1);
182 TRACE ("-- destroying IShellFolder(%p)\n", This
);
184 SHFree (This
->pidlRoot
);
185 if (This
->sPathTarget
)
186 SHFree (This
->sPathTarget
);
187 LocalFree ((HLOCAL
) This
);
193 /**************************************************************************
194 * ISF_Desktop_fnParseDisplayName
197 * "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and "" binds
200 static HRESULT WINAPI
ISF_Desktop_fnParseDisplayName (IShellFolder2
* iface
,
201 HWND hwndOwner
, LPBC pbc
, LPOLESTR lpszDisplayName
,
202 DWORD
* pchEaten
, LPITEMIDLIST
* ppidl
, DWORD
* pdwAttributes
)
204 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
205 WCHAR szElement
[MAX_PATH
];
206 LPCWSTR szNext
= NULL
;
207 LPITEMIDLIST pidlTemp
= NULL
;
211 TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
212 This
, hwndOwner
, pbc
, lpszDisplayName
, debugstr_w(lpszDisplayName
),
213 pchEaten
, ppidl
, pdwAttributes
);
215 if (!lpszDisplayName
|| !ppidl
)
221 *pchEaten
= 0; /* strange but like the original */
223 if (lpszDisplayName
[0] == ':' && lpszDisplayName
[1] == ':')
225 szNext
= GetNextElementW (lpszDisplayName
, szElement
, MAX_PATH
);
226 TRACE ("-- element: %s\n", debugstr_w (szElement
));
227 SHCLSIDFromStringW (szElement
+ 2, &clsid
);
228 pidlTemp
= _ILCreateGuid (PT_GUID
, &clsid
);
230 else if (PathGetDriveNumberW (lpszDisplayName
) >= 0)
232 /* it's a filesystem path with a drive. Let MyComputer parse it */
233 pidlTemp
= _ILCreateMyComputer ();
234 szNext
= lpszDisplayName
;
236 else if (PathIsUNCW(lpszDisplayName
))
238 pidlTemp
= _ILCreateNetwork();
239 szNext
= lpszDisplayName
;
241 else if( (pidlTemp
= SHELL32_CreatePidlFromBindCtx(pbc
, lpszDisplayName
)) )
248 /* it's a filesystem path on the desktop. Let a FSFolder parse it */
250 if (*lpszDisplayName
)
252 WCHAR szPath
[MAX_PATH
];
255 /* build a complete path to create a simple pidl */
256 MultiByteToWideChar(CP_ACP
, 0, This
->sPathTarget
, -1, szPath
,
257 sizeof(szPath
) / sizeof(szPath
[0]));
258 pathPtr
= PathAddBackslashW(szPath
);
261 lstrcpynW(pathPtr
, lpszDisplayName
,
262 sizeof(szPath
)/sizeof(szPath
[0]) - (pathPtr
- szPath
));
263 hr
= _ILCreateFromPathW(szPath
, &pidlTemp
);
267 /* should never reach here, but for completeness */
268 hr
= HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER
);
272 pidlTemp
= _ILCreateMyComputer();
277 if (SUCCEEDED(hr
) && pidlTemp
)
279 if (szNext
&& *szNext
)
281 hr
= SHELL32_ParseNextElement(iface
, hwndOwner
, pbc
,
282 &pidlTemp
, (LPOLESTR
) szNext
, pchEaten
, pdwAttributes
);
286 if (pdwAttributes
&& *pdwAttributes
)
287 hr
= SHELL32_GetItemAttributes(_IShellFolder_ (This
),
288 pidlTemp
, pdwAttributes
);
294 TRACE ("(%p)->(-- ret=0x%08lx)\n", This
, hr
);
299 /**************************************************************************
300 * CreateDesktopEnumList()
302 static const WCHAR Desktop_NameSpaceW
[] = { 'S','O','F','T','W','A','R','E',
303 '\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
304 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l',
305 'o','r','e','r','\\','D','e','s','k','t','o','p','\\','N','a','m','e','s','p',
308 static BOOL
CreateDesktopEnumList(IEnumIDList
*list
, DWORD dwFlags
)
311 WCHAR szPath
[MAX_PATH
];
313 TRACE("(%p)->(flags=0x%08lx) \n",list
,dwFlags
);
315 /* enumerate the root folders */
316 if (dwFlags
& SHCONTF_FOLDERS
)
321 /* create the pidl for This item */
322 ret
= AddToEnumList(list
, _ILCreateMyComputer());
324 r
= RegOpenKeyExW(HKEY_LOCAL_MACHINE
, Desktop_NameSpaceW
,
326 if (ret
&& ERROR_SUCCESS
== r
)
330 BOOL moreKeys
= TRUE
;
332 while (ret
&& moreKeys
)
337 r
= RegEnumKeyExW(hkey
, i
, iid
, &size
, 0, NULL
, NULL
, NULL
);
338 if (ERROR_SUCCESS
== r
)
340 ret
= AddToEnumList(list
, _ILCreateGuidFromStrW(iid
));
343 else if (ERROR_NO_MORE_ITEMS
== r
)
352 /* enumerate the elements in %windir%\desktop */
353 SHGetSpecialFolderPathW(0, szPath
, CSIDL_DESKTOPDIRECTORY
, FALSE
);
354 ret
= ret
&& CreateFolderEnumList(list
, szPath
, dwFlags
);
359 /**************************************************************************
360 * ISF_Desktop_fnEnumObjects
362 static HRESULT WINAPI
ISF_Desktop_fnEnumObjects (IShellFolder2
* iface
,
363 HWND hwndOwner
, DWORD dwFlags
, LPENUMIDLIST
* ppEnumIDList
)
365 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
367 TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n",
368 This
, hwndOwner
, dwFlags
, ppEnumIDList
);
370 *ppEnumIDList
= IEnumIDList_Constructor();
372 CreateDesktopEnumList(*ppEnumIDList
, dwFlags
);
374 TRACE ("-- (%p)->(new ID List: %p)\n", This
, *ppEnumIDList
);
376 return *ppEnumIDList
? S_OK
: E_OUTOFMEMORY
;
379 /**************************************************************************
380 * ISF_Desktop_fnBindToObject
382 static HRESULT WINAPI
ISF_Desktop_fnBindToObject (IShellFolder2
* iface
,
383 LPCITEMIDLIST pidl
, LPBC pbcReserved
, REFIID riid
, LPVOID
* ppvOut
)
385 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
387 TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n",
388 This
, pidl
, pbcReserved
, shdebugstr_guid (riid
), ppvOut
);
390 return SHELL32_BindToChild (This
->pidlRoot
, This
->sPathTarget
, pidl
, riid
, ppvOut
);
393 /**************************************************************************
394 * ISF_Desktop_fnBindToStorage
396 static HRESULT WINAPI
ISF_Desktop_fnBindToStorage (IShellFolder2
* iface
,
397 LPCITEMIDLIST pidl
, LPBC pbcReserved
, REFIID riid
, LPVOID
* ppvOut
)
399 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
401 FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n",
402 This
, pidl
, pbcReserved
, shdebugstr_guid (riid
), ppvOut
);
408 /**************************************************************************
409 * ISF_Desktop_fnCompareIDs
411 static HRESULT WINAPI
ISF_Desktop_fnCompareIDs (IShellFolder2
* iface
,
412 LPARAM lParam
, LPCITEMIDLIST pidl1
, LPCITEMIDLIST pidl2
)
414 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
417 TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This
, lParam
, pidl1
, pidl2
);
418 nReturn
= SHELL32_CompareIDs (_IShellFolder_ (This
), lParam
, pidl1
, pidl2
);
419 TRACE ("-- %i\n", nReturn
);
423 /**************************************************************************
424 * ISF_Desktop_fnCreateViewObject
426 static HRESULT WINAPI
ISF_Desktop_fnCreateViewObject (IShellFolder2
* iface
,
427 HWND hwndOwner
, REFIID riid
, LPVOID
* ppvOut
)
429 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
430 LPSHELLVIEW pShellView
;
431 HRESULT hr
= E_INVALIDARG
;
433 TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
434 This
, hwndOwner
, shdebugstr_guid (riid
), ppvOut
);
441 if (IsEqualIID (riid
, &IID_IDropTarget
))
443 WARN ("IDropTarget not implemented\n");
446 else if (IsEqualIID (riid
, &IID_IContextMenu
))
448 WARN ("IContextMenu not implemented\n");
451 else if (IsEqualIID (riid
, &IID_IShellView
))
453 pShellView
= IShellView_Constructor ((IShellFolder
*) iface
);
456 hr
= IShellView_QueryInterface (pShellView
, riid
, ppvOut
);
457 IShellView_Release (pShellView
);
460 TRACE ("-- (%p)->(interface=%p)\n", This
, ppvOut
);
464 /**************************************************************************
465 * ISF_Desktop_fnGetAttributesOf
467 static HRESULT WINAPI
ISF_Desktop_fnGetAttributesOf (IShellFolder2
* iface
,
468 UINT cidl
, LPCITEMIDLIST
* apidl
, DWORD
* rgfInOut
)
470 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
473 TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n",
474 This
, cidl
, apidl
, *rgfInOut
);
476 if (!cidl
|| !apidl
|| !rgfInOut
)
482 while (cidl
> 0 && *apidl
)
485 SHELL32_GetItemAttributes (_IShellFolder_ (This
), *apidl
, rgfInOut
);
490 TRACE ("-- result=0x%08lx\n", *rgfInOut
);
495 /**************************************************************************
496 * ISF_Desktop_fnGetUIObjectOf
499 * HWND hwndOwner, //[in ] Parent window for any output
500 * UINT cidl, //[in ] array size
501 * LPCITEMIDLIST* apidl, //[in ] simple pidl array
502 * REFIID riid, //[in ] Requested Interface
503 * UINT* prgfInOut, //[ ] reserved
504 * LPVOID* ppvObject) //[out] Resulting Interface
507 static HRESULT WINAPI
ISF_Desktop_fnGetUIObjectOf (IShellFolder2
* iface
,
508 HWND hwndOwner
, UINT cidl
, LPCITEMIDLIST
* apidl
,
509 REFIID riid
, UINT
* prgfInOut
, LPVOID
* ppvOut
)
511 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
514 IUnknown
*pObj
= NULL
;
515 HRESULT hr
= E_INVALIDARG
;
517 TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
518 This
, hwndOwner
, cidl
, apidl
, shdebugstr_guid (riid
), prgfInOut
, ppvOut
);
523 if (IsEqualIID (riid
, &IID_IDataObject
) && (cidl
>= 1))
525 pObj
= (LPUNKNOWN
) IDataObject_Constructor( hwndOwner
,
526 This
->pidlRoot
, apidl
, cidl
);
529 else if ((IsEqualIID(riid
,&IID_IShellLinkW
) ||
530 IsEqualIID(riid
,&IID_IShellLinkA
)) && (cidl
== 1))
532 pidl
= ILCombine (This
->pidlRoot
, apidl
[0]);
533 hr
= IShellLink_ConstructFromFile(NULL
, riid
, pidl
, (LPVOID
*)&pObj
);
536 else if (IsEqualIID (riid
, &IID_IContextMenu
))
539 pObj
= (LPUNKNOWN
) ISvItemCm_Constructor( (IShellFolder
*) iface
, This
->pidlRoot
, apidl
, cidl
);
541 pObj
= (LPUNKNOWN
) ISvBgCm_Constructor( (IShellFolder
*) iface
, TRUE
);
544 else if (IsEqualIID (riid
, &IID_IExtractIconA
) && (cidl
== 1))
546 pidl
= ILCombine (This
->pidlRoot
, apidl
[0]);
547 pObj
= (LPUNKNOWN
) IExtractIconA_Constructor (pidl
);
551 else if (IsEqualIID (riid
, &IID_IExtractIconW
) && (cidl
== 1))
553 pidl
= ILCombine (This
->pidlRoot
, apidl
[0]);
554 pObj
= (LPUNKNOWN
) IExtractIconW_Constructor (pidl
);
558 else if (IsEqualIID (riid
, &IID_IDropTarget
) && (cidl
>= 1))
560 hr
= IShellFolder_QueryInterface (iface
,
561 &IID_IDropTarget
, (LPVOID
*) & pObj
);
566 if (SUCCEEDED(hr
) && !pObj
)
570 TRACE ("(%p)->hr=0x%08lx\n", This
, hr
);
574 /**************************************************************************
575 * ISF_Desktop_fnGetDisplayNameOf
578 * special case: pidl = null gives desktop-name back
580 static HRESULT WINAPI
ISF_Desktop_fnGetDisplayNameOf (IShellFolder2
* iface
,
581 LPCITEMIDLIST pidl
, DWORD dwFlags
, LPSTRRET strRet
)
583 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
584 CHAR szPath
[MAX_PATH
];
590 TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", This
, pidl
, dwFlags
, strRet
);
596 if (_ILIsDesktop (pidl
))
598 if ((GET_SHGDN_RELATION (dwFlags
) == SHGDN_NORMAL
) &&
599 (GET_SHGDN_FOR (dwFlags
) == SHGDN_FORPARSING
))
601 lstrcpyA (szPath
, This
->sPathTarget
);
604 HCR_GetClassNameA(&CLSID_ShellDesktop
, szPath
, MAX_PATH
);
606 else if (_ILIsPidlSimple (pidl
))
608 if ((clsid
= _ILGetGUIDPointer (pidl
)))
610 if (GET_SHGDN_FOR (dwFlags
) == SHGDN_FORPARSING
)
612 int bWantsForParsing
;
615 * We can only get a filesystem path from a shellfolder if the
616 * value WantsFORPARSING in CLSID\\{...}\\shellfolder exists.
618 * Exception: The MyComputer folder doesn't have this key,
619 * but any other filesystem backed folder it needs it.
621 if (IsEqualIID (clsid
, &CLSID_MyComputer
))
623 bWantsForParsing
= 1;
627 /* get the "WantsFORPARSING" flag from the registry */
628 static const WCHAR clsidW
[] =
629 { 'C','L','S','I','D','\\',0 };
630 static const WCHAR shellfolderW
[] =
631 { '\\','s','h','e','l','l','f','o','l','d','e','r',0 };
632 static const WCHAR wantsForParsingW
[] =
633 { 'W','a','n','t','s','F','o','r','P','a','r','s','i','n',
635 WCHAR szRegPath
[100];
638 lstrcpyW (szRegPath
, clsidW
);
639 SHELL32_GUIDToStringW (clsid
, &szRegPath
[6]);
640 lstrcatW (szRegPath
, shellfolderW
);
641 r
= SHGetValueW(HKEY_CLASSES_ROOT
, szRegPath
,
642 wantsForParsingW
, NULL
, NULL
, NULL
);
643 if (r
== ERROR_SUCCESS
)
644 bWantsForParsing
= TRUE
;
646 bWantsForParsing
= FALSE
;
649 if ((GET_SHGDN_RELATION (dwFlags
) == SHGDN_NORMAL
) &&
653 * we need the filesystem path to the destination folder.
654 * Only the folder itself can know it
656 hr
= SHELL32_GetDisplayNameOfChild (iface
, pidl
, dwFlags
,
661 /* parsing name like ::{...} */
662 lstrcpyA (szPath
, "::");
663 SHELL32_GUIDToStringA (clsid
, &szPath
[2]);
668 /* user friendly name */
669 HCR_GetClassNameA (clsid
, szPath
, MAX_PATH
);
674 /* file system folder */
675 _ILSimpleGetText (pidl
, szPath
, MAX_PATH
);
677 if (!_ILIsFolder(pidl
))
678 SHELL_FS_ProcessDisplayFilename(szPath
, dwFlags
);
683 /* a complex pidl, let the subfolder do the work */
684 hr
= SHELL32_GetDisplayNameOfChild (iface
, pidl
, dwFlags
, szPath
, MAX_PATH
);
689 strRet
->uType
= STRRET_CSTR
;
690 lstrcpynA (strRet
->u
.cStr
, szPath
, MAX_PATH
);
693 TRACE ("-- (%p)->(%s,0x%08lx)\n", This
, szPath
, hr
);
697 /**************************************************************************
698 * ISF_Desktop_fnSetNameOf
699 * Changes the name of a file object or subfolder, possibly changing its item
700 * identifier in the process.
703 * HWND hwndOwner, //[in ] Owner window for output
704 * LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
705 * LPCOLESTR lpszName, //[in ] the items new display name
706 * DWORD dwFlags, //[in ] SHGNO formatting flags
707 * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
709 static HRESULT WINAPI
ISF_Desktop_fnSetNameOf (IShellFolder2
* iface
,
710 HWND hwndOwner
, LPCITEMIDLIST pidl
, /* simple pidl */
711 LPCOLESTR lpName
, DWORD dwFlags
, LPITEMIDLIST
* pPidlOut
)
713 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
715 FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This
, hwndOwner
, pidl
,
716 debugstr_w (lpName
), dwFlags
, pPidlOut
);
721 static HRESULT WINAPI
ISF_Desktop_fnGetDefaultSearchGUID(IShellFolder2
*iface
,
724 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
726 FIXME ("(%p)\n", This
);
730 static HRESULT WINAPI
ISF_Desktop_fnEnumSearches (IShellFolder2
*iface
,
731 IEnumExtraSearch
** ppenum
)
733 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
734 FIXME ("(%p)\n", This
);
738 static HRESULT WINAPI
ISF_Desktop_fnGetDefaultColumn (IShellFolder2
* iface
,
739 DWORD dwRes
, ULONG
* pSort
, ULONG
* pDisplay
)
741 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
743 TRACE ("(%p)\n", This
);
752 static HRESULT WINAPI
ISF_Desktop_fnGetDefaultColumnState (
753 IShellFolder2
* iface
, UINT iColumn
, DWORD
* pcsFlags
)
755 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
757 TRACE ("(%p)\n", This
);
759 if (!pcsFlags
|| iColumn
>= DESKTOPSHELLVIEWCOLUMNS
)
762 *pcsFlags
= DesktopSFHeader
[iColumn
].pcsFlags
;
767 static HRESULT WINAPI
ISF_Desktop_fnGetDetailsEx (IShellFolder2
* iface
,
768 LPCITEMIDLIST pidl
, const SHCOLUMNID
* pscid
, VARIANT
* pv
)
770 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
771 FIXME ("(%p)\n", This
);
776 static HRESULT WINAPI
ISF_Desktop_fnGetDetailsOf (IShellFolder2
* iface
,
777 LPCITEMIDLIST pidl
, UINT iColumn
, SHELLDETAILS
* psd
)
779 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
783 TRACE ("(%p)->(%p %i %p)\n", This
, pidl
, iColumn
, psd
);
785 if (!psd
|| iColumn
>= DESKTOPSHELLVIEWCOLUMNS
)
790 psd
->fmt
= DesktopSFHeader
[iColumn
].fmt
;
791 psd
->cxChar
= DesktopSFHeader
[iColumn
].cxChar
;
792 psd
->str
.uType
= STRRET_CSTR
;
793 LoadStringA (shell32_hInstance
, DesktopSFHeader
[iColumn
].colnameid
,
794 psd
->str
.u
.cStr
, MAX_PATH
);
798 /* the data from the pidl */
802 hr
= IShellFolder_GetDisplayNameOf(iface
, pidl
,
803 SHGDN_NORMAL
| SHGDN_INFOLDER
, &psd
->str
);
806 _ILGetFileSize (pidl
, psd
->str
.u
.cStr
, MAX_PATH
);
809 _ILGetFileType (pidl
, psd
->str
.u
.cStr
, MAX_PATH
);
812 _ILGetFileDate (pidl
, psd
->str
.u
.cStr
, MAX_PATH
);
814 case 4: /* attributes */
815 _ILGetFileAttributes (pidl
, psd
->str
.u
.cStr
, MAX_PATH
);
819 psd
->str
.uType
= STRRET_CSTR
;
824 static HRESULT WINAPI
ISF_Desktop_fnMapColumnToSCID (
825 IShellFolder2
* iface
, UINT column
, SHCOLUMNID
* pscid
)
827 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
828 FIXME ("(%p)\n", This
);
832 static IShellFolder2Vtbl vt_MCFldr_ShellFolder2
=
834 ISF_Desktop_fnQueryInterface
,
835 ISF_Desktop_fnAddRef
,
836 ISF_Desktop_fnRelease
,
837 ISF_Desktop_fnParseDisplayName
,
838 ISF_Desktop_fnEnumObjects
,
839 ISF_Desktop_fnBindToObject
,
840 ISF_Desktop_fnBindToStorage
,
841 ISF_Desktop_fnCompareIDs
,
842 ISF_Desktop_fnCreateViewObject
,
843 ISF_Desktop_fnGetAttributesOf
,
844 ISF_Desktop_fnGetUIObjectOf
,
845 ISF_Desktop_fnGetDisplayNameOf
,
846 ISF_Desktop_fnSetNameOf
,
848 ISF_Desktop_fnGetDefaultSearchGUID
,
849 ISF_Desktop_fnEnumSearches
,
850 ISF_Desktop_fnGetDefaultColumn
,
851 ISF_Desktop_fnGetDefaultColumnState
,
852 ISF_Desktop_fnGetDetailsEx
,
853 ISF_Desktop_fnGetDetailsOf
,
854 ISF_Desktop_fnMapColumnToSCID