From cc3a3f1b5d2405537450f6e78b997d0feb42fc60 Mon Sep 17 00:00:00 2001 From: Shyanne Date: Sat, 14 Mar 2026 16:44:00 -0400 Subject: [PATCH] handled the handles --- .../INotificationSystemEventAccessor.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Notification/INotificationSystemEventAccessor.cs b/src/Ryujinx.HLE/HOS/Services/Notification/INotificationSystemEventAccessor.cs index 1f34d4496..8cca7cc6e 100644 --- a/src/Ryujinx.HLE/HOS/Services/Notification/INotificationSystemEventAccessor.cs +++ b/src/Ryujinx.HLE/HOS/Services/Notification/INotificationSystemEventAccessor.cs @@ -1,16 +1,31 @@ using Ryujinx.Common.Logging; +using Ryujinx.HLE.HOS.Ipc; +using Ryujinx.HLE.HOS.Kernel.Threading; +using Ryujinx.Horizon.Common; +using System; namespace Ryujinx.HLE.HOS.Services.Notification { class INotificationSystemEventAccessor : IpcService { + + private readonly KEvent _getNotificationSendingNotifierEvent; + private int _getNotificationSendingNotifierEventHandle; public INotificationSystemEventAccessor(ServiceCtx context) { } - + [CommandCmif(0)] // 9.0.0+ // GetNotificationSendingNotifier() -> nn::notification::server::INotificationSystemEventAccessor public ResultCode GetSystemEvent(ServiceCtx context) { - Logger.Stub?.PrintStub(LogClass.ServiceNotification); + if (_getNotificationSendingNotifierEventHandle == 0) + { + if (context.Process.HandleTable.GenerateHandle(_getNotificationSendingNotifierEvent.ReadableEvent, out _getNotificationSendingNotifierEventHandle) != Result.Success) + { + throw new InvalidOperationException("Out of handles!"); + } + } + + context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_getNotificationSendingNotifierEventHandle); return ResultCode.Success; } }