2020-04-30 06:58:19 +02:00
|
|
|
|
using LibHac;
|
2021-12-23 17:55:50 +01:00
|
|
|
|
using LibHac.Common;
|
2020-04-30 06:58:19 +02:00
|
|
|
|
using LibHac.Ncm;
|
|
|
|
|
using LibHac.Ns;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
using ApplicationId = LibHac.ApplicationId;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Arp
|
|
|
|
|
{
|
2021-01-02 23:34:28 +01:00
|
|
|
|
class LibHacIReader : LibHac.Arp.Impl.IReader
|
2020-04-30 06:58:19 +02:00
|
|
|
|
{
|
2021-08-12 23:56:24 +02:00
|
|
|
|
public ApplicationId ApplicationId { get; set; }
|
2020-04-30 06:58:19 +02:00
|
|
|
|
|
|
|
|
|
public Result GetApplicationLaunchProperty(out LibHac.Arp.ApplicationLaunchProperty launchProperty, ulong processId)
|
|
|
|
|
{
|
2021-01-02 23:34:28 +01:00
|
|
|
|
launchProperty = new LibHac.Arp.ApplicationLaunchProperty
|
|
|
|
|
{
|
2022-02-27 00:52:25 +01:00
|
|
|
|
StorageId = StorageId.BuiltInUser,
|
2021-08-12 23:56:24 +02:00
|
|
|
|
ApplicationId = ApplicationId
|
2021-01-02 23:34:28 +01:00
|
|
|
|
};
|
2020-04-30 06:58:19 +02:00
|
|
|
|
|
|
|
|
|
return Result.Success;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-23 17:55:50 +01:00
|
|
|
|
public void Dispose() { }
|
|
|
|
|
|
2021-01-02 23:34:28 +01:00
|
|
|
|
public Result GetApplicationLaunchPropertyWithApplicationId(out LibHac.Arp.ApplicationLaunchProperty launchProperty, ApplicationId applicationId)
|
2020-04-30 06:58:19 +02:00
|
|
|
|
{
|
2021-01-02 23:34:28 +01:00
|
|
|
|
launchProperty = new LibHac.Arp.ApplicationLaunchProperty
|
|
|
|
|
{
|
2022-02-27 00:52:25 +01:00
|
|
|
|
StorageId = StorageId.BuiltInUser,
|
2021-01-02 23:34:28 +01:00
|
|
|
|
ApplicationId = applicationId
|
|
|
|
|
};
|
2020-04-30 06:58:19 +02:00
|
|
|
|
|
|
|
|
|
return Result.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Result GetApplicationControlProperty(out ApplicationControlProperty controlProperty, ulong processId)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-02 23:34:28 +01:00
|
|
|
|
public Result GetApplicationControlPropertyWithApplicationId(out ApplicationControlProperty controlProperty, ApplicationId applicationId)
|
2020-04-30 06:58:19 +02:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
2021-08-12 23:56:24 +02:00
|
|
|
|
|
|
|
|
|
public Result GetServiceObject(out object serviceObject)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal class LibHacArpServiceObject : LibHac.Sm.IServiceObject
|
|
|
|
|
{
|
2021-12-23 17:55:50 +01:00
|
|
|
|
private SharedRef<LibHacIReader> _serviceObject;
|
2021-08-12 23:56:24 +02:00
|
|
|
|
|
2021-12-23 17:55:50 +01:00
|
|
|
|
public LibHacArpServiceObject(ref SharedRef<LibHacIReader> serviceObject)
|
2021-08-12 23:56:24 +02:00
|
|
|
|
{
|
2021-12-23 17:55:50 +01:00
|
|
|
|
_serviceObject = SharedRef<LibHacIReader>.CreateCopy(in serviceObject);
|
2021-08-12 23:56:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
2021-12-23 17:55:50 +01:00
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
_serviceObject.Destroy();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Result GetServiceObject(ref SharedRef<IDisposable> serviceObject)
|
2021-08-12 23:56:24 +02:00
|
|
|
|
{
|
2021-12-23 17:55:50 +01:00
|
|
|
|
serviceObject.SetByCopy(in _serviceObject);
|
2021-08-12 23:56:24 +02:00
|
|
|
|
|
|
|
|
|
return Result.Success;
|
|
|
|
|
}
|
2020-04-30 06:58:19 +02:00
|
|
|
|
}
|
2021-01-02 23:34:28 +01:00
|
|
|
|
}
|