<div class="content"><p> </p><p>The <b>FAX_WriteFile (Opnum 70)</b> method is called by the
client.</p><p>The server MUST validate the <i>hCopy</i> handle to be a
copy handle that has been returned by a previous call to <b>FAX_StartCopyToServer</b> (section
<span><a href="d4fdc04e-6594-4563-9700-d4cc645b4335" data-linktype="relative-path">3.1.4.1.97</a></span>)
in the <i>lpHandle</i> output argument. The server MUST validate that the data
size is not 0. On success, the server MUST copy the specified data to the file
specified by the <i>hCopy</i> copy handle in the <b>server queue directory</b>
(section <span><a href="bd422bcf-7ce8-4576-addb-89345ea84f9f" data-linktype="relative-path">3.1.1</a></span>).</p><p>The fax client SHOULD split the contents of the file in one
or multiple parts (chunks) and individually copy each part (chunk) with a <b>FAX_WriteFile</b>
call<a id="Appendix_A_Target_180"></a><a aria-label="Product behavior note 180" href="056171e7-80bc-45ff-8107-66ba3abb2023#Appendix_A_180" data-linktype="relative-path">&lt;180&gt;</a> until the entire file
contents are copied. When the entire contents of the file are copied, the fax
client MUST notify the fax server by calling the <b>FAX_EndCopy</b> (section
<span><a href="efdf1a1b-8f2c-450c-b6a7-36f115aa6ec3" data-linktype="relative-path">3.1.4.1.15</a></span>)
method as described in <b>Sequencing Rules</b> (section <span><a href="2417f40b-e82f-409b-baa0-d08537dd01bb" data-linktype="relative-path">3.1.4.1.1</a></span>).</p><p>If the fax server fails a <b>FAX_WriteFile</b> call
returning ERROR_INVALID_HANDLE during a copy file operation successfully
started by the fax client with <b>FAX_StartCopyToServer</b>, the fax client MAY
call <b>FAX_StartCopyToServer</b> again to restart the copy file operation from
the beginning of the file.</p><p>No specific access rights are required for the client&#39;s fax
user account to successfully call this method.</p><dl>
<dd>
<div><pre> error_status_t FAX_WriteFile(
   [in, ref] RPC_FAX_COPY_HANDLE hCopy,
   [in, ref, size_is(dwDataSize)] const LPBYTE lpbData,
   [in, range(0, RPC_COPY_BUFFER_SIZE)] DWORD dwDataSize
 );
</pre></div>
</dd></dl><p><b>hCopy: </b>An <span><a href="46aba9c4-ebb1-4b10-86ac-4bb3025657b9#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> context handle
that is returned by <b>FAX_StartCopyToServer</b>.</p><p><b>lpbData: </b>A pointer to the buffer from which to
copy the file.</p><p><b>dwDataSize:</b> A <b>DWORD</b> (<span><a href="../ms-dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2" data-linktype="relative-path">[MS-DTYP]</a></span>
section <span><a href="../ms-dtyp/262627d8-3418-4627-9218-4ffe110850b2" data-linktype="relative-path">2.2.9</a></span>)
value indicating the size, in bytes, of the data buffer pointed by the <i>lpbData</i>
argument. This size MUST be between 1 and RPC_COPY_BUFFER_SIZE (16384) bytes.</p><p><b>Return Values: </b>This method MUST return
0x00000000 (ERROR_SUCCESS) for success; otherwise, it MUST return one of the
following error codes, one of the fax-specific errors that are defined in
section <span><a href="cbe6c4fb-4dda-4f6c-9701-0d490ba0d105" data-linktype="relative-path">2.2.52</a></span>, or one of
the other standard errors defined in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>
section <span><a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a></span>.<a id="Appendix_A_Target_181"></a><a aria-label="Product behavior note 181" href="056171e7-80bc-45ff-8107-66ba3abb2023#Appendix_A_181" data-linktype="relative-path">&lt;181&gt;</a></p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>ERROR_INVALID_HANDLE</p>
  <p>0x00000006</p>
  </td>
  <td>
  <p>The handle value specified by the <i>hCopy</i>
  argument is not a valid copy handle returned by <b>FAX_StartCopyToServer</b>.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_GEN_FAILURE</p>
  <p>0x0000001F</p>
  </td>
  <td>
  <p>A device attached to the system is not functioning.
  The call was unable to write the full amount of the data that was requested
  to be written.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_INVALID_PARAMETER</p>
  <p>0x00000057</p>
  </td>
  <td>
  <p>The following conditions can lead to this value being
  returned:</p>
  <p><span>§<span>  
  </span></span>The parameter is incorrect.</p>
  <p><span>§<span>  
  </span></span>The <i>dwDataSize</i> parameter is 0.</p>
  <p><span>§<span>  
  </span></span>The handle value specified by the <i>hCopy</i> argument is NULL
  or the buffer size specified by the <i>dwDataSize</i> is zero.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>Exceptions Thrown:</b> No exceptions are thrown
except those that are thrown by the underlying RPC protocol, <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>.</p></div>