LibHacIReader.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using LibHac;
  2. using LibHac.Ncm;
  3. using LibHac.Ns;
  4. using System;
  5. using ApplicationId = LibHac.ApplicationId;
  6. namespace Ryujinx.HLE.HOS.Services.Arp
  7. {
  8. class LibHacIReader : LibHac.Arp.Impl.IReader
  9. {
  10. public ApplicationId ApplicationId { get; set; }
  11. public Result GetApplicationLaunchProperty(out LibHac.Arp.ApplicationLaunchProperty launchProperty, ulong processId)
  12. {
  13. launchProperty = new LibHac.Arp.ApplicationLaunchProperty
  14. {
  15. BaseStorageId = StorageId.BuiltInUser,
  16. ApplicationId = ApplicationId
  17. };
  18. return Result.Success;
  19. }
  20. public Result GetApplicationLaunchPropertyWithApplicationId(out LibHac.Arp.ApplicationLaunchProperty launchProperty, ApplicationId applicationId)
  21. {
  22. launchProperty = new LibHac.Arp.ApplicationLaunchProperty
  23. {
  24. BaseStorageId = StorageId.BuiltInUser,
  25. ApplicationId = applicationId
  26. };
  27. return Result.Success;
  28. }
  29. public Result GetApplicationControlProperty(out ApplicationControlProperty controlProperty, ulong processId)
  30. {
  31. throw new NotImplementedException();
  32. }
  33. public Result GetApplicationControlPropertyWithApplicationId(out ApplicationControlProperty controlProperty, ApplicationId applicationId)
  34. {
  35. throw new NotImplementedException();
  36. }
  37. public Result GetServiceObject(out object serviceObject)
  38. {
  39. throw new NotImplementedException();
  40. }
  41. }
  42. internal class LibHacArpServiceObject : LibHac.Sm.IServiceObject
  43. {
  44. private LibHacIReader _serviceObject;
  45. public LibHacArpServiceObject(LibHacIReader serviceObject)
  46. {
  47. _serviceObject = serviceObject;
  48. }
  49. public Result GetServiceObject(out object serviceObject)
  50. {
  51. serviceObject = _serviceObject;
  52. return Result.Success;
  53. }
  54. }
  55. }