From d353213d7259ba3d8935692d86116565942c7790 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Mon, 4 Mar 2019 10:42:07 -0500 Subject: [PATCH] Added appletHolderRequestExit. --- 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 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;