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