1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 8<title>NANDWrite</title> 9</head> 10 11<body> 12 13<h1>NANDWrite</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre class="construction">#include <revolution/nand.h> 17 18s32 NANDWrite(NANDFileInfo *info, const void *buf, u32 length); 19</pre></dd></dl> 20 21<h2>Arguments</h2> 22<p> 23<TABLE class="arguments" border="1" > 24 <tr> 25<TH>info</TH> 26<TD>Pointer to a <CODE>NANDFileInfo</CODE> structure.</TD> 27 </tr> 28 <tr> 29<TH>buf</TH> 30<TD>Pointer to the start of the data that will be written to Wii console NAND memory. The buffer storing the data must be 32-byte aligned.</TD> 31 </tr> 32 <tr> 33<TH>length</TH> 34<TD>Number of bytes of data to write to Wii console NAND memory.</TD> 35 </tr> 36</TABLE> 37</p> 38 39<h2>Return Values</h2> 40<p> 41Returns the number of bytes for the written data when the write is successful. One of the following codes is returned on failure. 42<p> 43<code> 44NAND_RESULT_ACCESS<br> 45NAND_RESULT_ALLOC_FAILED<br> 46NAND_RESULT_AUTHENTICATION<br> 47NAND_RESULT_BUSY<br> 48NAND_RESULT_CORRUPT<br> 49NAND_RESULT_ECC_CRIT<br> 50NAND_RESULT_INVALID<br> 51NAND_RESULT_MAXBLOCKS<br> 52NAND_RESULT_UNKNOWN<br> 53NAND_RESULT_FATAL_ERROR<br> 54</code> 55</p> 56</p> 57 58<H2>Description</H2> 59<p> 60Writes data to a file. 61</p> 62 63<p> 64This function may put the current thread to sleep. For precautions related to calling similar functions, see <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>. 65</p> 66 67<h2>See Also</h2> 68<p class="reference"> 69<a href="./NANDRead.html">NANDRead</a>, 70<a href="./NANDReadAsync.html">NANDReadAsync</a>, 71<a href="./NANDWriteAsync.html">NANDWriteAsync</a>, 72<a href="./NANDSeek.html">NANDSeek</a>, 73<a href="./NANDSeekAsync.html">NANDSeekAsync</a>, 74<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 75</p> 76 77<H2>Revision History</H2> 78<p> 792007/09/25 Added information about the sleep status of threads.<br>2006/11/30 Added the <CODE>NAND_RESULT_ALLOC_FAILED</CODE> and <CODE>NAND_RESULT_BUSY</CODE> codes.<br>2006/10/xx Unified terminology.<br>2006/09/19 Added the <CODE>ECC_CRIT</CODE> result code.<br>2006/09/07 Eliminated the restriction that the data-write size had to be a multiple of 32 bytes.<br>2006/08/15 Added the <CODE>AUTHENTICATION</CODE> result code.<br>2006/06/16 Initial version.<BR> 80</p> 81 82<hr><p>CONFIDENTIAL</p></body> 83</html>