From a6af70baa19172b00b6ffe658fa59c03f3d990bc Mon Sep 17 00:00:00 2001 From: Coxxs <58-coxxs@users.noreply.git.ryujinx.app> Date: Sat, 14 Mar 2026 18:25:36 -0500 Subject: [PATCH] HLE: Implement CreateContextForSystem Implement nn::ssl::sf::ISslServiceForSystem -> CreateContextForSystem (100) Ryujinx implements both ISslService and ISslServiceForSystem in one class so we can just return new ISslContext. Also fixed the incorrect parameter reading order. (CreateContextForSystem basically has same params as CreateContext) --- src/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs b/src/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs index 17fde279c..220e63f0b 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs @@ -17,7 +17,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl public ISslService(ServiceCtx context) { } [CommandCmif(0)] - // CreateContext(nn::ssl::sf::SslVersion, u64, pid) -> object + // CreateContext(nn::ssl::sf::SslVersion, u64 pid_placeholder, pid) -> object public ResultCode CreateContext(ServiceCtx context) { SslVersion sslVersion = (SslVersion)context.RequestData.ReadUInt32(); @@ -126,14 +126,18 @@ namespace Ryujinx.HLE.HOS.Services.Ssl } [CommandCmif(100)] - // CreateContextForSystem(u64 pid, nn::ssl::sf::SslVersion, u64) + // CreateContextForSystem(nn::ssl::sf::SslVersion, u64 pid_placeholder, pid) -> object public ResultCode CreateContextForSystem(ServiceCtx context) { - ulong pid = context.RequestData.ReadUInt64(); SslVersion sslVersion = (SslVersion)context.RequestData.ReadUInt32(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment ulong pidPlaceholder = context.RequestData.ReadUInt64(); - - Logger.Stub?.PrintStub(LogClass.ServiceSsl, new { pid, sslVersion, pidPlaceholder }); + #pragma warning restore IDE0059 + + // Note: We use ISslContext here instead of ISslContextForSystem class because Ryujinx implements both in one class. + MakeObject(context, new ISslContext(context.Request.HandleDesc.PId, sslVersion)); + + Logger.Stub?.PrintStub(LogClass.ServiceSsl, new { sslVersion }); return ResultCode.Success; }