Compliant with review.
This commit is contained in:
parent
b30640d749
commit
fb27eb5d1e
1 changed files with 5 additions and 7 deletions
|
@ -10,7 +10,7 @@ namespace Ryujinx.HLE.OsHle.Services.Spl
|
||||||
|
|
||||||
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
||||||
|
|
||||||
private RNGCryptoServiceProvider CspRnd;
|
private RNGCryptoServiceProvider Rng;
|
||||||
|
|
||||||
public IRandomInterface()
|
public IRandomInterface()
|
||||||
{
|
{
|
||||||
|
@ -19,18 +19,16 @@ namespace Ryujinx.HLE.OsHle.Services.Spl
|
||||||
{ 0, GetRandomBytes }
|
{ 0, GetRandomBytes }
|
||||||
};
|
};
|
||||||
|
|
||||||
CspRnd = new RNGCryptoServiceProvider();
|
Rng = new RNGCryptoServiceProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetRandomBytes(ServiceCtx Context)
|
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(Context.Request.ReceiveBuff[0].Position, RandomBytes);
|
||||||
|
|
||||||
Context.Memory.WriteBytes(Position, BytesBuffer);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue