ws2_32/tests: Add tests for InetNtopW.
[wine.git] / dlls / shell32 / shfldr_netplaces.c
blob16e7cd5a895037a542a6161d87b6a3eab86cab37
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((IShellFolder *)&This->IShellFolder2_iface, pidlTemp,
224 pdwAttributes);
228 if (SUCCEEDED(hr))
229 *ppidl = pidlTemp;
230 else
231 ILFree(pidlTemp);
233 TRACE ("(%p)->(-- ret=0x%08x)\n", This, hr);
235 return hr;
238 /**************************************************************************
239 * ISF_NetworkPlaces_fnEnumObjects
241 static HRESULT WINAPI ISF_NetworkPlaces_fnEnumObjects (IShellFolder2 * iface,
242 HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
244 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
245 IEnumIDListImpl *list;
247 TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", This,
248 hwndOwner, dwFlags, ppEnumIDList);
250 if (!(list = IEnumIDList_Constructor()))
251 return E_OUTOFMEMORY;
252 *ppEnumIDList = &list->IEnumIDList_iface;
254 TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList);
256 return S_OK;
259 /**************************************************************************
260 * ISF_NetworkPlaces_fnBindToObject
262 static HRESULT WINAPI ISF_NetworkPlaces_fnBindToObject (IShellFolder2 * iface,
263 LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
265 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
267 TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This,
268 pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
270 return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut);
273 /**************************************************************************
274 * ISF_NetworkPlaces_fnBindToStorage
276 static HRESULT WINAPI ISF_NetworkPlaces_fnBindToStorage (IShellFolder2 * iface,
277 LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
279 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
281 FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This,
282 pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
284 *ppvOut = NULL;
285 return E_NOTIMPL;
288 /**************************************************************************
289 * ISF_NetworkPlaces_fnCompareIDs
292 static HRESULT WINAPI ISF_NetworkPlaces_fnCompareIDs (IShellFolder2 * iface,
293 LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
295 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
296 int nReturn;
298 TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
299 nReturn = SHELL32_CompareIDs(&This->IShellFolder2_iface, lParam, pidl1, pidl2);
300 TRACE ("-- %i\n", nReturn);
301 return nReturn;
304 /**************************************************************************
305 * ISF_NetworkPlaces_fnCreateViewObject
307 static HRESULT WINAPI ISF_NetworkPlaces_fnCreateViewObject (IShellFolder2 * iface,
308 HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
310 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
311 LPSHELLVIEW pShellView;
312 HRESULT hr = E_INVALIDARG;
314 TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This,
315 hwndOwner, shdebugstr_guid (riid), ppvOut);
317 if (!ppvOut)
318 return hr;
320 *ppvOut = NULL;
322 if (IsEqualIID (riid, &IID_IDropTarget))
324 WARN ("IDropTarget not implemented\n");
325 hr = E_NOTIMPL;
327 else if (IsEqualIID (riid, &IID_IContextMenu))
329 WARN ("IContextMenu not implemented\n");
330 hr = E_NOTIMPL;
332 else if (IsEqualIID (riid, &IID_IShellView))
334 pShellView = IShellView_Constructor ((IShellFolder *) iface);
335 if (pShellView)
337 hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
338 IShellView_Release (pShellView);
341 TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
342 return hr;
345 /**************************************************************************
346 * ISF_NetworkPlaces_fnGetAttributesOf
348 static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface,
349 UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
351 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
352 HRESULT hr = S_OK;
354 TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", This,
355 cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
357 if (!rgfInOut)
358 return E_INVALIDARG;
359 if (cidl && !apidl)
360 return E_INVALIDARG;
362 if (*rgfInOut == 0)
363 *rgfInOut = ~0;
365 if (cidl == 0)
367 IShellFolder *psfParent = NULL;
368 LPCITEMIDLIST rpidl = NULL;
370 hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (void**)&psfParent, &rpidl);
371 if(SUCCEEDED(hr))
373 SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut);
374 IShellFolder_Release(psfParent);
377 else
379 while (cidl > 0 && *apidl)
381 pdump (*apidl);
382 SHELL32_GetItemAttributes ((IShellFolder *)&This->IShellFolder2_iface, *apidl, rgfInOut);
383 apidl++;
384 cidl--;
388 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
389 *rgfInOut &= ~SFGAO_VALIDATE;
391 TRACE ("-- result=0x%08x\n", *rgfInOut);
392 return hr;
395 /**************************************************************************
396 * ISF_NetworkPlaces_fnGetUIObjectOf
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
407 static HRESULT WINAPI ISF_NetworkPlaces_fnGetUIObjectOf (IShellFolder2 * iface,
408 HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid,
409 UINT * prgfInOut, LPVOID * ppvOut)
411 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
413 LPITEMIDLIST pidl;
414 IUnknown *pObj = NULL;
415 HRESULT hr = E_INVALIDARG;
417 TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", This,
418 hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
420 if (!ppvOut)
421 return hr;
423 *ppvOut = NULL;
425 if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1))
427 return ItemMenu_Constructor((IShellFolder*)iface, This->pidlRoot, apidl, cidl, riid, ppvOut);
429 else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
431 pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
432 hr = S_OK;
434 else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1))
436 pidl = ILCombine (This->pidlRoot, apidl[0]);
437 pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
438 SHFree (pidl);
439 hr = S_OK;
441 else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1))
443 pidl = ILCombine (This->pidlRoot, apidl[0]);
444 pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
445 SHFree (pidl);
446 hr = S_OK;
448 else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1))
450 hr = IShellFolder2_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj);
452 else
453 hr = E_NOINTERFACE;
455 if (SUCCEEDED(hr) && !pObj)
456 hr = E_OUTOFMEMORY;
458 *ppvOut = pObj;
459 TRACE ("(%p)->hr=0x%08x\n", This, hr);
460 return hr;
463 /**************************************************************************
464 * ISF_NetworkPlaces_fnGetDisplayNameOf
467 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDisplayNameOf (IShellFolder2 * iface,
468 LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
470 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
472 FIXME ("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet);
473 pdump (pidl);
475 if (!strRet)
476 return E_INVALIDARG;
478 return E_NOTIMPL;
481 /**************************************************************************
482 * ISF_NetworkPlaces_fnSetNameOf
483 * Changes the name of a file object or subfolder, possibly changing its item
484 * identifier in the process.
486 * PARAMETERS
487 * hwndOwner [in] Owner window for output
488 * pidl [in] simple pidl of item to change
489 * lpszName [in] the items new display name
490 * dwFlags [in] SHGNO formatting flags
491 * ppidlOut [out] simple pidl returned
493 static HRESULT WINAPI ISF_NetworkPlaces_fnSetNameOf (IShellFolder2 * iface,
494 HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
495 LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
497 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
499 FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This,
500 hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
501 return E_FAIL;
504 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultSearchGUID (
505 IShellFolder2 * iface, GUID * pguid)
507 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
509 FIXME ("(%p)\n", This);
510 return E_NOTIMPL;
513 static HRESULT WINAPI ISF_NetworkPlaces_fnEnumSearches (IShellFolder2 * iface,
514 IEnumExtraSearch ** ppenum)
516 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
518 FIXME ("(%p)\n", This);
519 return E_NOTIMPL;
522 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultColumn (IShellFolder2 * iface,
523 DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
525 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
527 TRACE ("(%p)\n", This);
529 if (pSort)
530 *pSort = 0;
531 if (pDisplay)
532 *pDisplay = 0;
534 return S_OK;
537 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultColumnState (
538 IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
540 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
542 TRACE ("(%p)->(%d %p)\n", This, iColumn, pcsFlags);
544 if (!pcsFlags || iColumn >= NETWORKPLACESSHELLVIEWCOLUMNS)
545 return E_INVALIDARG;
547 *pcsFlags = networkplaces_header[iColumn].pcsFlags;
549 return S_OK;
552 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDetailsEx (IShellFolder2 * iface,
553 LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
555 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
557 FIXME ("(%p)\n", This);
558 return E_NOTIMPL;
561 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDetailsOf (IShellFolder2 * iface,
562 LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
564 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
566 FIXME ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
568 return E_NOTIMPL;
571 static HRESULT WINAPI ISF_NetworkPlaces_fnMapColumnToSCID (IShellFolder2 * iface,
572 UINT column, SHCOLUMNID * pscid)
574 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
576 FIXME ("(%p)\n", This);
578 return E_NOTIMPL;
581 static const IShellFolder2Vtbl vt_ShellFolder2 = {
582 ISF_NetworkPlaces_fnQueryInterface,
583 ISF_NetworkPlaces_fnAddRef,
584 ISF_NetworkPlaces_fnRelease,
585 ISF_NetworkPlaces_fnParseDisplayName,
586 ISF_NetworkPlaces_fnEnumObjects,
587 ISF_NetworkPlaces_fnBindToObject,
588 ISF_NetworkPlaces_fnBindToStorage,
589 ISF_NetworkPlaces_fnCompareIDs,
590 ISF_NetworkPlaces_fnCreateViewObject,
591 ISF_NetworkPlaces_fnGetAttributesOf,
592 ISF_NetworkPlaces_fnGetUIObjectOf,
593 ISF_NetworkPlaces_fnGetDisplayNameOf,
594 ISF_NetworkPlaces_fnSetNameOf,
595 /* ShellFolder2 */
596 ISF_NetworkPlaces_fnGetDefaultSearchGUID,
597 ISF_NetworkPlaces_fnEnumSearches,
598 ISF_NetworkPlaces_fnGetDefaultColumn,
599 ISF_NetworkPlaces_fnGetDefaultColumnState,
600 ISF_NetworkPlaces_fnGetDetailsEx,
601 ISF_NetworkPlaces_fnGetDetailsOf,
602 ISF_NetworkPlaces_fnMapColumnToSCID
605 /************************************************************************
606 * INPFldr_PersistFolder2_QueryInterface
608 static HRESULT WINAPI INPFldr_PersistFolder2_QueryInterface (IPersistFolder2 * iface,
609 REFIID iid, LPVOID * ppvObj)
611 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
613 TRACE ("(%p)\n", This);
615 return IShellFolder2_QueryInterface (&This->IShellFolder2_iface, iid, ppvObj);
618 /************************************************************************
619 * INPFldr_PersistFolder2_AddRef
621 static ULONG WINAPI INPFldr_PersistFolder2_AddRef (IPersistFolder2 * iface)
623 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
625 TRACE ("(%p)->(count=%u)\n", This, This->ref);
627 return IShellFolder2_AddRef (&This->IShellFolder2_iface);
630 /************************************************************************
631 * ISFPersistFolder_Release
633 static ULONG WINAPI INPFldr_PersistFolder2_Release (IPersistFolder2 * iface)
635 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
637 TRACE ("(%p)->(count=%u)\n", This, This->ref);
639 return IShellFolder2_Release (&This->IShellFolder2_iface);
642 /************************************************************************
643 * INPFldr_PersistFolder2_GetClassID
645 static HRESULT WINAPI INPFldr_PersistFolder2_GetClassID (
646 IPersistFolder2 * iface, CLSID * lpClassId)
648 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
650 TRACE ("(%p)\n", This);
652 if (!lpClassId)
653 return E_POINTER;
655 *lpClassId = CLSID_NetworkPlaces;
657 return S_OK;
660 /************************************************************************
661 * INPFldr_PersistFolder2_Initialize
663 * NOTES: it makes no sense to change the pidl
665 static HRESULT WINAPI INPFldr_PersistFolder2_Initialize (
666 IPersistFolder2 * iface, LPCITEMIDLIST pidl)
668 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
670 TRACE ("(%p)->(%p)\n", This, pidl);
672 return E_NOTIMPL;
675 /**************************************************************************
676 * IPersistFolder2_fnGetCurFolder
678 static HRESULT WINAPI INPFldr_PersistFolder2_GetCurFolder (
679 IPersistFolder2 * iface, LPITEMIDLIST * pidl)
681 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
683 TRACE ("(%p)->(%p)\n", This, pidl);
685 if (!pidl)
686 return E_POINTER;
688 *pidl = ILClone (This->pidlRoot);
690 return S_OK;
693 static const IPersistFolder2Vtbl vt_NP_PersistFolder2 =
695 INPFldr_PersistFolder2_QueryInterface,
696 INPFldr_PersistFolder2_AddRef,
697 INPFldr_PersistFolder2_Release,
698 INPFldr_PersistFolder2_GetClassID,
699 INPFldr_PersistFolder2_Initialize,
700 INPFldr_PersistFolder2_GetCurFolder