nn::boss::RegisterStorage Functionnn::Result RegisterStorage( bit32 storageId, size_t size, nn::boss::StorageType storageType = nn::boss::USER_EXT_SAVEDATA_STORAGE );
| Name | Description | |
|---|---|---|
| in | storageId | Specifies the storage (additional data) identifier. |
| in | size | Specifies the total maximum usable size within the storage region. |
| in | storageType | Specifies the type of the storage region. (Omit this because usually the default BOSS storage for the user's expanded save data is used.) |
Result values listed below. | Value | Description |
|---|---|
ResultSuccess |
Registration successful. |
ResultStorageAccessPermission |
You do not have permission to access storage. Reconfirm tour access rights. |
ResultIpcNotSessionInitialized |
Either a session had not been initialized or there were incompatible permissions. This Result value is returned if you call this function before Initialize or InitializePrivileged. Always call Initialize or InitializePrivileged first when you use the BOSS library. |
| A value other than the above. | Unexpected error (see boss_Result.h for details). |
Registers the BOSS storage that is used by BOSSD for NSA tasks and other purposes. An expanded save data region must be created ahead of time before registration. Allocate a total size that can accommodate the value specified by the size argument. Furthermore, when creating this you must specify a number of files that is greater than the total number of serial IDs you want to store. An error will be returned if you specify an expanded save data ID to which the application does not have access rights. If you do not register this, you cannot download NS data.
(1) To get NS data even though application has not registered task
By registering BOSS storage, any NS data in the NSA format downloaded by the administrator that is addressed to the application will be automatically copied to that registered storage.
(2) To download NS data addressed to an application after registering task from application
By registering BOSS storage and then registering and executing tasks, you can download NS data addressed to the application. Like situation #1, if there is any NS data addressed to the application within the NSA format downloaded by the administrator, it is automatically copied to the registered storage.
(3) Sharing Other Applications' NS Data
When you register the same storage region as another application, you can get NS data that was downloaded for that application. An application can even get data from other applications when it downloads its own NS data. For more information on these operations, see the GetNsDataIdList and GetNewDataNsDataIdList functions.
When you download NS data, data with older (smaller) serial IDs is automatically deleted if the total amount of data does not fit in the size of the region. With this feature, total data equal to or less than the maximum data size will be stored, and an error will result if there is not enough room even after deleting older data, so be sure to set an appropriate value for the capacity.
CONFIDENTIAL