From: yellows8 Date: Mon, 26 Dec 2016 00:21:20 +0000 (-0500) Subject: Added force_user param to bossInit(). X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=95bcb4d69a990aa3b742fb4225414c91eab00143;p=corbenik%2Fctrulib.git Added force_user param to bossInit(). --- diff --git a/libctru/include/3ds/services/boss.h b/libctru/include/3ds/services/boss.h index 6b179c4..3b9c68e 100644 --- a/libctru/include/3ds/services/boss.h +++ b/libctru/include/3ds/services/boss.h @@ -47,8 +47,9 @@ typedef enum { /** * @brief Initializes BOSS. * @param programID programID to use, 0 for the current process. Not used internally unless BOSSP is available. + * @param force_user When true, just use bossU instead of trying to initialize with bossP first. */ -Result bossInit(u64 programID); +Result bossInit(u64 programID, bool force_user); /// Exits BOSS. void bossExit(void); diff --git a/libctru/source/services/boss.c b/libctru/source/services/boss.c index d5098b4..f7dc6c0 100644 --- a/libctru/source/services/boss.c +++ b/libctru/source/services/boss.c @@ -15,7 +15,7 @@ static u32 bossPriv = 0; static Result bossipc_InitializeSession(u64 programID); -Result bossInit(u64 programID) +Result bossInit(u64 programID, bool force_user) { Result res=0; Handle envhandle=0; @@ -23,9 +23,15 @@ Result bossInit(u64 programID) if (AtomicPostIncrement(&bossRefCount)) return 0; - res = srvGetServiceHandle(&handle, "boss:P"); - envhandle = envGetHandle("boss:P"); - bossPriv = 1; + res = -1; + + if(!force_user) + { + res = srvGetServiceHandle(&handle, "boss:P"); + envhandle = envGetHandle("boss:P"); + bossPriv = 1; + } + if (R_FAILED(res)) { bossPriv = 0;