IShellInterface.cs 938 B

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