ILibraryAppletCreator.cs 974 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using Ryujinx.HLE.HOS.Ipc;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.HLE.HOS.Services.Am
  4. {
  5. class ILibraryAppletCreator : IpcService
  6. {
  7. private Dictionary<int, ServiceProcessRequest> _commands;
  8. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
  9. public ILibraryAppletCreator()
  10. {
  11. _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(context.Device.System));
  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. }