mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-31 01:59:59 -06:00
Horizon: Implement arp:r and arp:w services (#5802)
* 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
This commit is contained in:
74
src/Ryujinx.Horizon/Arp/Ipc/Updater.cs
Normal file
74
src/Ryujinx.Horizon/Arp/Ipc/Updater.cs
Normal file
@ -0,0 +1,74 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user