IAccountServiceForSystemService.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using Ryujinx.Common;
  2. using Ryujinx.HLE.HOS.Services.Account.Acc.AccountService;
  3. namespace Ryujinx.HLE.HOS.Services.Account.Acc
  4. {
  5. [Service("acc:u1", AccountServiceFlag.SystemService)] // Max Sessions: 16
  6. class IAccountServiceForSystemService : IpcService
  7. {
  8. private ApplicationServiceServer _applicationServiceServer;
  9. public IAccountServiceForSystemService(ServiceCtx context, AccountServiceFlag serviceFlag)
  10. {
  11. _applicationServiceServer = new ApplicationServiceServer(serviceFlag);
  12. }
  13. [CommandHipc(0)]
  14. // GetUserCount() -> i32
  15. public ResultCode GetUserCount(ServiceCtx context)
  16. {
  17. return _applicationServiceServer.GetUserCountImpl(context);
  18. }
  19. [CommandHipc(1)]
  20. // GetUserExistence(nn::account::Uid) -> bool
  21. public ResultCode GetUserExistence(ServiceCtx context)
  22. {
  23. return _applicationServiceServer.GetUserExistenceImpl(context);
  24. }
  25. [CommandHipc(2)]
  26. // ListAllUsers() -> array<nn::account::Uid, 0xa>
  27. public ResultCode ListAllUsers(ServiceCtx context)
  28. {
  29. return _applicationServiceServer.ListAllUsers(context);
  30. }
  31. [CommandHipc(3)]
  32. // ListOpenUsers() -> array<nn::account::Uid, 0xa>
  33. public ResultCode ListOpenUsers(ServiceCtx context)
  34. {
  35. return _applicationServiceServer.ListOpenUsers(context);
  36. }
  37. [CommandHipc(4)]
  38. // GetLastOpenedUser() -> nn::account::Uid
  39. public ResultCode GetLastOpenedUser(ServiceCtx context)
  40. {
  41. return _applicationServiceServer.GetLastOpenedUser(context);
  42. }
  43. [CommandHipc(5)]
  44. // GetProfile(nn::account::Uid) -> object<nn::account::profile::IProfile>
  45. public ResultCode GetProfile(ServiceCtx context)
  46. {
  47. ResultCode resultCode = _applicationServiceServer.GetProfile(context, out IProfile iProfile);
  48. if (resultCode == ResultCode.Success)
  49. {
  50. MakeObject(context, iProfile);
  51. }
  52. return resultCode;
  53. }
  54. [CommandHipc(50)]
  55. // IsUserRegistrationRequestPermitted(pid) -> bool
  56. public ResultCode IsUserRegistrationRequestPermitted(ServiceCtx context)
  57. {
  58. // NOTE: pid is unused.
  59. return _applicationServiceServer.IsUserRegistrationRequestPermitted(context);
  60. }
  61. [CommandHipc(51)]
  62. // TrySelectUserWithoutInteraction(bool) -> nn::account::Uid
  63. public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context)
  64. {
  65. return _applicationServiceServer.TrySelectUserWithoutInteraction(context);
  66. }
  67. [CommandHipc(102)]
  68. // GetBaasAccountManagerForSystemService(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication>
  69. public ResultCode GetBaasAccountManagerForSystemService(ServiceCtx context)
  70. {
  71. UserId userId = context.RequestData.ReadStruct<UserId>();
  72. if (userId.IsNull)
  73. {
  74. return ResultCode.NullArgument;
  75. }
  76. MakeObject(context, new IManagerForSystemService(userId));
  77. // Doesn't occur in our case.
  78. // return ResultCode.NullObject;
  79. return ResultCode.Success;
  80. }
  81. [CommandHipc(140)] // 6.0.0+
  82. // ListQualifiedUsers() -> array<nn::account::Uid, 0xa>
  83. public ResultCode ListQualifiedUsers(ServiceCtx context)
  84. {
  85. return _applicationServiceServer.ListQualifiedUsers(context);
  86. }
  87. }
  88. }