aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs b/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
index c56d65db..0c26b7d9 100644
--- a/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
+++ b/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
@@ -1,5 +1,6 @@
using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Kernel;
+using System;
using System.Collections.Generic;
namespace Ryujinx.HLE.HOS.Services.Sm
@@ -59,7 +60,10 @@ namespace Ryujinx.HLE.HOS.Services.Sm
KSession Session = new KSession(ServiceFactory.MakeService(Context.Device.System, Name), Name);
- 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);