diff --git a/nx/include/switch/services/applet.h b/nx/include/switch/services/applet.h index dac8bce0..caed849d 100644 --- a/nx/include/switch/services/applet.h +++ b/nx/include/switch/services/applet.h @@ -315,6 +315,12 @@ Result appletHolderGetIndirectLayerConsumerHandle(AppletHolder *h, u64 *out); */ Result appletHolderStart(AppletHolder *h); +/** + * @brief Requests the LibraryApplet to exit. The command is only used if \ref appletHolderCheckFinished returns false. + * @param h AppletHolder object. + */ +Result appletHolderRequestExit(AppletHolder *h); + /** * @brief Waits for the LibraryApplet to exit. * @param h AppletHolder object. diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index 2166ec7b..ae521cd5 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -1955,6 +1955,17 @@ Result appletHolderStart(AppletHolder *h) { return rc; } +Result appletHolderRequestExit(AppletHolder *h) { + Result rc=0; + + if (!serviceIsActive(&h->s)) + return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); + + if (!appletHolderCheckFinished(h)) rc = _appletCmdNoIO(&h->s, 20);//RequestExit + + return rc; +} + void appletHolderJoin(AppletHolder *h) { Result rc=0; LibAppletExitReason res = LibAppletExitReason_Normal;