IShellInterface.cs 949 B

123456789101112131415161718192021222324252627282930313233
  1. using Ryujinx.HLE.HOS.Ipc;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.HLE.HOS.Services.Pm
  4. {
  5. [Service("pm:shell")]
  6. class IShellInterface : IpcService
  7. {
  8. private Dictionary<int, ServiceProcessRequest> _commands;
  9. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
  10. public IShellInterface(ServiceCtx context)
  11. {
  12. _commands = new Dictionary<int, ServiceProcessRequest>
  13. {
  14. { 6, GetApplicationPid }
  15. };
  16. }
  17. // GetApplicationPid() -> u64
  18. public long GetApplicationPid(ServiceCtx context)
  19. {
  20. // FIXME: This is wrong but needed to make hb loader works
  21. // TODO: Change this when we will have a way to process via a PM like interface.
  22. long pid = context.Process.Pid;
  23. context.ResponseData.Write(pid);
  24. return 0;
  25. }
  26. }
  27. }