| 53 | } |
| 54 | |
| 55 | std::wstring ProcessInfo::GetProcessName(HANDLE handle) |
| 56 | { |
| 57 | std::array<wchar_t, MAX_PATH> buf; |
| 58 | auto rc = GetProcessImageFileName(handle, buf.data(), buf.size()); |
| 59 | if (rc == 0) |
| 60 | return L""; |
| 61 | |
| 62 | const wchar_t* name = buf.data(); |
| 63 | for (auto it = buf.data(); *it; ++it) |
| 64 | { |
| 65 | if (*it == '\\') |
| 66 | name = it + 1; |
| 67 | } |
| 68 | return name; |
| 69 | } |
| 70 | |
| 71 | std::wstring ProcessInfo::GetProcessInfo(HANDLE handle) |
| 72 | { |