Added bossReinit() and bossUnregisterStorage(). Updated comments for bossInit().

This commit is contained in:
yellows8 2016-12-27 18:04:17 -05:00
parent d14fa59ba5
commit 47d9585624
2 changed files with 29 additions and 1 deletions

View File

@ -46,11 +46,17 @@ typedef enum {
/**
* @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. Only used when BOSSP is available without *hax payload.
* @param force_user When true, just use bossU instead of trying to initialize with bossP first.
*/
Result bossInit(u64 programID, bool force_user);
/**
* @brief Run the InitializeSession service cmd. This is mainly for changing the programID associated with the current BOSS session.
* @param programID programID to use, 0 for the current process.
*/
Result bossReinit(u64 programID);
/// Exits BOSS.
void bossExit(void);
@ -65,6 +71,11 @@ Handle bossGetSessionHandle(void);
*/
Result bossSetStorageInfo(u64 extdataID, u32 boss_size, u8 mediaType);
/**
* @brief Unregister the content data storage location, which includes unregistering the BOSS-session programID with BOSS.
*/
Result bossUnregisterStorage(void);
/**
* @brief Register a task.
* @param taskID BOSS taskID.

View File

@ -53,6 +53,11 @@ Result bossInit(u64 programID, bool force_user)
return res;
}
Result bossReinit(u64 programID)
{
return bossipc_InitializeSession(programID);
}
void bossExit(void)
{
if (AtomicDecrement(&bossRefCount)) return;
@ -97,6 +102,18 @@ Result bossSetStorageInfo(u64 extdataID, u32 boss_size, u8 mediaType)
return (Result)cmdbuf[1];
}
Result bossUnregisterStorage(void)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x3,0,0); // 0x30000
if(R_FAILED(ret = svcSendSyncRequest(bossHandle)))return ret;
return (Result)cmdbuf[1];
}
Result bossRegisterTask(const char *taskID, u8 unk0, u8 unk1)
{
Result ret = 0;