From 299d11d86fd7a0a13572c1245b1510ced271bee3 Mon Sep 17 00:00:00 2001 From: PabloG02 Date: Mon, 9 Jan 2023 10:36:57 +0100 Subject: [PATCH] Stub IApplicationFunctions::GetNotificationStorageChannelEvent --- .../services/am/controller/IApplicationFunctions.cpp | 10 +++++++++- .../services/am/controller/IApplicationFunctions.h | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp b/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp index 150ccdee..19e353d8 100644 --- a/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp +++ b/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp @@ -14,7 +14,8 @@ namespace skyline::service::am { IApplicationFunctions::IApplicationFunctions(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager), gpuErrorEvent(std::make_shared(state, false)), - friendInvitationStorageChannelEvent(std::make_shared(state, false)) {} + friendInvitationStorageChannelEvent(std::make_shared(state, false)), + notificationStorageChannelEvent(std::make_shared(state, false)) {} Result IApplicationFunctions::PopLaunchParameter(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { constexpr u32 LaunchParameterMagic{0xC79497CA}; //!< The magic of the application launch parameters @@ -182,4 +183,11 @@ namespace skyline::service::am { Result IApplicationFunctions::TryPopFromFriendInvitationStorageChannel(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { return result::NotAvailable; } + + Result IApplicationFunctions::GetNotificationStorageChannelEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + auto handle{state.process->InsertItem(notificationStorageChannelEvent)}; + Logger::Warn("Notification Storage Channel Event Handle: 0x{:X}", handle); + response.copyHandles.push_back(handle); + return {}; + } } diff --git a/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.h b/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.h index 37456bdf..07b05218 100644 --- a/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.h +++ b/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.h @@ -21,6 +21,7 @@ namespace skyline::service::am { private: std::shared_ptr gpuErrorEvent; //!< The event signalled on GPU errors std::shared_ptr friendInvitationStorageChannelEvent; //!< The event signalled on friend invitations + std::shared_ptr notificationStorageChannelEvent; i32 previousProgramIndex{-1}; //!< There was no previous title public: @@ -131,6 +132,12 @@ namespace skyline::service::am { Result TryPopFromFriendInvitationStorageChannel(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** + * @brief Obtains a handle to the Notification StorageChannel KEvent + * @url https://switchbrew.org/wiki/Applet_Manager_services#GetNotificationStorageChannelEvent + */ + Result GetNotificationStorageChannelEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + SERVICE_DECL( SFUNC(0x1, IApplicationFunctions, PopLaunchParameter), SFUNC(0x14, IApplicationFunctions, EnsureSaveData), @@ -150,7 +157,8 @@ namespace skyline::service::am { SFUNC(0x7B, IApplicationFunctions, GetPreviousProgramIndex), SFUNC(0x82, IApplicationFunctions, GetGpuErrorDetectedSystemEvent), SFUNC(0x8C, IApplicationFunctions, GetFriendInvitationStorageChannelEvent), - SFUNC(0x8D, IApplicationFunctions, TryPopFromFriendInvitationStorageChannel) + SFUNC(0x8D, IApplicationFunctions, TryPopFromFriendInvitationStorageChannel), + SFUNC(0x96, IApplicationFunctions, GetNotificationStorageChannelEvent) ) };