2
2
#include " CNodePtrArray.h"
3
3
4
4
CNodePtrArray::CNodePtrArray ( )
5
- : m_PtrCount ( 1 )
6
- , m_CurrentIndex ( 0 )
7
- , m_NodePtr ( new CNodePtr )
5
+ : m_ulPtrCount ( 1 )
6
+ , m_iCurrentIndex ( 0 )
7
+ , m_pNodePtr ( new CNodePtr )
8
8
{
9
9
m_nodeType = nt_ptrarray;
10
10
}
@@ -35,16 +35,16 @@ NODESIZE CNodePtrArray::Draw( const PVIEWINFO View, int x, int y )
35
35
tx = AddText ( View, tx, y, g_crType, HS_NONE, _T ( " ArrayOfPointers " ) );
36
36
tx = AddText ( View, tx, y, g_crName, HS_NAME, _T ( " %s" ), m_strName );
37
37
tx = AddText ( View, tx, y, g_crIndex, HS_NONE, _T ( " [" ) );
38
- tx = AddText ( View, tx, y, g_crIndex, HS_EDIT, _T ( " %i " ), m_PtrCount );
38
+ tx = AddText ( View, tx, y, g_crIndex, HS_EDIT, _T ( " %u " ), m_ulPtrCount );
39
39
tx = AddText ( View, tx, y, g_crIndex, HS_NONE, _T ( " ]" ) );
40
40
41
41
tx = AddIcon ( View, tx, y, ICON_LEFT, HS_SELECT, HS_CLICK );
42
42
tx = AddText ( View, tx, y, g_crIndex, HS_NONE, _T ( " (" ) );
43
- tx = AddText ( View, tx, y, g_crIndex, 1 , _T ( " %i" ), m_CurrentIndex );
43
+ tx = AddText ( View, tx, y, g_crIndex, 1 , _T ( " %i" ), m_iCurrentIndex );
44
44
tx = AddText ( View, tx, y, g_crIndex, HS_NONE, _T ( " )" ) );
45
45
tx = AddIcon ( View, tx, y, ICON_RIGHT, HS_DROP, HS_CLICK );
46
46
47
- tx = AddText ( View, tx, y, g_crValue, HS_NONE, _T ( " <%s* Size=%i >" ), m_NodePtr ->GetClass ( )->GetName ( ), GetMemorySize ( ) );
47
+ tx = AddText ( View, tx, y, g_crValue, HS_NONE, _T ( " <%s* Size=%u >" ), m_pNodePtr ->GetClass ( )->GetName ( ), GetMemorySize ( ) );
48
48
tx = AddIcon ( View, tx, y, ICON_CHANGE, HS_CLICK, HS_CHANGE_X );
49
49
50
50
tx += g_FontWidth;
@@ -53,19 +53,19 @@ NODESIZE CNodePtrArray::Draw( const PVIEWINFO View, int x, int y )
53
53
y += g_FontHeight;
54
54
if (m_LevelsOpen[View->Level ])
55
55
{
56
- if (IsMemory ( View->Address + m_Offset + (sizeof ( uintptr_t ) * m_CurrentIndex ) ))
56
+ if (IsMemory ( View->Address + m_Offset + (sizeof ( ULONG_PTR ) * m_iCurrentIndex ) ))
57
57
{
58
- ClassSize = m_NodePtr ->GetClass ( )->GetMemorySize ( );
59
- m_NodePtr ->Memory ( )->SetSize ( ClassSize );
58
+ ClassSize = m_pNodePtr ->GetClass ( )->GetMemorySize ( );
59
+ m_pNodePtr ->Memory ( )->SetSize ( ClassSize );
60
60
61
61
VIEWINFO NewView;
62
62
memcpy ( &NewView, View, sizeof ( NewView ) );
63
- NewView.Data = m_NodePtr ->Memory ( )->Data ( );
64
- NewView.Address = *(uintptr_t *)(View->Data + m_Offset + (sizeof ( uintptr_t ) * m_CurrentIndex ));
63
+ NewView.Data = m_pNodePtr ->Memory ( )->Data ( );
64
+ NewView.Address = *(ULONG_PTR *)(View->Data + m_Offset + (sizeof ( ULONG_PTR ) * m_iCurrentIndex ));
65
65
66
66
ReClassReadMemory ( (LPVOID)NewView.Address , (LPVOID)NewView.Data , ClassSize );
67
67
68
- ChildDrawSize = m_NodePtr ->GetClass ( )->Draw ( &NewView, x, y );
68
+ ChildDrawSize = m_pNodePtr ->GetClass ( )->Draw ( &NewView, x, y );
69
69
70
70
y = ChildDrawSize.y ;
71
71
if (ChildDrawSize.x > DrawSize.x )
@@ -79,36 +79,43 @@ NODESIZE CNodePtrArray::Draw( const PVIEWINFO View, int x, int y )
79
79
80
80
ULONG CNodePtrArray::GetMemorySize ( )
81
81
{
82
- return m_NodePtr ->GetMemorySize ( ) * m_PtrCount ;
82
+ return m_pNodePtr ->GetMemorySize ( ) * m_ulPtrCount ;
83
83
}
84
84
85
85
void CNodePtrArray::Update ( const PHOTSPOT Spot )
86
86
{
87
+ LONG LongValue;
88
+ ULONG UlongValue;
89
+
87
90
StandardUpdate ( Spot );
88
91
89
- int v = _ttoi ( Spot->Text .GetString ( ) );
90
- if (v < 0 ) return ;
92
+ LongValue = _ttol ( Spot->Text .GetString ( ) );
93
+ if (LongValue < 0 )
94
+ return ;
95
+
96
+ UlongValue = (ULONG)LongValue;
91
97
92
98
if (Spot->Id == 0 )
93
99
{
94
- if (v == 0 )
100
+ if (UlongValue == 0 )
95
101
return ;
96
- m_PtrCount = ( size_t )v ;
102
+ m_ulPtrCount = UlongValue ;
97
103
}
98
104
else if (Spot->Id == 1 )
99
105
{
100
- if (v >= (int )m_PtrCount) return ;
101
- m_CurrentIndex = (int )v;
106
+ if (UlongValue >= m_ulPtrCount)
107
+ return ;
108
+ m_iCurrentIndex = UlongValue;
102
109
}
103
110
else if (Spot->Id == 2 )
104
111
{
105
- if (m_CurrentIndex > 0 )
106
- m_CurrentIndex --;
112
+ if (m_iCurrentIndex > 0 )
113
+ m_iCurrentIndex --;
107
114
}
108
115
else if (Spot->Id == 3 )
109
116
{
110
- if (( size_t )m_CurrentIndex < m_PtrCount - 1 )
111
- m_CurrentIndex ++;
117
+ if (m_iCurrentIndex < (INT)m_ulPtrCount - 1 )
118
+ m_iCurrentIndex ++;
112
119
}
113
120
}
114
121
0 commit comments