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

commit a1f6d8a3f6f1fa4f36c0076163cde0ed870da32b
Author:     Kyle Katarn <[email protected]>
AuthorDate: Fri Sep 9 20:23:11 2022 +0200
Commit:     GitHub <[email protected]>
CommitDate: Fri Sep 9 20:23:11 2022 +0200

    [EXPLORER] Fix Start Menu context menu actions (#4643)
    
    CORE-18336
    
    The current design was not processing actions verbs correctly for some
    Start Menu context menu actions (Properties, Open all users, Explore all 
users),
    despite associated code being implemented.
    This was due by incorrectly filtering command IDs, not routing to the 
appropriate processing.
---
 base/shell/explorer/startctxmnu.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/base/shell/explorer/startctxmnu.cpp 
b/base/shell/explorer/startctxmnu.cpp
index a404cb4ba1f..935c8d7773d 100644
--- a/base/shell/explorer/startctxmnu.cpp
+++ b/base/shell/explorer/startctxmnu.cpp
@@ -32,6 +32,7 @@ class CStartMenuBtnCtxMenu :
     CComPtr<ITrayWindow>  m_TrayWnd;
     CComPtr<IContextMenu> m_Inner;
     CComPtr<IShellFolder> m_Folder;
+    UINT m_idCmdCmLast;
 
     HWND m_Owner;
     LPITEMIDLIST m_FolderPidl;
@@ -167,7 +168,8 @@ public:
                     hRet = psfDesktop->BindToObject(pidlStart, NULL, 
IID_PPV_ARG(IShellFolder, &m_Folder));
                     if (SUCCEEDED(hRet))
                     {
-                        CreateContextMenuFromShellFolderPidl(hPopup);
+                        hRet = CreateContextMenuFromShellFolderPidl(hPopup);
+                        m_idCmdCmLast = (SUCCEEDED(hRet)) ? HRESULT_CODE(hRet) 
: ID_SHELL_CMD_LAST;
                         AddStartContextMenuItems(hPopup);
                     }
                 }
@@ -185,7 +187,7 @@ public:
         UINT uiCmdId = PtrToUlong(lpici->lpVerb);
         if (uiCmdId != 0)
         {
-            if ((uiCmdId >= ID_SHELL_CMD_FIRST) && (uiCmdId <= 
ID_SHELL_CMD_LAST))
+            if ((uiCmdId >= ID_SHELL_CMD_FIRST) && (uiCmdId < m_idCmdCmLast))
             {
                 CMINVOKECOMMANDINFO cmici = { 0 };
                 CHAR szDir[MAX_PATH];
@@ -224,6 +226,7 @@ public:
 
     CStartMenuBtnCtxMenu()
     {
+        m_idCmdCmLast = ID_SHELL_CMD_LAST;
     }
 
     virtual ~CStartMenuBtnCtxMenu()

Reply via email to