mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-17 04:31:30 +00:00
* Horizon: Implement arp:r and arp:w services * Fix formatting * Remove HLE arp services * Revert "Remove HLE arp services" This reverts commit c576fcccadb963db56b96bacabd1c1ac7abfb1ab. * Keep LibHac impl since it's used in bcat * Addresses gdkchan's feedback * ArpApi in PrepoIpcServer and remove LmApi * Fix 2 * Fixes ArpApi init * Fix encoding * Update PrepoService.cs * Fix prepo
75 lines
2.3 KiB
C#
75 lines
2.3 KiB
C#
using Ryujinx.Horizon.Common;
|
|
using Ryujinx.Horizon.Sdk.Arp;
|
|
using Ryujinx.Horizon.Sdk.Arp.Detail;
|
|
using Ryujinx.Horizon.Sdk.Sf;
|
|
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
|
using System;
|
|
|
|
namespace Ryujinx.Horizon.Arp.Ipc
|
|
{
|
|
partial class Updater : IUpdater, IServiceObject
|
|
{
|
|
private readonly ApplicationInstanceManager _applicationInstanceManager;
|
|
private readonly ulong _applicationInstanceId;
|
|
private readonly bool _forCertificate;
|
|
|
|
public Updater(ApplicationInstanceManager applicationInstanceManager, ulong applicationInstanceId, bool forCertificate)
|
|
{
|
|
_applicationInstanceManager = applicationInstanceManager;
|
|
_applicationInstanceId = applicationInstanceId;
|
|
_forCertificate = forCertificate;
|
|
}
|
|
|
|
[CmifCommand(0)]
|
|
public Result Issue()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
[CmifCommand(1)]
|
|
public Result SetApplicationProcessProperty(ulong pid, ApplicationProcessProperty applicationProcessProperty)
|
|
{
|
|
if (_forCertificate)
|
|
{
|
|
return ArpResult.DataAlreadyBound;
|
|
}
|
|
|
|
if (pid == 0)
|
|
{
|
|
return ArpResult.InvalidPid;
|
|
}
|
|
|
|
_applicationInstanceManager.Entries[_applicationInstanceId].Pid = pid;
|
|
_applicationInstanceManager.Entries[_applicationInstanceId].ProcessProperty = applicationProcessProperty;
|
|
|
|
return Result.Success;
|
|
}
|
|
|
|
[CmifCommand(2)]
|
|
public Result DeleteApplicationProcessProperty()
|
|
{
|
|
if (_forCertificate)
|
|
{
|
|
return ArpResult.DataAlreadyBound;
|
|
}
|
|
|
|
_applicationInstanceManager.Entries[_applicationInstanceId].ProcessProperty = new ApplicationProcessProperty();
|
|
|
|
return Result.Success;
|
|
}
|
|
|
|
[CmifCommand(3)]
|
|
public Result SetApplicationCertificate([Buffer(HipcBufferFlags.In | HipcBufferFlags.AutoSelect)] ApplicationCertificate applicationCertificate)
|
|
{
|
|
if (!_forCertificate)
|
|
{
|
|
return ArpResult.DataAlreadyBound;
|
|
}
|
|
|
|
_applicationInstanceManager.Entries[_applicationInstanceId].Certificate = applicationCertificate;
|
|
|
|
return Result.Success;
|
|
}
|
|
}
|
|
}
|