1<html>
2
3<head>
4<META http-equiv="Content-Type" content="text/html; charset=utf-8">
5<META name="GENERATOR" content="Microsoft FrontPage 5.0">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>OSGetTitleStatus</title>
9</head>
10
11<body>
12
13<h1>OSGetTitleStatus</h1>
14
15<h2>Syntax</h2>
16
17<pre><code>
18#include &lt;revolution/discnand.h&gt;
19
20#define OSTITLE_STATUS_UNKNOWN      0
21#define OSTITLE_STATUS_INSTALLED    1
22#define OSTITLE_STATUS_NOEXISTS     2
23#define OSTITLE_STATUS_DELETED      3
24#define OSTITLE_STATUS_SAVEONLY     4
25#define OSTITLE_STATUS_NORIGHTS     5
26#define OSTITLE_STATUS_PARTIAL      6
27#define OSTITLE_STATUS_FATAL        7
28
29BOOL OSGetTitleStatus(OSTitleId <i>titleId</i>, u32* <i>status</i>, void* <i>buffer</i>, u32* <i>bufferSize</i>);
30</code></pre>
31
32<h2>Arguments</h2>
33
34<table border="1" cellpadding="3" cellspacing="0">
35  <tr>
36<td width="120" bgcolor="#ffffe8"><code><b><i>titleId</i></b></code></td>
37<td width="520">Title ID of the NAND application whose status you want to get.</td>
38  </tr>
39  <tr>
40<td width="120" bgcolor="#ffffe8"><code><b><i>status</i></b></code></td>
41<td width="520">Status of the application indicated by <code>OSTITLE_STATUS_*</code>.</td>
42  </tr>
43  <tr>
44<td width="120" bgcolor="#ffffe8"><code><b><i>buffer</i></b></code></td>
45<td width="520">Address of the temporary buffer used to get the status. This address of this buffer must be aligned to 32 bytes. If <CODE>NULL</CODE> is specified, a buffer is not used.</td>
46  </tr>
47  <tr>
48<td width="120" bgcolor="#ffffe8"><code><b><i>bufferSize</i></b></code></td>
49<td width="520">When <CODE>NULL</CODE> has been passed to <SPAN class="argument">buffer</SPAN>, the required size of the temporary buffer is stored in <code>*bufSize</code>. If a buffer address has been passed to <SPAN class="argument">buffer</SPAN> (that is, it is not <CODE>NULL</CODE>), the value of <code>*bufSize</code> is treated as the upper limit for the temporary buffer used inside the function. After the buffer is finished being used, it can be released.</td>
50  </tr>
51</table>
52
53<h2>Return Values</h2>
54<p>Returns <code>OSTITLE_RESULT_OK</code> when the process has ended normally. Returns <code>OSTITLE_RESULT_ALLOC_FAILED</code> if the temporary buffer is not large enough. Returns <code>OSTITLE_RESULT_OPERATION</code> if the process does not end normally.
55</p>
56<h2>Description</h2>
57<P>
58Gets the status for the NAND application specified by the title ID.<br>The application status is defined with the following macro constants.<br><br>
59      <TABLE border="1" width="800" cellspacing="0.1">
60        <TBODY>
61          <TR>
62<TD width="150"><CODE>OSTITLE_STATUS_UNKNOWN</CODE></TD>
63<TD width="650">Cannot get the status. This is returned while still in the process of getting the actual status, and when the process fails.</TD>
64          </TR>
65          <TR>
66<TD width="150"><CODE>OSTITLE_STATUS_INSTALLED</CODE></TD>
67<TD width="650">Installed in an executable state.</TD>
68          </TR>
69          <TR>
70<TD width="150"><CODE>OSTITLE_STATUS_NOEXISTS</CODE></TD>
71<TD width="650">Never been installed.</TD>
72          </TR>
73          <TR>
74<TD width="150"><CODE>OSTITLE_STATUS_DELETED</CODE></TD>
75<TD width="650">Deleted from the Wii Menu (there is evidence of a past installation).</TD>
76          </TR>
77          <TR>
78<TD width="150"><CODE>OSTITLE_STATUS_SAVEONLY</CODE></TD>
79<TD width="650">Only the channel has been deleted from the Wii Menu, and save data remains.</TD>
80          </TR>
81          <TR>
82<TD width="150"><CODE>OSTITLE_STATUS_NORIGHTS</CODE></TD>
83<TD width="650">Installed, but this application does not have the right to execute it.</TD>
84          </TR>
85          <TR>
86<TD width="150"><CODE>OSTITLE_STATUS_PARTIAL</CODE></TD>
87<TD width="650">Partially installed.</TD>
88            </TD>
89          </TR>
90          <TR>
91<TD width="150"><CODE>OSTITLE_STATUS_FATAL</CODE></TD>
92<TD width="650">Fatal state, possibly because content that should exist is not present.</TD>
93            </TD>
94          </TR>
95        </TBODY>
96      </TABLE><br>
97
98Normal NAND applications do not return these three status states: <CODE>OSTITLE_STATUS_NORIGHTS</CODE>, <CODE>OSTITLE_STATUS_PARTIAL</CODE>, and <CODE>OSTITLE_STATUS_FATAL</CODE>.<BR><BR>Getting the <CODE>OSTITLE_STATUS_INSTALLED</CODE> state, which is the status for a normal installation, requires the temporary buffer used inside the library. If the size of the temporary buffer is unknown, use the following procedure to get the status.<br>
99</P>
100
101<OL>
102<LI>Call this function with <code>NULL</code> specified for the third argument, <SPAN class="argument">buffer</SPAN>. When this is done, the necessary size for the buffer gets stored to the memory region indicated by the fourth argument, <SPAN class="argument">bufferSize</SPAN>.</LI>
103<LI>If the buffer size that gets stored here is non-zero, allocate a memory region larger than this size.<br>If zero is stored here for the buffer size, quit the process if the application status stored in the second argument, <SPAN class="argument">status</SPAN>, is not <CODE>OSTITLE_STATUS_UNKNOWN</CODE>.<br>Otherwise, you can proceed, but be sure that the returned buffer size is zero. When that is the case, pass <CODE>NULL</CODE> for the buffer address.
104</LI>
105<LI>Now call the function again, this time with the starting address of the allocated memory (or <CODE>NULL</CODE>) specified for the <SPAN class="argument">buffer</SPAN> argument.</LI>
106<LI>The status of the application is written to the <SPAN class="argument">status</SPAN> argument.</LI>
107</OL>
108
109<P>
110The maximum size of the temporary buffer is several KB, compared to the several hundred bytes of a normal NAND application (basically, an application that has not been updated to a newer version).
111</P>
112
113
114<h2>See Also</h2>
115<p><code><a href="OSIsTitleInstalled.html">OSIsTitleInstalled</a><BR></code></p>
116<H2>Revision History</H2>
117<P>
1182009/10/16 Changed the <CODE>include</CODE> file.<BR> 2007/07/18 Initial version.
119</P>
120<hr><p>CONFIDENTIAL</p></body>
121</html>