Move WriteBytes to AMemory, implement it with a Marshal copy like ReadBytes, fix regression on address range checking
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using ChocolArm64.Memory;
|
||||
using Ryujinx.Core.OsHle.Ipc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -78,7 +77,7 @@ namespace Ryujinx.Core.OsHle.Services.FspSrv
|
||||
|
||||
byte[] NameBuffer = Encoding.UTF8.GetBytes(Path.GetFileName(FullPath));
|
||||
|
||||
AMemoryHelper.WriteBytes(Context.Memory, Position, NameBuffer);
|
||||
Context.Memory.WriteBytes(Position, NameBuffer);
|
||||
|
||||
int Type = 0;
|
||||
long Size = 0;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using ChocolArm64.Memory;
|
||||
using Ryujinx.Core.OsHle.Ipc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -47,7 +46,7 @@ namespace Ryujinx.Core.OsHle.Services.FspSrv
|
||||
|
||||
int ReadSize = BaseStream.Read(Data, 0, (int)Size);
|
||||
|
||||
AMemoryHelper.WriteBytes(Context.Memory, Position, Data);
|
||||
Context.Memory.WriteBytes(Position, Data);
|
||||
|
||||
Context.ResponseData.Write((long)ReadSize);
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using ChocolArm64.Memory;
|
||||
using Ryujinx.Core.OsHle.Ipc;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -43,7 +42,7 @@ namespace Ryujinx.Core.OsHle.Services.FspSrv
|
||||
BaseStream.Seek(Offset, SeekOrigin.Begin);
|
||||
BaseStream.Read(Data, 0, Data.Length);
|
||||
|
||||
AMemoryHelper.WriteBytes(Context.Memory, BuffDesc.Position, Data);
|
||||
Context.Memory.WriteBytes(BuffDesc.Position, Data);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user