diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-11-21 01:52:25 +0100 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-11-21 02:56:29 +0100 |
commit | 9173f07a51ee355d79c60fed21e7731868db5e6d (patch) | |
tree | f1f94b76f0094d24e1ac6a964b0ed272a329ddbe /src | |
parent | service: pm: Add all relevant result codes (diff) | |
download | yuzu-9173f07a51ee355d79c60fed21e7731868db5e6d.tar yuzu-9173f07a51ee355d79c60fed21e7731868db5e6d.tar.gz yuzu-9173f07a51ee355d79c60fed21e7731868db5e6d.tar.bz2 yuzu-9173f07a51ee355d79c60fed21e7731868db5e6d.tar.lz yuzu-9173f07a51ee355d79c60fed21e7731868db5e6d.tar.xz yuzu-9173f07a51ee355d79c60fed21e7731868db5e6d.tar.zst yuzu-9173f07a51ee355d79c60fed21e7731868db5e6d.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hle/service/pm/pm.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp index b2e97a218..277abc17a 100644 --- a/src/core/hle/service/pm/pm.cpp +++ b/src/core/hle/service/pm/pm.cpp @@ -134,6 +134,9 @@ public: : ServiceFramework{system_, "pm:info"}, process_list{process_list_} { static const FunctionInfo functions[] = { {0, &Info::GetProgramId, "GetProgramId"}, + {65000, &Info::AtmosphereGetProcessId, "AtmosphereGetProcessId"}, + {65001, nullptr, "AtmosphereHasLaunchedProgram"}, + {65002, nullptr, "AtmosphereGetProcessInfo"}, }; RegisterHandlers(functions); } @@ -160,6 +163,27 @@ private: rb.Push((*process)->GetProgramID()); } + void AtmosphereGetProcessId(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto program_id = rp.PopRaw<u64>(); + + LOG_DEBUG(Service_PM, "called, program_id={:016X}", program_id); + + const auto process = SearchProcessList(process_list, [program_id](const auto& proc) { + return proc->GetProgramID() == program_id; + }); + + if (!process.has_value()) { + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultProcessNotFound); + return; + } + + IPC::ResponseBuilder rb{ctx, 4}; + rb.Push(ResultSuccess); + rb.Push((*process)->GetProcessID()); + } + const std::vector<Kernel::KProcess*>& process_list; }; |