IAppletResource.cs 926 B

12345678910111213141516171819202122232425262728293031323334
  1. using Ryujinx.HLE.OsHle.Handles;
  2. using Ryujinx.HLE.OsHle.Ipc;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.HLE.OsHle.Services.Hid
  5. {
  6. class IAppletResource : IpcService
  7. {
  8. private Dictionary<int, ServiceProcessRequest> m_Commands;
  9. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  10. private HSharedMem HidSharedMem;
  11. public IAppletResource(HSharedMem HidSharedMem)
  12. {
  13. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  14. {
  15. { 0, GetSharedMemoryHandle }
  16. };
  17. this.HidSharedMem = HidSharedMem;
  18. }
  19. public long GetSharedMemoryHandle(ServiceCtx Context)
  20. {
  21. int Handle = Context.Process.HandleTable.OpenHandle(HidSharedMem);
  22. Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
  23. return 0;
  24. }
  25. }
  26. }