<div class="content" name="FAX_SetExtensionData" uuid="eb6d732d-5025-4bb6-9671-e61553bc2d9b"><p>The fax client application calls the <b>FAX_SetExtensionData
(Opnum 50)</b> method in order to write the private data for a routing
extension or routing method for one or all fax devices installed on the fax
server. The corresponding method that the fax client calls to read this private
data is <b>FAX_GetExtensionData</b> (section <a href="b585fe59-dd89-42a5-a066-9820d97a34f5" data-linktype="relative-path">3.1.4.1.39</a>). The value for
the <i>dwDeviceId</i> parameter can be obtained using either the <b>FAX_EnumPorts </b>(section
<a href="7143a58b-d7c5-4353-8857-39c7f708e778" data-linktype="relative-path">3.1.4.1.28</a>) or <b>FAX_EnumPortsEx</b> (section
<a href="f26e50ab-ed8e-448d-928c-1820f4a42918" data-linktype="relative-path">3.1.4.1.29</a>) method. The
<i>lpcwstrNameGUID</i> parameter MUST be for a valid routing extension or
routing method for which the client requests the private data to be written.</p><p>In response, the server MUST validate that the client&#39;s fax
user account has access to manage configuration on the server.</p><p>On success, the server MUST apply the specified private
routing extension data or private routing method data for the specified device.</p><p>When <a href="46aba9c4-ebb1-4b10-86ac-4bb3025657b9#gt_efaa1290-6d4b-4f44-9e84-35a867069d45" data-linktype="relative-path">routing</a>
method configuration data is specified, <i>lpcwstrNameGUID</i> MUST contain the
GUID of the corresponding routing method.</p><dl>
<dd>
<div><pre> error_status_t FAX_SetExtensionData(
   [in] handle_t hFaxHandle,
   [in, string] LPCWSTR lpcwstrComputerName,
   [in] DWORD dwDeviceId,
   [in, string] LPCWSTR lpcwstrNameGUID,
   [in, ref, size_is(dwDataSize)] LPBYTE pData,
   [in, range(0,FAX_MAX_RPC_BUFFER)] 
     DWORD dwDataSize
 );
</pre></div>
</dd></dl><p><b>hFaxHandle: </b>The RPC binding handle for this
call. The client SHOULD reuse the RPC binding handle used as an input <i>hBinding</i>
argument for the <b>FAX_ConnectFaxServer</b> (section <a href="5cbfd38d-7a14-4560-ad24-9ed78f19a3bb" data-linktype="relative-path">3.1.4.1.10</a>) or <b>FAX_ConnectionRefCoun</b>t (section
<a href="a92941ac-bd07-4a71-af85-c2c157c97cf9" data-linktype="relative-path">3.1.4.1.11</a>) method call
used to connect to the fax server.</p><p><b>lpcwstrComputerName: </b>A null-terminated
character string that SHOULD hold the name of the client computer.</p><p><b>dwDeviceId: </b>A <b>DWORD</b> (<a href="../ms-dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2" data-linktype="relative-path">[MS-DTYP]</a>
section <a href="../ms-dtyp/262627d8-3418-4627-9218-4ffe110850b2" data-linktype="relative-path">2.2.9</a>)
value of the unique device identifier. A value of zero indicates the caller
needs to set a named data BLOB that is not associated with any specific device.
This value can be used to store configurations that affect all the devices. For
example, an Optical Character Recognition (OCR) routing extension might export
several different routing methods that all rely on the same OCR parameters.
This routing extension can associate the OCR configuration with a non-specific
device so that it becomes global.</p><p><b>lpcwstrNameGUID: </b>A curly-braced GUID string
that identifies the data to set. The GUID can identify a routing extension or a
routing method. Because GUIDs are unique, the server determines from the
specific GUID value whether the call is requesting to set routing extension
data or routing method data. If some data is already set for the specified <a href="46aba9c4-ebb1-4b10-86ac-4bb3025657b9#gt_f49694cc-c350-462d-ab8e-816f0103c6c1" data-linktype="relative-path">GUID</a>, the fax server SHOULD
replace it with the new data that is pointed to by the <i>pData</i> parameter.</p><p><b>pData: </b>A pointer to the data buffer to set.
For the default routing methods described in the Default Routing Methods
(section <a href="89220226-b68e-4d97-96ef-ce622145ecfa" data-linktype="relative-path">2.2.87</a>) this
data is a null-terminated character string containing an EmailID, Printer, or
Folder name. For other routing extensions or methods the format of this data
depends on the respective routing extension or routing method and SHOULD be
treated as opaque binary data by the fax server.</p><p><b>dwDataSize: </b>A <b>DWORD</b> value that
indicates the size, in bytes, of the <i>pData</i> buffer. The maximum size is <b>FAX_MAX_RPC_BUFFER</b> (section
<a href="8bb4ba82-db45-44ea-9caa-af64d7448e6d" data-linktype="relative-path">2.2.82</a>).</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 <a href="cbe6c4fb-4dda-4f6c-9701-0d490ba0d105" data-linktype="relative-path">2.2.52</a>, or one
of the other standard errors defined in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>
section <a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a>.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>ERROR_ACCESS_DENIED 0x00000005</td>
  <td>Access is denied. The client&#39;s fax user account does not have the required FAX_ACCESS_MANAGE_CONFIG authorization for this operation.</td>
 </tr><tr>
  <td>ERROR_INVALID_PARAMETER 0x00000057</td>
  <td>The parameter is incorrect. This error code is returned if any of the following conditions are met:&lt;161&gt; § The lpcwstrComputerName parameter is set to a NULL pointer value. § The lpcwstrNameGUID parameter is set to a NULL pointer value. § The pData parameter is set to a NULL pointer value. § The dwDataSize parameter is set to zero. § The lpcwstrNameGUID parameter holds an invalid curly-braced GUID string.</td>
 </tr><tr>
  <td>ERROR_REGISTRY_CORRUPT 0x000003F7</td>
  <td>The registry is corrupted. The structure of one of the files that contain registry data is corrupted, or the system&#39;s memory image of the file is corrupted, or the file could not be recovered because the alternate copy or log was absent or corrupted.</td>
 </tr></tbody></table>
</dd></dl><p><b>Exceptions Thrown:</b> No exceptions are thrown
except those that are thrown by the underlying <a href="46aba9c4-ebb1-4b10-86ac-4bb3025657b9#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> protocol <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>.</p></div>