mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-08-19 21:52:22 +00:00
[hipc] Fix 'Unexpected result code Success returned' in Reply() (#4215)
* horizon: Add AbortOnFailureUnless() * hipc: Replace AbortUnless() with AbortOnFailureUnless() in Reply()
This commit is contained in:
parent
38519f3b9a
commit
81fae0d1a6
|
@ -100,6 +100,14 @@ namespace Ryujinx.Horizon.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AbortOnFailureUnless(Result result, Result result2)
|
||||||
|
{
|
||||||
|
if (this != Success && this != result && this != result2)
|
||||||
|
{
|
||||||
|
ThrowInvalidResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ThrowInvalidResult()
|
private void ThrowInvalidResult()
|
||||||
{
|
{
|
||||||
throw new InvalidResultException(this);
|
throw new InvalidResultException(this);
|
||||||
|
@ -115,4 +123,4 @@ namespace Ryujinx.Horizon.Common
|
||||||
return PrintableResult;
|
return PrintableResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -51,7 +51,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||||
{
|
{
|
||||||
Result result = ReplyImpl(sessionHandle, messageBuffer);
|
Result result = ReplyImpl(sessionHandle, messageBuffer);
|
||||||
|
|
||||||
result.AbortUnless(KernelResult.TimedOut, KernelResult.PortRemoteClosed);
|
result.AbortOnFailureUnless(KernelResult.TimedOut, KernelResult.PortRemoteClosed);
|
||||||
|
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
|
@ -86,4 +86,4 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue