[SHELL32]
[reactos.git] / reactos / dll / win32 / shell32 / folders / CNetFolder.cpp
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 * Copyright 2009 Andrew Hill
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24 #include <precomp.h>
25
26 WINE_DEFAULT_DEBUG_CHANNEL (shell);
27
28 #define HACKY_UNC_PATHS
29
30 #ifdef HACKY_UNC_PATHS
31 LPITEMIDLIST ILCreateFromNetworkPlaceW(LPCWSTR lpNetworkPlace)
32 {
33 int cbData = sizeof(WORD) + sizeof(WCHAR) * (wcslen(lpNetworkPlace)+1);
34 LPITEMIDLIST pidl = (LPITEMIDLIST)SHAlloc(cbData + sizeof(WORD));
35 if (!pidl)
36 return NULL;
37
38 pidl->mkid.cb = cbData;
39 wcscpy((WCHAR*)&pidl->mkid.abID[0], lpNetworkPlace);
40 *(WORD*)((char*)pidl + cbData) = 0;
41
42 return pidl;
43 }
44 #endif
45
46 /***********************************************************************
47 * IShellFolder implementation
48 */
49
50 class CNetFolderEnum :
51 public CEnumIDListBase
52 {
53 public:
54 CNetFolderEnum();
55 ~CNetFolderEnum();
56 HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags);
57 BOOL CreateMyCompEnumList(DWORD dwFlags);
58 BOOL EnumerateRec(LPNETRESOURCE lpNet);
59
60 BEGIN_COM_MAP(CNetFolderEnum)
61 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
62 END_COM_MAP()
63 };
64
65 static shvheader NetworkPlacesSFHeader[] = {
66 {IDS_SHV_COLUMN8, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
67 {IDS_SHV_COLUMN13, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
68 {IDS_SHV_COLUMN_WORKGROUP, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
69 {IDS_SHV_NETWORKLOCATION, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}
70 };
71
72 #define COLUMN_NAME 0
73 #define COLUMN_CATEGORY 1
74 #define COLUMN_WORKGROUP 2
75 #define COLUMN_NETLOCATION 3
76
77 #define NETWORKPLACESSHELLVIEWCOLUMNS 4
78
79 CNetFolderEnum::CNetFolderEnum()
80 {
81 }
82
83 CNetFolderEnum::~CNetFolderEnum()
84 {
85 }
86
87 HRESULT WINAPI CNetFolderEnum::Initialize(HWND hwndOwner, DWORD dwFlags)
88 {
89 if (CreateMyCompEnumList(dwFlags) == FALSE)
90 return E_FAIL;
91
92 return S_OK;
93 }
94
95 /**************************************************************************
96 * CDrivesFolderEnum::CreateMyCompEnumList()
97 */
98
99 BOOL CNetFolderEnum::EnumerateRec(LPNETRESOURCE lpNet)
100 {
101 BOOL bRet = TRUE;
102 DWORD dRet;
103 HANDLE hEnum;
104 LPNETRESOURCE lpRes;
105 DWORD dSize = 0x1000;
106 DWORD dCount = -1;
107 LPNETRESOURCE lpCur;
108
109 dRet = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK, 0, lpNet, &hEnum);
110 if (dRet != WN_SUCCESS)
111 {
112 ERR("WNetOpenEnum() failed: %x\n", dRet);
113 return FALSE;
114 }
115
116 lpRes = (LPNETRESOURCE)CoTaskMemAlloc(dSize);
117 if (!lpRes)
118 {
119 ERR("CoTaskMemAlloc() failed\n");
120 WNetCloseEnum(hEnum);
121 return FALSE;
122 }
123
124 do
125 {
126 dSize = 0x1000;
127 dCount = -1;
128
129 memset(lpRes, 0, dSize);
130 dRet = WNetEnumResource(hEnum, &dCount, lpRes, &dSize);
131 if (dRet == WN_SUCCESS || dRet == WN_MORE_DATA)
132 {
133 lpCur = lpRes;
134 for (; dCount; dCount--)
135 {
136 TRACE("lpRemoteName: %S\n", lpCur->lpRemoteName);
137
138 if ((lpCur->dwUsage & RESOURCEUSAGE_CONTAINER) == RESOURCEUSAGE_CONTAINER)
139 {
140 TRACE("Found provider: %S\n", lpCur->lpProvider);
141 /* Sounds like a WTF hack.... Is Wine doing correct? */
142 if (!wcscmp(lpCur->lpRemoteName, lpCur->lpProvider))
143 {
144 lpCur->lpRemoteName = NULL;
145 }
146 EnumerateRec(lpCur);
147 }
148 else
149 {
150 LPITEMIDLIST pidl;
151
152 #ifdef HACKY_UNC_PATHS
153 pidl = ILCreateFromNetworkPlaceW(lpCur->lpRemoteName);
154 #endif
155 if (pidl != NULL)
156 bRet = AddToEnumList(pidl);
157 else
158 {
159 ERR("ILCreateFromPathW() failed\n");
160 bRet = FALSE;
161 break;
162 }
163 }
164
165 lpCur++;
166 }
167 }
168 } while (dRet != WN_NO_MORE_ENTRIES);
169
170 CoTaskMemFree(lpRes);
171 WNetCloseEnum(hEnum);
172
173 TRACE("Done: %u\n", bRet);
174
175 return bRet;
176 }
177
178 BOOL CNetFolderEnum::CreateMyCompEnumList(DWORD dwFlags)
179 {
180 BOOL bRet = TRUE;
181
182 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
183
184 /* enumerate the folders */
185 if (dwFlags & SHCONTF_FOLDERS)
186 {
187 bRet = EnumerateRec(NULL);
188 }
189
190 return bRet;
191 }
192
193 CNetFolder::CNetFolder()
194 {
195 pidlRoot = NULL;
196 }
197
198 CNetFolder::~CNetFolder()
199 {
200 TRACE("-- destroying IShellFolder(%p)\n", this);
201 SHFree(pidlRoot);
202 }
203
204 HRESULT WINAPI CNetFolder::FinalConstruct()
205 {
206 pidlRoot = _ILCreateGuid(PT_GUID, CLSID_NetworkPlaces); /* my qualified pidl */
207 if (pidlRoot == NULL)
208 return E_OUTOFMEMORY;
209 return S_OK;
210 }
211
212 /**************************************************************************
213 * CNetFolder::ParseDisplayName
214 */
215 HRESULT WINAPI CNetFolder::ParseDisplayName(HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName,
216 DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
217 {
218 HRESULT hr = E_UNEXPECTED;
219 #ifdef HACKY_UNC_PATHS
220 /* FIXME: the code below is an ugly hack */
221
222 /* Can we use a CFSFolder on that path? */
223 DWORD attrs = GetFileAttributes(lpszDisplayName);
224 if ((attrs & FILE_ATTRIBUTE_DIRECTORY))
225 {
226 if (pchEaten)
227 *pchEaten = 0; /* strange but like the original */
228
229 /* YES WE CAN */
230
231 /* Create our hacky pidl */
232 LPITEMIDLIST pidl = ILCreateFromNetworkPlaceW(lpszDisplayName);
233
234 *ppidl = pidl;
235 if (pdwAttributes)
236 *pdwAttributes = SFGAO_FILESYSTEM | SFGAO_CANLINK | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR;
237 return S_OK;
238 }
239 #endif
240
241 TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
242 hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName),
243 pchEaten, ppidl, pdwAttributes);
244
245 *ppidl = 0;
246 if (pchEaten)
247 *pchEaten = 0; /* strange but like the original */
248
249 TRACE("(%p)->(-- ret=0x%08x)\n", this, hr);
250
251 return hr;
252 }
253
254 /**************************************************************************
255 * CNetFolder::EnumObjects
256 */
257 HRESULT WINAPI CNetFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
258 {
259 return ShellObjectCreatorInit<CNetFolderEnum>(hwndOwner, dwFlags, IID_IEnumIDList, ppEnumIDList);
260 }
261
262 /**************************************************************************
263 * CNetFolder::BindToObject
264 */
265 HRESULT WINAPI CNetFolder::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
266 {
267 #ifdef HACKY_UNC_PATHS
268 HRESULT hr;
269 CComPtr<IPersistFolder3> ppf3;
270 hr = SHCoCreateInstance(NULL, &CLSID_ShellFSFolder, NULL, IID_PPV_ARG(IPersistFolder3, &ppf3));
271 if (FAILED(hr))
272 return hr;
273
274 PERSIST_FOLDER_TARGET_INFO pfti = {0};
275 pfti.csidl = -1;
276 wcscpy(pfti.szTargetParsingName, (WCHAR*)pidl->mkid.abID);
277
278 PCUIDLIST_RELATIVE pidlChild = ILCloneFirst (pidl);
279
280 hr = ppf3->InitializeEx(NULL, ILCombine(pidlRoot,pidlChild), &pfti);
281 if (FAILED(hr))
282 return hr;
283
284 if (_ILIsPidlSimple (pidl))
285 {
286 return ppf3->QueryInterface(riid, ppvOut);
287 }
288 else
289 {
290 CComPtr<IShellFolder> psf;
291 hr = ppf3->QueryInterface(IID_PPV_ARG(IShellFolder, &psf));
292 if (FAILED(hr))
293 return hr;
294
295 return psf->BindToObject(ILGetNext (pidl), pbcReserved, riid, ppvOut);
296 }
297
298 #else
299 return E_NOTIMPL;
300 #endif
301 }
302
303 /**************************************************************************
304 * CNetFolder::BindToStorage
305 */
306 HRESULT WINAPI CNetFolder::BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
307 {
308 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this,
309 pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
310
311 *ppvOut = NULL;
312 return E_NOTIMPL;
313 }
314
315 /**************************************************************************
316 * CNetFolder::CompareIDs
317 */
318
319 HRESULT WINAPI CNetFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
320 {
321 return E_NOTIMPL;
322 }
323
324 /**************************************************************************
325 * CNetFolder::CreateViewObject
326 */
327 HRESULT WINAPI CNetFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
328 {
329 CComPtr<IShellView> pShellView;
330 HRESULT hr = E_INVALIDARG;
331
332 TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
333 hwndOwner, shdebugstr_guid (&riid), ppvOut);
334
335 if (!ppvOut)
336 return hr;
337
338 *ppvOut = NULL;
339
340 if (IsEqualIID(riid, IID_IDropTarget))
341 {
342 WARN("IDropTarget not implemented\n");
343 hr = E_NOTIMPL;
344 }
345 else if (IsEqualIID(riid, IID_IContextMenu))
346 {
347 WARN("IContextMenu not implemented\n");
348 hr = E_NOTIMPL;
349 }
350 else if (IsEqualIID(riid, IID_IShellView))
351 {
352 hr = CDefView_Constructor(this, riid, ppvOut);
353 }
354 TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
355 return hr;
356 }
357
358 /**************************************************************************
359 * CNetFolder::GetAttributesOf
360 */
361 HRESULT WINAPI CNetFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
362 {
363 static const DWORD dwNethoodAttributes =
364 SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
365 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE;
366 HRESULT hr = S_OK;
367
368 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", this,
369 cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
370
371 if (!rgfInOut)
372 return E_INVALIDARG;
373 if (cidl && !apidl)
374 return E_INVALIDARG;
375
376 if (*rgfInOut == 0)
377 *rgfInOut = ~0;
378
379 if(cidl == 0)
380 *rgfInOut = dwNethoodAttributes;
381 else
382 {
383 /* FIXME: Implement when enumerating items is implemented */
384 #ifdef HACKY_UNC_PATHS
385 *rgfInOut = SFGAO_FILESYSTEM | SFGAO_CANLINK | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR;
386 #endif
387 }
388
389 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
390 *rgfInOut &= ~SFGAO_VALIDATE;
391
392 TRACE("-- result=0x%08x\n", *rgfInOut);
393 return hr;
394 }
395
396 /**************************************************************************
397 * CNetFolder::GetUIObjectOf
398 *
399 * PARAMETERS
400 * hwndOwner [in] Parent window for any output
401 * cidl [in] array size
402 * apidl [in] simple pidl array
403 * riid [in] Requested Interface
404 * prgfInOut [ ] reserved
405 * ppvObject [out] Resulting Interface
406 *
407 */
408 HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid,
409 UINT * prgfInOut, LPVOID * ppvOut)
410 {
411 LPITEMIDLIST pidl;
412 IUnknown *pObj = NULL;
413 HRESULT hr = E_INVALIDARG;
414
415 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
416 hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
417
418 if (!ppvOut)
419 return hr;
420
421 *ppvOut = NULL;
422
423 if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1))
424 {
425 IContextMenu * pCm = NULL;
426 hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, 0, NULL, &pCm);
427 pObj = pCm;
428 }
429 else if (IsEqualIID(riid, IID_IDataObject) && (cidl >= 1))
430 {
431 IDataObject * pDo = NULL;
432 hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, &pDo);
433 pObj = pDo;
434 }
435 else if (IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1))
436 {
437 pidl = ILCombine (pidlRoot, apidl[0]);
438 pObj = IExtractIconA_Constructor (pidl);
439 SHFree (pidl);
440 hr = S_OK;
441 }
442 else if (IsEqualIID(riid, IID_IExtractIconW) && (cidl == 1))
443 {
444 pidl = ILCombine (pidlRoot, apidl[0]);
445 pObj = IExtractIconW_Constructor (pidl);
446 SHFree (pidl);
447 hr = S_OK;
448 }
449 else if (IsEqualIID(riid, IID_IDropTarget) && (cidl >= 1))
450 {
451 IDropTarget * pDt = NULL;
452 hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
453 pObj = pDt;
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 * CNetFolder::GetDisplayNameOf
468 *
469 */
470 HRESULT WINAPI CNetFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
471 {
472 LPWSTR pszName;
473
474 TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", this, pidl, dwFlags, strRet);
475 pdump (pidl);
476
477 if (!strRet)
478 return E_INVALIDARG;
479
480 if (!pidl->mkid.cb)
481 {
482 pszName = (LPWSTR)CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR));
483 if (!pszName)
484 return E_OUTOFMEMORY;
485
486 if (LoadStringW(shell32_hInstance, IDS_NETWORKPLACE, pszName, MAX_PATH))
487 {
488 pszName[MAX_PATH-1] = L'\0';
489 strRet->uType = STRRET_WSTR;
490 strRet->pOleStr = pszName;
491 return S_OK;
492 }
493 CoTaskMemFree(pszName);
494 return E_FAIL;
495 }
496 #ifdef HACKY_UNC_PATHS
497 else
498 {
499 LPCWSTR pstr = (LPCWSTR)pidl->mkid.abID;
500 pszName = (LPWSTR)CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR));
501 if (!pszName)
502 return E_OUTOFMEMORY;
503
504 wcscpy(pszName, pstr);
505 strRet->pOleStr = pszName;
506 strRet->uType = STRRET_WSTR;
507 return S_OK;
508 }
509 #endif
510 return E_NOTIMPL;
511 }
512
513 /**************************************************************************
514 * CNetFolder::SetNameOf
515 * Changes the name of a file object or subfolder, possibly changing its item
516 * identifier in the process.
517 *
518 * PARAMETERS
519 * hwndOwner [in] Owner window for output
520 * pidl [in] simple pidl of item to change
521 * lpszName [in] the items new display name
522 * dwFlags [in] SHGNO formatting flags
523 * ppidlOut [out] simple pidl returned
524 */
525 HRESULT WINAPI CNetFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, /*simple pidl */
526 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
527 {
528 FIXME("(%p)->(%p,pidl=%p,%s,%u,%p)\n", this,
529 hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
530 return E_FAIL;
531 }
532
533 HRESULT WINAPI CNetFolder::GetDefaultSearchGUID(GUID *pguid)
534 {
535 FIXME("(%p)\n", this);
536 return E_NOTIMPL;
537 }
538
539 HRESULT WINAPI CNetFolder::EnumSearches(IEnumExtraSearch ** ppenum)
540 {
541 FIXME("(%p)\n", this);
542 return E_NOTIMPL;
543 }
544
545 HRESULT WINAPI CNetFolder::GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
546 {
547 TRACE("(%p)\n", this);
548
549 if (pSort)
550 *pSort = 0;
551 if (pDisplay)
552 *pDisplay = 0;
553
554 return S_OK;
555 }
556
557 HRESULT WINAPI CNetFolder::GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
558 {
559 TRACE("(%p)\n", this);
560
561 if (!pcsFlags || iColumn >= NETWORKPLACESSHELLVIEWCOLUMNS)
562 return E_INVALIDARG;
563 *pcsFlags = NetworkPlacesSFHeader[iColumn].pcsFlags;
564 return S_OK;
565 }
566
567 HRESULT WINAPI CNetFolder::GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
568 {
569 FIXME("(%p)\n", this);
570 return E_NOTIMPL;
571 }
572
573 HRESULT WINAPI CNetFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
574 {
575 WCHAR buffer[MAX_PATH] = {0};
576 HRESULT hr = E_FAIL;
577
578 if (iColumn >= NETWORKPLACESSHELLVIEWCOLUMNS)
579 return E_FAIL;
580
581 psd->fmt = NetworkPlacesSFHeader[iColumn].fmt;
582 psd->cxChar = NetworkPlacesSFHeader[iColumn].cxChar;
583 if (pidl == NULL)
584 {
585 psd->str.uType = STRRET_WSTR;
586 if (LoadStringW(shell32_hInstance, NetworkPlacesSFHeader[iColumn].colnameid, buffer, _countof(buffer)))
587 hr = SHStrDupW(buffer, &psd->str.pOleStr);
588
589 return hr;
590 }
591
592 if (iColumn == COLUMN_NAME)
593 return GetDisplayNameOf(pidl, SHGDN_NORMAL, &psd->str);
594
595 FIXME("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
596
597 return E_NOTIMPL;
598 }
599
600 HRESULT WINAPI CNetFolder::MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
601 {
602 FIXME("(%p)\n", this);
603
604 return E_NOTIMPL;
605 }
606
607 /************************************************************************
608 * CNetFolder::GetClassID
609 */
610 HRESULT WINAPI CNetFolder::GetClassID(CLSID *lpClassId)
611 {
612 TRACE("(%p)\n", this);
613
614 if (!lpClassId)
615 return E_POINTER;
616
617 *lpClassId = CLSID_NetworkPlaces;
618
619 return S_OK;
620 }
621
622 /************************************************************************
623 * CNetFolder::Initialize
624 *
625 * NOTES: it makes no sense to change the pidl
626 */
627 HRESULT WINAPI CNetFolder::Initialize(LPCITEMIDLIST pidl)
628 {
629 TRACE("(%p)->(%p)\n", this, pidl);
630
631 return S_OK;
632 }
633
634 /**************************************************************************
635 * CNetFolder::GetCurFolder
636 */
637 HRESULT WINAPI CNetFolder::GetCurFolder(LPITEMIDLIST *pidl)
638 {
639 TRACE("(%p)->(%p)\n", this, pidl);
640
641 if (!pidl)
642 return E_POINTER;
643
644 *pidl = ILClone(pidlRoot);
645
646 return S_OK;
647 }