aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs
diff options
context:
space:
mode:
authorIsaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com>2023-01-15 16:16:24 -0500
committerGitHub <noreply@github.com>2023-01-15 22:16:24 +0100
commit139a93040741ec78a4ee13035eab1b1b705bdcf8 (patch)
tree1d4b69bf7949317e0e44caf3f65966ac14683eaa /Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs
parent719dc97bbd321e98083f47267feb01db769e5fa6 (diff)
Implement missing service calls in `pm` (#4210)
* Implement `GetTitleId` Fixes #2516 * Null check + Proper result code * Better comment * Implement `GetApplicationProcessId` * Add TODOs * Update Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs Co-authored-by: Ac_K <Acoustik666@gmail.com> * Update Ryujinx.HLE/HOS/Services/Pm/IDebugMonitorInterface.cs Co-authored-by: Ac_K <Acoustik666@gmail.com> * Remove new function from KernelStatic Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs22
1 files changed, 21 insertions, 1 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs b/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs
index 0be85c4f..e3ce6d2a 100644
--- a/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs
+++ b/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs
@@ -1,8 +1,28 @@
-namespace Ryujinx.HLE.HOS.Services.Pm
+using Ryujinx.HLE.HOS.Kernel;
+using Ryujinx.HLE.HOS.Kernel.Process;
+
+namespace Ryujinx.HLE.HOS.Services.Pm
{
[Service("pm:info")]
class IInformationInterface : IpcService
{
public IInformationInterface(ServiceCtx context) { }
+
+ [CommandHipc(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