CDefView::_GetPIDL函数分析之ListView_GetItem函数的参数item的item.mask 为LVIF_PARAM

ops/2025/3/14 21:37:45/

CDefView::_GetPIDL函数分析之ListView_GetItem函数的参数item的item.mask 为LVIF_PARAM


第一部分:

1: kd> t
SHELL32!CDefView::_GetPIDL:
001b:77308013 55              push    ebp
1: kd> dv
           this = 0x00000015
              i = 0n21
           pidl = 0x00040056


// This function checks to see if we are in virtual mode or not.  If we are in
// virtual mode, we always need to ask our folder we are viewing for the item and
// not the listview.

LPCITEMIDLIST CDefView::_GetPIDL(int i)
{
    if (_IsOwnerData())
    {
        LPCITEMIDLIST pidl = NULL;
        CallCB(SFVM_GETITEMIDLIST, i, (LPARAM)&pidl);
        return pidl;
    }

    return (LPCITEMIDLIST)LVUtil_GetLParam(_hwndListview, i);
}

第二部分:

1: kd> t
SHELL32!LVUtil_GetLParam:
001b:772c7714 55              push    ebp
1: kd> kc 12
 #
00 SHELL32!LVUtil_GetLParam
01 SHELL32!CDefView::_GetPIDL
02 SHELL32!CDefView::_GetItemArray
03 SHELL32!CDefView::_GetItemObjects
04 SHELL32!CDefView::_CreateSelectionShellItemArray

//
// Note that it returns NULL, if iItem is -1.
//
LPARAM LVUtil_GetLParam(HWND hwndLV, int i)
{
    LV_ITEM item;

    item.mask = LVIF_PARAM;
    item.iItem = i;
    item.iSubItem = 0;
    item.lParam = 0;
    if (i != -1)
    {
        ListView_GetItem(hwndLV, &item);
    }

    return item.lParam;
}


// ListView Item structure

#define LVIF_TEXT           0x0001  // LV_ITEM.mask flags (indicate valid fields in LV_ITEM)
#define LVIF_IMAGE          0x0002
#define LVIF_PARAM          0x0004
#define LVIF_STATE          0x0008


#define ListView_GetItem(hwnd, pitem) \
    (BOOL)SNDMSG((hwnd), LVM_GETITEM, 0, (LPARAM)(LV_ITEM *)(pitem))

#define LVM_GETITEMA            (LVM_FIRST + 5)
#define LVM_GETITEMW            (LVM_FIRST + 75)            push    104Bh
#ifdef UNICODE
#define LVM_GETITEM             LVM_GETITEMW
#else
#define LVM_GETITEM             LVM_GETITEMA
#endif
#define LVM_FIRST       0x1000      // ListView messages

第三部分:

1: kd> dv
            plv = 0x00108d88
           plvi = 0x013bf8a4
             nm = struct tagLVDISPINFOW

1: kd> dx -id 0,0,896d1020 -r1 ((comctl32!tagLVITEMW *)0x13bf8a4)
((comctl32!tagLVITEMW *)0x13bf8a4)                 : 0x13bf8a4 [Type: tagLVITEMW *]
    [+0x000] mask             : 0x4 [Type: unsigned int]
    [+0x004] iItem            : 21 [Type: int]
    [+0x008] iSubItem         : 0 [Type: int]
    [+0x00c] state            : 0x100c [Type: unsigned int]
    [+0x010] stateMask        : 0xffffffff [Type: unsigned int]
    [+0x014] pszText          : 0x772c74e9 : 0x10c2 [Type: unsigned short *]
    [+0x018] cchTextMax       : 4108 [Type: int]
    [+0x01c] iImage           : 1083208 [Type: int]
    [+0x020] lParam           : 0 [Type: long]            lParam           : 0
    [+0x024] iIndent          : 20707516 [Type: int]
    [+0x028] iGroupId         : 524288 [Type: int]
    [+0x02c] cColumns         : 0x13bfb20 [Type: unsigned int]
    [+0x030] puColumns        : 0x77456e76 : 0x209c25ff [Type: unsigned int *]

