MCPcopy Create free account
hub / github.com/WallBreaker2/op / GetProcessInfo

Method GetProcessInfo

libop/window/WindowProcess.cpp:210–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210bool 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
226bool WindowService::GetProcesspath(DWORD ProcessID, std::wstring &process_path) {
227 process_path.clear();

Callers

nothing calls this directly

Calls 3

find_process_nameFunction · 0.85
clearMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected