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};