IShopServiceAccessServerInterface.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using LibHac.Ncm;
  2. using Ryujinx.Common.Logging;
  3. using Ryujinx.HLE.HOS.Services.Arp;
  4. using Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface;
  5. namespace Ryujinx.HLE.HOS.Services.Nim
  6. {
  7. [Service("nim:eca")] // 5.0.0+
  8. class IShopServiceAccessServerInterface : IpcService
  9. {
  10. public IShopServiceAccessServerInterface(ServiceCtx context) { }
  11. [CommandHipc(0)]
  12. // CreateServerInterface(pid, handle<unknown>, u64) -> object<nn::ec::IShopServiceAccessServer>
  13. public ResultCode CreateServerInterface(ServiceCtx context)
  14. {
  15. // Close transfer memory immediately as we don't use it.
  16. context.Device.System.KernelContext.Syscall.CloseHandle(context.Request.HandleDesc.ToCopy[0]);
  17. MakeObject(context, new IShopServiceAccessServer());
  18. Logger.Stub?.PrintStub(LogClass.ServiceNim);
  19. return ResultCode.Success;
  20. }
  21. [CommandHipc(4)] // 10.0.0+
  22. // IsLargeResourceAvailable(pid) -> b8
  23. public ResultCode IsLargeResourceAvailable(ServiceCtx context)
  24. {
  25. // TODO: Service calls arp:r GetApplicationInstanceId (10.0.0+) then if it fails it calls arp:r GetMicroApplicationInstanceId (10.0.0+)
  26. // then if it fails it returns the arp:r result code.
  27. // NOTE: Firmare 10.0.0+ don't use the Pid here anymore, but the returned InstanceId. We don't support that for now so we can just use the Pid instead.
  28. StorageId baseStorageId = (StorageId)ApplicationLaunchProperty.GetByPid(context).BaseGameStorageId;
  29. // NOTE: Service returns ResultCode.InvalidArgument if baseStorageId is null, doesn't occur in our case.
  30. context.ResponseData.Write(baseStorageId == StorageId.Host);
  31. return ResultCode.Success;
  32. }
  33. }
  34. }