From fb27eb5d1e868331f97c9778bcf4470c56d946d3 Mon Sep 17 00:00:00 2001 From: Starlet Date: Tue, 3 Jul 2018 17:56:27 -0400 Subject: [PATCH] Compliant with review. --- Ryujinx.HLE/OsHle/Services/Spl/IRandomInterface.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Ryujinx.HLE/OsHle/Services/Spl/IRandomInterface.cs b/Ryujinx.HLE/OsHle/Services/Spl/IRandomInterface.cs index b534f150fa..e17dab7c3b 100644 --- a/Ryujinx.HLE/OsHle/Services/Spl/IRandomInterface.cs +++ b/Ryujinx.HLE/OsHle/Services/Spl/IRandomInterface.cs @@ -10,7 +10,7 @@ namespace Ryujinx.HLE.OsHle.Services.Spl public override IReadOnlyDictionary Commands => m_Commands; - private RNGCryptoServiceProvider CspRnd; + private RNGCryptoServiceProvider Rng; public IRandomInterface() { @@ -19,18 +19,16 @@ namespace Ryujinx.HLE.OsHle.Services.Spl { 0, GetRandomBytes } }; - CspRnd = new RNGCryptoServiceProvider(); + Rng = new RNGCryptoServiceProvider(); } public long GetRandomBytes(ServiceCtx Context) { - (long Position, long Size) = Context.Request.GetBufferType0x21(); + byte[] RandomBytes = new byte[Context.Request.ReceiveBuff[0].Size]; - byte[] BytesBuffer = new byte[Size]; + Rng.GetBytes(RandomBytes); - CspRnd.GetBytes(BytesBuffer); - - Context.Memory.WriteBytes(Position, BytesBuffer); + Context.Memory.WriteBytes(Context.Request.ReceiveBuff[0].Position, RandomBytes); return 0; }