CViewState::InitializeColumns函数分析之_hdsaColumnStates的结构
CViewState::InitializeColumns函数分析之_hdsaColumnStates的结构
// Set up saved column state only if the saved state
// contains information other than "nothing".
if (_hdsaColumnStates)
{
UINT cStates = DSA_GetItemCount(_hdsaColumnStates);
if (cStates > 0)
{
// 99/02/05 vtan: If there is a saved column state then
// clear all the column "on" states to "off" and only
// display what columns are specified. Start at 1 so
// that name is always on. 把35项的选中标志置OFF
for (iReal = 1; iReal < GetColumnCount(); iReal++)
{
COL_INFO* pci = (COL_INFO*)DSA_GetItemPtr(_hdsaColumns, iReal);
pci->csFlags &= ~SHCOLSTATE_ONBYDEFAULT;
}
//把_hdsaColumnStates的结构对应数组置ON,这里是0,1,2,3,6项的选中标志置ON
for (UINT i = 0; i < cStates; i++)
{
DWORD dw;
DSA_GetItem(_hdsaColumnStates, i, &dw);
SetColumnState(dw, SHCOLSTATE_ONBYDEFAULT, SHCOLSTATE_ONBYDEFAULT);
}
}
}
return S_OK;
}
结果:
1: kd> dt comctl32!_DSA 000d6ba0
+0x000 cItem : 0n5
+0x004 aItem : 0x000f0210 Void
+0x008 cItemAlloc : 0n5
+0x00c cbItem : 0n4
+0x010 cItemGrow : 0n5
+0x014 magic : 0x4153
1: kd> dt 0x000f0210+0x4*0
Symbol not found at address 000f0210.
1: kd> dd 0x000f0210+0x4*0
000f0210 00000000 00000001 00000002 00000003
000f0220 00000006 00000000 00110a50 00094400
000f0230 00050004 000a01bd 801f0014 2559a1f0
000f0240 11d421d7 c000afbd f0b9604f 00000000
000f0250 00040029 000901b1 501f0014 20d04fe0
000f0260 10693aea 0008d8a2 9d30302b 432f0019
000f0270 00005c3a 00000000 00000000 00000000
000f0280 00000000 31006a00 00000000 00000000
1: kd> dt shell32!COL_INFO 0x1209c0 +0xb0*7
+0x000 szName : [80] 0x53
+0x0a0 cChars : 0xa
+0x0a4 fmt : 0
+0x0a8 csFlags : 0x81
+0x0ac tsFlags : 0
1: kd> dt shell32!COL_INFO 0x1209c0 +0xb0*6
+0x000 szName : [80] 0x41
+0x0a0 cChars : 0xa
+0x0a4 fmt : 0
+0x0a8 csFlags : 0x11
+0x0ac tsFlags : 0
1: kd> dt shell32!COL_INFO 0x1209c0 +0xb0*5
+0x000 szName : [80] 0x44
+0x0a0 cChars : 0x14
+0x0a4 fmt : 0
+0x0a8 csFlags : 0x83
+0x0ac tsFlags : 0
1: kd> dt shell32!COL_INFO 0x1209c0 +0xb0*4
+0x000 szName : [80] 0x44
+0x0a0 cChars : 0x14
+0x0a4 fmt : 0
+0x0a8 csFlags : 3
+0x0ac tsFlags : 0
1: kd> dt shell32!COL_INFO 0x1209c0 +0xb0*3
+0x000 szName : [80] 0x44
+0x0a0 cChars : 0x14
+0x0a4 fmt : 0
+0x0a8 csFlags : 0x13
+0x0ac tsFlags : 0
1: kd> dt shell32!COL_INFO 0x1209c0 +0xb0*2
+0x000 szName : [80] 0x54
+0x0a0 cChars : 0x14
+0x0a4 fmt : 0
+0x0a8 csFlags : 0x11
+0x0ac tsFlags : 0
1: kd> dt shell32!COL_INFO 0x1209c0 +0xb0*1
+0x000 szName : [80] 0x53
+0x0a0 cChars : 0x10
+0x0a4 fmt : 1
+0x0a8 csFlags : 0x12
+0x0ac tsFlags : 0
1: kd> dt shell32!COL_INFO 0x1209c0 +0xb0*0
+0x000 szName : [80] 0x4e
+0x0a0 cChars : 0x1e
+0x0a4 fmt : 0
+0x0a8 csFlags : 0x11
+0x0ac tsFlags : 0
1: kd> db 0x1209c0 +0xb0*0
001209c0 4e 00 61 00 6d 00 65 00-00 00 00 00 00 00 00 00 N.a.m.e.........
1: kd> db 0x1209c0 +0xb0*1
00120a70 53 00 69 00 7a 00 65 00-00 00 00 00 00 00 00 00 S.i.z.e.........
1: kd> db 0x1209c0 +0xb0*2
00120b20 54 00 79 00 70 00 65 00-00 00 00 00 00 00 00 00 T.y.p.e.........
1: kd> db 0x1209c0 +0xb0*3
00120bd0 44 00 61 00 74 00 65 00-20 00 4d 00 6f 00 64 00 D.a.t.e. .M.o.d.
00120be0 69 00 66 00 69 00 65 00-64 00 00 00 00 00 00 00 i.f.i.e.d.......
1: kd> db 0x1209c0 +0xb0*4
00120c80 44 00 61 00 74 00 65 00-20 00 43 00 72 00 65 00 D.a.t.e. .C.r.e.
00120c90 61 00 74 00 65 00 64 00-00 00 00 00 00 00 00 00 a.t.e.d.........
1: kd> db 0x1209c0 +0xb0*5
00120d30 44 00 61 00 74 00 65 00-20 00 41 00 63 00 63 00 D.a.t.e. .A.c.c.
00120d40 65 00 73 00 73 00 65 00-64 00 00 00 00 00 00 00 e.s.s.e.d.......
1: kd> db 0x1209c0 +0xb0*6
00120de0 41 00 74 00 74 00 72 00-69 00 62 00 75 00 74 00 A.t.t.r.i.b.u.t.
00120df0 65 00 73 00 00 00 00 00-00 00 00 00 00 00 00 00 e.s.............