https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9efa7cc498d620808dd69…
commit 9efa7cc498d620808dd69ee4283083dec9a4f1f5
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Thu Sep 1 21:54:31 2022 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Fri Oct 14 21:04:19 2022 +0200
[SHELL32] Fix CDefaultContextMenu DFM_MERGECONTEXTMENU handling
---
dll/win32/shell32/CDefaultContextMenu.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dll/win32/shell32/CDefaultContextMenu.cpp
b/dll/win32/shell32/CDefaultContextMenu.cpp
index 55aa8022af6..10cffcfe4f2 100644
--- a/dll/win32/shell32/CDefaultContextMenu.cpp
+++ b/dll/win32/shell32/CDefaultContextMenu.cpp
@@ -433,7 +433,7 @@ CDefaultContextMenu::AddShellExtensionsToMenu(HMENU hMenu, UINT*
pIndexMenu, UIN
if (SUCCEEDED(hr))
{
info.iIdCmdFirst = cIds;
- info.NumIds = LOWORD(hr);
+ info.NumIds = HRESULT_CODE(hr);
(*pIndexMenu) += info.NumIds;
cIds += info.NumIds;
@@ -646,8 +646,9 @@ CDefaultContextMenu::QueryContextMenu(
QCMINFO qcminfo = {hMenu, IndexMenu, idCmdNext, idCmdLast, NULL};
if (SUCCEEDED(_DoCallback(DFM_MERGECONTEXTMENU, uFlags, &qcminfo)))
{
- cIds += qcminfo.idCmdFirst;
- IndexMenu += qcminfo.idCmdFirst;
+ UINT added = idCmdNext - (idCmdFirst + cIds);
+ cIds += added;
+ IndexMenu += added;
m_iIdCBFirst = m_iIdSHELast;
m_iIdCBLast = cIds;
idCmdNext = idCmdFirst + cIds;