mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-10-02 16:50:20 -07:00

* 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>
28 lines
871 B
C#
28 lines
871 B
C#
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;
|
|
}
|
|
}
|
|
} |