| 21 | } |
| 22 | |
| 23 | ProcessAttributes ProcessInfoEx::GetAttributes(const WinSys::ProcessManager& pm) const { |
| 24 | if (_attributes == ProcessAttributes::NotComputed) { |
| 25 | _attributes = ProcessAttributes::None; |
| 26 | if (_process) { |
| 27 | if (_process->IsManaged()) |
| 28 | _attributes |= ProcessAttributes::Managed; |
| 29 | if (_process->IsProtected()) |
| 30 | _attributes |= ProcessAttributes::Protected; |
| 31 | if (_process->IsImmersive()) |
| 32 | _attributes |= ProcessAttributes::Immersive; |
| 33 | if (_process->IsSecure()) |
| 34 | _attributes |= ProcessAttributes::Secure; |
| 35 | if (_process->IsInJob()) |
| 36 | _attributes |= ProcessAttributes::InJob; |
| 37 | auto parent = pm.GetProcessById(_pi->ParentId); |
| 38 | if (parent && ::_wcsicmp(parent->GetImageName().c_str(), L"services.exe") == 0) |
| 39 | _attributes |= ProcessAttributes::Service; |
| 40 | if (_process->IsWow64Process()) |
| 41 | _attributes |= ProcessAttributes::Wow64; |
| 42 | } |
| 43 | } |
| 44 | return _attributes; |
| 45 | } |
| 46 | |
| 47 | const std::wstring& ProcessInfoEx::GetExecutablePath() const { |
| 48 | if (_executablePath.empty() && _pi->Id != 0) { |
no test coverage detected