diff options
| author | emmauss <emmausssss@gmail.com> | 2018-08-24 20:20:42 +0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-08-24 14:20:42 -0300 |
| commit | da7e7027518c40702536d4c51905ae7cb496cdb5 (patch) | |
| tree | 940fa8d450cf36fdd50314fcc5030f60a57218cc /Ryujinx.HLE/HOS/Ipc | |
| parent | 624e813cd3e5d782847c577c2da0cfb8a121fd18 (diff) | |
Update BSD service implementation (#363)
* Update BSD service to handle libnx's 'smart IPC buffers' for address info
* Use existing "GetBufferType0x21" for certain BSD socket methods
* Parse address port as unsigned short
* Fix bounds check on reading the IPC buffer
* Implement Read, Write methods
* rebased and cleaned
* addressed nits
* remove unused swap method
* fixed alignments
Diffstat (limited to 'Ryujinx.HLE/HOS/Ipc')
| -rw-r--r-- | Ryujinx.HLE/HOS/Ipc/IpcMessage.cs | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs b/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs index c8153fdb..02900444 100644 --- a/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs +++ b/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs @@ -174,39 +174,39 @@ namespace Ryujinx.HLE.HOS.Ipc return 0; } - public (long Position, long Size) GetBufferType0x21() + public (long Position, long Size) GetBufferType0x21(int Index = 0) { - if (PtrBuff.Count != 0 && - PtrBuff[0].Position != 0 && - PtrBuff[0].Size != 0) + if (PtrBuff.Count > Index && + PtrBuff[Index].Position != 0 && + PtrBuff[Index].Size != 0) { - return (PtrBuff[0].Position, PtrBuff[0].Size); + return (PtrBuff[Index].Position, PtrBuff[Index].Size); } - if (SendBuff.Count != 0 && - SendBuff[0].Position != 0 && - SendBuff[0].Size != 0) + if (SendBuff.Count > Index && + SendBuff[Index].Position != 0 && + SendBuff[Index].Size != 0) { - return (SendBuff[0].Position, SendBuff[0].Size); + return (SendBuff[Index].Position, SendBuff[Index].Size); } return (0, 0); } - public (long Position, long Size) GetBufferType0x22() + public (long Position, long Size) GetBufferType0x22(int Index = 0) { - if (RecvListBuff.Count != 0 && - RecvListBuff[0].Position != 0 && - RecvListBuff[0].Size != 0) + if (RecvListBuff.Count > Index && + RecvListBuff[Index].Position != 0 && + RecvListBuff[Index].Size != 0) { - return (RecvListBuff[0].Position, RecvListBuff[0].Size); + return (RecvListBuff[Index].Position, RecvListBuff[Index].Size); } - if (ReceiveBuff.Count != 0 && - ReceiveBuff[0].Position != 0 && - ReceiveBuff[0].Size != 0) + if (ReceiveBuff.Count > Index && + ReceiveBuff[Index].Position != 0 && + ReceiveBuff[Index].Size != 0) { - return (ReceiveBuff[0].Position, ReceiveBuff[0].Size); + return (ReceiveBuff[Index].Position, ReceiveBuff[Index].Size); } return (0, 0); |
