aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-12-12 00:06:20 -0300
committerGitHub <noreply@github.com>2020-12-12 14:06:20 +1100
commit74aa7b20be5ef924f3e8cbde699fcf4f8431f750 (patch)
tree173851ac0907333cf4b62467b1763fdbf9c8816a /Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator
parent06057a99a653b83389447a9c56d926c463317b47 (diff)
Rewrite size for fixed size buffers (#1808)
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator')
-rw-r--r--Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheProgressService.cs13
1 files changed, 5 insertions, 8 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheProgressService.cs b/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheProgressService.cs
index 54b1a58a..741f3363 100644
--- a/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheProgressService.cs
+++ b/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheProgressService.cs
@@ -1,5 +1,6 @@
using Ryujinx.Common;
using Ryujinx.Common.Logging;
+using Ryujinx.Cpu;
using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Threading;
@@ -48,21 +49,17 @@ namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
Result = 0
};
- WriteDeliveryCacheProgressImpl(context, context.Request.RecvListBuff[0], deliveryCacheProgress);
+ long dcpSize = WriteDeliveryCacheProgressImpl(context, context.Request.RecvListBuff[0], deliveryCacheProgress);
+ context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize(dcpSize);
Logger.Stub?.PrintStub(LogClass.ServiceBcat);
return ResultCode.Success;
}
- private void WriteDeliveryCacheProgressImpl(ServiceCtx context, IpcRecvListBuffDesc ipcDesc, DeliveryCacheProgressImpl deliveryCacheProgress)
+ private long WriteDeliveryCacheProgressImpl(ServiceCtx context, IpcRecvListBuffDesc ipcDesc, DeliveryCacheProgressImpl deliveryCacheProgress)
{
- using (MemoryStream memory = new MemoryStream((int)ipcDesc.Size))
- using (BinaryWriter bufferWriter = new BinaryWriter(memory))
- {
- bufferWriter.WriteStruct(deliveryCacheProgress);
- context.Memory.Write((ulong)ipcDesc.Position, memory.ToArray());
- }
+ return MemoryHelper.Write(context.Memory, ipcDesc.Position, deliveryCacheProgress);
}
}
} \ No newline at end of file