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>nn::boss::RegisterStorage</CODE> Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14<a href="../../nn/Result/Overview.html">nn::Result</a> RegisterStorage( 15 bit32 storageId, 16 size_t size, 17 <a href="../../nn/boss/StorageType.html">nn::boss::StorageType</a> storageType = nn::boss::USER_EXT_SAVEDATA_STORAGE 18); 19</pre> 20 </div> 21<h2>Arguments</h2> 22 <div class="section"> 23 <table class="arguments"> 24 <thead> 25 <tr> 26 <td width="15" /> 27<th>Name</th> 28<td>Description</td> 29 </tr> 30 </thead> 31 <tr> 32<td>in</td> 33<th>storageId</th> 34<td>Specifies the identifier for the storage (extra data).</td> 35 </tr> 36 <tr> 37<td>in</td> 38<th>size</th> 39<td>Specifies the total maximum usable size within the storage region.</td> 40 </tr> 41 <tr> 42<td>in</td> 43<th>storageType</th> 44<td>Specifies the type of the storage region. (Omit this because usually the default BOSS storage for the user's expanded save data is used.)</td> 45 </tr> </table> 46 </div> 47<h2>Return Values</h2> 48<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 /> 49 <table class="arguments"> 50 <thead> 51 <tr> 52<th>Value</th> 53<td>Description</td> 54 </tr> 55 </thead> 56 <tr> 57<th><CODE>ResultSuccess</CODE></th> 58<td>Registration successful.</td> 59 </tr> 60 <tr> 61<th><CODE>ResultStorageAccessPermission</CODE></th> 62<td>You do not have storage access rights. Reconfirm your access rights.</td> 63 </tr> 64 <tr> 65<th><CODE>ResultIpcNotSessionInitialized</CODE></th> 66<td>Either the session is not initialized or there are incompatible permissions. This <CODE>Result</CODE> is returned if this function is called before the <a href="../../nn/boss/Initialize.html"><CODE>Initialize</CODE></A> or the <CODE>InitializePriviledged</CODE> function is called. Always call the <a href="../../nn/boss/Initialize.html"><CODE>Initialize</CODE></a> or <CODE>InitializePrivileged</CODE> function first when you use the BOSS library.</td> 67 </tr> 68 <tr> 69<th>A value other than the above.</th> 70<td>Unexpected error (see <CODE>boss_Result.h</CODE> for error details).</td> 71 </tr> 72 </table> </div> 73<h2>Description</h2> 74 <div class="section"> 75<p>Registers the BOSS storage that is used by BOSSD for NSA tasks and other purposes. Before registering, you must create an expanded save data region. When doing so, allocate a region of at least the total usable size specified by <SPAN class="argument">size</SPAN>. Furthermore, when creating the region, you must specify a number of files as least as large as the total number of serial IDs you want to store. This function returns an error 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.<br /><br /> <B>(1) Application does not register tasks, but wants to get NS data.</B><br />If the application registers BOSS storage, any NS data that is addressed to that application in the NS archive format downloaded by the administrator is automatically copied to the application's registered storage.<br /><br /> <B>(2) Application registers tasks and wants to download NS data addressed to it.<br /></B>If the application registers BOSS storage and then registers and runs tasks, it can download NS data addressed to the application and store it in the storage specified when it registered the task. 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.<br /><br /><B>(3) Sharing Other Applications' NS Data</B><br />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 <a href="../../nn/boss/GetNsDataIdList.html"><CODE>GetNsDataIdList</CODE></a> and <a href="../../nn/boss/GetNewDataNsDataIdList.html"><CODE>GetNewDataNsDataIdList</CODE></a> functions.<br /><br /> 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 region. This feature ensures that only a total amount of data equal to or less than the maximum data size is stored. An error results if there is not enough room even after deleting older data, so be sure to set an appropriate value for the capacity of the region.</p><!-- write here --></div> 76<h2>Revision History</h2> 77 <div class="section"> 78 <dl class="history"> 79 <dt>2010/09/16</dt> 80<dd>Initial version.<br /> 81 </dd> 82 </dl> 83 </div> 84 <hr><p>CONFIDENTIAL</p></body> 85</html> 86