aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs b/Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs
index bb664e55..0bb4123f 100644
--- a/Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs
+++ b/Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs
@@ -17,17 +17,17 @@ namespace Ryujinx.HLE.HOS.Services.Fs
// ReadSaveDataInfo() -> (u64, buffer<unknown, 6>)
public ResultCode ReadSaveDataInfo(ServiceCtx context)
{
- ulong bufferPosition = context.Request.ReceiveBuff[0].Position;
+ ulong bufferAddress = context.Request.ReceiveBuff[0].Position;
ulong bufferLen = context.Request.ReceiveBuff[0].Size;
- byte[] infoBuffer = new byte[bufferLen];
-
- Result result = _baseReader.Get.Read(out long readCount, new OutBuffer(infoBuffer));
+ using (var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true))
+ {
+ Result result = _baseReader.Get.Read(out long readCount, new OutBuffer(region.Memory.Span));
- context.Memory.Write(bufferPosition, infoBuffer);
- context.ResponseData.Write(readCount);
+ context.ResponseData.Write(readCount);
- return (ResultCode)result.Value;
+ return (ResultCode)result.Value;
+ }
}
protected override void Dispose(bool isDisposing)