CDefFolderMenu_MergeMenu函数分析之添加了分割线和属性菜单项两项
CDefFolderMenu_MergeMenu函数分析之添加了分割线和属性菜单项两项
第一部分:
void CDefFolderMenu_MergeMenu(HINSTANCE hinst, UINT idMainMerge, UINT idPopupMerge, QCMINFO *pqcm)
{
UINT idMax = pqcm->idCmdFirst;
if (idMainMerge)
{
HMENU hmMerge = SHLoadPopupMenu(hinst, idMainMerge);
if (hmMerge)
{
idMax = Shell_MergeMenus(
pqcm->hmenu, hmMerge, pqcm->indexMenu,
pqcm->idCmdFirst, pqcm->idCmdLast,
MM_ADDSEPARATOR | MM_SUBMENUSHAVEIDS | MM_DONTREMOVESEPS);
DestroyMenu(hmMerge);
}
}
第二部分:
Shell_MergeMenus函数运行之前:+0x020 cItems : 0x11
1: kd> dt win32k!menu 0xbc692924
+0x000 head : _PROCDESKHEAD
+0x014 fFlags : 1
+0x018 iItem : 0n0
+0x01c cAlloced : 0x18
+0x020 cItems : 0x11
+0x024 cxMenu : 0
+0x028 cyMenu : 0
+0x02c cxTextAlign : 0
+0x030 spwndNotify : (null)
+0x034 rgItems : 0xbc697244 tagITEM
+0x038 pParentMenus : (null)
+0x03c dwContextHelpId : 0
+0x040 cyMax : 0
+0x044 dwMenuData : 0
+0x048 hbrBack : (null)
+0x04c iTop : 0n0
+0x050 iMaxTop : 0n0
+0x054 dwArrowsOn : 0y00
Shell_MergeMenus函数运行之后:+0x020 cItems : 0x13
1: kd> dt win32k!menu 0xbc692924
+0x000 head : _PROCDESKHEAD
+0x014 fFlags : 1
+0x018 iItem : 0n0
+0x01c cAlloced : 0x18
+0x020 cItems : 0x13
+0x024 cxMenu : 0
+0x028 cyMenu : 0
+0x02c cxTextAlign : 0
+0x030 spwndNotify : (null)
+0x034 rgItems : 0xbc697244 tagITEM
+0x038 pParentMenus : (null)
+0x03c dwContextHelpId : 0
+0x040 cyMax : 0
+0x044 dwMenuData : 0
+0x048 hbrBack : (null)
+0x04c iTop : 0n0
+0x050 iMaxTop : 0n0
+0x054 dwArrowsOn : 0y00
1: kd> dt win32k!tagITEM 0xbc697244+0x4c*d
+0x000 fType : 0
+0x004 fState : 0
+0x008 wID : 0x7916
+0x00c spSubMenu : (null)
+0x010 hbmpChecked : (null)
+0x014 hbmpUnchecked : (null)
+0x018 lpstr : 0xbc694b74 -> 0x50
+0x01c cch : 0xb
+0x020 dwItemData : 0
+0x024 xItem : 0
+0x028 yItem : 0
+0x02c cxItem : 0
+0x030 cyItem : 0
+0x034 dxTab : 0
+0x038 ulX : 0x7fffffff
+0x03c ulWidth : 0
+0x040 hbmp : (null)
+0x044 cxBmp : 0n-1
+0x048 cyBmp : 0n0
1: kd> db 0xbc694b74
bc694b74 50 00 26 00 72 00 6f 00-70 00 65 00 72 00 74 00 P.&.r.o.p.e.r.t.
bc694b84 69 00 65 00 73 00 00 00-55 48 5f 54 41 49 4c 00 i.e.s...UH_TAIL.
1: kd> dt win32k!tagITEM 0xbc697244+0x4c*c
+0x000 fType : 0x800
+0x004 fState : 3
+0x008 wID : 0x79fe
+0x00c spSubMenu : (null)
+0x010 hbmpChecked : (null)
+0x014 hbmpUnchecked : (null)
+0x018 lpstr : (null)
+0x01c cch : 0
+0x020 dwItemData : 0
+0x024 xItem : 0
+0x028 yItem : 0
+0x02c cxItem : 0
+0x030 cyItem : 0
+0x034 dxTab : 0
+0x038 ulX : 0x7fffffff
+0x03c ulWidth : 0
+0x040 hbmp : (null)
+0x044 cxBmp : 0n-1
+0x048 cyBmp : 0n0