https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a99325c7168c5c3b9c1c07fc139dab4290fb880e

commit a99325c7168c5c3b9c1c07fc139dab4290fb880e
Author:     Mark Jansen <[email protected]>
AuthorDate: Fri Sep 13 21:37:07 2019 +0200
Commit:     Mark Jansen <[email protected]>
CommitDate: Sat Oct 19 18:42:14 2019 +0200

    [ZIPFLDR] Fix number of menu items returned for DFM_MERGECONTEXTMENU
---
 dll/shellext/zipfldr/CZipFolder.hpp | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/dll/shellext/zipfldr/CZipFolder.hpp 
b/dll/shellext/zipfldr/CZipFolder.hpp
index 7b51a750eba..af70c9cb406 100644
--- a/dll/shellext/zipfldr/CZipFolder.hpp
+++ b/dll/shellext/zipfldr/CZipFolder.hpp
@@ -370,7 +370,7 @@ public:
             if (FAILED_UNEXPECTEDLY(hr))
                 return hr;
 
-            pqcminfo->indexMenu += HRESULT_CODE(hr);
+            pqcminfo->idCmdFirst += HRESULT_CODE(hr);
             return S_OK;
         }
         case DFM_INVOKECOMMAND:
@@ -523,7 +523,7 @@ public:
     }
     STDMETHODIMP QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT 
idCmdFirst, UINT idCmdLast, UINT uFlags)
     {
-        int Entries = 0;
+        UINT idCmd = idCmdFirst;
 
         if (!(uFlags & CMF_DEFAULTONLY))
         {
@@ -532,13 +532,11 @@ public:
             if (indexMenu)
             {
                 InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_SEPARATOR, 
0, NULL);
-                Entries++;
             }
-            InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_STRING, 
idCmdFirst++, menuText);
-            Entries++;
+            InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_STRING, 
idCmd++, menuText);
         }
 
-        return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Entries);
+        return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, idCmd - 
idCmdFirst);
     }
 
     // *** IShellExtInit methods ***

Reply via email to