d5e445c9a3426a5db163cf69cef55592845904d0
[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 WNetCloseEnum(hEnum);
171
172 TRACE("Done: %u\n", bRet);
173
174 return bRet;
175 }
176
177 BOOL CNetFolderEnum::CreateMyCompEnumList(DWORD dwFlags)
178 {
179 BOOL bRet = TRUE;
180
181 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
182
183 /* enumerate the folders */
184 if (dwFlags & SHCONTF_FOLDERS)
185 {
186 bRet = EnumerateRec(NULL);
187 }
188
189 return bRet;
190 }
191
192 CNetFolder::CNetFolder()
193 {
194 pidlRoot = NULL;
195 }
196
197 CNetFolder::~CNetFolder()
198 {
199 TRACE("-- destroying IShellFolder(%p)\n", this);
200 SHFree(pidlRoot);
201 }
202
203 HRESULT WINAPI CNetFolder::FinalConstruct()
204 {
205 pidlRoot = _ILCreateGuid(PT_GUID, CLSID_NetworkPlaces); /* my qualified pidl */
206 if (pidlRoot == NULL)
207 return E_OUTOFMEMORY;
208 return S_OK;
209 }
210
211 /**************************************************************************
212 * CNetFolder::ParseDisplayName
213 */
214 HRESULT WINAPI CNetFolder::ParseDisplayName(HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName,
215 DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
216 {
217 HRESULT hr = E_UNEXPECTED;
218 #ifdef HACKY_UNC_PATHS
219 /* FIXME: the code below is an ugly hack */
220
221 /* Can we use a CFSFolder on that path? */
222 DWORD attrs = GetFileAttributes(lpszDisplayName);
223 if ((attrs & FILE_ATTRIBUTE_DIRECTORY))
224 {
225 if (pchEaten)
226 *pchEaten = 0; /* strange but like the original */
227
228 /* YES WE CAN */
229
230 /* Create our hacky pidl */
231 LPITEMIDLIST pidl = ILCreateFromNetworkPlaceW(lpszDisplayName);
232
233 *ppidl = pidl;
234 if (pdwAttributes)
235 *pdwAttributes = SFGAO_FILESYSTEM | SFGAO_CANLINK | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR;
236 return S_OK;
237 }
238 #endif
239
240 TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
241 hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName),
242 pchEaten, ppidl, pdwAttributes);
243
244 *ppidl = 0;
245 if (pchEaten)
246 *pchEaten = 0; /* strange but like the original */
247
248 TRACE("(%p)->(-- ret=0x%08x)\n", this, hr);
249
250 return hr;
251 }
252
253 /**************************************************************************
254 * CNetFolder::EnumObjects
255 */
256 HRESULT WINAPI CNetFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
257 {
258 return ShellObjectCreatorInit<CNetFolderEnum>(hwndOwner, dwFlags, IID_IEnumIDList, ppEnumIDList);
259 }
260
261 /**************************************************************************
262 * CNetFolder::BindToObject
263 */
264 HRESULT WINAPI CNetFolder::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
265 {
266 #ifdef HACKY_UNC_PATHS
267 HRESULT hr;
268 CComPtr<IPersistFolder3> ppf3;
269 hr = SHCoCreateInstance(NULL, &CLSID_ShellFSFolder, NULL, IID_PPV_ARG(IPersistFolder3, &ppf3));
270 if (FAILED(hr))
271 return hr;
272
273 PERSIST_FOLDER_TARGET_INFO pfti = {0};
274 pfti.csidl = -1;
275 wcscpy(pfti.szTargetParsingName, (WCHAR*)pidl->mkid.abID);
276
277 PCUIDLIST_RELATIVE pidlChild = ILCloneFirst (pidl);
278
279 hr = ppf3->InitializeEx(NULL, ILCombine(pidlRoot,pidlChild), &pfti);
280 if (FAILED(hr))
281 return hr;
282
283 if (_ILIsPidlSimple (pidl))
284 {
285 return ppf3->QueryInterface(riid, ppvOut);
286 }
287 else
288 {
289 CComPtr<IShellFolder> psf;
290 hr = ppf3->QueryInterface(IID_PPV_ARG(IShellFolder, &psf));
291 if (FAILED(hr))
292 return hr;
293
294 return psf->BindToObject(ILGetNext (pidl), pbcReserved, riid, ppvOut);
295 }
296
297 #else
298 return E_NOTIMPL;
299 #endif
300 }
301
302 /**************************************************************************
303 * CNetFolder::BindToStorage
304 */
305 HRESULT WINAPI CNetFolder::BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
306 {
307 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this,
308 pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
309
310 *ppvOut = NULL;
311 return E_NOTIMPL;
312 }
313
314 /**************************************************************************
315 * CNetFolder::CompareIDs
316 */
317
318 HRESULT WINAPI CNetFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
319 {
320 return E_NOTIMPL;
321 }
322
323 /**************************************************************************
324 * CNetFolder::CreateViewObject
325 */
326 HRESULT WINAPI CNetFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
327 {
328 CComPtr<IShellView> pShellView;
329 HRESULT hr = E_INVALIDARG;
330
331 TRACE("(%p)->(hwnd=%p,%s,%p)\n", this,
332 hwndOwner, shdebugstr_guid (&riid), ppvOut);
333
334 if (!ppvOut)
335 return hr;
336
337 *ppvOut = NULL;
338
339 if (IsEqualIID(riid, IID_IDropTarget))
340 {
341 WARN("IDropTarget not implemented\n");
342 hr = E_NOTIMPL;
343 }
344 else if (IsEqualIID(riid, IID_IContextMenu))
345 {
346 WARN("IContextMenu not implemented\n");
347 hr = E_NOTIMPL;
348 }
349 else if (IsEqualIID(riid, IID_IShellView))
350 {
351 hr = CDefView_Constructor(this, riid, ppvOut);
352 }
353 TRACE("-- (%p)->(interface=%p)\n", this, ppvOut);
354 return hr;
355 }
356
357 /**************************************************************************
358 * CNetFolder::GetAttributesOf
359 */
360 HRESULT WINAPI CNetFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
361 {
362 static const DWORD dwNethoodAttributes =
363 SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
364 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE;
365 HRESULT hr = S_OK;
366
367 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", this,
368 cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
369
370 if (!rgfInOut)
371 return E_INVALIDARG;
372 if (cidl && !apidl)
373 return E_INVALIDARG;
374
375 if (*rgfInOut == 0)
376 *rgfInOut = ~0;
377
378 if(cidl == 0)
379 *rgfInOut = dwNethoodAttributes;
380 else
381 {
382 /* FIXME: Implement when enumerating items is implemented */
383 #ifdef HACKY_UNC_PATHS
384 *rgfInOut = SFGAO_FILESYSTEM | SFGAO_CANLINK | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR;
385 #endif
386 }
387
388 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
389 *rgfInOut &= ~SFGAO_VALIDATE;
390
391 TRACE("-- result=0x%08x\n", *rgfInOut);
392 return hr;
393 }
394
395 /**************************************************************************
396 * CNetFolder::GetUIObjectOf
397 *
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
405 *
406 */
407 HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid,
408 UINT * prgfInOut, LPVOID * ppvOut)
409 {
410 LPITEMIDLIST pidl;
411 IUnknown *pObj = NULL;
412 HRESULT hr = E_INVALIDARG;
413
414 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
415 hwndOwner, cidl, apidl, shdebugstr_guid (&riid), prgfInOut, ppvOut);
416
417 if (!ppvOut)
418 return hr;
419
420 *ppvOut = NULL;
421
422 if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1))
423 {
424 IContextMenu * pCm = NULL;
425 hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, 0, NULL, &pCm);
426 pObj = pCm;
427 }
428 else if (IsEqualIID(riid, IID_IDataObject) && (cidl >= 1))
429 {
430 IDataObject * pDo = NULL;
431 hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, &pDo);
432 pObj = pDo;
433 }
434 else if (IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1))
435 {
436 pidl = ILCombine (pidlRoot, apidl[0]);
437 pObj = IExtractIconA_Constructor (pidl);
438 SHFree (pidl);
439 hr = S_OK;
440 }
441 else if (IsEqualIID(riid, IID_IExtractIconW) && (cidl == 1))
442 {
443 pidl = ILCombine (pidlRoot, apidl[0]);
444 pObj = IExtractIconW_Constructor (pidl);
445 SHFree (pidl);
446 hr = S_OK;
447 }
448 else if (IsEqualIID(riid, IID_IDropTarget) && (cidl >= 1))
449 {
450 IDropTarget * pDt = NULL;
451 hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
452 pObj = pDt;
453 }
454 else
455 hr = E_NOINTERFACE;
456
457 if (SUCCEEDED(hr) && !pObj)
458 hr = E_OUTOFMEMORY;
459
460 *ppvOut = pObj;
461 TRACE("(%p)->hr=0x%08x\n", this, hr);
462 return hr;
463 }
464
465 /**************************************************************************
466 * CNetFolder::GetDisplayNameOf
467 *
468 */
469 HRESULT WINAPI CNetFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
470 {
471 LPWSTR pszName;
472
473 TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", this, pidl, dwFlags, strRet);
474 pdump (pidl);
475
476 if (!strRet)
477 return E_INVALIDARG;
478
479 if (!pidl->mkid.cb)
480 {
481 pszName = (LPWSTR)CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR));
482 if (!pszName)
483 return E_OUTOFMEMORY;
484
485 if (LoadStringW(shell32_hInstance, IDS_NETWORKPLACE, pszName, MAX_PATH))
486 {
487 pszName[MAX_PATH-1] = L'\0';
488 strRet->uType = STRRET_WSTR;
489 strRet->pOleStr = pszName;
490 return S_OK;
491 }
492 CoTaskMemFree(pszName);
493 return E_FAIL;
494 }
495 #ifdef HACKY_UNC_PATHS
496 else
497 {
498 LPCWSTR pstr = (LPCWSTR)pidl->mkid.abID;
499 pszName = (LPWSTR)CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR));
500 if (!pszName)
501 return E_OUTOFMEMORY;
502
503 wcscpy(pszName, pstr);
504 strRet->pOleStr = pszName;
505 strRet->uType = STRRET_WSTR;
506 return S_OK;
507 }
508 #endif
509 return E_NOTIMPL;
510 }
511
512 /**************************************************************************
513 * CNetFolder::SetNameOf
514 * Changes the name of a file object or subfolder, possibly changing its item
515 * identifier in the process.
516 *
517 * PARAMETERS
518 * hwndOwner [in] Owner window for output
519 * pidl [in] simple pidl of item to change
520 * lpszName [in] the items new display name
521 * dwFlags [in] SHGNO formatting flags
522 * ppidlOut [out] simple pidl returned
523 */
524 HRESULT WINAPI CNetFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, /*simple pidl */
525 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
526 {
527 FIXME("(%p)->(%p,pidl=%p,%s,%u,%p)\n", this,
528 hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
529 return E_FAIL;
530 }
531
532 HRESULT WINAPI CNetFolder::GetDefaultSearchGUID(GUID *pguid)
533 {
534 FIXME("(%p)\n", this);
535 return E_NOTIMPL;
536 }
537
538 HRESULT WINAPI CNetFolder::EnumSearches(IEnumExtraSearch ** ppenum)
539 {
540 FIXME("(%p)\n", this);
541 return E_NOTIMPL;
542 }
543
544 HRESULT WINAPI CNetFolder::GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
545 {
546 TRACE("(%p)\n", this);
547
548 if (pSort)
549 *pSort = 0;
550 if (pDisplay)
551 *pDisplay = 0;
552
553 return S_OK;
554 }
555
556 HRESULT WINAPI CNetFolder::GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
557 {
558 TRACE("(%p)\n", this);
559
560 if (!pcsFlags || iColumn >= NETWORKPLACESSHELLVIEWCOLUMNS)
561 return E_INVALIDARG;
562 *pcsFlags = NetworkPlacesSFHeader[iColumn].pcsFlags;
563 return S_OK;
564 }
565
566 HRESULT WINAPI CNetFolder::GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
567 {
568 FIXME("(%p)\n", this);
569 return E_NOTIMPL;
570 }
571
572 HRESULT WINAPI CNetFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
573 {
574 WCHAR buffer[MAX_PATH] = {0};
575 HRESULT hr = E_FAIL;
576
577 if (iColumn >= NETWORKPLACESSHELLVIEWCOLUMNS)
578 return E_FAIL;
579
580 psd->fmt = NetworkPlacesSFHeader[iColumn].fmt;
581 psd->cxChar = NetworkPlacesSFHeader[iColumn].cxChar;
582 if (pidl == NULL)
583 {
584 psd->str.uType = STRRET_WSTR;
585 if (LoadStringW(shell32_hInstance, NetworkPlacesSFHeader[iColumn].colnameid, buffer, _countof(buffer)))
586 hr = SHStrDupW(buffer, &psd->str.pOleStr);
587
588 return hr;
589 }
590
591 if (iColumn == COLUMN_NAME)
592 return GetDisplayNameOf(pidl, SHGDN_NORMAL, &psd->str);
593
594 FIXME("(%p)->(%p %i %p)\n", this, pidl, iColumn, psd);
595
596 return E_NOTIMPL;
597 }
598
599 HRESULT WINAPI CNetFolder::MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
600 {
601 FIXME("(%p)\n", this);
602
603 return E_NOTIMPL;
604 }
605
606 /************************************************************************
607 * CNetFolder::GetClassID
608 */
609 HRESULT WINAPI CNetFolder::GetClassID(CLSID *lpClassId)
610 {
611 TRACE("(%p)\n", this);
612
613 if (!lpClassId)
614 return E_POINTER;
615
616 *lpClassId = CLSID_NetworkPlaces;
617
618 return S_OK;
619 }
620
621 /************************************************************************
622 * CNetFolder::Initialize
623 *
624 * NOTES: it makes no sense to change the pidl
625 */
626 HRESULT WINAPI CNetFolder::Initialize(LPCITEMIDLIST pidl)
627 {
628 TRACE("(%p)->(%p)\n", this, pidl);
629
630 return S_OK;
631 }
632
633 /**************************************************************************
634 * CNetFolder::GetCurFolder
635 */
636 HRESULT WINAPI CNetFolder::GetCurFolder(LPITEMIDLIST *pidl)
637 {
638 TRACE("(%p)->(%p)\n", this, pidl);
639
640 if (!pidl)
641 return E_POINTER;
642
643 *pidl = ILClone(pidlRoot);
644
645 return S_OK;
646 }