Added force_user param to bossInit().

This commit is contained in:
yellows8 2016-12-25 19:21:20 -05:00
parent 7ccfe71e45
commit 95bcb4d69a
2 changed files with 12 additions and 5 deletions

View File

@ -47,8 +47,9 @@ typedef enum {
/** /**
* @brief Initializes BOSS. * @brief Initializes BOSS.
* @param programID programID to use, 0 for the current process. Not used internally unless BOSSP is available. * @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. /// Exits BOSS.
void bossExit(void); void bossExit(void);

View File

@ -15,7 +15,7 @@ static u32 bossPriv = 0;
static Result bossipc_InitializeSession(u64 programID); static Result bossipc_InitializeSession(u64 programID);
Result bossInit(u64 programID) Result bossInit(u64 programID, bool force_user)
{ {
Result res=0; Result res=0;
Handle envhandle=0; Handle envhandle=0;
@ -23,9 +23,15 @@ Result bossInit(u64 programID)
if (AtomicPostIncrement(&bossRefCount)) return 0; if (AtomicPostIncrement(&bossRefCount)) return 0;
res = -1;
if(!force_user)
{
res = srvGetServiceHandle(&handle, "boss:P"); res = srvGetServiceHandle(&handle, "boss:P");
envhandle = envGetHandle("boss:P"); envhandle = envGetHandle("boss:P");
bossPriv = 1; bossPriv = 1;
}
if (R_FAILED(res)) if (R_FAILED(res))
{ {
bossPriv = 0; bossPriv = 0;