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>MountRom</title> 8 </head> 9 <body> 10<h1><CODE><a href="../../nn/Overview.html">nn</a>::<a href="../../nn/fs/Overview.html">fs</a>::MountRom</CODE> Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14<a href="../../nn/Result/Overview.html">Result</a> MountRom( 15 const char * archiveName, 16 size_t maxFile, 17 size_t maxDirectory, 18 void * workingMemory, 19 size_t workingMemorySize, 20 bool useCache = true 21); 22</pre> 23 </div> 24<h2>Parameters</h2> 25 <div class="section"> 26 <table class="arguments"> 27 <thead> 28 <tr> 29 <td width="15" /> 30<th>Name</th> 31<td>Description</td> 32 </tr> 33 </thead> 34 <tr> 35<td>in</td> 36<th>archiveName</th> 37<td>Specifies the name of the archive. (In the overloaded version of this function in which this argument is omitted, "<CODE>rom:</CODE>" is specified implicitly.)</td> 38 </tr> 39 <tr> 40<td>in</td> 41<th>maxFile</th> 42<td>The maximum number of files that can be opened simultaneously.</td> 43 </tr> 44 <tr> 45<td>in</td> 46<th>maxDirectory</th> 47<td>The maximum number of directories that can be opened simultaneously.</td> 48 </tr> 49 <tr> 50<td>in</td> 51<th>workingMemory</th> 52<td>The starting address of the memory region used for ROM archive operations.</td> 53 </tr> 54 <tr> 55<td>in</td> 56<th>workingMemorySize</th> 57<td>The size of the memory region used for ROM archive operations.</td> 58 </tr> 59 <tr> 60<td>in</td> 61<th>useCache</th> 62<td>Set to <CODE>true</CODE> to enable caching of metadata to memory, or <CODE>false</CODE> to disable metadata caching.</td> 63 </tr> </table> 64 </div> 65<h2>Return Values</h2> 66<div class="section">Returns the result of the operation. <br /> 67 <table class="arguments"> 68 <thead> 69 <tr> 70<th>Value</th> 71<td>Description</td> 72 </tr> 73 </thead> 74 <tr> 75<th><CODE>Result::IsSuccess</CODE></th> 76<td>Process was successful.</td> 77 </tr> 78 <tr> 79<th><CODE>ResultNotFound</CODE></th> 80<td>There is no ROMFS. Confirm that the content of the RSF file is correct. You must not allow this error to occur in retail products.</td> 81 </tr> 82 <tr> 83<th><CODE>ResultAlreadyExists</CODE></th> 84<td>The specified archive name is already mounted. <BR>You must not allow this error to occur in retail products.</td> 85 </tr> 86 <tr> 87<th><CODE>ResultNotEnoughSpace</CODE></th> 88<td>An insufficient memory size was specified to <SPAN class="argument">workingMemory</SPAN>. You must not allow this error to occur in retail products.</td> 89 </tr> 90 <tr> 91<th>A value other than the above.</th> 92<td>An unexpected or fatal error occurred.</td> 93 </tr> 94 </table> </div> 95<h2>Description</h2> 96 <div class="section"> 97<p>Mounts a ROM archive.</p><p>This function mounts a ROM archive that accesses a ROMFS generated at build time. The numbers of files and directories you can simultaneously open from the ROM archive are specified by <SPAN class="argument">maxFile</SPAN> and <SPAN class="argument">maxDirectory</SPAN>, respectively.</p><p>The region passed into <SPAN class="argument">workingMemory</SPAN> must be no smaller than the size calculated by the <a href="../../nn/fs/GetRomRequiredMemorySize.html"><CODE>GetRomRequiredMemorySize</CODE></a> function. You can cache ROMFS metadata to memory by setting the <SPAN class="argument">useCache</SPAN> argument to <CODE>true</CODE>. This reduces the time taken to open files and scan directories. However, it also increases the amount of memory required.</p><p> 98The following page has hints on how to handle mount errors. Please use this as a reference. 99</p><ul><li><a href="briefing/aboutErrorHandling.html#Mounting_RomArchive">Handling Mount Errors: rom Archive</a></li></ul><h3>About the return values:</h3><div class="section"> 100This function was revised in the SDK version below to transition to the error display screen when an error occurs, rather than returning the process to the application. Applications do not need to implement error handling for this function.<br /><br /><table><thead><th>Series</th><th>SDK version</th><th>Return Value Specification</th></thead><tr><th rowspan="2">CTR-SDK 1.X</th><td>1.1 and earlier</td><td>One of the results above is returned when an error occurs.</td></tr><tr><td>1.2 or later</td><td>An error will cause a transition to the error display screen. (Only <I>success </I>is returned.)</td></tr><tr><th rowspan="2">CTR-SDK 2.X</th><td>2.0 and earlier</td><td>One of the results above is returned when an error occurs.</td></tr><tr><td>2.1 or later</td><td>An error will cause a transition to the error display screen. (Only <I>success </I>is returned.)</td></tr></table></div></div> 101<h2>Revision History</h2> 102 <div class="section"> 103 <dl class="history"> 104 <dt>2011/02/28</dt> 105<dd>Added information about changes to return value specification.<br /> 106 </dd> 107 <dt>2010/12/14</dt> 108<dd>Added return values. 109 </dd> 110 <dt>2010/09/10</dt> 111<dd>Initial version.<br /> 112 </dd> 113 </dl> 114 </div> 115 <hr><p>CONFIDENTIAL</p></body> 116</html> 117