ReactOS 0.4.15-dev-7934-g1dc8d80
shfldr_netconnect.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Shell
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: CNetworkConnections Shell Folder
5 * COPYRIGHT: Copyright 2008 Johannes Anderwald <johannes.anderwald@reactos.org>
6 */
7
8#include "precomp.h"
9
10#define MAX_PROPERTY_SHEET_PAGE (10)
11
12/***********************************************************************
13* IShellFolder implementation
14*/
15
16static const shvheader NetConnectSFHeader[] = {
23};
24
25#define NETCONNECTSHELLVIEWCOLUMNS 6
26
27#define COLUMN_NAME 0
28#define COLUMN_TYPE 1
29#define COLUMN_STATUS 2
30#define COLUMN_DEVNAME 3
31#define COLUMN_PHONE 4
32#define COLUMN_OWNER 5
33
36 IOleCommandTarget *lpOleCmd,
37 PCUITEMID_CHILD pidl,
38 HWND hwnd);
39
41 m_pidlRoot(NULL)
42{
43 HRESULT hr;
44 hr = CoCreateInstance(CLSID_ConnectionTray, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IOleCommandTarget, &m_lpOleCmd));
47}
48
50{
51 if (m_pidlRoot)
53}
54
55/**************************************************************************
56* ISF_NetConnect_fnParseDisplayName
57*/
59 HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName,
60 DWORD * pchEaten, PIDLIST_RELATIVE * ppidl, DWORD * pdwAttributes)
61{
63
64 *ppidl = 0;
65 if (pchEaten)
66 *pchEaten = 0; /* strange but like the original */
67
68 return hr;
69}
70
71/**************************************************************************
72* ISF_NetConnect_fnEnumObjects
73*/
75 HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
76{
77 return CEnumIDList_CreateInstance(hwndOwner, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
78}
79
80/**************************************************************************
81* ISF_NetConnect_fnBindToObject
82*/
84 PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
85{
86 return E_NOTIMPL;
87}
88
89/**************************************************************************
90* ISF_NetConnect_fnBindToStorage
91*/
93 PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
94{
95 *ppvOut = NULL;
96 return E_NOTIMPL;
97}
98
99/**************************************************************************
100* ISF_NetConnect_fnCompareIDs
101*/
102
105{
106 return E_NOTIMPL;
107}
108
109/**************************************************************************
110* ISF_NetConnect_fnCreateViewObject
111*/
113 HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
114{
116
117 if (!ppvOut)
118 return hr;
119
120 *ppvOut = NULL;
121
122 if (IsEqualIID(riid, IID_IShellView))
123 {
124 CSFV cvf = {sizeof(cvf), this};
125 CComPtr<IShellView> pShellView;
126 hr = SHCreateShellFolderViewEx(&cvf, &pShellView);
128 return hr;
129
130 return pShellView->QueryInterface(riid, ppvOut);
131 }
132
133 return hr;
134}
135
136/**************************************************************************
137* ISF_NetConnect_fnGetAttributesOf
138*/
140 UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD * rgfInOut)
141{
142 //IGenericSFImpl *This = (IGenericSFImpl *)iface;
143 HRESULT hr = S_OK;
144 static const DWORD dwNetConnectAttributes = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
145 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE;
146
147 static const DWORD dwNetConnectItemAttributes = SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
148 SFGAO_FILESYSANCESTOR | SFGAO_CANRENAME;
149
150 if (!rgfInOut)
151 return E_INVALIDARG;
152
153 if (cidl && !apidl)
154 return E_INVALIDARG;
155
156 if (*rgfInOut == 0)
157 *rgfInOut = ~0;
158
159 if (cidl == 0)
160 {
161 *rgfInOut = dwNetConnectAttributes;
162 }
163 else
164 {
165 *rgfInOut = dwNetConnectItemAttributes;
166
167 while (cidl > 0 && *apidl)
168 {
170 if (!pdata)
171 continue;
172
173 if (!(pdata->dwCharacter & NCCF_ALLOW_RENAME))
174 *rgfInOut &= ~SFGAO_CANRENAME;
175
176 apidl++;
177 cidl--;
178 }
179 }
180
181 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
182 *rgfInOut &= ~SFGAO_VALIDATE;
183
184 return hr;
185}
186
187/**************************************************************************
188* ISF_NetConnect_fnGetUIObjectOf
189*
190* PARAMETERS
191* hwndOwner [in] Parent window for any output
192* cidl [in] array size
193* apidl [in] simple pidl array
194* riid [in] Requested Interface
195* prgfInOut [ ] reserved
196* ppvObject [out] Resulting Interface
197*
198*/
199
201 HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid,
202 UINT * prgfInOut, LPVOID * ppvOut)
203{
204 IUnknown *pObj = NULL;
206
207 if (!ppvOut)
208 return hr;
209
210 *ppvOut = NULL;
211
212 if ((IsEqualIID(riid, IID_IContextMenu) || IsEqualIID (riid, IID_IContextMenu2) || IsEqualIID(riid, IID_IContextMenu3) ||
213 IsEqualIID(riid, IID_IQueryInfo) || IsEqualIID(riid, IID_IExtractIconW)) && cidl >= 1)
214 {
215 return ShellObjectCreatorInit<CNetConUiObject>(apidl[0], m_lpOleCmd, riid, ppvOut);
216 }
217 else
219
220 *ppvOut = pObj;
221 return hr;
222}
223
224/**************************************************************************
225* ISF_NetConnect_fnGetDisplayNameOf
226*
227*/
229{
230 if (!strRet)
231 return E_INVALIDARG;
232
233 if (!pidl)
234 return SHSetStrRet(strRet, netshell_hInstance, IDS_NETWORKCONNECTION);
235
236 PWCHAR pwchName = ILGetConnName(pidl);
237 if (!pwchName)
238 {
239 ERR("Got invalid pidl\n");
240 return E_INVALIDARG;
241 }
242
243 return SHSetStrRet(strRet, pwchName);
244}
245
246/**************************************************************************
247* ISF_NetConnect_fnSetNameOf
248* Changes the name of a file object or subfolder, possibly changing its item
249* identifier in the process.
250*
251* PARAMETERS
252* hwndOwner [in] Owner window for output
253* pidl [in] simple pidl of item to change
254* lpszName [in] the items new display name
255* dwFlags [in] SHGNO formatting flags
256* ppidlOut [out] simple pidl returned
257*/
259 HWND hwndOwner, PCUITEMID_CHILD pidl, /*simple pidl */
260 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD * pPidlOut)
261{
262 HRESULT hr;
264
265 hr = ILGetConnection(pidl, &pCon);
267 return hr;
268
269 hr = pCon->Rename(lpName);
271 return hr;
272
273 *pPidlOut = ILCreateNetConnectItem(pCon);
274 if (*pPidlOut == NULL)
275 return E_FAIL;
276
277 return S_OK;
278}
279
281{
282 return E_NOTIMPL;
283}
284
286{
287 return E_NOTIMPL;
288}
289
291{
292 if (pSort)
293 *pSort = 0;
294 if (pDisplay)
295 *pDisplay = 0;
296
297 return S_OK;
298}
299
301{
302 if (!pcsFlags || iColumn >= NETCONNECTSHELLVIEWCOLUMNS)
303 return E_INVALIDARG;
304 *pcsFlags = NetConnectSFHeader[iColumn].pcsFlags;
305 return S_OK;
306}
307
309 PCUITEMID_CHILD pidl, const SHCOLUMNID * pscid, VARIANT * pv)
310{
311 return E_NOTIMPL;
312}
313
315 PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS * psd)
316{
317 if (iColumn >= NETCONNECTSHELLVIEWCOLUMNS)
318 return E_FAIL;
319
320 psd->fmt = NetConnectSFHeader[iColumn].fmt;
321 psd->cxChar = NetConnectSFHeader[iColumn].cxChar;
322 if (pidl == NULL)
323 return SHSetStrRet(&psd->str, netshell_hInstance, NetConnectSFHeader[iColumn].colnameid);
324
326 if (!pdata)
327 return E_FAIL;
328
329 switch (iColumn)
330 {
331 case COLUMN_NAME:
332 return SHSetStrRet(&psd->str, ILGetConnName(pidl));
333 case COLUMN_TYPE:
334 if (pdata->MediaType == NCM_LAN || pdata->MediaType == NCM_SHAREDACCESSHOST_RAS)
335 {
336 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_TYPE_ETHERNET);
337 }
338 else
339 {
340 return SHSetStrRet(&psd->str, "");
341 }
342 break;
343 case COLUMN_STATUS:
344 switch(pdata->Status)
345 {
347 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_NON_OPERATIONAL);
348 case NCS_DISCONNECTED:
349 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_UNREACHABLE);
351 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_DISCONNECTED);
352 case NCS_CONNECTING:
353 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_CONNECTING);
354 case NCS_CONNECTED:
355 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_CONNECTED);
356 default:
357 return SHSetStrRet(&psd->str, "");
358 }
359 break;
360 case COLUMN_DEVNAME:
361 return SHSetStrRet(&psd->str, ILGetDeviceName(pidl));
362 case COLUMN_PHONE:
363 case COLUMN_OWNER:
364 return SHSetStrRet(&psd->str, "");
365 }
366
367 return E_FAIL;
368}
369
371{
372 return E_NOTIMPL;
373}
374
375//IObjectWithSite
376//IInternetSecurityManager
377
378/**************************************************************************
379* IContextMenu2 Implementation
380*/
381
383 : m_pidl(NULL)
384{
385}
386
388{
389}
390
392{
393 m_pidl = pidl;
394 m_lpOleCmd = lpOleCmd;
395 return S_OK;
396}
397
399 HMENU hmenu,
400 UINT indexMenu,
401 BOOL fByPosition,
402 UINT wID,
403 UINT fType,
404 LPCWSTR dwTypeData,
405 UINT fState)
406{
407 MENUITEMINFOW mii;
408 WCHAR szText[100];
409
410 ZeroMemory(&mii, sizeof(mii));
411 mii.cbSize = sizeof(mii);
412 if (fType == MFT_SEPARATOR)
413 {
414 mii.fMask = MIIM_ID | MIIM_TYPE;
415 }
416 else if (fType == MFT_STRING)
417 {
419 if ((ULONG_PTR)HIWORD((ULONG_PTR)dwTypeData) == 0)
420 {
421 if (LoadStringW(netshell_hInstance, LOWORD((ULONG_PTR)dwTypeData), szText, sizeof(szText)/sizeof(WCHAR)))
422 {
423 szText[(sizeof(szText)/sizeof(WCHAR))-1] = 0;
424 mii.dwTypeData = szText;
425 }
426 else
427 {
428 return;
429 }
430 }
431 else
432 {
433 mii.dwTypeData = (LPWSTR) dwTypeData;
434 }
435 mii.fState = fState;
436 }
437
438 mii.wID = wID;
439 mii.fType = fType;
440 InsertMenuItemW( hmenu, indexMenu, fByPosition, &mii);
441}
442
443/**************************************************************************
444* ISF_NetConnect_IContextMenu_QueryContextMenu()
445*/
447 HMENU hMenu,
448 UINT indexMenu,
449 UINT idCmdFirst,
450 UINT idCmdLast,
451 UINT uFlags)
452{
454 if (!pdata)
455 {
456 ERR("Got invalid pidl\n");
457 return E_FAIL;
458 }
459
460 if (pdata->Status == NCS_HARDWARE_DISABLED || pdata->Status == NCS_MEDIA_DISCONNECTED || pdata->Status == NCS_DISCONNECTED)
462 else
463 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 1, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_DEACTIVATE), MFS_ENABLED);
464
465 if (pdata->Status == NCS_HARDWARE_DISABLED || pdata->Status == NCS_MEDIA_DISCONNECTED || pdata->Status == NCS_DISCONNECTED)
466 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 2, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_STATUS), MFS_GRAYED);
467 else if (pdata->Status == NCS_CONNECTED)
468 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 2, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_STATUS), MFS_DEFAULT);
469 else
470 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 2, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_STATUS), MFS_ENABLED);
471
472 if (pdata->Status == NCS_HARDWARE_DISABLED || pdata->Status == NCS_MEDIA_DISCONNECTED)
473 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 3, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_REPAIR), MFS_GRAYED);
474 else
475 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 3, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_REPAIR), MFS_ENABLED);
476
477 _InsertMenuItemW(hMenu, indexMenu++, TRUE, -1, MFT_SEPARATOR, NULL, MFS_ENABLED);
478 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 4, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_CREATELINK), MFS_ENABLED);
479
480 if (pdata->dwCharacter & NCCF_ALLOW_REMOVAL)
481 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 5, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_DELETE), MFS_ENABLED);
482 else
483 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 5, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_DELETE), MFS_GRAYED);
484
485 if (pdata->dwCharacter & NCCF_ALLOW_RENAME)
486 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 6, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_RENAME), MFS_ENABLED);
487 else
488 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 6, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_RENAME), MFS_GRAYED);
489
490 _InsertMenuItemW(hMenu, indexMenu++, TRUE, -1, MFT_SEPARATOR, NULL, MFS_ENABLED);
491 if (pdata->Status == NCS_CONNECTED)
492 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 7, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_PROPERTIES), MFS_ENABLED);
493 else
494 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 7, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_PROPERTIES), MFS_DEFAULT);
495
496 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 9);
497}
498
499BOOL
502{
504
505 if (pinfo->nPages < MAX_PROPERTY_SHEET_PAGE)
506 {
507 pinfo->phpage[pinfo->nPages++] = hPage;
508 return TRUE;
509 }
510 return FALSE;
511}
512
515 IOleCommandTarget *lpOleCmd,
516 PCUITEMID_CHILD pidl,
517 HWND hwnd)
518{
519 if (!lpOleCmd)
520 return E_FAIL;
521
523 if (!pdata)
524 {
525 ERR("Got invalid pidl\n");
526 return E_FAIL;
527 }
528
529 return lpOleCmd->Exec(&pdata->guidId, OLECMDID_NEW, OLECMDEXECOPT_DODEFAULT, NULL, NULL);
530}
531
532static int CALLBACK
534{
535 // NOTE: This callback is needed to set large icon correctly.
536 HICON hIcon;
537 switch (uMsg)
538 {
539 case PSCB_INITIALIZED:
540 {
542 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
543 break;
544 }
545 }
546 return 0;
547}
548
551 INetConnection *pNetConnect,
552 HWND hwnd)
553{
554 HRESULT hr;
555 CLSID ClassID;
556 PROPSHEETHEADERW pinfo;
559 NETCON_PROPERTIES * pProperties;
560
561 if (pNetConnect->GetProperties(&pProperties) != S_OK)
562 return E_FAIL;
563
564 hr = pNetConnect->GetUiObjectClassId(&ClassID);
565 if (FAILED(hr))
566 {
567 NcFreeNetconProperties(pProperties);
568 return hr;
569 }
570
571 hr = CoCreateInstance(ClassID, NULL, CLSCTX_INPROC_SERVER, IID_INetConnectionPropertyUi, (LPVOID*)&pNCP);
572 if (FAILED(hr))
573 {
574 NcFreeNetconProperties(pProperties);
575 return hr;
576 }
577
578 hr = pNCP->SetConnection(pNetConnect);
579 if (SUCCEEDED(hr))
580 {
581 ZeroMemory(&pinfo, sizeof(PROPSHEETHEADERW));
582 ZeroMemory(hppages, sizeof(hppages));
583 pinfo.dwSize = sizeof(PROPSHEETHEADERW);
584 pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW |
588 pinfo.phpage = hppages;
589 pinfo.hwndParent = hwnd;
591
592 pinfo.pszCaption = pProperties->pszwName;
593 hr = pNCP->AddPages(hwnd, PropSheetExCallback, (LPARAM)&pinfo);
594 if (SUCCEEDED(hr))
595 {
596 if (PropertySheetW(&pinfo) < 0)
597 hr = E_FAIL;
598 }
599 }
600 NcFreeNetconProperties(pProperties);
601 return hr;
602}
603
604
605/**************************************************************************
606* ISF_NetConnect_IContextMenu_InvokeCommand()
607*/
609{
610 UINT CmdId;
611
612 /* We should get this when F2 is pressed in explorer */
613 if (HIWORD(lpcmi->lpVerb) && !strcmp(lpcmi->lpVerb, "rename"))
615
616 if (HIWORD(lpcmi->lpVerb) || LOWORD(lpcmi->lpVerb) > 7)
617 {
618 FIXME("Got invalid command\n");
619 return E_NOTIMPL;
620 }
621
622 CmdId = LOWORD(lpcmi->lpVerb) + IDS_NET_ACTIVATE;
623
624 switch(CmdId)
625 {
626 case IDS_NET_RENAME:
627 {
628 HRESULT hr;
631 if (SUCCEEDED(hr))
632 {
633 SVSIF selFlags = SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE | SVSI_FOCUSED | SVSI_SELECT;
634 psv->SelectItem(m_pidl, selFlags);
635 }
636
637 return S_OK;
638 }
639 case IDS_NET_STATUS:
640 {
642 }
643 case IDS_NET_REPAIR:
645 case IDS_NET_DELETE:
646 FIXME("Command %u is not implemented\n", CmdId);
647 return E_NOTIMPL;
648 }
649
650 HRESULT hr;
652
653 hr = ILGetConnection(m_pidl, &pCon);
655 return hr;
656
657 switch(CmdId)
658 {
659 case IDS_NET_ACTIVATE:
660 return pCon->Connect();
662 return pCon->Disconnect();
664 return ShowNetConnectionProperties(pCon, lpcmi->hwnd);
665 }
666
667 return E_NOTIMPL;
668}
669
670/**************************************************************************
671 * ISF_NetConnect_IContextMenu_GetCommandString()
672 *
673 */
675 UINT_PTR idCommand,
676 UINT uFlags,
677 UINT* lpReserved,
678 LPSTR lpszName,
679 UINT uMaxNameLen)
680{
681 return E_FAIL;
682}
683
684/**************************************************************************
685* ISF_NetConnect_IContextMenu_HandleMenuMsg()
686*/
688 UINT uMsg,
691{
692 return E_NOTIMPL;
693}
694
696 UINT uMsg,
699 LRESULT *plResult)
700{
701 return E_NOTIMPL;
702}
703
705{
706 if (!m_pUnknown)
707 {
708 *ppvSite = NULL;
709 return E_FAIL;
710 }
711
712 return m_pUnknown->QueryInterface(riid, ppvSite);
713}
714
716{
717 m_pUnknown = pUnkSite;
718 return S_OK;
719}
720
721/************************************************************************
722 * ISF_NetConnect_IExtractIcon_GetIconLocation
723 */
725 UINT uFlags,
726 LPWSTR szIconFile,
727 UINT cchMax,
728 int *piIndex,
729 UINT *pwFlags)
730{
731 *pwFlags = 0;
733 {
734 ERR("GetModuleFileNameW failed\n");
735 return E_FAIL;
736 }
737
739 if (!pdata)
740 {
741 ERR("Got invalid pidl\n");
742 return E_FAIL;
743 }
744
745 if (pdata->Status == NCS_CONNECTED || pdata->Status == NCS_CONNECTING)
746 *piIndex = -IDI_NET_IDLE;
747 else
748 *piIndex = -IDI_NET_OFF;
749
750 return S_OK;
751}
752
753/************************************************************************
754 * ISF_NetConnect_IExtractIcon_Extract
755 */
757 LPCWSTR pszFile,
758 UINT nIconIndex,
759 HICON *phiconLarge,
760 HICON *phiconSmall,
761 UINT nIconSize)
762{
763 return SHDefExtractIconW(pszFile, nIconIndex, 0, phiconLarge, phiconSmall, nIconSize);
764}
765
766/************************************************************************
767 * ISF_NetConnect_PersistFolder2_GetClassID
768 */
770{
771 if (!lpClassId)
772 return E_POINTER;
773
774 *lpClassId = CLSID_ConnectionFolder;
775
776 return S_OK;
777}
778
779/************************************************************************
780 * ISF_NetConnect_PersistFolder2_Initialize
781 *
782 * NOTES: it makes no sense to change the pidl
783 */
785{
786 if (m_pidlRoot)
788 m_pidlRoot = ILClone(pidl);
789
790 return S_OK;
791}
792
793/**************************************************************************
794 * ISF_NetConnect_PersistFolder2_GetCurFolder
795 */
797{
798 if (!pidl)
799 return E_POINTER;
800
801 *pidl = ILClone(m_pidlRoot);
802
803 return S_OK;
804}
805
806/************************************************************************
807 * ISF_NetConnect_ShellExecuteHookW_Execute
808 */
810{
813 if (!pdata)
814 {
815 ERR("Got invalid pidl\n");
816 return E_FAIL;
817 }
818
819 if (pdata->Status == NCS_CONNECTED)
820 {
821 return ShowNetConnectionStatus(m_lpOleCmd, pidl, pei->hwnd);
822 }
823
824 return S_OK;
825}
826
828{
829 FIXME("CNetworkConnections::Initialize()\n");
830 return E_NOTIMPL;
831}
832
833HRESULT WINAPI CNetworkConnections::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
834{
835 FIXME("CNetworkConnections::Exec()\n");
836 return E_NOTIMPL;
837}
838
839HRESULT WINAPI CNetworkConnections::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
840{
841 FIXME("CNetworkConnections::QueryStatus()\n");
842 return E_NOTIMPL;
843}
844
846{
847 FIXME("CNetworkConnections::MessageSFVCB()\n");
848 return E_NOTIMPL;
849}
850
852{
853 *pdwFlags = 0;
854
855 return S_OK;
856}
857
858/************************************************************************
859 * ISF_NetConnect_PersistFolder2_Initialize
860 *
861 * NOTES: it makes no sense to change the pidl
862 */
864{
865 *ppwszTip = NULL;
866 return S_OK;
867}
HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV psvcbi, IShellView **ppsv)
Definition: CDefView.cpp:3837
UINT cchMax
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define FIXME(fmt,...)
Definition: debug.h:111
#define ERR(fmt,...)
Definition: debug.h:110
STDMETHOD() HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) override
STDMETHOD() GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) override
STDMETHOD() GetIconLocation(UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags) override
STDMETHOD() Extract(LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) override
STDMETHOD() SetSite(IUnknown *punk) override
PCUITEMID_CHILD m_pidl
STDMETHOD() GetSite(REFIID iid, void **ppvSite) override
STDMETHOD() QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
HRESULT WINAPI Initialize(PCUITEMID_CHILD pidl, IOleCommandTarget *lpOleCmd)
STDMETHOD() InvokeCommand(LPCMINVOKECOMMANDINFO lpici) override
CComPtr< IOleCommandTarget > m_lpOleCmd
CComPtr< IUnknown > m_pUnknown
STDMETHOD() HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam) override
STDMETHOD() GetInfoFlags(DWORD *pdwFlags) override
STDMETHOD() GetInfoTip(DWORD dwFlags, WCHAR **ppwszTip) override
STDMETHOD() BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
STDMETHOD() GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
STDMETHOD() QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) override
STDMETHOD() GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
STDMETHOD() GetCurFolder(PIDLIST_ABSOLUTE *pidl) override
STDMETHOD() GetDefaultSearchGUID(GUID *pguid) override
STDMETHOD() GetClassID(CLSID *lpClassId) override
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
PIDLIST_ABSOLUTE m_pidlRoot
STDMETHOD() ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override
STDMETHOD() CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
STDMETHOD() Initialize(PCIDLIST_ABSOLUTE pidl) override
CComPtr< IOleCommandTarget > m_lpOleCmd
STDMETHOD() GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
STDMETHOD() SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
STDMETHOD() BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
STDMETHOD() GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) override
STDMETHOD() Execute(LPSHELLEXECUTEINFOW pei) override
STDMETHOD() MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) override
STDMETHOD() MapColumnToSCID(UINT column, SHCOLUMNID *pscid) override
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDS_NET_DELETE
Definition: resource.h:93
#define IDI_SHELL_NETWORK_FOLDER
Definition: resource.h:5
#define IDS_NET_STATUS
Definition: resource.h:90
#define IDS_NET_PROPERTIES
Definition: resource.h:95
#define IDS_SHV_COLUMN_STATE
Definition: resource.h:76
#define IDS_STATUS_NON_OPERATIONAL
Definition: resource.h:81
#define IDS_SHV_COLUMN_DEVNAME
Definition: resource.h:77
#define IDS_NET_DEACTIVATE
Definition: resource.h:89
#define IDS_STATUS_CONNECTED
Definition: resource.h:85
#define IDS_SHV_COLUMN_TYPE
Definition: resource.h:75
#define IDS_SHV_COLUMN_PHONE
Definition: resource.h:78
#define IDS_NET_RENAME
Definition: resource.h:94
#define IDI_NET_OFF
Definition: resource.h:11
#define IDS_NET_REPAIR
Definition: resource.h:91
#define IDS_SHV_COLUMN_NAME
Definition: resource.h:74
#define IDS_NET_ACTIVATE
Definition: resource.h:88
#define IDS_STATUS_DISCONNECTED
Definition: resource.h:83
#define IDI_NET_IDLE
Definition: resource.h:10
#define IDS_SHV_COLUMN_OWNER
Definition: resource.h:79
#define IDS_TYPE_ETHERNET
Definition: resource.h:80
#define IDS_NET_CREATELINK
Definition: resource.h:92
#define IDS_NETWORKCONNECTION
Definition: resource.h:73
#define IDS_STATUS_UNREACHABLE
Definition: resource.h:82
#define IDS_STATUS_CONNECTING
Definition: resource.h:84
UINT uFlags
Definition: api.c:59
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2913
#define CALLBACK
Definition: compat.h:35
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1497
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
PITEMID_CHILD ILCreateNetConnectItem(INetConnection *pItem)
Definition: enumlist.cpp:33
HRESULT CEnumIDList_CreateInstance(HWND hwndOwner, DWORD dwFlags, REFIID riid, LPVOID *ppv)
Definition: enumlist.cpp:337
PWCHAR ILGetDeviceName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:25
HRESULT ILGetConnection(PCITEMID_CHILD pidl, INetConnection **pItem)
Definition: enumlist.cpp:77
PNETCONIDSTRUCT ILGetConnData(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:10
PWCHAR ILGetConnName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:17
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
Definition: iconcache.cpp:1009
REFIID riid
Definition: atlbase.h:39
HRESULT GetProperties([out] NETCON_PROPERTIES **ppProps)
HRESULT GetUiObjectClassId([out, ref] CLSID *pclsid)
HRESULT Exec([in, unique] const GUID *pguidCmdGroup, [in] DWORD nCmdID, [in] DWORD nCmdexecopt, [in, unique] VARIANT *pvaIn, [in, out, unique] VARIANT *pvaOut)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
static HICON
Definition: imagelist.c:84
static LPOLESTR
Definition: stg_prop.c:27
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static PROTOCOLDATA * pdata
Definition: protocol.c:158
HICON hIcon
Definition: msconfig.c:44
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
@ NCCF_ALLOW_REMOVAL
Definition: netcon.h:18
@ NCCF_ALLOW_RENAME
Definition: netcon.h:19
@ NCS_CONNECTING
Definition: netcon.h:40
@ NCS_MEDIA_DISCONNECTED
Definition: netcon.h:46
@ NCS_CONNECTED
Definition: netcon.h:41
@ NCS_DISCONNECTED
Definition: netcon.h:39
@ NCS_HARDWARE_DISABLED
Definition: netcon.h:44
@ NCM_LAN
Definition: netcon.h:71
@ NCM_SHAREDACCESSHOST_RAS
Definition: netcon.h:77
EXTERN_C const IID IID_INetConnectionPropertyUi
Definition: netcon.h:227
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
VOID WINAPI NcFreeNetconProperties(NETCON_PROPERTIES *pProps)
Definition: netshell.cpp:119
interface IBindCtx * LPBC
Definition: objfwd.h:18
#define LOWORD(l)
Definition: pedump.c:82
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:198
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_USEICONID
Definition: prsht.h:42
#define PSCB_INITIALIZED
Definition: prsht.h:75
struct _PROPSHEETHEADERW PROPSHEETHEADERW
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
#define LVCFMT_RIGHT
Definition: commctrl.h:2599
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define COLUMN_OWNER
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
#define COLUMN_NAME
#define NETCONNECTSHELLVIEWCOLUMNS
BOOL CALLBACK PropSheetExCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
#define MAX_PROPERTY_SHEET_PAGE
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
static const shvheader NetConnectSFHeader[]
#define COLUMN_DEVNAME
#define COLUMN_TYPE
#define COLUMN_STATUS
HRESULT ShowNetConnectionStatus(IOleCommandTarget *lpOleCmd, PCUITEMID_CHILD pidl, HWND hwnd)
#define COLUMN_PHONE
HRESULT ShowNetConnectionProperties(INetConnection *pNetConnect, HWND hwnd)
HRESULT ShowNetConnectionProperties(INetConnection *pNetConnect, HWND hwnd)
HRESULT hr
Definition: shlfolder.c:183
#define SID_IFolderView
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
@ SHCOLSTATE_TYPE_DATE
Definition: shtypes.idl:123
@ SHCOLSTATE_TYPE_STR
Definition: shtypes.idl:121
@ SHCOLSTATE_ONBYDEFAULT
Definition: shtypes.idl:125
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
STRRET str
Definition: shtypes.idl:108
Definition: shlobj.h:1268
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
LPCWSTR pszCaption
Definition: prsht.h:301
LPWSTR dwTypeData
Definition: winuser.h:3269
#define ICON_BIG
Definition: tnclass.cpp:51
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
static HMENU hmenu
Definition: win.c:66
#define ZeroMemory
Definition: winbase.h:1712
_In_ LPCSTR lpName
Definition: winbase.h:2789
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define SEVERITY_SUCCESS
Definition: winerror.h:64
#define E_UNEXPECTED
Definition: winerror.h:2456
#define E_POINTER
Definition: winerror.h:2365
#define MIIM_ID
Definition: winuser.h:722
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MFT_SEPARATOR
Definition: winuser.h:744
#define MIIM_STATE
Definition: winuser.h:721
#define MFS_DEFAULT
Definition: winuser.h:748
#define MFS_GRAYED
Definition: winuser.h:751
#define MFS_ENABLED
Definition: winuser.h:750
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define MFT_STRING
Definition: winuser.h:746
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075
#define MIIM_TYPE
Definition: winuser.h:725
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
#define IID_PPV_ARG(Itype, ppType)
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185