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