]> Chaos Git - corbenik/ctrulib.git/commitdiff
Added bossSetStorageInfo().
authoryellows8 <yellows8@users.noreply.github.com>
Mon, 26 Dec 2016 06:43:12 +0000 (01:43 -0500)
committeryellows8 <yellows8@users.noreply.github.com>
Mon, 26 Dec 2016 06:43:12 +0000 (01:43 -0500)
libctru/include/3ds/services/boss.h
libctru/source/services/boss.c

index 3b9c68edb16b2e246cc1aa0869065b322fa595da..6d65906c31cc9a14a722ecddab9b27757133046c 100644 (file)
@@ -57,6 +57,14 @@ void bossExit(void);
 /// Returns the BOSS session handle.
 Handle bossGetSessionHandle(void);
 
+/**
+ * @brief Set the content data storage location.
+ * @param extdataID u64 extdataID, must have the high word set to the shared-extdata value when it's for NAND.
+ * @param boss_size Probably the max size in the extdata which BOSS can use.
+ * @param mediaType Roughly the same as FS mediatype.
+ */
+Result bossSetStorageInfo(u64 extdataID, u32 boss_size, u8 mediaType);
+
 /**
  * @brief Register a task.
  * @param taskID BOSS taskID.
index f7dc6c00fbbc2033ec65b0f458b7df9f6babd45f..cc1631da1eea9297c573c7bee361609f4941307d 100644 (file)
@@ -81,6 +81,22 @@ static Result bossipc_InitializeSession(u64 programID)
        return (Result)cmdbuf[1];
 }
 
+Result bossSetStorageInfo(u64 extdataID, u32 boss_size, u8 mediaType)
+{
+       Result ret = 0;
+       u32 *cmdbuf = getThreadCommandBuffer();
+
+       cmdbuf[0] = IPC_MakeHeader(0x2,4,0); // 0x20100
+       cmdbuf[1] = (u32) extdataID;
+       cmdbuf[2] = (u32) (extdataID >> 32);
+       cmdbuf[3] = boss_size;
+       cmdbuf[4] = mediaType;
+
+       if(R_FAILED(ret = svcSendSyncRequest(bossHandle)))return ret;
+
+       return (Result)cmdbuf[1];
+}
+
 Result bossRegisterTask(const char *taskID, u8 unk0, u8 unk1)
 {
        Result ret = 0;