| 208 | } |
| 209 | |
| 210 | bool WindowService::GetProcessInfo(LONG pid, std::wstring &retstring) { |
| 211 | retstring.clear(); |
| 212 | |
| 213 | const std::wstring process_name = find_process_name(static_cast<DWORD>(pid)); |
| 214 | if (process_name.empty()) |
| 215 | return false; |
| 216 | |
| 217 | std::wstring process_path; |
| 218 | GetProcesspath(static_cast<DWORD>(pid), process_path); |
| 219 | const auto cpu = static_cast<DWORD>(get_cpu_usage(static_cast<DWORD>(pid))); |
| 220 | const auto meminfo = GetMemoryInfo(static_cast<DWORD>(pid)); |
| 221 | |
| 222 | retstring = process_name + L"|" + process_path + L"|" + std::to_wstring(cpu) + L"|" + std::to_wstring(meminfo); |
| 223 | return true; |
| 224 | } |
| 225 | |
| 226 | bool WindowService::GetProcesspath(DWORD ProcessID, std::wstring &process_path) { |
| 227 | process_path.clear(); |
nothing calls this directly
no test coverage detected