aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs')
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs b/src/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs
new file mode 100644
index 00000000..b3b5595f
--- /dev/null
+++ b/src/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs
@@ -0,0 +1,27 @@
+using Ryujinx.HLE.HOS.Kernel.Process;
+
+namespace Ryujinx.HLE.HOS.Services.Pm
+{
+ [Service("pm:info")]
+ class IInformationInterface : IpcService
+ {
+ public IInformationInterface(ServiceCtx context) { }
+
+ [CommandCmif(0)]
+ // GetProgramId(os::ProcessId process_id) -> sf::Out<ncm::ProgramId> out
+ public ResultCode GetProgramId(ServiceCtx context)
+ {
+ ulong pid = context.RequestData.ReadUInt64();
+
+ // TODO: Not correct as it shouldn't be directly using kernel objects here
+ if (context.Device.System.KernelContext.Processes.TryGetValue(pid, out KProcess process))
+ {
+ context.ResponseData.Write(process.TitleId);
+
+ return ResultCode.Success;
+ }
+
+ return ResultCode.ProcessNotFound;
+ }
+ }
+} \ No newline at end of file