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

Method ParseProcessStartStop

WinSysCore/TraceManager.cpp:191–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191bool TraceManager::ParseProcessStartStop(EventData* data) {
192 if (data->GetEventName().substr(0, 8) != L"Process/")
193 return false;
194
195 switch (data->GetEventDescriptor().Opcode)
196 {
197 case 1: // process created
198 {
199 auto prop = data->GetProperty(L"ImageFileName");
200 if (prop) {
201 auto name = prop->GetAnsiString();
202 if (name) {
203 std::wstring pname;
204 pname.assign(name, name + strlen(name));
205 AddProcessName(data->GetProperty(L"ProcessId")->GetValue<DWORD>(), pname);
206 assert(!pname.empty());
207 }
208 }
209 break;
210 }
211
212 case 2: // process end
213 RemoveProcessName(data->GetProcessId());
214 break;
215 }
216
217 return true;
218}
219
220void TraceManager::ResetIndex(uint32_t index) {
221 _index = index;

Callers

nothing calls this directly

Calls 4

GetPropertyMethod · 0.80
GetAnsiStringMethod · 0.80
emptyMethod · 0.80
GetProcessIdMethod · 0.80

Tested by

no test coverage detected