summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/pm/pm.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/pm/pm.cpp24
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;
};