https://git.reactos.org/?p=reactos.git;a=commitdiff;h=132463abf20d379e6d3e7051b0718052c60b334b
commit 132463abf20d379e6d3e7051b0718052c60b334b Author: Giannis Adamopoulos <[email protected]> AuthorDate: Tue Nov 13 00:09:46 2018 +0200 Commit: Giannis Adamopoulos <[email protected]> CommitDate: Sun Nov 18 14:01:54 2018 +0200 [NETSHELL] CNetConUiObject: Implement the Connect and Disconnect context menu items --- dll/shellext/netshell/shfldr_netconnect.cpp | 36 ++++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/dll/shellext/netshell/shfldr_netconnect.cpp b/dll/shellext/netshell/shfldr_netconnect.cpp index 8f553d289b..a3398f36ec 100644 --- a/dll/shellext/netshell/shfldr_netconnect.cpp +++ b/dll/shellext/netshell/shfldr_netconnect.cpp @@ -477,7 +477,7 @@ HRESULT WINAPI CNetConUiObject::QueryContextMenu( return E_FAIL; } - if (pdata->Status == NCS_HARDWARE_DISABLED) + if (pdata->Status == NCS_HARDWARE_DISABLED || pdata->Status == NCS_MEDIA_DISCONNECTED || pdata->Status == NCS_DISCONNECTED) _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_ACTIVATE), MFS_DEFAULT); else _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 1, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_DEACTIVATE), MFS_ENABLED); @@ -622,13 +622,6 @@ HRESULT WINAPI CNetConUiObject::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) switch(CmdId) { - case IDS_NET_ACTIVATE: - case IDS_NET_DEACTIVATE: - case IDS_NET_REPAIR: - case IDS_NET_CREATELINK: - case IDS_NET_DELETE: - FIXME("Command %u is not implemented\n", CmdId); - return E_NOTIMPL; case IDS_NET_RENAME: { HRESULT hr; @@ -646,17 +639,28 @@ HRESULT WINAPI CNetConUiObject::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) { return ShowNetConnectionStatus(m_lpOleCmd, m_pidl, lpcmi->hwnd); } - case IDS_NET_PROPERTIES: - { - HRESULT hr; - CComPtr<INetConnection> pCon; + case IDS_NET_REPAIR: + case IDS_NET_CREATELINK: + case IDS_NET_DELETE: + FIXME("Command %u is not implemented\n", CmdId); + return E_NOTIMPL; + } - hr = ILGetConnection(m_pidl, &pCon); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; + HRESULT hr; + CComPtr<INetConnection> pCon; + + hr = ILGetConnection(m_pidl, &pCon); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + switch(CmdId) + { + case IDS_NET_ACTIVATE: + return pCon->Connect(); + case IDS_NET_DEACTIVATE: + return pCon->Disconnect(); + case IDS_NET_PROPERTIES: return ShowNetConnectionProperties(pCon, lpcmi->hwnd); - } } return E_NOTIMPL;
