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