[NETSHELL] CNetConUiObject: Use a switch in InvokeCommand
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 11 Nov 2018 13:37:44 +0000 (15:37 +0200)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 11 Nov 2018 18:28:32 +0000 (20:28 +0200)
dll/shellext/netshell/shfldr_netconnect.cpp

index 64b7806..ef00ff2 100644 (file)
@@ -983,21 +983,29 @@ ShowNetConnectionProperties(
 HRESULT WINAPI CNetConUiObject::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
 {
     const VALUEStruct * val;
+    UINT CmdId;
 
     val = _ILGetValueStruct(m_pidl);
     if (!val)
         return E_FAIL;
 
-    if (lpcmi->lpVerb == MAKEINTRESOURCEA(IDS_NET_STATUS) ||
-        lpcmi->lpVerb == MAKEINTRESOURCEA(IDS_NET_STATUS-1)) //HACK for Windows XP
+    if (HIWORD(lpcmi->lpVerb))
     {
-        return ShowNetConnectionStatus(m_lpOleCmd, val->pItem, lpcmi->hwnd);
+        //FIXME
+        return E_NOTIMPL;
     }
-    else if (lpcmi->lpVerb == MAKEINTRESOURCEA(IDS_NET_PROPERTIES) ||
-             lpcmi->lpVerb == MAKEINTRESOURCEA(10099)) //HACK for Windows XP
+
+    CmdId = LOWORD(lpcmi->lpVerb);
+
+
+    switch(CmdId)
     {
-        /* FIXME perform version checks */
-        return ShowNetConnectionProperties(val->pItem, lpcmi->hwnd);
+        case IDS_NET_STATUS:
+        case IDS_NET_STATUS-1:  //HACK for Windows XP
+            return ShowNetConnectionStatus(m_lpOleCmd, val->pItem, lpcmi->hwnd);
+        case IDS_NET_PROPERTIES:
+        case 10099:             //HACK for Windows XP
+            return ShowNetConnectionProperties(val->pItem, lpcmi->hwnd);
     }
 
     return S_OK;