IShellInterface.cs 905 B

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