Stub IWriterForApplication: 0 (CreateContextRegistrar) (ryubing/ryujinx!183)

See merge request ryubing/ryujinx!183
This commit is contained in:
Coxxs 2025-11-16 18:24:41 -06:00 committed by GreemDev
parent 7b39ff36c0
commit 456db46065
3 changed files with 42 additions and 0 deletions

View file

@ -35,6 +35,7 @@ namespace Ryujinx.Common.Logging
ServiceBsd, ServiceBsd,
ServiceBtm, ServiceBtm,
ServiceCaps, ServiceCaps,
ServiceEctx,
ServiceFatal, ServiceFatal,
ServiceFriend, ServiceFriend,
ServiceFs, ServiceFs,

View file

@ -0,0 +1,32 @@
using System;
using Ryujinx.Common.Logging;
using Ryujinx.Horizon.Common;
namespace Ryujinx.HLE.HOS.Services.Ectx
{
class IContextRegistrar : DisposableIpcService
{
public IContextRegistrar(ServiceCtx context) { }
[CommandCmif(0)] // 11.0.0+
// Complete(nn::Result result, buffer<bytes, 5> raw_context) -> (i32 context_descriptor)
public ResultCode Complete(ServiceCtx context)
{
Result result = new(context.RequestData.ReadInt32());
ulong rawContextPosition = context.Request.SendBuff[0].Position;
ulong rawContextSize = context.Request.SendBuff[0].Size;
byte[] rawContext = new byte[rawContextSize];
context.Memory.Read(rawContextPosition, rawContext);
context.ResponseData.Write(0); // TODO: return context_descriptor
Logger.Stub?.PrintStub(LogClass.ServiceEctx, $"Result: {result}, rawContext: {Convert.ToHexString(rawContext)}" );
return ResultCode.Success;
}
protected override void Dispose(bool isDisposing) { }
}
}

View file

@ -4,5 +4,14 @@ namespace Ryujinx.HLE.HOS.Services.Ectx
class IWriterForApplication : IpcService class IWriterForApplication : IpcService
{ {
public IWriterForApplication(ServiceCtx context) { } public IWriterForApplication(ServiceCtx context) { }
[CommandCmif(0)]
// CreateContextRegistrar() -> object<nn::err::context::IContextRegistrar>
public ResultCode CreateContextRegistrar(ServiceCtx context)
{
MakeObject(context, new IContextRegistrar(context));
return ResultCode.Success;
}
} }
} }