Release 2.16.
[wine.git] / dlls / shell32 / shfldr_netplaces.c
blobb9513a9b5e06bb34fb45060c873429f565875833
1 /*
2 * Network Places (Neighbourhood) folder
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998, 1999, 2002 Juergen Schmied
6 * Copyright 2003 Mike McCormack for CodeWeavers
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "config.h"
24 #include "wine/port.h"
26 #include <stdlib.h>
27 #include <string.h>
28 #include <stdarg.h>
29 #include <stdio.h>
31 #define COBJMACROS
33 #include "winerror.h"
34 #include "windef.h"
35 #include "winbase.h"
36 #include "winreg.h"
38 #include "pidl.h"
39 #include "undocshell.h"
40 #include "shell32_main.h"
41 #include "shresdef.h"
42 #include "wine/debug.h"
43 #include "wine/unicode.h"
44 #include "debughlp.h"
45 #include "shfldr.h"
47 WINE_DEFAULT_DEBUG_CHANNEL (shell);
49 /***********************************************************************
50 * IShellFolder implementation
53 typedef struct {
54 IShellFolder2 IShellFolder2_iface;
55 IPersistFolder2 IPersistFolder2_iface;
56 LONG ref;
58 /* both paths are parsible from the desktop */
59 LPITEMIDLIST pidlRoot; /* absolute pidl */
60 } IGenericSFImpl;
62 static const IShellFolder2Vtbl vt_ShellFolder2;
63 static const IPersistFolder2Vtbl vt_NP_PersistFolder2;
65 static inline IGenericSFImpl *impl_from_IShellFolder2(IShellFolder2 *iface)
67 return CONTAINING_RECORD(iface, IGenericSFImpl, IShellFolder2_iface);
70 static inline IGenericSFImpl *impl_from_IPersistFolder2(IPersistFolder2 *iface)
72 return CONTAINING_RECORD(iface, IGenericSFImpl, IPersistFolder2_iface);
76 static const shvheader networkplaces_header[] = {
77 {IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
78 {IDS_SHV_COLUMN9, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10}
81 #define NETWORKPLACESSHELLVIEWCOLUMNS sizeof(networkplaces_header)/sizeof(shvheader)
83 /**************************************************************************
84 * ISF_NetworkPlaces_Constructor
86 HRESULT WINAPI ISF_NetworkPlaces_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
88 IGenericSFImpl *sf;
90 TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
92 if (!ppv)
93 return E_POINTER;
94 if (pUnkOuter)
95 return CLASS_E_NOAGGREGATION;
97 sf = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (IGenericSFImpl));
98 if (!sf)
99 return E_OUTOFMEMORY;
101 sf->ref = 0;
102 sf->IShellFolder2_iface.lpVtbl = &vt_ShellFolder2;
103 sf->IPersistFolder2_iface.lpVtbl = &vt_NP_PersistFolder2;
104 sf->pidlRoot = _ILCreateNetHood(); /* my qualified pidl */
106 if (FAILED (IShellFolder2_QueryInterface (&sf->IShellFolder2_iface, riid, ppv)))
108 IShellFolder2_Release (&sf->IShellFolder2_iface);
109 return E_NOINTERFACE;
112 TRACE ("--(%p)\n", sf);
113 return S_OK;
116 /**************************************************************************
117 * ISF_NetworkPlaces_fnQueryInterface
119 * NOTE
120 * supports not IPersist/IPersistFolder
122 static HRESULT WINAPI ISF_NetworkPlaces_fnQueryInterface (IShellFolder2 *iface, REFIID riid, LPVOID *ppvObj)
124 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
126 TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
128 *ppvObj = NULL;
130 if (IsEqualIID (riid, &IID_IUnknown) ||
131 IsEqualIID (riid, &IID_IShellFolder) ||
132 IsEqualIID (riid, &IID_IShellFolder2))
134 *ppvObj = &This->IShellFolder2_iface;
136 else if (IsEqualIID (riid, &IID_IPersist) ||
137 IsEqualIID (riid, &IID_IPersistFolder) ||
138 IsEqualIID (riid, &IID_IPersistFolder2))
140 *ppvObj = &This->IPersistFolder2_iface;
143 if (*ppvObj)
145 IUnknown_AddRef ((IUnknown *) (*ppvObj));
146 TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
147 return S_OK;
149 TRACE ("-- Interface: E_NOINTERFACE\n");
150 return E_NOINTERFACE;
153 static ULONG WINAPI ISF_NetworkPlaces_fnAddRef (IShellFolder2 * iface)
155 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
156 ULONG refCount = InterlockedIncrement(&This->ref);
158 TRACE ("(%p)->(count=%u)\n", This, refCount - 1);
160 return refCount;
163 static ULONG WINAPI ISF_NetworkPlaces_fnRelease (IShellFolder2 * iface)
165 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
166 ULONG refCount = InterlockedDecrement(&This->ref);
168 TRACE ("(%p)->(count=%u)\n", This, refCount + 1);
170 if (!refCount) {
171 TRACE ("-- destroying IShellFolder(%p)\n", This);
172 SHFree (This->pidlRoot);
173 HeapFree (GetProcessHeap(), 0, This);
175 return refCount;
178 /**************************************************************************
179 * ISF_NetworkPlaces_fnParseDisplayName
181 static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * iface,
182 HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName,
183 DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
185 static const WCHAR wszEntireNetwork[] = {'E','n','t','i','r','e','N','e','t','w','o','r','k'}; /* not nul-terminated */
186 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
187 HRESULT hr = E_INVALIDARG;
188 LPCWSTR szNext = NULL;
189 WCHAR szElement[MAX_PATH];
190 LPITEMIDLIST pidlTemp = NULL;
191 int len;
193 TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", This,
194 hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName),
195 pchEaten, ppidl, pdwAttributes);
197 *ppidl = NULL;
199 szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
200 len = strlenW(szElement);
201 if (len == sizeof(wszEntireNetwork)/sizeof(wszEntireNetwork[0]) &&
202 !strncmpiW(szElement, wszEntireNetwork, sizeof(wszEntireNetwork)/sizeof(wszEntireNetwork[0])))
204 pidlTemp = _ILCreateEntireNetwork();
205 if (pidlTemp)
206 hr = S_OK;
207 else
208 hr = E_OUTOFMEMORY;
210 else
211 FIXME("not implemented for %s\n", debugstr_w(lpszDisplayName));
213 if (SUCCEEDED(hr) && pidlTemp)
215 if (szNext && *szNext)
217 hr = SHELL32_ParseNextElement(iface, hwndOwner, pbcReserved,
218 &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
220 else
222 if (pdwAttributes && *pdwAttributes)
223 hr = SHELL32_GetItemAttributes(&This->IShellFolder2_iface, pidlTemp, pdwAttributes);
227 if (SUCCEEDED(hr))
228 *ppidl = pidlTemp;
229 else
230 ILFree(pidlTemp);
232 TRACE ("(%p)->(-- ret=0x%08x)\n", This, hr);
234 return hr;
237 /**************************************************************************
238 * ISF_NetworkPlaces_fnEnumObjects
240 static HRESULT WINAPI ISF_NetworkPlaces_fnEnumObjects (IShellFolder2 * iface,
241 HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
243 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
244 IEnumIDListImpl *list;
246 TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", This,
247 hwndOwner, dwFlags, ppEnumIDList);
249 if (!(list = IEnumIDList_Constructor()))
250 return E_OUTOFMEMORY;
251 *ppEnumIDList = &list->IEnumIDList_iface;
253 TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList);
255 return S_OK;
258 /**************************************************************************
259 * ISF_NetworkPlaces_fnBindToObject
261 static HRESULT WINAPI ISF_NetworkPlaces_fnBindToObject (IShellFolder2 * iface,
262 LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
264 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
266 TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This,
267 pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
269 return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut);
272 /**************************************************************************
273 * ISF_NetworkPlaces_fnBindToStorage
275 static HRESULT WINAPI ISF_NetworkPlaces_fnBindToStorage (IShellFolder2 * iface,
276 LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
278 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
280 FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This,
281 pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
283 *ppvOut = NULL;
284 return E_NOTIMPL;
287 /**************************************************************************
288 * ISF_NetworkPlaces_fnCompareIDs
291 static HRESULT WINAPI ISF_NetworkPlaces_fnCompareIDs (IShellFolder2 * iface,
292 LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
294 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
295 int nReturn;
297 TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
298 nReturn = SHELL32_CompareIDs(&This->IShellFolder2_iface, lParam, pidl1, pidl2);
299 TRACE ("-- %i\n", nReturn);
300 return nReturn;
303 /**************************************************************************
304 * ISF_NetworkPlaces_fnCreateViewObject
306 static HRESULT WINAPI ISF_NetworkPlaces_fnCreateViewObject (IShellFolder2 * iface,
307 HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
309 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
310 LPSHELLVIEW pShellView;
311 HRESULT hr = E_INVALIDARG;
313 TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This,
314 hwndOwner, shdebugstr_guid (riid), ppvOut);
316 if (!ppvOut)
317 return hr;
319 *ppvOut = NULL;
321 if (IsEqualIID (riid, &IID_IDropTarget))
323 WARN ("IDropTarget not implemented\n");
324 hr = E_NOTIMPL;
326 else if (IsEqualIID (riid, &IID_IContextMenu))
328 WARN ("IContextMenu not implemented\n");
329 hr = E_NOTIMPL;
331 else if (IsEqualIID (riid, &IID_IShellView))
333 pShellView = IShellView_Constructor ((IShellFolder *) iface);
334 if (pShellView)
336 hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
337 IShellView_Release (pShellView);
340 TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
341 return hr;
344 /**************************************************************************
345 * ISF_NetworkPlaces_fnGetAttributesOf
347 static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface,
348 UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
350 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
351 HRESULT hr = S_OK;
353 TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", This,
354 cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
356 if (!rgfInOut)
357 return E_INVALIDARG;
358 if (cidl && !apidl)
359 return E_INVALIDARG;
361 if (*rgfInOut == 0)
362 *rgfInOut = ~0;
364 if (cidl == 0)
366 IShellFolder2 *parent = NULL;
367 LPCITEMIDLIST rpidl = NULL;
369 hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder2, (void **)&parent, &rpidl);
370 if(SUCCEEDED(hr))
372 SHELL32_GetItemAttributes(parent, rpidl, rgfInOut);
373 IShellFolder2_Release(parent);
376 else
378 while (cidl > 0 && *apidl)
380 pdump (*apidl);
381 SHELL32_GetItemAttributes(&This->IShellFolder2_iface, *apidl, rgfInOut);
382 apidl++;
383 cidl--;
387 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
388 *rgfInOut &= ~SFGAO_VALIDATE;
390 TRACE ("-- result=0x%08x\n", *rgfInOut);
391 return hr;
394 /**************************************************************************
395 * ISF_NetworkPlaces_fnGetUIObjectOf
397 * PARAMETERS
398 * hwndOwner [in] Parent window for any output
399 * cidl [in] array size
400 * apidl [in] simple pidl array
401 * riid [in] Requested Interface
402 * prgfInOut [ ] reserved
403 * ppvObject [out] Resulting Interface
406 static HRESULT WINAPI ISF_NetworkPlaces_fnGetUIObjectOf (IShellFolder2 * iface,
407 HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid,
408 UINT * prgfInOut, LPVOID * ppvOut)
410 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
412 LPITEMIDLIST pidl;
413 IUnknown *pObj = NULL;
414 HRESULT hr = E_INVALIDARG;
416 TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", This,
417 hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
419 if (!ppvOut)
420 return hr;
422 *ppvOut = NULL;
424 if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1))
426 return ItemMenu_Constructor((IShellFolder*)iface, This->pidlRoot, apidl, cidl, riid, ppvOut);
428 else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
430 pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
431 hr = S_OK;
433 else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1))
435 pidl = ILCombine (This->pidlRoot, apidl[0]);
436 pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
437 SHFree (pidl);
438 hr = S_OK;
440 else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1))
442 pidl = ILCombine (This->pidlRoot, apidl[0]);
443 pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
444 SHFree (pidl);
445 hr = S_OK;
447 else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1))
449 hr = IShellFolder2_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj);
451 else
452 hr = E_NOINTERFACE;
454 if (SUCCEEDED(hr) && !pObj)
455 hr = E_OUTOFMEMORY;
457 *ppvOut = pObj;
458 TRACE ("(%p)->hr=0x%08x\n", This, hr);
459 return hr;
462 /**************************************************************************
463 * ISF_NetworkPlaces_fnGetDisplayNameOf
466 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDisplayNameOf (IShellFolder2 * iface,
467 LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
469 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
471 FIXME ("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet);
472 pdump (pidl);
474 if (!strRet)
475 return E_INVALIDARG;
477 return E_NOTIMPL;
480 /**************************************************************************
481 * ISF_NetworkPlaces_fnSetNameOf
482 * Changes the name of a file object or subfolder, possibly changing its item
483 * identifier in the process.
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
492 static HRESULT WINAPI ISF_NetworkPlaces_fnSetNameOf (IShellFolder2 * iface,
493 HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
494 LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
496 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
498 FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This,
499 hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
500 return E_FAIL;
503 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultSearchGUID (
504 IShellFolder2 * iface, GUID * pguid)
506 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
508 FIXME ("(%p)\n", This);
509 return E_NOTIMPL;
512 static HRESULT WINAPI ISF_NetworkPlaces_fnEnumSearches (IShellFolder2 * iface,
513 IEnumExtraSearch ** ppenum)
515 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
517 FIXME ("(%p)\n", This);
518 return E_NOTIMPL;
521 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultColumn (IShellFolder2 * iface,
522 DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
524 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
526 TRACE ("(%p)\n", This);
528 if (pSort)
529 *pSort = 0;
530 if (pDisplay)
531 *pDisplay = 0;
533 return S_OK;
536 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultColumnState (
537 IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
539 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
541 TRACE ("(%p)->(%d %p)\n", This, iColumn, pcsFlags);
543 if (!pcsFlags || iColumn >= NETWORKPLACESSHELLVIEWCOLUMNS)
544 return E_INVALIDARG;
546 *pcsFlags = networkplaces_header[iColumn].pcsFlags;
548 return S_OK;
551 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDetailsEx (IShellFolder2 * iface,
552 LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
554 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
556 FIXME ("(%p)\n", This);
557 return E_NOTIMPL;
560 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDetailsOf (IShellFolder2 * iface,
561 LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
563 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
565 FIXME ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
567 return E_NOTIMPL;
570 static HRESULT WINAPI ISF_NetworkPlaces_fnMapColumnToSCID (IShellFolder2 * iface,
571 UINT column, SHCOLUMNID * pscid)
573 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
575 FIXME ("(%p)\n", This);
577 return E_NOTIMPL;
580 static const IShellFolder2Vtbl vt_ShellFolder2 = {
581 ISF_NetworkPlaces_fnQueryInterface,
582 ISF_NetworkPlaces_fnAddRef,
583 ISF_NetworkPlaces_fnRelease,
584 ISF_NetworkPlaces_fnParseDisplayName,
585 ISF_NetworkPlaces_fnEnumObjects,
586 ISF_NetworkPlaces_fnBindToObject,
587 ISF_NetworkPlaces_fnBindToStorage,
588 ISF_NetworkPlaces_fnCompareIDs,
589 ISF_NetworkPlaces_fnCreateViewObject,
590 ISF_NetworkPlaces_fnGetAttributesOf,
591 ISF_NetworkPlaces_fnGetUIObjectOf,
592 ISF_NetworkPlaces_fnGetDisplayNameOf,
593 ISF_NetworkPlaces_fnSetNameOf,
594 /* ShellFolder2 */
595 ISF_NetworkPlaces_fnGetDefaultSearchGUID,
596 ISF_NetworkPlaces_fnEnumSearches,
597 ISF_NetworkPlaces_fnGetDefaultColumn,
598 ISF_NetworkPlaces_fnGetDefaultColumnState,
599 ISF_NetworkPlaces_fnGetDetailsEx,
600 ISF_NetworkPlaces_fnGetDetailsOf,
601 ISF_NetworkPlaces_fnMapColumnToSCID
604 /************************************************************************
605 * INPFldr_PersistFolder2_QueryInterface
607 static HRESULT WINAPI INPFldr_PersistFolder2_QueryInterface (IPersistFolder2 * iface,
608 REFIID iid, LPVOID * ppvObj)
610 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
612 TRACE ("(%p)\n", This);
614 return IShellFolder2_QueryInterface (&This->IShellFolder2_iface, iid, ppvObj);
617 /************************************************************************
618 * INPFldr_PersistFolder2_AddRef
620 static ULONG WINAPI INPFldr_PersistFolder2_AddRef (IPersistFolder2 * iface)
622 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
624 TRACE ("(%p)->(count=%u)\n", This, This->ref);
626 return IShellFolder2_AddRef (&This->IShellFolder2_iface);
629 /************************************************************************
630 * ISFPersistFolder_Release
632 static ULONG WINAPI INPFldr_PersistFolder2_Release (IPersistFolder2 * iface)
634 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
636 TRACE ("(%p)->(count=%u)\n", This, This->ref);
638 return IShellFolder2_Release (&This->IShellFolder2_iface);
641 /************************************************************************
642 * INPFldr_PersistFolder2_GetClassID
644 static HRESULT WINAPI INPFldr_PersistFolder2_GetClassID (
645 IPersistFolder2 * iface, CLSID * lpClassId)
647 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
649 TRACE ("(%p)\n", This);
651 if (!lpClassId)
652 return E_POINTER;
654 *lpClassId = CLSID_NetworkPlaces;
656 return S_OK;
659 /************************************************************************
660 * INPFldr_PersistFolder2_Initialize
662 * NOTES: it makes no sense to change the pidl
664 static HRESULT WINAPI INPFldr_PersistFolder2_Initialize (
665 IPersistFolder2 * iface, LPCITEMIDLIST pidl)
667 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
669 TRACE ("(%p)->(%p)\n", This, pidl);
671 return E_NOTIMPL;
674 /**************************************************************************
675 * IPersistFolder2_fnGetCurFolder
677 static HRESULT WINAPI INPFldr_PersistFolder2_GetCurFolder (
678 IPersistFolder2 * iface, LPITEMIDLIST * pidl)
680 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
682 TRACE ("(%p)->(%p)\n", This, pidl);
684 if (!pidl)
685 return E_POINTER;
687 *pidl = ILClone (This->pidlRoot);
689 return S_OK;
692 static const IPersistFolder2Vtbl vt_NP_PersistFolder2 =
694 INPFldr_PersistFolder2_QueryInterface,
695 INPFldr_PersistFolder2_AddRef,
696 INPFldr_PersistFolder2_Release,
697 INPFldr_PersistFolder2_GetClassID,
698 INPFldr_PersistFolder2_Initialize,
699 INPFldr_PersistFolder2_GetCurFolder