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;