| 73 | } |
| 74 | |
| 75 | ProcessSnapshot InspectProcess(PID_t pid) { |
| 76 | const Utils::Stopwatch timer; |
| 77 | ProcessSnapshot snapshot{}; |
| 78 | snapshot.pid = pid; |
| 79 | snapshot.creationTime = GetProcessCreationTime(pid).value_or(0); |
| 80 | |
| 81 | if (auto imagePath = QueryProcessImagePath(pid)) { |
| 82 | snapshot.imagePath = *imagePath; |
| 83 | snapshot.imageName = BaseNameFromPath(snapshot.imagePath); |
| 84 | } |
| 85 | snapshot.steamClientProcess = IsSteamProcessName(snapshot.imageName); |
| 86 | snapshot.environment = ReadSteamEnvironment(pid); |
| 87 | snapshot.likelyGameProcess = !snapshot.steamClientProcess && snapshot.environment.HasSteamAppEnvironment(); |
| 88 | |
| 89 | LOG_PIPE_INFO("ProcessInspector: inspected {} elapsed_ms={:.3f}", |
| 90 | snapshot.DebugString(), timer.ElapsedMs()); |
| 91 | return snapshot; |
| 92 | } |
| 93 | |
| 94 | } // namespace ProcessInspector |
no test coverage detected