BOOL ListView_OnGetItem(LV* plv, LV_ITEM* plvi)
{


        pitem = ListView_FastGetItemPtr(plv, plvi->iItem);

        if (mask & LVIF_PARAM)
        {
            plvi->lParam = pitem->lParam;
        }


1: kd> dt LISTITEM 0010fe68
comctl32!LISTITEM
   +0x000 pszText          : 0x00111770  -> 0x4e
   +0x004 pt               : tagPOINT
   +0x00c iImage           : 0n115
   +0x00e cxSingleLabel    : 0n119
   +0x010 cxMultiLabel     : 0n70
   +0x012 cyFoldedLabel    : 0n28
   +0x014 cyUnfoldedLabel  : 0n28
   +0x016 iWorkArea        : 0n0
   +0x018 state            : 3
   +0x01a iIndent          : 0n0
   +0x01c lParam           : 0n1168016                +0x01c lParam           : 0n1168016
   +0x020 hrgnIcon         : (null)
   +0x024 ptRgn            : tagPOINT
   +0x02c rcTextRgn        : tagRECT
   +0x03c pGroup           : 0xffffffff tagLISTGROUP
   +0x040 cColumns         : 0xffffffff
   +0x044 puColumns        : (null)
   +0x048 dwId             : 0x1d

第四部分:
1: kd> g
Breakpoint 34 hit
SHELL32!LVUtil_GetLParam+0x32:
001b:772c7746 8b45ec          mov     eax,dword ptr [ebp-14h]
1: kd> r
eax=00000001 ebx=00000015 ecx=772c74e9 edx=00000004 esi=00108748 edi=0000100c
eip=772c7746 esp=013bf8a4 ebp=013bf8d8 iopl=0         nv up ei pl zr na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000246
SHELL32!LVUtil_GetLParam+0x32:
001b:772c7746 8b45ec          mov     eax,dword ptr [ebp-14h] ss:0023:013bf8c4=0011d290
1: kd> dv
         hwndLV = 0x00040056
              i = 0n21
           item = struct tagLVITEMW
1: kd> dx -id 0,0,896d1020 -r1 (*((SHELL32!tagLVITEMW *)0x13bf8a4))
(*((SHELL32!tagLVITEMW *)0x13bf8a4))                 [Type: tagLVITEMW]
    [+0x000] mask             : 0x4 [Type: unsigned int]
    [+0x004] iItem            : 21 [Type: int]
    [+0x008] iSubItem         : 0 [Type: int]
    [+0x00c] state            : 0x100c [Type: unsigned int]
    [+0x010] stateMask        : 0xffffffff [Type: unsigned int]
    [+0x014] pszText          : 0x772c74e9 : 0x10c2 [Type: unsigned short *]
    [+0x018] cchTextMax       : 4108 [Type: int]
    [+0x01c] iImage           : 1083208 [Type: int]
    [+0x020] lParam           : 1168016 [Type: long]                lParam           : 1168016
    [+0x024] iIndent          : 20707516 [Type: int]
    [+0x028] iGroupId         : 524288 [Type: int]
    [+0x02c] cColumns         : 0x13bfb20 [Type: unsigned int]
    [+0x030] puColumns        : 0x77456e76 : 0x209c25ff [Type: unsigned int *]


第五部分:
1: kd> dt _ITEMIDLIST 0011d290
Explorer!_ITEMIDLIST
   +0x000 mkid             : _SHITEMID
1: kd> dx -id 0,0,896d1020 -r1 (*((Explorer!_SHITEMID *)0x11d290))
(*((Explorer!_SHITEMID *)0x11d290))                 [Type: _SHITEMID]
    [+0x000] cb               : 0x5e [Type: unsigned short]
    [+0x002] abID             [Type: unsigned char [1]]
1: kd> db 0x11d290
0011d290  5e 00 32 00 00 00 00 00-66 5a c8 78 20 00 4e 45  ^.2.....fZ.x .NE
0011d2a0  57 54 45 58 7e 31 2e 54-58 54 00 00 42 00 03 00  WTEX~1.TXT..B...
0011d2b0  04 00 ef be 66 5a c8 78-66 5a c8 78 14 00 00 00  ....fZ.xfZ.x....
0011d2c0  4e 00 65 00 77 00 20 00-54 00 65 00 78 00 74 00  N.e.w. .T.e.x.t.
0011d2d0  20 00 44 00 6f 00 63 00-75 00 6d 00 65 00 6e 00   .D.o.c.u.m.e.n.
0011d2e0  74 00 2e 00 74 00 78 00-74 00 00 00 1c 00 00 00  t...t.x.t.......


http://www.ppmy.cn/ops/165483.html

相关文章

如何使用Cursor的claude-3.7模型来开发高保真的原型设计图,学会写好的提示词人人都是设计师

1、想要开发出高保真的设计图原型,需要给出cursor具体的提示词:比如我想开发一款IT面试题小程序,给出的提示词是这样的 我想开发一个 {IT面试题库小程序},现在需要输出高保真的原型图,请通过以下方式帮我完成所有界面…

【DNS系列】使用TCP传输

DNS ​默认使用UDP协议​(端口53)进行通信,但在以下场景中会切换到TCP协议​(端口53): ​1. 响应数据过大(超过512字节)​ ​UDP限制:DNS的UDP协议默认限制单个数据包大…

基于Redis实现限流

限流尽可能在满足需求的情况下越简单越好! 1、基于Redsi的increment方法实现固定窗口限流 Redis的increment方法保证并发线程安全窗口尽可能越小越好(太大可能某一小段时间就打满请求剩下的都拿不到令牌了)这个原理其实就是用当前时间戳然后除窗口大小 在这个窗口大…

视频推拉流:EasyDSS平台直播通道重连转推失败原因排查与解决

视频推拉流EasyDSS视频直播点播平台,集视频直播、点播、转码、管理、录像、检索、时移回看等功能于一体,可提供音视频采集、视频推拉流、播放H.265编码视频、存储、分发等视频能力服务。 用户使用EasyDSS平台对直播通道进行转推,发现只要关闭…

机器学习—赵卫东阅读笔记(一)

第一章:机器学习基础 1.1.2 机器学习主要流派 1.符号主义 2.贝叶斯分类——基础是贝叶斯定理 3.联结主义——源于神经学,主要算法是神经网络。——BP算法:作为一种监督学习算法,训练神经网络时通过不断反馈当前网络计算结果与…

vb编程有哪些相关的IDE开发工具vb.net,Basic语言?

在编程领域,VB 系列拥有丰富多样的 IDE 开发工具,为不同需求的开发者提供了广泛的选择,以下为你详细介绍: 兼容 VB6 源码的开发工具 twinbasic:属于 VB7 系列,它几乎能 100% 兼容 VB6 源码,这…

doris:ClickHouse

Deepseek R1 提供的 3D 迷宫设计方案是一个结合虚拟现实(VR)、增强现实(AR)和物理迷宫的创新项目,旨在为用户提供沉浸式体验。以下是该设计方案的详细讲解: 1. 设计目标 沉浸式体验:通过 3D 技…

鸿蒙ArkTs如何实现v-html的功能,显示富文本内容?

鸿蒙ArkTs如何实现v-html的功能,显示富文本内容? 先看效果前言功能介绍解决方案hp-richtext介绍hp-richtext 组件是如何实现的?下载安装代码示例richTextOption属性自定义 parser 函数具体介绍imageProp 对象具体属性 我在使用中遇到的问题问…