forked from emmauss/Ryujinx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement PM GetProcessInfo atmosphere extension (partially)
- Loading branch information
Showing
6 changed files
with
63 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,31 @@ | ||
namespace Ryujinx.HLE.HOS.Services.Pm | ||
using Ryujinx.HLE.HOS.Ipc; | ||
using Ryujinx.HLE.HOS.Kernel; | ||
using Ryujinx.HLE.HOS.Kernel.Common; | ||
using Ryujinx.HLE.HOS.Kernel.Process; | ||
|
||
namespace Ryujinx.HLE.HOS.Services.Pm | ||
{ | ||
[Service("pm:dmnt")] | ||
class IDebugMonitorInterface : IpcService | ||
{ | ||
public IDebugMonitorInterface(ServiceCtx context) { } | ||
|
||
[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) | ||
{ | ||
ulong pid = context.RequestData.ReadUInt64(); | ||
|
||
KProcess process = KernelStatic.GetProcessByPid(pid); | ||
|
||
if (context.Process.HandleTable.GenerateHandle(process, out int processHandle) != KernelResult.Success) | ||
{ | ||
throw new System.Exception("Out of handles!"); | ||
} | ||
|
||
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(processHandle); | ||
|
||
return ResultCode.Success; | ||
} | ||
} | ||
} |