MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / Refresh

Method Refresh

WinArk/ProcessMemoryTable.cpp:143–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void CProcessMemoryTable::Refresh() {
144 if (m_Details.empty())
145 m_Details.reserve(128);
146
147 m_Tracker->EnumRegions();
148 m_Table.data.info = m_Tracker->GetRegions();
149 m_Details.clear();
150 m_Details.reserve(m_Table.data.info.size() / 2);
151
152 // enum threads
153 m_ProcMgr.EnumProcessAndThreads(m_Pid);
154 m_Threads = m_ProcMgr.GetThreads();
155
156 // enum heaps
157 m_Heaps.clear();
158 m_Heaps.reserve(8);
159 wil::unique_handle hSnapshot(::CreateToolhelp32Snapshot(TH32CS_SNAPHEAPLIST, m_Pid));
160 if (hSnapshot) {
161 HEAPLIST32 list;
162 list.dwSize = sizeof(list);
163 HEAPENTRY32 entry;
164 entry.dwSize = sizeof(entry);
165 int index = 1;
166 ::Heap32ListFirst(hSnapshot.get(), &list);
167 do {
168 HeapInfo hi;
169 hi.Address = list.th32HeapID;
170 hi.Flags = list.dwFlags;
171 hi.Id = index++;
172 m_Heaps.push_back(hi);
173 } while (::Heap32ListNext(hSnapshot.get(), &list));
174 }
175
176 for (auto& mi : m_Table.data.info) {
177 GetDetails(mi);
178 }
179
180 auto count = static_cast<int>(m_Table.data.info.size());
181 m_Table.data.n = count;
182
183 return;
184}
185
186PCWSTR CProcessMemoryTable::StateToString(DWORD state) {
187 switch (state) {

Callers

nothing calls this directly

Calls 7

emptyMethod · 0.80
reserveMethod · 0.80
EnumRegionsMethod · 0.80
clearMethod · 0.80
EnumProcessAndThreadsMethod · 0.80
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected