<div class="content" name="FAX_SetPort" uuid="e3e3dbb9-5f2d-4537-a6a1-3a7b534c5f71"><p>A fax client application uses the <b>FAX_SetPort (Opnum 12)</b>
method to set fax device information. The function sets extension configuration
properties that are stored at the device level, such as enabling or disabling
sending and receiving, and the auto or manual answering of calls.</p><p>In response, the server MUST validate whether the
FaxPortHandle argument that is passed by the client refers to a port handle
that is obtained by a call to <b>FAX_OpenPort</b> (section <a href="aca2b58a-e310-42dc-9903-18c5b6c35797" data-linktype="relative-path">3.1.4.1.65</a>) with the
PORT_OPEN_MODIFY port access mode flag specified with the <i>Flags</i>
argument. The server MUST validate whether the client&#39;s fax user account has
access to modify the properties of this port. On success, the server MUST
modify the properties of the port as specified by the client.<a id="Appendix_A_Target_165"></a><a aria-label="Product behavior note 165" href="056171e7-80bc-45ff-8107-66ba3abb2023#Appendix_A_165" data-linktype="relative-path">&lt;165&gt;</a></p><dl>
<dd>
<div><pre> error_status_t FAX_SetPort(
   [in] RPC_FAX_PORT_HANDLE FaxPortHandle,
   [in] const FAX_PORT_INFO* PortInfo
 );
</pre></div>
</dd></dl><p><b>FaxPortHandle: </b>An <a href="46aba9c4-ebb1-4b10-86ac-4bb3025657b9#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> context handle that
references a specified fax port.</p><p><b>PortInfo: </b>A pointer to a <b>FAX_PORT_INFO</b>
(section <a href="2b46d16c-e74a-4e3b-b50c-0b94f78bebd0" data-linktype="relative-path">2.2.7</a>)
structure. The structure (except the <b>State</b> field, which has no purpose
for this call and which the fax server SHOULD ignore) contains data to modify
the configuration of the specified fax port. The client MUST set the <b>SizeofStruct</b>
member of this structure to the correct size described in section 2.2.7 before
it calls the <b>FAX_SetPort</b>.</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 FAX_ACCESS_MANAGE_CONFIG fax access right.</td>
 </tr><tr>
  <td>ERROR_INVALID_DATA 0x0000000D</td>
  <td>The handle specified by the FaxPortHandle argument is not a valid fax port handle obtained by a call to FAX_OpenPort.&lt;166&gt;</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: § The pointer specified by the PortInfo argument is NULL. § The handle specified by the FaxPortHandle argument is NULL. § The requested value of the Priority member of the PortInfo parameter is 0, or is greater than the total number of installed fax devices. § The size of the PortInfo argument specified in the SizeOfStruct field is not the correct size, in bytes, for the FAX_PORT_INFO. § When FAX_ERR_DEVICE_NUM_LIMIT_EXCEEDED is to be returned, but the fax client does not support this error code (the fax client API version described in section 3.1.4.1.10 is FAX_API_VERSION_0).</td>
 </tr><tr>
  <td>FAX_ERR_DEVICE_NUM_LIMIT_EXCEEDED 0x00001B62</td>
  <td>The fax server cannot complete the operation because all of the following conditions are true: If the fax server has an implementation-dependent maximum number of supported devices set&lt;167&gt; and the number of fax devices currently connected to the server is equal to or exceeds this maximum number of supported devices. The device is not send, receive, or manual-receive enabled.</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 <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>.</p></div>