| 8 | } |
| 9 | |
| 10 | CString ProcessObjectType::GetDetails(HANDLE hProcess) { |
| 11 | CString details; |
| 12 | auto pid = ::GetProcessId(hProcess); |
| 13 | auto name = ProcessHelper::GetProcessName(hProcess); |
| 14 | if (name.IsEmpty()) { |
| 15 | auto info = _pm.GetProcessById(pid); |
| 16 | if (info) |
| 17 | name = info->GetImageName().c_str(); |
| 18 | } |
| 19 | FILETIME create, exit{}, dummy; |
| 20 | if (::GetProcessTimes(hProcess, &create, &exit, &dummy, &dummy)) { |
| 21 | details.Format(L"PID: %d (%s) Created: %s Exited: %s", pid, name, |
| 22 | CTime(create).Format(L"%D %X"), |
| 23 | exit.dwHighDateTime + exit.dwLowDateTime == 0 ? CString(L"(running)") : CTime(exit).Format(L"%D %X")); |
| 24 | } |
| 25 | else { |
| 26 | details.Format(L"PID: %d (%s)", pid, name); |
| 27 | } |
| 28 | return details; |
| 29 | } |
nothing calls this directly
no test coverage detected