nn::boss::RegisterStorage Functionnn::Result RegisterStorage( bit32 storageId, size_t storageSize, u16 entryCount, nn::boss::StorageType storageType = nn::boss::USER_EXT_SAVEDATA_STORAGE );
| Name | Description | |
|---|---|---|
| in | storageId | Specifies the ID of an expanded save data region that creates BOSS storage. |
| in | storageSize |
Specifies the maximum total size of files that can be held in BOSS storage. |
| in | entryCount |
Specifies the maximum number of NS data entries that can be held in BOSS storage. |
| in | storageType | Specifies the BOSS storage type. (Omit this because usually the default BOSS storage for the user's expanded save data region is used.) |
Result values listed below. | Value | Description |
|---|---|
Result::IsSuccess |
Registration successful. |
ResultStorageAccessPermission |
You do not have storage access rights. Reconfirm your access rights. |
ResultIpcNotSessionInitialized |
The session has not been initialized. This result is returned if this function is called before the Initialize function. Always call the Initialize function before using the BOSS library. |
| A value other than the above. | Unexpected error (see boss_Result.h for error details). |
Registers BOSS storage.
BOSS storage must be registered before registering or executing NADL tasks.
NS data cannot be downloaded if the storage is not registered.
Before registering BOSS storage, you must first create an extended save data region in memory.
You must also create an expanded save data region, while specifying more than the total number of NS data files to be stored.
This function returns an error if you specify an expanded save data region ID in the storageID argument to which the application does not have access rights.
When downloading NS data, if the total size of NS data for BOSS storage exceeds the maximum data size, the NS data having the oldest serial ID (=the lowest serial ID) is automatically deleted. Similarly, even if the amount of NS data in BOSS storage exceeds entryCount, the NS data having the oldest serial ID (=the lowest serial ID) is automatically deleted.
1) To get NS data without the application registering a task
If an application has already registered BOSS storage, and NS data addressed to that application is included in an NS archive downloaded by a task registered by another application, that NS data is automatically downloaded to the BOSS storage already registered.
2) To download NS data addressed to the application that registers a task
If the application registers BOSS storage and then registers and runs a task, it can download NS data addressed to the application and store it in the BOSS storage specified when it registered the task. In addition, the same as with 1) above, if NS data addressed to the application that registered BOSS storage is included in an NS archive downloaded by a task registered by another application, that NS data is automatically downloaded to the BOSS storage already registered.
3) To share NS data with another application
You can get NS data downloaded to another application by registering BOSS storage ahead of time in the same extended save data region as that for another application. An application can even get this NS data from other applications when it downloads its own NS data. For more information on these operations, see the GetNsDataIdList and GetNewDataNsDataIdList functions.
CONFIDENTIAL