1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-18 22:26:40 +00:00
Ryujinx/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForSystemService.cs
Mary 0746b83edf
Initial support for the new 12.x IPC system (#2182)
* Rename CommandAttribute as CommandHIpcAttribute to prepare for 12.x changes

* Implement inital support for TIPC and adds SM command ids

* *Ipc to *ipc

* Missed a ref in last commit...

* CommandAttributeTIpc to CommandAttributeTipc

* Addresses comment and fixes some bugs around

TIPC doesn't have any padding requirements as buffer C isn't a thing
Fix for RegisterService inverting two argument only on TIPC
2021-04-14 00:01:24 +02:00

107 lines
No EOL
3.5 KiB
C#

using Ryujinx.Common;
using Ryujinx.HLE.HOS.Services.Account.Acc.AccountService;
namespace Ryujinx.HLE.HOS.Services.Account.Acc
{
[Service("acc:u1", AccountServiceFlag.SystemService)] // Max Sessions: 16
class IAccountServiceForSystemService : IpcService
{
private ApplicationServiceServer _applicationServiceServer;
public IAccountServiceForSystemService(ServiceCtx context, AccountServiceFlag serviceFlag)
{
_applicationServiceServer = new ApplicationServiceServer(serviceFlag);
}
[CommandHipc(0)]
// GetUserCount() -> i32
public ResultCode GetUserCount(ServiceCtx context)
{
return _applicationServiceServer.GetUserCountImpl(context);
}
[CommandHipc(1)]
// GetUserExistence(nn::account::Uid) -> bool
public ResultCode GetUserExistence(ServiceCtx context)
{
return _applicationServiceServer.GetUserExistenceImpl(context);
}
[CommandHipc(2)]
// ListAllUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListAllUsers(ServiceCtx context)
{
return _applicationServiceServer.ListAllUsers(context);
}
[CommandHipc(3)]
// ListOpenUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListOpenUsers(ServiceCtx context)
{
return _applicationServiceServer.ListOpenUsers(context);
}
[CommandHipc(4)]
// GetLastOpenedUser() -> nn::account::Uid
public ResultCode GetLastOpenedUser(ServiceCtx context)
{
return _applicationServiceServer.GetLastOpenedUser(context);
}
[CommandHipc(5)]
// GetProfile(nn::account::Uid) -> object<nn::account::profile::IProfile>
public ResultCode GetProfile(ServiceCtx context)
{
ResultCode resultCode = _applicationServiceServer.GetProfile(context, out IProfile iProfile);
if (resultCode == ResultCode.Success)
{
MakeObject(context, iProfile);
}
return resultCode;
}
[CommandHipc(50)]
// IsUserRegistrationRequestPermitted(pid) -> bool
public ResultCode IsUserRegistrationRequestPermitted(ServiceCtx context)
{
// NOTE: pid is unused.
return _applicationServiceServer.IsUserRegistrationRequestPermitted(context);
}
[CommandHipc(51)]
// TrySelectUserWithoutInteraction(bool) -> nn::account::Uid
public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context)
{
return _applicationServiceServer.TrySelectUserWithoutInteraction(context);
}
[CommandHipc(102)]
// GetBaasAccountManagerForSystemService(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication>
public ResultCode GetBaasAccountManagerForSystemService(ServiceCtx context)
{
UserId userId = context.RequestData.ReadStruct<UserId>();
if (userId.IsNull)
{
return ResultCode.NullArgument;
}
MakeObject(context, new IManagerForSystemService(userId));
// Doesn't occur in our case.
// return ResultCode.NullObject;
return ResultCode.Success;
}
[CommandHipc(140)] // 6.0.0+
// ListQualifiedUsers() -> array<nn::account::Uid, 0xa>
public ResultCode ListQualifiedUsers(ServiceCtx context)
{
return _applicationServiceServer.ListQualifiedUsers(context);
}
}
}