diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Pm/IDebugMonitorInterface.cs')
-rw-r--r-- | Ryujinx.HLE/HOS/Services/Pm/IDebugMonitorInterface.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Pm/IDebugMonitorInterface.cs b/Ryujinx.HLE/HOS/Services/Pm/IDebugMonitorInterface.cs index c9c6354d..8d4934fa 100644 --- a/Ryujinx.HLE/HOS/Services/Pm/IDebugMonitorInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Pm/IDebugMonitorInterface.cs @@ -10,6 +10,24 @@ namespace Ryujinx.HLE.HOS.Services.Pm { public IDebugMonitorInterface(ServiceCtx context) { } + [CommandHipc(4)] + // GetProgramId() -> sf::Out<ncm::ProgramId> out_process_id + public ResultCode GetApplicationProcessId(ServiceCtx context) + { + // TODO: Not correct as it shouldn't be directly using kernel objects here + foreach (KProcess process in context.Device.System.KernelContext.Processes.Values) + { + if (process.IsApplication) + { + context.ResponseData.Write(process.Pid); + + return ResultCode.Success; + } + } + + return ResultCode.ProcessNotFound; + } + [CommandHipc(65000)] // AtmosphereGetProcessInfo(os::ProcessId process_id) -> sf::OutCopyHandle out_process_handle, sf::Out<ncm::ProgramLocation> out_loc, sf::Out<cfg::OverrideStatus> out_status public ResultCode GetProcessInfo(ServiceCtx context) |