IServiceCreator.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator;
  2. using Ryujinx.HLE.HOS.Services.Arp;
  3. namespace Ryujinx.HLE.HOS.Services.Bcat
  4. {
  5. [Service("bcat:a")]
  6. [Service("bcat:m")]
  7. [Service("bcat:u")]
  8. [Service("bcat:s")]
  9. class IServiceCreator : IpcService
  10. {
  11. public IServiceCreator(ServiceCtx context) { }
  12. [Command(0)]
  13. // CreateBcatService(u64, pid) -> object<nn::bcat::detail::ipc::IBcatService>
  14. public ResultCode CreateBcatService(ServiceCtx context)
  15. {
  16. // TODO: Call arp:r GetApplicationLaunchProperty with the pid to get the TitleId.
  17. // Add an instance of nn::bcat::detail::service::core::PassphraseManager.
  18. // Add an instance of nn::bcat::detail::service::ServiceMemoryManager.
  19. // Add an instance of nn::bcat::detail::service::core::TaskManager who load "bcat-sys:/" system save data and open "dc/task.bin".
  20. // If the file don't exist, create a new one (size of 0x800) and write 2 empty struct with a size of 0x400.
  21. MakeObject(context, new IBcatService(ApplicationLaunchProperty.GetByPid(context)));
  22. // NOTE: If the IBcatService is null this error is returned, Doesn't occur in our case.
  23. // return ResultCode.NullObject;
  24. return ResultCode.Success;
  25. }
  26. [Command(1)]
  27. // CreateDeliveryCacheStorageService(u64, pid) -> object<nn::bcat::detail::ipc::IDeliveryCacheStorageService>
  28. public ResultCode CreateDeliveryCacheStorageService(ServiceCtx context)
  29. {
  30. // TODO: Call arp:r GetApplicationLaunchProperty with the pid to get the TitleId.
  31. // Add an instance of nn::bcat::detail::service::core::ApplicationStorageManager who load "bcat-dc-X:/" system save data,
  32. // return ResultCode.NullSaveData if failed.
  33. // Where X depend of the ApplicationLaunchProperty stored in an array (range 0-3).
  34. // Add an instance of nn::bcat::detail::service::ServiceMemoryManager.
  35. MakeObject(context, new IDeliveryCacheStorageService(context, ApplicationLaunchProperty.GetByPid(context)));
  36. // NOTE: If the IDeliveryCacheStorageService is null this error is returned, Doesn't occur in our case.
  37. // return ResultCode.NullObject;
  38. return ResultCode.Success;
  39. }
  40. }
  41. }