diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-01-08 15:34:49 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-08 15:34:49 -0300 |
commit | 6f60e102a29aa04fff5c6bcdec37213b2d8ac646 (patch) | |
tree | 28d6bbe66452006603f1bd901acf4cc483c244cb | |
parent | eeb2af9953f48479c3a902664f31634e6a2148be (diff) |
HIPC: Fix reply possibly also receiving one request (#4232)1.1.521
-rw-r--r-- | Ryujinx.Horizon.Common/Result.cs | 8 | ||||
-rw-r--r-- | Ryujinx.Horizon/Sdk/Sf/Hipc/Api.cs | 8 |
2 files changed, 2 insertions, 14 deletions
diff --git a/Ryujinx.Horizon.Common/Result.cs b/Ryujinx.Horizon.Common/Result.cs index ac843688..28056310 100644 --- a/Ryujinx.Horizon.Common/Result.cs +++ b/Ryujinx.Horizon.Common/Result.cs @@ -100,14 +100,6 @@ namespace Ryujinx.Horizon.Common } } - public void AbortOnFailureUnless(Result result, Result result2) - { - if (this != Success && this != result && this != result2) - { - ThrowInvalidResult(); - } - } - private void ThrowInvalidResult() { throw new InvalidResultException(this); diff --git a/Ryujinx.Horizon/Sdk/Sf/Hipc/Api.cs b/Ryujinx.Horizon/Sdk/Sf/Hipc/Api.cs index 822a4b4a..33c42825 100644 --- a/Ryujinx.Horizon/Sdk/Sf/Hipc/Api.cs +++ b/Ryujinx.Horizon/Sdk/Sf/Hipc/Api.cs @@ -51,22 +51,18 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc { Result result = ReplyImpl(sessionHandle, messageBuffer); - result.AbortOnFailureUnless(KernelResult.TimedOut, KernelResult.PortRemoteClosed); + result.AbortUnless(KernelResult.TimedOut, KernelResult.PortRemoteClosed); return Result.Success; } private static Result ReplyImpl(int sessionHandle, ReadOnlySpan<byte> messageBuffer) { - Span<int> handles = stackalloc int[1]; - - handles[0] = sessionHandle; - var tlsSpan = HorizonStatic.AddressSpace.GetSpan(HorizonStatic.ThreadContext.TlsAddress, TlsMessageBufferSize); if (messageBuffer == tlsSpan) { - return HorizonStatic.Syscall.ReplyAndReceive(out _, handles, sessionHandle, 0); + return HorizonStatic.Syscall.ReplyAndReceive(out _, ReadOnlySpan<int>.Empty, sessionHandle, 0); } else { |