From 3513c91c3cd495bc603b76479a42b60c0ce9f0e7 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Fri, 17 Aug 2018 21:55:37 -0400 Subject: [PATCH] Added the remaining init for AppletType_SystemApplet. --- nx/source/services/applet.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index 02cf1eb3..f4733d9e 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -21,6 +21,9 @@ static u64 g_refCnt; // From Get*Functions. static Service g_appletIFunctions; +static Service g_appletIGlobalStateController; +static Service g_appletIApplicationCreator; + static Service g_appletILibraryAppletSelfAccessor; static Service g_appletIProcessWindingController; @@ -125,7 +128,14 @@ Result appletInitialize(void) if (R_SUCCEEDED(rc) && __nx_applet_type != AppletType_LibraryApplet) rc = _appletGetSession(&g_appletProxySession, &g_appletIFunctions, 20); - // TODO: Add non-{Application/LibraryApplet} type-specific session init here. + if (R_SUCCEEDED(rc) && __nx_applet_type == AppletType_SystemApplet) { + //GetGlobalStateController + rc = _appletGetSession(&g_appletProxySession, &g_appletIGlobalStateController, 21); + + //GetApplicationCreator + if (R_SUCCEEDED(rc)) + rc = _appletGetSession(&g_appletProxySession, &g_appletIApplicationCreator, 22); + } if (R_SUCCEEDED(rc) && __nx_applet_type == AppletType_LibraryApplet) { //GetLibraryAppletSelfAccessor @@ -260,6 +270,11 @@ void appletExit(void) serviceClose(&g_appletICommonStateGetter); serviceClose(&g_appletILibraryAppletCreator); + if (__nx_applet_type == AppletType_SystemApplet) { + serviceClose(&g_appletIApplicationCreator); + serviceClose(&g_appletIGlobalStateController); + } + if (__nx_applet_type != AppletType_LibraryApplet) serviceClose(&g_appletIFunctions);