ILibraryAppletCreator.cs 962 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using Ryujinx.HLE.OsHle.Ipc;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.HLE.OsHle.Services.Am
  4. {
  5. class ILibraryAppletCreator : IpcService
  6. {
  7. private Dictionary<int, ServiceProcessRequest> m_Commands;
  8. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  9. public ILibraryAppletCreator()
  10. {
  11. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  12. {
  13. { 0, CreateLibraryApplet },
  14. { 10, CreateStorage }
  15. };
  16. }
  17. public long CreateLibraryApplet(ServiceCtx Context)
  18. {
  19. MakeObject(Context, new ILibraryAppletAccessor());
  20. return 0;
  21. }
  22. public long CreateStorage(ServiceCtx Context)
  23. {
  24. long Size = Context.RequestData.ReadInt64();
  25. MakeObject(Context, new IStorage(new byte[Size]));
  26. return 0;
  27. }
  28. }
  29. }