From 50ba233ac628ffb9661ea2bda2cda216d18e81c1 Mon Sep 17 00:00:00 2001 From: Ac_K Date: Tue, 22 Jun 2021 19:32:22 +0200 Subject: [PATCH] ipc: Remove size checks for buffer type 0x21/0x22 (#2387) * ipc: Remove size checks for buffer type 0x21/0x22 Since original IPC implementation doesn't check the buffers size, there is no reason to check them so I've removed it. Checking the buffers addresses could prevent to unexpected behaviors. That's fix a bsd service issue with some homebrew and some games like Knockout City (https://github.com/Ryujinx/Ryujinx-Games-List/issues/3622) which is now bootable: * addresses gdkchan's review --- Ryujinx.HLE/HOS/Ipc/IpcMessage.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs b/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs index e5b9bf046..09e237fe5 100644 --- a/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs +++ b/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs @@ -246,16 +246,12 @@ namespace Ryujinx.HLE.HOS.Ipc // ReSharper disable once InconsistentNaming public (ulong Position, ulong Size) GetBufferType0x21(int index = 0) { - if (PtrBuff.Count > index && - PtrBuff[index].Position != 0 && - PtrBuff[index].Size != 0) + if (PtrBuff.Count > index && PtrBuff[index].Position != 0) { return (PtrBuff[index].Position, PtrBuff[index].Size); } - if (SendBuff.Count > index && - SendBuff[index].Position != 0 && - SendBuff[index].Size != 0) + if (SendBuff.Count > index) { return (SendBuff[index].Position, SendBuff[index].Size); } @@ -266,16 +262,12 @@ namespace Ryujinx.HLE.HOS.Ipc // ReSharper disable once InconsistentNaming public (ulong Position, ulong Size) GetBufferType0x22(int index = 0) { - if (RecvListBuff.Count > index && - RecvListBuff[index].Position != 0 && - RecvListBuff[index].Size != 0) + if (RecvListBuff.Count > index && RecvListBuff[index].Position != 0) { return (RecvListBuff[index].Position, RecvListBuff[index].Size); } - if (ReceiveBuff.Count > index && - ReceiveBuff[index].Position != 0 && - ReceiveBuff[index].Size != 0) + if (ReceiveBuff.Count > index) { return (ReceiveBuff[index].Position, ReceiveBuff[index].Size); }