gdi32: Recompute the background masks on every use to support PALETTEINDEX colors.
[wine/multimedia.git] / dlls / shell32 / shfldr_netplaces.c
blobc5034f86b41339f44a948be2109a3ed902c4ce50
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
32 #define NONAMELESSUNION
33 #define NONAMELESSSTRUCT
35 #include "winerror.h"
36 #include "windef.h"
37 #include "winbase.h"
38 #include "winreg.h"
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"
49 WINE_DEFAULT_DEBUG_CHANNEL (shell);
51 /***********************************************************************
52 * IShellFolder implementation
55 typedef struct {
56 IShellFolder2 IShellFolder2_iface;
57 IPersistFolder2 IPersistFolder2_iface;
58 LONG ref;
60 /* both paths are parsible from the desktop */
61 LPITEMIDLIST pidlRoot; /* absolute pidl */
62 } IGenericSFImpl;
64 static const IShellFolder2Vtbl vt_ShellFolder2;
65 static const IPersistFolder2Vtbl vt_NP_PersistFolder2;
67 static inline IGenericSFImpl *impl_from_IShellFolder2(IShellFolder2 *iface)
69 return CONTAINING_RECORD(iface, IGenericSFImpl, IShellFolder2_iface);
72 static inline IGenericSFImpl *impl_from_IPersistFolder2(IPersistFolder2 *iface)
74 return CONTAINING_RECORD(iface, IGenericSFImpl, IPersistFolder2_iface);
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}
83 #define NETWORKPLACESSHELLVIEWCOLUMNS sizeof(networkplaces_header)/sizeof(shvheader)
85 /**************************************************************************
86 * ISF_NetworkPlaces_Constructor
88 HRESULT WINAPI ISF_NetworkPlaces_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
90 IGenericSFImpl *sf;
92 TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
94 if (!ppv)
95 return E_POINTER;
96 if (pUnkOuter)
97 return CLASS_E_NOAGGREGATION;
99 sf = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (IGenericSFImpl));
100 if (!sf)
101 return E_OUTOFMEMORY;
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 */
108 if (FAILED (IShellFolder2_QueryInterface (&sf->IShellFolder2_iface, riid, ppv)))
110 IShellFolder2_Release (&sf->IShellFolder2_iface);
111 return E_NOINTERFACE;
114 TRACE ("--(%p)\n", sf);
115 return S_OK;
118 /**************************************************************************
119 * ISF_NetworkPlaces_fnQueryInterface
121 * NOTE
122 * supports not IPersist/IPersistFolder
124 static HRESULT WINAPI ISF_NetworkPlaces_fnQueryInterface (IShellFolder2 *iface, REFIID riid, LPVOID *ppvObj)
126 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
128 TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
130 *ppvObj = NULL;
132 if (IsEqualIID (riid, &IID_IUnknown) ||
133 IsEqualIID (riid, &IID_IShellFolder) ||
134 IsEqualIID (riid, &IID_IShellFolder2))
136 *ppvObj = This;
138 else if (IsEqualIID (riid, &IID_IPersist) ||
139 IsEqualIID (riid, &IID_IPersistFolder) ||
140 IsEqualIID (riid, &IID_IPersistFolder2))
142 *ppvObj = &This->IPersistFolder2_iface;
145 if (*ppvObj)
147 IUnknown_AddRef ((IUnknown *) (*ppvObj));
148 TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
149 return S_OK;
151 TRACE ("-- Interface: E_NOINTERFACE\n");
152 return E_NOINTERFACE;
155 static ULONG WINAPI ISF_NetworkPlaces_fnAddRef (IShellFolder2 * iface)
157 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
158 ULONG refCount = InterlockedIncrement(&This->ref);
160 TRACE ("(%p)->(count=%u)\n", This, refCount - 1);
162 return refCount;
165 static ULONG WINAPI ISF_NetworkPlaces_fnRelease (IShellFolder2 * iface)
167 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
168 ULONG refCount = InterlockedDecrement(&This->ref);
170 TRACE ("(%p)->(count=%u)\n", This, refCount + 1);
172 if (!refCount) {
173 TRACE ("-- destroying IShellFolder(%p)\n", This);
174 SHFree (This->pidlRoot);
175 HeapFree (GetProcessHeap(), 0, This);
177 return refCount;
180 /**************************************************************************
181 * ISF_NetworkPlaces_fnParseDisplayName
183 static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * iface,
184 HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName,
185 DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
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;
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);
199 *ppidl = NULL;
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])))
206 pidlTemp = _ILCreateEntireNetwork();
207 if (pidlTemp)
208 hr = S_OK;
209 else
210 hr = E_OUTOFMEMORY;
212 else
213 FIXME("not implemented for %s\n", debugstr_w(lpszDisplayName));
215 if (SUCCEEDED(hr) && pidlTemp)
217 if (szNext && *szNext)
219 hr = SHELL32_ParseNextElement(iface, hwndOwner, pbcReserved,
220 &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
222 else
224 if (pdwAttributes && *pdwAttributes)
225 hr = SHELL32_GetItemAttributes((IShellFolder *)&This->IShellFolder2_iface, pidlTemp,
226 pdwAttributes);
230 if (SUCCEEDED(hr))
231 *ppidl = pidlTemp;
232 else
233 ILFree(pidlTemp);
235 TRACE ("(%p)->(-- ret=0x%08x)\n", This, hr);
237 return hr;
240 /**************************************************************************
241 * ISF_NetworkPlaces_fnEnumObjects
243 static HRESULT WINAPI ISF_NetworkPlaces_fnEnumObjects (IShellFolder2 * iface,
244 HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
246 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
247 IEnumIDListImpl *list;
249 TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", This,
250 hwndOwner, dwFlags, ppEnumIDList);
252 if (!(list = IEnumIDList_Constructor()))
253 return E_OUTOFMEMORY;
254 *ppEnumIDList = &list->IEnumIDList_iface;
256 TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList);
258 return S_OK;
261 /**************************************************************************
262 * ISF_NetworkPlaces_fnBindToObject
264 static HRESULT WINAPI ISF_NetworkPlaces_fnBindToObject (IShellFolder2 * iface,
265 LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
267 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
269 TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This,
270 pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
272 return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut);
275 /**************************************************************************
276 * ISF_NetworkPlaces_fnBindToStorage
278 static HRESULT WINAPI ISF_NetworkPlaces_fnBindToStorage (IShellFolder2 * iface,
279 LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
281 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
283 FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This,
284 pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
286 *ppvOut = NULL;
287 return E_NOTIMPL;
290 /**************************************************************************
291 * ISF_NetworkPlaces_fnCompareIDs
294 static HRESULT WINAPI ISF_NetworkPlaces_fnCompareIDs (IShellFolder2 * iface,
295 LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
297 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
298 int nReturn;
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;
306 /**************************************************************************
307 * ISF_NetworkPlaces_fnCreateViewObject
309 static HRESULT WINAPI ISF_NetworkPlaces_fnCreateViewObject (IShellFolder2 * iface,
310 HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
312 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
313 LPSHELLVIEW pShellView;
314 HRESULT hr = E_INVALIDARG;
316 TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This,
317 hwndOwner, shdebugstr_guid (riid), ppvOut);
319 if (!ppvOut)
320 return hr;
322 *ppvOut = NULL;
324 if (IsEqualIID (riid, &IID_IDropTarget))
326 WARN ("IDropTarget not implemented\n");
327 hr = E_NOTIMPL;
329 else if (IsEqualIID (riid, &IID_IContextMenu))
331 WARN ("IContextMenu not implemented\n");
332 hr = E_NOTIMPL;
334 else if (IsEqualIID (riid, &IID_IShellView))
336 pShellView = IShellView_Constructor ((IShellFolder *) iface);
337 if (pShellView)
339 hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
340 IShellView_Release (pShellView);
343 TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
344 return hr;
347 /**************************************************************************
348 * ISF_NetworkPlaces_fnGetAttributesOf
350 static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface,
351 UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
353 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
354 HRESULT hr = S_OK;
356 TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", This,
357 cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
359 if (!rgfInOut)
360 return E_INVALIDARG;
361 if (cidl && !apidl)
362 return E_INVALIDARG;
364 if (*rgfInOut == 0)
365 *rgfInOut = ~0;
367 if (cidl == 0)
369 IShellFolder *psfParent = NULL;
370 LPCITEMIDLIST rpidl = NULL;
372 hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (void**)&psfParent, &rpidl);
373 if(SUCCEEDED(hr))
375 SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut);
376 IShellFolder_Release(psfParent);
379 else
381 while (cidl > 0 && *apidl)
383 pdump (*apidl);
384 SHELL32_GetItemAttributes ((IShellFolder *)&This->IShellFolder2_iface, *apidl, rgfInOut);
385 apidl++;
386 cidl--;
390 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
391 *rgfInOut &= ~SFGAO_VALIDATE;
393 TRACE ("-- result=0x%08x\n", *rgfInOut);
394 return hr;
397 /**************************************************************************
398 * ISF_NetworkPlaces_fnGetUIObjectOf
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
409 static HRESULT WINAPI ISF_NetworkPlaces_fnGetUIObjectOf (IShellFolder2 * iface,
410 HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid,
411 UINT * prgfInOut, LPVOID * ppvOut)
413 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
415 LPITEMIDLIST pidl;
416 IUnknown *pObj = NULL;
417 HRESULT hr = E_INVALIDARG;
419 TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", This,
420 hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
422 if (!ppvOut)
423 return hr;
425 *ppvOut = NULL;
427 if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1))
429 pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
430 hr = S_OK;
432 else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
434 pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
435 hr = S_OK;
437 else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1))
439 pidl = ILCombine (This->pidlRoot, apidl[0]);
440 pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
441 SHFree (pidl);
442 hr = S_OK;
444 else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1))
446 pidl = ILCombine (This->pidlRoot, apidl[0]);
447 pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
448 SHFree (pidl);
449 hr = S_OK;
451 else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1))
453 hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj);
455 else
456 hr = E_NOINTERFACE;
458 if (SUCCEEDED(hr) && !pObj)
459 hr = E_OUTOFMEMORY;
461 *ppvOut = pObj;
462 TRACE ("(%p)->hr=0x%08x\n", This, hr);
463 return hr;
466 /**************************************************************************
467 * ISF_NetworkPlaces_fnGetDisplayNameOf
470 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDisplayNameOf (IShellFolder2 * iface,
471 LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
473 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
475 FIXME ("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet);
476 pdump (pidl);
478 if (!strRet)
479 return E_INVALIDARG;
481 return E_NOTIMPL;
484 /**************************************************************************
485 * ISF_NetworkPlaces_fnSetNameOf
486 * Changes the name of a file object or subfolder, possibly changing its item
487 * identifier in the process.
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
496 static HRESULT WINAPI ISF_NetworkPlaces_fnSetNameOf (IShellFolder2 * iface,
497 HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
498 LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
500 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
502 FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This,
503 hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
504 return E_FAIL;
507 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultSearchGUID (
508 IShellFolder2 * iface, GUID * pguid)
510 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
512 FIXME ("(%p)\n", This);
513 return E_NOTIMPL;
516 static HRESULT WINAPI ISF_NetworkPlaces_fnEnumSearches (IShellFolder2 * iface,
517 IEnumExtraSearch ** ppenum)
519 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
521 FIXME ("(%p)\n", This);
522 return E_NOTIMPL;
525 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultColumn (IShellFolder2 * iface,
526 DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
528 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
530 TRACE ("(%p)\n", This);
532 if (pSort)
533 *pSort = 0;
534 if (pDisplay)
535 *pDisplay = 0;
537 return S_OK;
540 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultColumnState (
541 IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
543 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
545 TRACE ("(%p)->(%d %p)\n", This, iColumn, pcsFlags);
547 if (!pcsFlags || iColumn >= NETWORKPLACESSHELLVIEWCOLUMNS)
548 return E_INVALIDARG;
550 *pcsFlags = networkplaces_header[iColumn].pcsFlags;
552 return S_OK;
555 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDetailsEx (IShellFolder2 * iface,
556 LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
558 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
560 FIXME ("(%p)\n", This);
561 return E_NOTIMPL;
564 static HRESULT WINAPI ISF_NetworkPlaces_fnGetDetailsOf (IShellFolder2 * iface,
565 LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
567 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
569 FIXME ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
571 return E_NOTIMPL;
574 static HRESULT WINAPI ISF_NetworkPlaces_fnMapColumnToSCID (IShellFolder2 * iface,
575 UINT column, SHCOLUMNID * pscid)
577 IGenericSFImpl *This = impl_from_IShellFolder2(iface);
579 FIXME ("(%p)\n", This);
581 return E_NOTIMPL;
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
608 /************************************************************************
609 * INPFldr_PersistFolder2_QueryInterface
611 static HRESULT WINAPI INPFldr_PersistFolder2_QueryInterface (IPersistFolder2 * iface,
612 REFIID iid, LPVOID * ppvObj)
614 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
616 TRACE ("(%p)\n", This);
618 return IShellFolder2_QueryInterface (&This->IShellFolder2_iface, iid, ppvObj);
621 /************************************************************************
622 * INPFldr_PersistFolder2_AddRef
624 static ULONG WINAPI INPFldr_PersistFolder2_AddRef (IPersistFolder2 * iface)
626 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
628 TRACE ("(%p)->(count=%u)\n", This, This->ref);
630 return IShellFolder2_AddRef (&This->IShellFolder2_iface);
633 /************************************************************************
634 * ISFPersistFolder_Release
636 static ULONG WINAPI INPFldr_PersistFolder2_Release (IPersistFolder2 * iface)
638 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
640 TRACE ("(%p)->(count=%u)\n", This, This->ref);
642 return IShellFolder2_Release (&This->IShellFolder2_iface);
645 /************************************************************************
646 * INPFldr_PersistFolder2_GetClassID
648 static HRESULT WINAPI INPFldr_PersistFolder2_GetClassID (
649 IPersistFolder2 * iface, CLSID * lpClassId)
651 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
653 TRACE ("(%p)\n", This);
655 if (!lpClassId)
656 return E_POINTER;
658 *lpClassId = CLSID_NetworkPlaces;
660 return S_OK;
663 /************************************************************************
664 * INPFldr_PersistFolder2_Initialize
666 * NOTES: it makes no sense to change the pidl
668 static HRESULT WINAPI INPFldr_PersistFolder2_Initialize (
669 IPersistFolder2 * iface, LPCITEMIDLIST pidl)
671 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
673 TRACE ("(%p)->(%p)\n", This, pidl);
675 return E_NOTIMPL;
678 /**************************************************************************
679 * IPersistFolder2_fnGetCurFolder
681 static HRESULT WINAPI INPFldr_PersistFolder2_GetCurFolder (
682 IPersistFolder2 * iface, LPITEMIDLIST * pidl)
684 IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
686 TRACE ("(%p)->(%p)\n", This, pidl);
688 if (!pidl)
689 return E_POINTER;
691 *pidl = ILClone (This->pidlRoot);
693 return S_OK;
696 static const IPersistFolder2Vtbl vt_NP_PersistFolder2 =
698 INPFldr_PersistFolder2_QueryInterface,
699 INPFldr_PersistFolder2_AddRef,
700 INPFldr_PersistFolder2_Release,
701 INPFldr_PersistFolder2_GetClassID,
702 INPFldr_PersistFolder2_Initialize,
703 INPFldr_PersistFolder2_GetCurFolder