aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/IpcService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/IpcService.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/IpcService.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Ryujinx.HLE/HOS/Services/IpcService.cs b/Ryujinx.HLE/HOS/Services/IpcService.cs
index 8e487d55..e9d82000 100644
--- a/Ryujinx.HLE/HOS/Services/IpcService.cs
+++ b/Ryujinx.HLE/HOS/Services/IpcService.cs
@@ -132,7 +132,10 @@ namespace Ryujinx.HLE.HOS.Services
{
KSession Session = new KSession(Obj, Context.Session.ServiceName);
- int Handle = Context.Process.HandleTable.OpenHandle(Session);
+ if (Context.Process.HandleTable.GenerateHandle(Session, out int Handle) != KernelResult.Success)
+ {
+ throw new InvalidOperationException("Out of handles!");
+ }
Context.Response.HandleDesc = IpcHandleDesc.MakeMove(Handle);
}
@@ -146,7 +149,7 @@ namespace Ryujinx.HLE.HOS.Services
{
int Handle = Context.Request.HandleDesc.ToMove[Index];
- KSession Session = Context.Process.HandleTable.GetData<KSession>(Handle);
+ KSession Session = Context.Process.HandleTable.GetObject<KSession>(Handle);
return Session?.Service is T ? (T)Session.Service : null;
}