From 7de7b559adc1924d3ff31cc58b281f70e468155f Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 23 Sep 2018 15:11:46 -0300 Subject: Improve kernel events implementation (#430) * Improve kernel events implementation * Some cleanup * Address PR feedback --- Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Ryujinx.HLE/HOS/Services/Pl') diff --git a/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs b/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs index 92821217..d73adc0e 100644 --- a/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs +++ b/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs @@ -1,5 +1,7 @@ using Ryujinx.HLE.HOS.Font; using Ryujinx.HLE.HOS.Ipc; +using Ryujinx.HLE.HOS.Kernel; +using System; using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Pl @@ -65,7 +67,10 @@ namespace Ryujinx.HLE.HOS.Services.Pl { Context.Device.System.Font.EnsureInitialized(); - int Handle = Context.Process.HandleTable.OpenHandle(Context.Device.System.FontSharedMem); + if (Context.Process.HandleTable.GenerateHandle(Context.Device.System.FontSharedMem, out int Handle) != KernelResult.Success) + { + throw new InvalidOperationException("Out of handles!"); + } Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle); -- cgit v1.2.3