1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../css/manpage.css" type="text/css" />
7<title>RegisterStorage</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../nn/Overview.html">nn</a>::<a href="../../nn/boss/Overview.html">boss</a>::RegisterStorage</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14<CODE><a href="../../nn/Result/Overview.html">nn::Result</a> RegisterStorage(</CODE>
15     bit32 storageId,
16     <CODE>size_t storageSize,</CODE>
17     <CODE>u16 entryCount,</CODE>
18     <a href="../../nn/boss/StorageType.html">nn::boss::StorageType</a> storageType = nn::boss::USER_EXT_SAVEDATA_STORAGE
19);
20</pre>
21    </div>
22<h2>Arguments</h2>
23    <div class="section">
24      <table class="arguments">
25        <thead>
26          <tr>
27            <td width="15" />
28<th>Name</th>
29<td>Description</td>
30          </tr>
31        </thead>
32        <tr>
33<td>in</td>
34<th>storageId</th>
35<td>Specifies the ID of an expanded save data region that creates BOSS storage.</td>
36        </tr>
37        <tr>
38<td>in</td>
39<th><CODE>storageSize</CODE></th>
40<td>Specifies the maximum total size of files that can be held in BOSS storage.</td>
41        </tr>
42        <tr>
43<td>in</td>
44<th><CODE>entryCount</CODE></th>
45<td>Specifies the maximum number of NS data entries that can be held in BOSS storage.</td>
46        </tr>
47        <tr>
48<td>in</td>
49<th>storageType</th>
50<td>Specifies the BOSS storage type. (Omit this because usually the default BOSS storage for the user's expanded save data region is used.)</td>
51        </tr> </table>
52    </div>
53<h2>Return Values</h2>
54<div class="section">Returns the function's execution result. Returns one of the <a href="../../nn/Result/Overview.html"><CODE>Result</CODE></a> values listed below. <br />
55      <table class="arguments">
56        <thead>
57          <tr>
58<th>Value</th>
59<td>Description</td>
60          </tr>
61        </thead>
62        <tr>
63<th><CODE>Result::IsSuccess</CODE></th>
64<td>Registration successful.</td>
65        </tr>
66        <tr>
67<th><CODE>ResultStorageAccessPermission</CODE></th>
68<td>You do not have storage access rights. Reconfirm your access rights.</td>
69        </tr>
70        <tr>
71<th><CODE>ResultIpcNotSessionInitialized</CODE></th>
72<td>The session has not been initialized. This result is returned if this function is called before the <CODE><a href="../../../nn/boss/Task/Initialize.html">Initialize</A></CODE> function. Always call the <CODE>Initialize</CODE> function first thing when you use the BOSS library. </td>
73        </tr>
74        <tr>
75<th>A value other than the above.</th>
76<td>Unexpected error (see <CODE>boss_Result.h</CODE> for error details).</td>
77        </tr>
78      </table> </div>
79<h2>Description</h2>
80    <div class="section">
81<p>Registers BOSS storage.</p><p>BOSS storage must be registered before registering or executing NADL tasks.<br />NS data cannot be downloaded if the storage is not registered.</p><p>Before registering BOSS storage, you must first create an extended save data region in memory.<br />Allocate the memory size specified by the <CODE>storageSize</CODE> argument for the extended save data region.<br />You must 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 <CODE>storageID</CODE> argument to which the application does not have access rights.</p><p>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 <CODE>entryCount</CODE>, the NS data having the oldest serial ID (=the lowest serial ID) is automatically deleted. </p><p>1) To get NS data without the application registering a task<br />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.</p><p><B>2) To download NS data addressed to the application that registers a task<br /></B>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.</p><p>3) To share NS data with another application<br />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 <a href="../../nn/boss/GetNsDataIdList.html"><CODE>GetNsDataIdList</CODE></a> and <a href="../../nn/boss/GetNewDataNsDataIdList.html"><CODE>GetNewDataNsDataIdList</CODE></a> functions.<br /><br /></p><!-- write here --></div>
82<h2>Revision History</h2>
83    <div class="section">
84      <dl class="history">
85        <dt>2010/09/16</dt>
86<dd>Initial version.<br />
87        </dd>
88      </dl>
89    </div>
90  <hr><p>CONFIDENTIAL</p></body>
91</html>