comdlg32: Implement SetDefaultFilename.
[wine] / dlls / shell32 / shfldr_netplaces.c
1 /*
2  *      Network Places (Neighbourhood) folder
3  *
4  *      Copyright 1997                  Marcus Meissner
5  *      Copyright 1998, 1999, 2002      Juergen Schmied
6  *      Copyright 2003                  Mike McCormack for CodeWeavers
7  *
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.
12  *
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.
17  *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  */
22
23 #include "config.h"
24 #include "wine/port.h"
25
26 #include <stdlib.h>
27 #include <string.h>
28 #include <stdarg.h>
29 #include <stdio.h>
30
31 #define COBJMACROS
32 #define NONAMELESSUNION
33 #define NONAMELESSSTRUCT
34
35 #include "winerror.h"
36 #include "windef.h"
37 #include "winbase.h"
38 #include "winreg.h"
39
40 #include "pidl.h"
41 #include "enumidlist.h"
42 #include "undocshell.h"
43 #include "shell32_main.h"
44 #include "shresdef.h"
45 #include "wine/debug.h"
46 #include "wine/unicode.h"
47 #include "debughlp.h"
48 #include "shfldr.h"
49
50 WINE_DEFAULT_DEBUG_CHANNEL (shell);
51
52 /***********************************************************************
53 *   IShellFolder implementation
54 */
55
56 typedef struct {
57     const IShellFolder2Vtbl  *lpVtbl;
58     LONG                       ref;
59     const IPersistFolder2Vtbl *lpVtblPersistFolder2;
60
61     /* both paths are parsible from the desktop */
62     LPITEMIDLIST pidlRoot;      /* absolute pidl */
63 } IGenericSFImpl;
64
65 static const IShellFolder2Vtbl vt_ShellFolder2;
66 static const IPersistFolder2Vtbl vt_NP_PersistFolder2;
67
68 static inline IGenericSFImpl *impl_from_IPersistFolder2(IPersistFolder2 *iface)
69 {
70     return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2));
71 }
72
73 #define _IUnknown_(This)        ((IUnknown*)&(This)->lpVtbl)
74 #define _IShellFolder_(This)    ((IShellFolder*)&(This)->lpVtbl)
75 #define _IPersistFolder2_(This) (&(This)->lpVtblPersistFolder2)
76
77 static const shvheader networkplaces_header[] = {
78     {IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
79     {IDS_SHV_COLUMN9, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10}
80 };
81
82 #define NETWORKPLACESSHELLVIEWCOLUMNS sizeof(networkplaces_header)/sizeof(shvheader)
83
84 /**************************************************************************
85 *       ISF_NetworkPlaces_Constructor
86 */
87 HRESULT WINAPI ISF_NetworkPlaces_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
88 {
89     IGenericSFImpl *sf;
90
91     TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
92
93     if (!ppv)
94         return E_POINTER;
95     if (pUnkOuter)
96         return CLASS_E_NOAGGREGATION;
97
98     sf = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (IGenericSFImpl));
99     if (!sf)
100         return E_OUTOFMEMORY;
101
102     sf->ref = 0;
103     sf->lpVtbl = &vt_ShellFolder2;
104     sf->lpVtblPersistFolder2 = &vt_NP_PersistFolder2;
105     sf->pidlRoot = _ILCreateNetHood();  /* my qualified pidl */
106
107     if (FAILED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv)))
108     {
109         IUnknown_Release (_IUnknown_ (sf));
110         return E_NOINTERFACE;
111     }
112
113     TRACE ("--(%p)\n", sf);
114     return S_OK;
115 }
116
117 /**************************************************************************
118  *      ISF_NetworkPlaces_fnQueryInterface
119  *
120  * NOTE
121  *     supports not IPersist/IPersistFolder
122  */
123 static HRESULT WINAPI ISF_NetworkPlaces_fnQueryInterface (IShellFolder2 *iface, REFIID riid, LPVOID *ppvObj)
124 {
125     IGenericSFImpl *This = (IGenericSFImpl *)iface;
126
127     TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
128
129     *ppvObj = NULL;
130
131     if (IsEqualIID (riid, &IID_IUnknown) ||
132         IsEqualIID (riid, &IID_IShellFolder) ||
133         IsEqualIID (riid, &IID_IShellFolder2))
134     {
135         *ppvObj = This;
136     }
137     else if (IsEqualIID (riid, &IID_IPersist) ||
138              IsEqualIID (riid, &IID_IPersistFolder) ||
139              IsEqualIID (riid, &IID_IPersistFolder2))
140     {
141         *ppvObj = _IPersistFolder2_ (This);
142     }
143
144     if (*ppvObj)
145     {
146         IUnknown_AddRef ((IUnknown *) (*ppvObj));
147         TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
148         return S_OK;
149     }
150     TRACE ("-- Interface: E_NOINTERFACE\n");
151     return E_NOINTERFACE;
152 }
153
154 static ULONG WINAPI ISF_NetworkPlaces_fnAddRef (IShellFolder2 * iface)
155 {
156     IGenericSFImpl *This = (IGenericSFImpl *)iface;
157     ULONG refCount = InterlockedIncrement(&This->ref);
158
159     TRACE ("(%p)->(count=%u)\n", This, refCount - 1);
160
161     return refCount;
162 }
163
164 static ULONG WINAPI ISF_NetworkPlaces_fnRelease (IShellFolder2 * iface)
165 {
166     IGenericSFImpl *This = (IGenericSFImpl *)iface;
167     ULONG refCount = InterlockedDecrement(&This->ref);
168
169     TRACE ("(%p)->(count=%u)\n", This, refCount + 1);
170
171     if (!refCount) {
172         TRACE ("-- destroying IShellFolder(%p)\n", This);
173         SHFree (This->pidlRoot);
174         HeapFree (GetProcessHeap(), 0, This);
175     }
176     return refCount;
177 }
178
179 /**************************************************************************
180 *       ISF_NetworkPlaces_fnParseDisplayName
181 */
182 static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * iface,
183                HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName,
184                DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
185 {
186     static const WCHAR wszEntireNetwork[] = {'E','n','t','i','r','e','N','e','t','w','o','r','k'}; /* not nul-terminated */
187     IGenericSFImpl *This = (IGenericSFImpl *)iface;
188     HRESULT hr = E_INVALIDARG;
189     LPCWSTR szNext = NULL;
190     WCHAR szElement[MAX_PATH];
191     LPITEMIDLIST pidlTemp = NULL;
192     int len;
193
194     TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", This,
195             hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName),
196             pchEaten, ppidl, pdwAttributes);
197
198     *ppidl = NULL;
199
200     szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
201     len = strlenW(szElement);
202     if (len == sizeof(wszEntireNetwork)/sizeof(wszEntireNetwork[0]) &&
203         !strncmpiW(szElement, wszEntireNetwork, sizeof(wszEntireNetwork)/sizeof(wszEntireNetwork[0])))
204     {
205         pidlTemp = _ILCreateEntireNetwork();
206         if (pidlTemp)
207             hr = S_OK;
208         else
209             hr = E_OUTOFMEMORY;
210     }
211     else
212         FIXME("not implemented for %s\n", debugstr_w(lpszDisplayName));
213
214     if (SUCCEEDED(hr) && pidlTemp)
215     {
216         if (szNext && *szNext)
217         {
218             hr = SHELL32_ParseNextElement(iface, hwndOwner, pbcReserved,
219                     &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
220         }
221         else
222         {
223             if (pdwAttributes && *pdwAttributes)
224                 hr = SHELL32_GetItemAttributes(_IShellFolder_ (This),
225                                                pidlTemp, pdwAttributes);
226         }
227     }
228
229     if (SUCCEEDED(hr))
230         *ppidl = pidlTemp;
231     else
232         ILFree(pidlTemp);
233
234     TRACE ("(%p)->(-- ret=0x%08x)\n", This, hr);
235
236     return hr;
237 }
238
239 /**************************************************************************
240 *               ISF_NetworkPlaces_fnEnumObjects
241 */
242 static HRESULT WINAPI ISF_NetworkPlaces_fnEnumObjects (IShellFolder2 * iface,
243                HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
244 {
245     IGenericSFImpl *This = (IGenericSFImpl *)iface;
246
247     TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", This,
248             hwndOwner, dwFlags, ppEnumIDList);
249
250     *ppEnumIDList = IEnumIDList_Constructor();
251
252     TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList);
253
254     return (*ppEnumIDList) ? S_OK : E_OUTOFMEMORY;
255 }
256
257 /**************************************************************************
258 *               ISF_NetworkPlaces_fnBindToObject
259 */
260 static HRESULT WINAPI ISF_NetworkPlaces_fnBindToObject (IShellFolder2 * iface,
261                LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
262 {
263     IGenericSFImpl *This = (IGenericSFImpl *)iface;
264
265     TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This,
266             pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
267
268     return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut);
269 }
270
271 /**************************************************************************
272 *       ISF_NetworkPlaces_fnBindToStorage
273 */
274 static HRESULT WINAPI ISF_NetworkPlaces_fnBindToStorage (IShellFolder2 * iface,
275                LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
276 {
277     IGenericSFImpl *This = (IGenericSFImpl *)iface;
278
279     FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This,
280             pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
281
282     *ppvOut = NULL;
283     return E_NOTIMPL;
284 }
285
286 /**************************************************************************
287 *       ISF_NetworkPlaces_fnCompareIDs
288 */
289
290 static HRESULT WINAPI ISF_NetworkPlaces_fnCompareIDs (IShellFolder2 * iface,
291                LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
292 {
293     IGenericSFImpl *This = (IGenericSFImpl *)iface;
294     int nReturn;
295
296     TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
297     nReturn = SHELL32_CompareIDs (_IShellFolder_ (This), lParam, pidl1, pidl2);
298     TRACE ("-- %i\n", nReturn);
299     return nReturn;
300 }
301
302 /**************************************************************************
303 *       ISF_NetworkPlaces_fnCreateViewObject
304 */
305 static HRESULT WINAPI ISF_NetworkPlaces_fnCreateViewObject (IShellFolder2 * iface,
306                HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
307 {
308     IGenericSFImpl *This = (IGenericSFImpl *)iface;
309     LPSHELLVIEW pShellView;
310     HRESULT hr = E_INVALIDARG;
311
312     TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This,
313            hwndOwner, shdebugstr_guid (riid), ppvOut);
314
315     if (!ppvOut)
316         return hr;
317
318     *ppvOut = NULL;
319
320     if (IsEqualIID (riid, &IID_IDropTarget))
321     {
322         WARN ("IDropTarget not implemented\n");
323         hr = E_NOTIMPL;
324     }
325     else if (IsEqualIID (riid, &IID_IContextMenu))
326     {
327         WARN ("IContextMenu not implemented\n");
328         hr = E_NOTIMPL;
329     }
330     else if (IsEqualIID (riid, &IID_IShellView))
331     {
332         pShellView = IShellView_Constructor ((IShellFolder *) iface);
333         if (pShellView)
334         {
335             hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
336             IShellView_Release (pShellView);
337         }
338     }
339     TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
340     return hr;
341 }
342
343 /**************************************************************************
344 *  ISF_NetworkPlaces_fnGetAttributesOf
345 */
346 static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface,
347                UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
348 {
349     IGenericSFImpl *This = (IGenericSFImpl *)iface;
350     HRESULT hr = S_OK;
351
352     TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", This,
353             cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
354
355     if (!rgfInOut)
356         return E_INVALIDARG;
357     if (cidl && !apidl)
358         return E_INVALIDARG;
359
360     if (*rgfInOut == 0)
361         *rgfInOut = ~0;
362
363     if (cidl == 0)
364     {
365         IShellFolder *psfParent = NULL;
366         LPCITEMIDLIST rpidl = NULL;
367
368         hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&rpidl);
369         if(SUCCEEDED(hr))
370         {
371             SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut);
372             IShellFolder_Release(psfParent);
373         }
374     }
375     else
376     {
377         while (cidl > 0 && *apidl)
378         {
379             pdump (*apidl);
380             SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
381             apidl++;
382             cidl--;
383         }
384     }
385
386     /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
387     *rgfInOut &= ~SFGAO_VALIDATE;
388
389     TRACE ("-- result=0x%08x\n", *rgfInOut);
390     return hr;
391 }
392
393 /**************************************************************************
394 *       ISF_NetworkPlaces_fnGetUIObjectOf
395 *
396 * PARAMETERS
397 *  hwndOwner [in]  Parent window for any output
398 *  cidl      [in]  array size
399 *  apidl     [in]  simple pidl array
400 *  riid      [in]  Requested Interface
401 *  prgfInOut [   ] reserved
402 *  ppvObject [out] Resulting Interface
403 *
404 */
405 static HRESULT WINAPI ISF_NetworkPlaces_fnGetUIObjectOf (IShellFolder2 * iface,
406                HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid,
407                UINT * prgfInOut, LPVOID * ppvOut)
408 {
409     IGenericSFImpl *This = (IGenericSFImpl *)iface;
410
411     LPITEMIDLIST pidl;
412     IUnknown *pObj = NULL;
413     HRESULT hr = E_INVALIDARG;
414
415     TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", This,
416             hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
417
418     if (!ppvOut)
419         return hr;
420
421     *ppvOut = NULL;
422
423     if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1))
424     {
425         pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
426         hr = S_OK;
427     }
428     else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
429     {
430         pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
431         hr = S_OK;
432     }
433     else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1))
434     {
435         pidl = ILCombine (This->pidlRoot, apidl[0]);
436         pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
437         SHFree (pidl);
438         hr = S_OK;
439     }
440     else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1))
441     {
442         pidl = ILCombine (This->pidlRoot, apidl[0]);
443         pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
444         SHFree (pidl);
445         hr = S_OK;
446     }
447     else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1))
448     {
449         hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj);
450     }
451     else
452         hr = E_NOINTERFACE;
453
454     if (SUCCEEDED(hr) && !pObj)
455         hr = E_OUTOFMEMORY;
456
457     *ppvOut = pObj;
458     TRACE ("(%p)->hr=0x%08x\n", This, hr);
459     return hr;
460 }
461
462 /**************************************************************************
463 *       ISF_NetworkPlaces_fnGetDisplayNameOf
464 *
465 */
466 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDisplayNameOf (IShellFolder2 * iface,
467                LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
468 {
469     IGenericSFImpl *This = (IGenericSFImpl *)iface;
470
471     FIXME ("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet);
472     pdump (pidl);
473
474     if (!strRet)
475         return E_INVALIDARG;
476
477     return E_NOTIMPL;
478 }
479
480 /**************************************************************************
481 *  ISF_NetworkPlaces_fnSetNameOf
482 *  Changes the name of a file object or subfolder, possibly changing its item
483 *  identifier in the process.
484 *
485 * PARAMETERS
486 *  hwndOwner [in]  Owner window for output
487 *  pidl      [in]  simple pidl of item to change
488 *  lpszName  [in]  the items new display name
489 *  dwFlags   [in]  SHGNO formatting flags
490 *  ppidlOut  [out] simple pidl returned
491 */
492 static HRESULT WINAPI ISF_NetworkPlaces_fnSetNameOf (IShellFolder2 * iface,
493                HWND hwndOwner, LPCITEMIDLIST pidl,      /*simple pidl */
494                LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
495 {
496     IGenericSFImpl *This = (IGenericSFImpl *)iface;
497     FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This,
498             hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
499     return E_FAIL;
500 }
501
502 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultSearchGUID (
503                IShellFolder2 * iface, GUID * pguid)
504 {
505     IGenericSFImpl *This = (IGenericSFImpl *)iface;
506     FIXME ("(%p)\n", This);
507     return E_NOTIMPL;
508 }
509
510 static HRESULT WINAPI ISF_NetworkPlaces_fnEnumSearches (IShellFolder2 * iface,
511                IEnumExtraSearch ** ppenum)
512 {
513     IGenericSFImpl *This = (IGenericSFImpl *)iface;
514     FIXME ("(%p)\n", This);
515     return E_NOTIMPL;
516 }
517
518 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultColumn (IShellFolder2 * iface,
519                DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
520 {
521     IGenericSFImpl *This = (IGenericSFImpl *)iface;
522
523     TRACE ("(%p)\n", This);
524
525     if (pSort)
526         *pSort = 0;
527     if (pDisplay)
528         *pDisplay = 0;
529
530     return S_OK;
531 }
532
533 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultColumnState (
534                IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
535 {
536     IGenericSFImpl *This = (IGenericSFImpl *)iface;
537
538     TRACE ("(%p)->(%d %p)\n", This, iColumn, pcsFlags);
539
540     if (!pcsFlags || iColumn >= NETWORKPLACESSHELLVIEWCOLUMNS)
541         return E_INVALIDARG;
542
543     *pcsFlags = networkplaces_header[iColumn].pcsFlags;
544
545     return S_OK;
546 }
547
548 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDetailsEx (IShellFolder2 * iface,
549                LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
550 {
551     IGenericSFImpl *This = (IGenericSFImpl *)iface;
552     FIXME ("(%p)\n", This);
553     return E_NOTIMPL;
554 }
555
556 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDetailsOf (IShellFolder2 * iface,
557                LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
558 {
559     IGenericSFImpl *This = (IGenericSFImpl *)iface;
560
561     FIXME ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
562
563     return E_NOTIMPL;
564 }
565
566 static HRESULT WINAPI ISF_NetworkPlaces_fnMapColumnToSCID (IShellFolder2 * iface,
567                UINT column, SHCOLUMNID * pscid)
568 {
569     IGenericSFImpl *This = (IGenericSFImpl *)iface;
570
571     FIXME ("(%p)\n", This);
572
573     return E_NOTIMPL;
574 }
575
576 static const IShellFolder2Vtbl vt_ShellFolder2 = {
577     ISF_NetworkPlaces_fnQueryInterface,
578     ISF_NetworkPlaces_fnAddRef,
579     ISF_NetworkPlaces_fnRelease,
580     ISF_NetworkPlaces_fnParseDisplayName,
581     ISF_NetworkPlaces_fnEnumObjects,
582     ISF_NetworkPlaces_fnBindToObject,
583     ISF_NetworkPlaces_fnBindToStorage,
584     ISF_NetworkPlaces_fnCompareIDs,
585     ISF_NetworkPlaces_fnCreateViewObject,
586     ISF_NetworkPlaces_fnGetAttributesOf,
587     ISF_NetworkPlaces_fnGetUIObjectOf,
588     ISF_NetworkPlaces_fnGetDisplayNameOf,
589     ISF_NetworkPlaces_fnSetNameOf,
590     /* ShellFolder2 */
591     ISF_NetworkPlaces_fnGetDefaultSearchGUID,
592     ISF_NetworkPlaces_fnEnumSearches,
593     ISF_NetworkPlaces_fnGetDefaultColumn,
594     ISF_NetworkPlaces_fnGetDefaultColumnState,
595     ISF_NetworkPlaces_fnGetDetailsEx,
596     ISF_NetworkPlaces_fnGetDetailsOf,
597     ISF_NetworkPlaces_fnMapColumnToSCID
598 };
599
600 /************************************************************************
601  *      INPFldr_PersistFolder2_QueryInterface
602  */
603 static HRESULT WINAPI INPFldr_PersistFolder2_QueryInterface (IPersistFolder2 * iface,
604                REFIID iid, LPVOID * ppvObj)
605 {
606     IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
607
608     TRACE ("(%p)\n", This);
609
610     return IUnknown_QueryInterface (_IUnknown_ (This), iid, ppvObj);
611 }
612
613 /************************************************************************
614  *      INPFldr_PersistFolder2_AddRef
615  */
616 static ULONG WINAPI INPFldr_PersistFolder2_AddRef (IPersistFolder2 * iface)
617 {
618     IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
619
620     TRACE ("(%p)->(count=%u)\n", This, This->ref);
621
622     return IUnknown_AddRef (_IUnknown_ (This));
623 }
624
625 /************************************************************************
626  *      ISFPersistFolder_Release
627  */
628 static ULONG WINAPI INPFldr_PersistFolder2_Release (IPersistFolder2 * iface)
629 {
630     IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
631
632     TRACE ("(%p)->(count=%u)\n", This, This->ref);
633
634     return IUnknown_Release (_IUnknown_ (This));
635 }
636
637 /************************************************************************
638  *      INPFldr_PersistFolder2_GetClassID
639  */
640 static HRESULT WINAPI INPFldr_PersistFolder2_GetClassID (
641                IPersistFolder2 * iface, CLSID * lpClassId)
642 {
643     IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
644
645     TRACE ("(%p)\n", This);
646
647     if (!lpClassId)
648         return E_POINTER;
649
650     *lpClassId = CLSID_NetworkPlaces;
651
652     return S_OK;
653 }
654
655 /************************************************************************
656  *      INPFldr_PersistFolder2_Initialize
657  *
658  * NOTES: it makes no sense to change the pidl
659  */
660 static HRESULT WINAPI INPFldr_PersistFolder2_Initialize (
661                IPersistFolder2 * iface, LPCITEMIDLIST pidl)
662 {
663     IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
664
665     TRACE ("(%p)->(%p)\n", This, pidl);
666
667     return E_NOTIMPL;
668 }
669
670 /**************************************************************************
671  *      IPersistFolder2_fnGetCurFolder
672  */
673 static HRESULT WINAPI INPFldr_PersistFolder2_GetCurFolder (
674                IPersistFolder2 * iface, LPITEMIDLIST * pidl)
675 {
676     IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
677
678     TRACE ("(%p)->(%p)\n", This, pidl);
679
680     if (!pidl)
681         return E_POINTER;
682
683     *pidl = ILClone (This->pidlRoot);
684
685     return S_OK;
686 }
687
688 static const IPersistFolder2Vtbl vt_NP_PersistFolder2 =
689 {
690     INPFldr_PersistFolder2_QueryInterface,
691     INPFldr_PersistFolder2_AddRef,
692     INPFldr_PersistFolder2_Release,
693     INPFldr_PersistFolder2_GetClassID,
694     INPFldr_PersistFolder2_Initialize,
695     INPFldr_PersistFolder2_GetCurFolder
696 };