IAppletResource.cs 842 B

1234567891011121314151617181920212223242526272829303132
  1. using Ryujinx.Core.OsHle.Handles;
  2. using Ryujinx.Core.OsHle.Ipc;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.Core.OsHle.Objects.Hid
  5. {
  6. class IAppletResource : IIpcInterface
  7. {
  8. private Dictionary<int, ServiceProcessRequest> m_Commands;
  9. public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  10. private HSharedMem Handle;
  11. public IAppletResource(HSharedMem Handle)
  12. {
  13. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  14. {
  15. { 0, GetSharedMemoryHandle }
  16. };
  17. this.Handle = Handle;
  18. }
  19. public static long GetSharedMemoryHandle(ServiceCtx Context)
  20. {
  21. Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Context.Ns.Os.HidHandle);
  22. return 0;
  23. }
  24. }
  25. }