2018-10-17 13:15:50 -04:00
|
|
|
using Ryujinx.Common.Logging;
|
2018-02-09 19:14:55 -05:00
|
|
|
|
2019-09-18 20:45:11 -04:00
|
|
|
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
|
2018-02-09 19:14:55 -05:00
|
|
|
{
|
2018-03-19 14:58:46 -04:00
|
|
|
class IWindowController : IpcService
|
2018-02-09 19:14:55 -05:00
|
|
|
{
|
2022-02-09 15:18:07 -05:00
|
|
|
private readonly ulong _pid;
|
2020-12-01 18:23:43 -05:00
|
|
|
|
2022-02-09 15:18:07 -05:00
|
|
|
public IWindowController(ulong pid)
|
2020-12-01 18:23:43 -05:00
|
|
|
{
|
|
|
|
_pid = pid;
|
|
|
|
}
|
2018-02-09 19:14:55 -05:00
|
|
|
|
2021-04-13 18:01:24 -04:00
|
|
|
[CommandHipc(1)]
|
2019-07-11 21:13:43 -04:00
|
|
|
// GetAppletResourceUserId() -> nn::applet::AppletResourceUserId
|
2019-07-14 15:04:38 -04:00
|
|
|
public ResultCode GetAppletResourceUserId(ServiceCtx context)
|
2018-02-09 19:14:55 -05:00
|
|
|
{
|
2020-08-03 19:32:53 -04:00
|
|
|
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2020-12-01 18:23:43 -05:00
|
|
|
long appletResourceUserId = context.Device.System.AppletState.AppletResourceUserIds.Add(_pid);
|
|
|
|
|
|
|
|
context.ResponseData.Write(appletResourceUserId);
|
2018-02-09 19:14:55 -05:00
|
|
|
|
2019-07-14 15:04:38 -04:00
|
|
|
return ResultCode.Success;
|
2018-02-09 19:14:55 -05:00
|
|
|
}
|
|
|
|
|
2021-04-13 18:01:24 -04:00
|
|
|
[CommandHipc(10)]
|
2019-07-11 21:13:43 -04:00
|
|
|
// AcquireForegroundRights()
|
2019-07-14 15:04:38 -04:00
|
|
|
public ResultCode AcquireForegroundRights(ServiceCtx context)
|
2018-02-09 19:14:55 -05:00
|
|
|
{
|
2020-08-03 19:32:53 -04:00
|
|
|
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2019-07-14 15:04:38 -04:00
|
|
|
return ResultCode.Success;
|
2018-02-09 19:14:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|