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 (IUnknown
* pUnkOuter
, REFIID riid
, LPVOID
* ppv
)
99 char szMyPath
[MAX_PATH
];
101 TRACE ("unkOut=%p %s\n", pUnkOuter
, shdebugstr_guid (riid
));
106 return CLASS_E_NOAGGREGATION
;
108 if (!SHGetSpecialFolderPathA (0, szMyPath
, CSIDL_DESKTOPDIRECTORY
, TRUE
))
111 sf
= (IGenericSFImpl
*) LocalAlloc (GMEM_ZEROINIT
, sizeof (IGenericSFImpl
));
113 return E_OUTOFMEMORY
;
116 sf
->lpVtbl
= &vt_MCFldr_ShellFolder2
;
117 sf
->pidlRoot
= _ILCreateDesktop (); /* my qualified pidl */
118 sf
->sPathTarget
= SHAlloc (strlen (szMyPath
) + 1);
119 lstrcpyA (sf
->sPathTarget
, szMyPath
);
121 if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf
), riid
, ppv
))) {
122 IUnknown_Release (_IUnknown_ (sf
));
123 return E_NOINTERFACE
;
126 TRACE ("--(%p)\n", sf
);
130 /**************************************************************************
131 * ISF_Desktop_fnQueryInterface
133 * NOTES supports not IPersist/IPersistFolder
135 static HRESULT WINAPI
ISF_Desktop_fnQueryInterface (IShellFolder2
* iface
, REFIID riid
, LPVOID
* ppvObj
)
137 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
139 TRACE ("(%p)->(%s,%p)\n", This
, shdebugstr_guid (riid
), ppvObj
);
143 if (IsEqualIID (riid
, &IID_IUnknown
) || IsEqualIID (riid
, &IID_IShellFolder
)
144 || IsEqualIID (riid
, &IID_IShellFolder2
)) {
149 IUnknown_AddRef ((IUnknown
*) (*ppvObj
));
150 TRACE ("-- Interface: (%p)->(%p)\n", ppvObj
, *ppvObj
);
153 TRACE ("-- Interface: E_NOINTERFACE\n");
154 return E_NOINTERFACE
;
157 static ULONG WINAPI
ISF_Desktop_fnAddRef (IShellFolder2
* iface
)
159 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
160 ULONG refCount
= InterlockedIncrement(&This
->ref
);
162 TRACE ("(%p)->(count=%lu)\n", This
, refCount
- 1);
167 static ULONG WINAPI
ISF_Desktop_fnRelease (IShellFolder2
* iface
)
169 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
170 ULONG refCount
= InterlockedDecrement(&This
->ref
);
172 TRACE ("(%p)->(count=%lu)\n", This
, refCount
+ 1);
175 TRACE ("-- destroying IShellFolder(%p)\n", This
);
177 SHFree (This
->pidlRoot
);
178 if (This
->sPathTarget
)
179 SHFree (This
->sPathTarget
);
180 LocalFree ((HLOCAL
) This
);
186 /**************************************************************************
187 * ISF_Desktop_fnParseDisplayName
190 * "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and "" binds
193 static HRESULT WINAPI
ISF_Desktop_fnParseDisplayName (IShellFolder2
* iface
,
196 LPOLESTR lpszDisplayName
,
197 DWORD
* pchEaten
, LPITEMIDLIST
* ppidl
, DWORD
* pdwAttributes
)
199 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
201 WCHAR szElement
[MAX_PATH
];
202 LPCWSTR szNext
= NULL
;
203 LPITEMIDLIST pidlTemp
= NULL
;
205 char szPath
[MAX_PATH
];
209 TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
210 This
, hwndOwner
, pbc
, lpszDisplayName
, debugstr_w (lpszDisplayName
), pchEaten
, ppidl
, pdwAttributes
);
212 if (!lpszDisplayName
|| !ppidl
)
218 *pchEaten
= 0; /* strange but like the original */
220 if (lpszDisplayName
[0] == ':' && lpszDisplayName
[1] == ':') {
221 szNext
= GetNextElementW (lpszDisplayName
, szElement
, MAX_PATH
);
222 TRACE ("-- element: %s\n", debugstr_w (szElement
));
223 SHCLSIDFromStringW (szElement
+ 2, &clsid
);
224 pidlTemp
= _ILCreateGuid (PT_GUID
, &clsid
);
225 } else if (PathGetDriveNumberW (lpszDisplayName
) >= 0) {
226 /* it's a filesystem path with a drive. Let MyComputer parse it */
227 pidlTemp
= _ILCreateMyComputer ();
228 szNext
= lpszDisplayName
;
229 } else if (PathIsUNCW(lpszDisplayName
)) {
230 pidlTemp
= _ILCreateNetwork();
231 szNext
= lpszDisplayName
;
233 /* it's a filesystem path on the desktop. Let a FSFolder parse it */
235 if (*lpszDisplayName
) {
236 /* build a complete path to create a simple pidl */
237 lstrcpyA(szPath
, This
->sPathTarget
);
238 PathAddBackslashA(szPath
);
239 len
= lstrlenA(szPath
);
240 WideCharToMultiByte(CP_ACP
, 0, lpszDisplayName
, -1, szPath
+ len
, MAX_PATH
- len
, NULL
, NULL
);
241 hr
= _ILCreateFromPathA(szPath
, &pidlTemp
);
243 pidlTemp
= _ILCreateMyComputer();
249 if (SUCCEEDED(hr
) && pidlTemp
) {
250 if (szNext
&& *szNext
) {
251 hr
= SHELL32_ParseNextElement (iface
, hwndOwner
, pbc
, &pidlTemp
, (LPOLESTR
) szNext
, pchEaten
, pdwAttributes
);
253 if (pdwAttributes
&& *pdwAttributes
) {
254 hr
= SHELL32_GetItemAttributes (_IShellFolder_ (This
), pidlTemp
, pdwAttributes
);
261 TRACE ("(%p)->(-- ret=0x%08lx)\n", This
, hr
);
266 /**************************************************************************
267 * CreateDesktopEnumList()
269 static BOOL
CreateDesktopEnumList(IEnumIDList
*list
, DWORD dwFlags
)
272 char szPath
[MAX_PATH
];
274 TRACE("(%p)->(flags=0x%08lx) \n",list
,dwFlags
);
276 /*enumerate the root folders */
277 if(dwFlags
& SHCONTF_FOLDERS
)
281 /*create the pidl for This item */
282 ret
= AddToEnumList(list
, _ILCreateMyComputer());
284 if (ret
&& !RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
285 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\explorer\\desktop\\NameSpace",
290 BOOL moreKeys
= TRUE
;
292 while (ret
&& moreKeys
)
294 DWORD size
= sizeof (iid
);
295 LONG apiRet
= RegEnumKeyExA(hkey
, i
, iid
, &size
, 0, NULL
, NULL
,
298 if (ERROR_SUCCESS
== apiRet
)
300 ret
= AddToEnumList(list
, _ILCreateGuidFromStrA(iid
));
303 else if (ERROR_NO_MORE_ITEMS
== apiRet
)
312 /*enumerate the elements in %windir%\desktop */
313 SHGetSpecialFolderPathA(0, szPath
, CSIDL_DESKTOPDIRECTORY
, FALSE
);
314 ret
= ret
&& CreateFolderEnumList(list
, szPath
, dwFlags
);
319 /**************************************************************************
320 * ISF_Desktop_fnEnumObjects
322 static HRESULT WINAPI
ISF_Desktop_fnEnumObjects (IShellFolder2
* iface
,
323 HWND hwndOwner
, DWORD dwFlags
, LPENUMIDLIST
* ppEnumIDList
)
325 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
327 TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This
, hwndOwner
, dwFlags
, ppEnumIDList
);
329 *ppEnumIDList
= IEnumIDList_Constructor();
331 CreateDesktopEnumList(*ppEnumIDList
, dwFlags
);
333 TRACE ("-- (%p)->(new ID List: %p)\n", This
, *ppEnumIDList
);
335 return *ppEnumIDList
? S_OK
: E_OUTOFMEMORY
;
338 /**************************************************************************
339 * ISF_Desktop_fnBindToObject
341 static HRESULT WINAPI
ISF_Desktop_fnBindToObject (IShellFolder2
* iface
,
342 LPCITEMIDLIST pidl
, LPBC pbcReserved
, REFIID riid
, LPVOID
* ppvOut
)
344 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
346 TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This
, pidl
, pbcReserved
, shdebugstr_guid (riid
), ppvOut
);
348 return SHELL32_BindToChild (This
->pidlRoot
, This
->sPathTarget
, pidl
, riid
, ppvOut
);
351 /**************************************************************************
352 * ISF_Desktop_fnBindToStorage
354 static HRESULT WINAPI
ISF_Desktop_fnBindToStorage (IShellFolder2
* iface
,
355 LPCITEMIDLIST pidl
, LPBC pbcReserved
, REFIID riid
, LPVOID
* ppvOut
)
357 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
359 FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This
, pidl
, pbcReserved
, shdebugstr_guid (riid
), ppvOut
);
365 /**************************************************************************
366 * ISF_Desktop_fnCompareIDs
369 static HRESULT WINAPI
ISF_Desktop_fnCompareIDs (IShellFolder2
* iface
,
370 LPARAM lParam
, LPCITEMIDLIST pidl1
, LPCITEMIDLIST pidl2
)
372 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
376 TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This
, lParam
, pidl1
, pidl2
);
377 nReturn
= SHELL32_CompareIDs (_IShellFolder_ (This
), lParam
, pidl1
, pidl2
);
378 TRACE ("-- %i\n", nReturn
);
382 /**************************************************************************
383 * ISF_Desktop_fnCreateViewObject
385 static HRESULT WINAPI
ISF_Desktop_fnCreateViewObject (IShellFolder2
* iface
,
386 HWND hwndOwner
, REFIID riid
, LPVOID
* ppvOut
)
388 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
390 LPSHELLVIEW pShellView
;
391 HRESULT hr
= E_INVALIDARG
;
393 TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This
, hwndOwner
, shdebugstr_guid (riid
), ppvOut
);
398 if (IsEqualIID (riid
, &IID_IDropTarget
)) {
399 WARN ("IDropTarget not implemented\n");
401 } else if (IsEqualIID (riid
, &IID_IContextMenu
)) {
402 WARN ("IContextMenu not implemented\n");
404 } else if (IsEqualIID (riid
, &IID_IShellView
)) {
405 pShellView
= IShellView_Constructor ((IShellFolder
*) iface
);
407 hr
= IShellView_QueryInterface (pShellView
, riid
, ppvOut
);
408 IShellView_Release (pShellView
);
412 TRACE ("-- (%p)->(interface=%p)\n", This
, ppvOut
);
416 /**************************************************************************
417 * ISF_Desktop_fnGetAttributesOf
419 static HRESULT WINAPI
ISF_Desktop_fnGetAttributesOf (IShellFolder2
* iface
,
420 UINT cidl
, LPCITEMIDLIST
* apidl
, DWORD
* rgfInOut
)
422 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
426 TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This
, cidl
, apidl
, *rgfInOut
);
428 if ((!cidl
) || (!apidl
) || (!rgfInOut
))
434 while (cidl
> 0 && *apidl
) {
436 SHELL32_GetItemAttributes (_IShellFolder_ (This
), *apidl
, rgfInOut
);
441 TRACE ("-- result=0x%08lx\n", *rgfInOut
);
446 /**************************************************************************
447 * ISF_Desktop_fnGetUIObjectOf
450 * HWND hwndOwner, //[in ] Parent window for any output
451 * UINT cidl, //[in ] array size
452 * LPCITEMIDLIST* apidl, //[in ] simple pidl array
453 * REFIID riid, //[in ] Requested Interface
454 * UINT* prgfInOut, //[ ] reserved
455 * LPVOID* ppvObject) //[out] Resulting Interface
458 static HRESULT WINAPI
ISF_Desktop_fnGetUIObjectOf (IShellFolder2
* iface
,
461 LPCITEMIDLIST
* apidl
,
462 REFIID riid
, UINT
* prgfInOut
, LPVOID
* ppvOut
)
464 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
467 IUnknown
*pObj
= NULL
;
468 HRESULT hr
= E_INVALIDARG
;
470 TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
471 This
, hwndOwner
, cidl
, apidl
, shdebugstr_guid (riid
), prgfInOut
, ppvOut
);
476 if (IsEqualIID (riid
, &IID_IDataObject
) && (cidl
>= 1))
478 pObj
= (LPUNKNOWN
) IDataObject_Constructor( hwndOwner
,
479 This
->pidlRoot
, apidl
, cidl
);
482 else if ((IsEqualIID(riid
,&IID_IShellLinkW
) ||
483 IsEqualIID(riid
,&IID_IShellLinkA
)) && (cidl
== 1))
485 pidl
= ILCombine (This
->pidlRoot
, apidl
[0]);
486 hr
= IShellLink_ConstructFromFile(NULL
, riid
, pidl
, (LPVOID
*)&pObj
);
489 else if (IsEqualIID (riid
, &IID_IContextMenu
))
492 pObj
= (LPUNKNOWN
) ISvItemCm_Constructor( (IShellFolder
*) iface
, This
->pidlRoot
, apidl
, cidl
);
494 pObj
= (LPUNKNOWN
) ISvBgCm_Constructor( (IShellFolder
*) iface
, TRUE
);
497 else if (IsEqualIID (riid
, &IID_IExtractIconA
) && (cidl
== 1))
499 pidl
= ILCombine (This
->pidlRoot
, apidl
[0]);
500 pObj
= (LPUNKNOWN
) IExtractIconA_Constructor (pidl
);
504 else if (IsEqualIID (riid
, &IID_IExtractIconW
) && (cidl
== 1))
506 pidl
= ILCombine (This
->pidlRoot
, apidl
[0]);
507 pObj
= (LPUNKNOWN
) IExtractIconW_Constructor (pidl
);
511 else if (IsEqualIID (riid
, &IID_IDropTarget
) && (cidl
>= 1))
513 hr
= IShellFolder_QueryInterface (iface
,
514 &IID_IDropTarget
, (LPVOID
*) & pObj
);
519 if (SUCCEEDED(hr
) && !pObj
)
524 TRACE ("(%p)->hr=0x%08lx\n", This
, hr
);
528 /**************************************************************************
529 * ISF_Desktop_fnGetDisplayNameOf
532 * special case: pidl = null gives desktop-name back
534 static HRESULT WINAPI
ISF_Desktop_fnGetDisplayNameOf (IShellFolder2
* iface
,
535 LPCITEMIDLIST pidl
, DWORD dwFlags
, LPSTRRET strRet
)
537 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
539 CHAR szPath
[MAX_PATH
];
545 TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", This
, pidl
, dwFlags
, strRet
);
551 if (_ILIsDesktop (pidl
)) {
552 if ((GET_SHGDN_RELATION (dwFlags
) == SHGDN_NORMAL
) && (GET_SHGDN_FOR (dwFlags
) == SHGDN_FORPARSING
)) {
553 lstrcpyA (szPath
, This
->sPathTarget
);
555 HCR_GetClassNameA(&CLSID_ShellDesktop
, szPath
, MAX_PATH
);
557 } else if (_ILIsPidlSimple (pidl
)) {
558 if ((clsid
= _ILGetGUIDPointer (pidl
))) {
559 if (GET_SHGDN_FOR (dwFlags
) == SHGDN_FORPARSING
) {
560 int bWantsForParsing
;
563 * we can only get a filesystem path from a shellfolder if the value WantsFORPARSING in
564 * CLSID\\{...}\\shellfolder exists
565 * exception: the MyComputer folder has this keys not but like any filesystem backed
566 * folder it needs these behaviour
568 if (IsEqualIID (clsid
, &CLSID_MyComputer
)) {
569 bWantsForParsing
= 1;
571 /* get the "WantsFORPARSING" flag from the registry */
574 lstrcpyA (szRegPath
, "CLSID\\");
575 SHELL32_GUIDToStringA (clsid
, &szRegPath
[6]);
576 lstrcatA (szRegPath
, "\\shellfolder");
579 SHGetValueA (HKEY_CLASSES_ROOT
, szRegPath
, "WantsFORPARSING", NULL
, NULL
, NULL
));
582 if ((GET_SHGDN_RELATION (dwFlags
) == SHGDN_NORMAL
) && bWantsForParsing
) {
583 /* we need the filesystem path to the destination folder. Only the folder itself can know it */
584 hr
= SHELL32_GetDisplayNameOfChild (iface
, pidl
, dwFlags
, szPath
, MAX_PATH
);
586 /* parsing name like ::{...} */
587 lstrcpyA (szPath
, "::");
588 SHELL32_GUIDToStringA (clsid
, &szPath
[2]);
591 /* user friendly name */
592 HCR_GetClassNameA (clsid
, szPath
, MAX_PATH
);
595 /* file system folder */
596 _ILSimpleGetText (pidl
, szPath
, MAX_PATH
);
598 if (!_ILIsFolder(pidl
))
599 SHELL_FS_ProcessDisplayFilename(szPath
, dwFlags
);
602 /* a complex pidl, let the subfolder do the work */
603 hr
= SHELL32_GetDisplayNameOfChild (iface
, pidl
, dwFlags
, szPath
, MAX_PATH
);
606 if (SUCCEEDED (hr
)) {
607 strRet
->uType
= STRRET_CSTR
;
608 lstrcpynA (strRet
->u
.cStr
, szPath
, MAX_PATH
);
611 TRACE ("-- (%p)->(%s,0x%08lx)\n", This
, szPath
, hr
);
615 /**************************************************************************
616 * ISF_Desktop_fnSetNameOf
617 * Changes the name of a file object or subfolder, possibly changing its item
618 * identifier in the process.
621 * HWND hwndOwner, //[in ] Owner window for output
622 * LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
623 * LPCOLESTR lpszName, //[in ] the items new display name
624 * DWORD dwFlags, //[in ] SHGNO formatting flags
625 * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
627 static HRESULT WINAPI
ISF_Desktop_fnSetNameOf (IShellFolder2
* iface
, HWND hwndOwner
, LPCITEMIDLIST pidl
, /*simple pidl */
628 LPCOLESTR lpName
, DWORD dwFlags
, LPITEMIDLIST
* pPidlOut
)
630 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
632 FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This
, hwndOwner
, pidl
, debugstr_w (lpName
), dwFlags
, pPidlOut
);
637 static HRESULT WINAPI
ISF_Desktop_fnGetDefaultSearchGUID (IShellFolder2
* iface
, GUID
* pguid
)
639 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
641 FIXME ("(%p)\n", This
);
644 static HRESULT WINAPI
ISF_Desktop_fnEnumSearches (IShellFolder2
* iface
, IEnumExtraSearch
** ppenum
)
646 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
647 FIXME ("(%p)\n", This
);
650 static HRESULT WINAPI
ISF_Desktop_fnGetDefaultColumn (IShellFolder2
* iface
,
651 DWORD dwRes
, ULONG
* pSort
, ULONG
* pDisplay
)
653 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
655 TRACE ("(%p)\n", This
);
664 static HRESULT WINAPI
ISF_Desktop_fnGetDefaultColumnState (IShellFolder2
* iface
, UINT iColumn
, DWORD
* pcsFlags
)
666 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
668 TRACE ("(%p)\n", This
);
670 if (!pcsFlags
|| iColumn
>= DESKTOPSHELLVIEWCOLUMNS
)
673 *pcsFlags
= DesktopSFHeader
[iColumn
].pcsFlags
;
677 static HRESULT WINAPI
ISF_Desktop_fnGetDetailsEx (IShellFolder2
* iface
,
678 LPCITEMIDLIST pidl
, const SHCOLUMNID
* pscid
, VARIANT
* pv
)
680 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
681 FIXME ("(%p)\n", This
);
685 static HRESULT WINAPI
ISF_Desktop_fnGetDetailsOf (IShellFolder2
* iface
,
686 LPCITEMIDLIST pidl
, UINT iColumn
, SHELLDETAILS
* psd
)
688 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
692 TRACE ("(%p)->(%p %i %p)\n", This
, pidl
, iColumn
, psd
);
694 if (!psd
|| iColumn
>= DESKTOPSHELLVIEWCOLUMNS
)
698 psd
->fmt
= DesktopSFHeader
[iColumn
].fmt
;
699 psd
->cxChar
= DesktopSFHeader
[iColumn
].cxChar
;
700 psd
->str
.uType
= STRRET_CSTR
;
701 LoadStringA (shell32_hInstance
, DesktopSFHeader
[iColumn
].colnameid
, psd
->str
.u
.cStr
, MAX_PATH
);
704 /* the data from the pidl */
707 hr
= IShellFolder_GetDisplayNameOf (iface
, pidl
, SHGDN_NORMAL
| SHGDN_INFOLDER
, &psd
->str
);
710 _ILGetFileSize (pidl
, psd
->str
.u
.cStr
, MAX_PATH
);
713 _ILGetFileType (pidl
, psd
->str
.u
.cStr
, MAX_PATH
);
716 _ILGetFileDate (pidl
, psd
->str
.u
.cStr
, MAX_PATH
);
718 case 4: /* attributes */
719 _ILGetFileAttributes (pidl
, psd
->str
.u
.cStr
, MAX_PATH
);
723 psd
->str
.uType
= STRRET_CSTR
;
728 static HRESULT WINAPI
ISF_Desktop_fnMapColumnToSCID (IShellFolder2
* iface
, UINT column
, SHCOLUMNID
* pscid
)
730 IGenericSFImpl
*This
= (IGenericSFImpl
*)iface
;
731 FIXME ("(%p)\n", This
);
735 static IShellFolder2Vtbl vt_MCFldr_ShellFolder2
=
737 ISF_Desktop_fnQueryInterface
,
738 ISF_Desktop_fnAddRef
,
739 ISF_Desktop_fnRelease
,
740 ISF_Desktop_fnParseDisplayName
,
741 ISF_Desktop_fnEnumObjects
,
742 ISF_Desktop_fnBindToObject
,
743 ISF_Desktop_fnBindToStorage
,
744 ISF_Desktop_fnCompareIDs
,
745 ISF_Desktop_fnCreateViewObject
,
746 ISF_Desktop_fnGetAttributesOf
,
747 ISF_Desktop_fnGetUIObjectOf
,
748 ISF_Desktop_fnGetDisplayNameOf
,
749 ISF_Desktop_fnSetNameOf
,
751 ISF_Desktop_fnGetDefaultSearchGUID
,
752 ISF_Desktop_fnEnumSearches
,
753 ISF_Desktop_fnGetDefaultColumn
,
754 ISF_Desktop_fnGetDefaultColumnState
,
755 ISF_Desktop_fnGetDetailsEx
,
756 ISF_Desktop_fnGetDetailsOf
,
757 ISF_Desktop_fnMapColumnToSCID
};