-------------------------------------------------------------------------
| 220 | |
| 221 | //------------------------------------------------------------------------- |
| 222 | void Debugger::OnCreateProcess( |
| 223 | const DEBUG_EVENT& debugEvent, |
| 224 | IDebugEventsHandler& debugEventsHandler) |
| 225 | { |
| 226 | const auto& processInfo = debugEvent.u.CreateProcessInfo; |
| 227 | Tools::ScopedAction scopedAction{ [&processInfo]{ CloseHandle(processInfo.hFile); } }; |
| 228 | |
| 229 | LOG_DEBUG << "Create Process:" << debugEvent.dwProcessId; |
| 230 | |
| 231 | if (!rootProcessId_ && processHandles_.empty()) |
| 232 | rootProcessId_ = debugEvent.dwProcessId; |
| 233 | |
| 234 | if (!processHandles_.emplace(debugEvent.dwProcessId, processInfo.hProcess).second) |
| 235 | THROW("Process id already exist"); |
| 236 | |
| 237 | debugEventsHandler.OnCreateProcess(processInfo); |
| 238 | |
| 239 | OnCreateThread(processInfo.hThread, debugEvent.dwThreadId); |
| 240 | } |
| 241 | |
| 242 | //------------------------------------------------------------------------- |
| 243 | int Debugger::OnExitProcess( |
nothing calls this directly
no outgoing calls
no test coverage detected