[SHELL32] Fix CDefaultContextMenu DFM_MERGECONTEXTMENU handling

This commit is contained in:
Mark Jansen 2022-09-01 21:54:31 +02:00
parent 6a1f287820
commit 9efa7cc498
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B

View file

@ -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;