From e069da432066c8d1c700271143f2122fd2cd9d30 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Tue, 20 Aug 2019 11:44:55 -0400 Subject: [PATCH] Added appletHolderTerminate. --- nx/include/switch/services/applet.h | 6 ++++++ nx/source/services/applet.c | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/nx/include/switch/services/applet.h b/nx/include/switch/services/applet.h index a869cfdb..e8bb425a 100644 --- a/nx/include/switch/services/applet.h +++ b/nx/include/switch/services/applet.h @@ -979,6 +979,12 @@ Result appletHolderJump(AppletHolder *h); */ Result appletHolderRequestExit(AppletHolder *h); +/** + * @brief Terminate the LibraryApplet. + * @param h AppletHolder object. + */ +Result appletHolderTerminate(AppletHolder *h); + /** * @brief Uses cmds GetAppletStateChangedEvent and RequestExit, then waits for the LibraryApplet to exit with the specified timeout. If a timeout occurs, the Terminate cmd is used. * @param h AppletHolder object. diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index 5a512ff5..75701eb1 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -2993,6 +2993,17 @@ Result appletHolderRequestExit(AppletHolder *h) { return rc; } +Result appletHolderTerminate(AppletHolder *h) { + Result rc=0; + + if (!serviceIsActive(&h->s)) + return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); + + rc = _appletCmdNoIO(&h->s, 25);//Terminate + + return rc; +} + static Result _appletAccessorRequestExitOrTerminate(Service* srv, u64 timeout) { Result rc=0; Event StateChangedEvent={0};