<div class="content"><p> </p><p>The client calls the <b>FaxObs_OpenPort (Opnum 3)</b> method
to open a fax port and obtain a fax port handle.</p><p>In response the server opens a fax port for subsequent use
in other fax methods and returns a fax port handle for use by the client.</p><p>The server MUST validate whether the client&#39;s fax user
account has access to open the specified fax port. The server MUST validate
that the <i>DeviceId</i> parameter that is passed by the client is for a valid
device. If the <i>Flags</i> parameter specifies PORT_OPEN_MODIFY, the server
MUST also confirm that the specified port has not yet been opened for
modification, and if the port is already opened for modification, the server
MUST fail the request by returning ERROR_INVALID_HANDLE. To indicate success,
the server MUST return a new port handle to the client.</p><dl>
<dd>
<div><pre> error_status_t FaxObs_OpenPort(
   [in] handle_t hBinding,
   [in] DWORD DeviceId,
   [in] DWORD Flags,
   [out] PRPC_FAX_PORT_HANDLE FaxPortHandle
 );
</pre></div>
</dd></dl><p><b>hBinding: </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>FaxObs_ConnectionRefCount</b> (section <span><a href="9430f7e2-d21d-4a38-a859-367b74f68a1a" data-linktype="relative-path">3.1.4.2.2</a></span>)
method call used to connect to the fax server.</p><p><b>DeviceId: </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>)
variable that contains the line identifier for the receiving device (port). The
client SHOULD call the <b>FaxObs_EnumPorts</b> (section <span><a href="d9e71aba-137d-455b-9ca8-8d89c89b2db7" data-linktype="relative-path">3.1.4.2.15</a></span>)
method to retrieve a valid value for this parameter.</p><p><b>Flags: </b>A <b>DWORD</b> variable that contains a
set of bit flags defining the access mode for the port.<a id="Appendix_A_Target_185"></a><a aria-label="Product behavior note 185" href="056171e7-80bc-45ff-8107-66ba3abb2023#Appendix_A_185" data-linktype="relative-path">&lt;185&gt;</a></p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value/code</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000000</p>
  </td>
  <td>
  <p>No port access mode flags are specified.</p>
  </td>
 </tr><tr>
  <td>
  <p>PORT_OPEN_QUERY</p>
  <p>0x00000001</p>
  </td>
  <td>
  <p>The port access mode that is required to obtain a fax
  port handle. This access level is also required to call the <b>FaxObs_GetPort</b> (section
  <span><a href="d321c037-bf10-425c-ac43-6d09d65359b0" data-linktype="relative-path">3.1.4.2.16</a></span>)
  method to query fax port information.<a id="Appendix_A_Target_186"></a><a aria-label="Product behavior note 186" href="056171e7-80bc-45ff-8107-66ba3abb2023#Appendix_A_186" data-linktype="relative-path">&lt;186&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>PORT_OPEN_MODIFY</p>
  <p>0x00000002</p>
  </td>
  <td>
  <p>The port access mode that allows changes to the
  configuration of a fax port. The fax server can use this port access mode to
  allow execution of the <b>FaxObs_SetPort</b> (section <span><a href="77fdb752-7238-4baf-8698-625337a0d328" data-linktype="relative-path">3.1.4.2.17</a></span>)
  method. This access mode also includes the allowance that is associated with
  the PORT_OPEN_QUERY access mode.<a id="Appendix_A_Target_187"></a><a aria-label="Product behavior note 187" href="056171e7-80bc-45ff-8107-66ba3abb2023#Appendix_A_187" data-linktype="relative-path">&lt;187&gt;</a></p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>FaxPortHandle: </b>A pointer to a variable that
receives a fax port handle (from the <b>Fax Data Types</b> (section <span><a href="46c77dee-7306-4b22-a407-070b221ae620" data-linktype="relative-path">2.2.74</a></span>)
enumeration) that is required on subsequent calls by other fax client methods.</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>.</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_ACCESS_DENIED</p>
  <p>0x00000005</p>
  </td>
  <td>
  <p>Access is denied. The caller does not have the
  FAX_PORT_QUERY access rights required for this operation.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_INVALID_HANDLE</p>
  <p>0x00000006</p>
  </td>
  <td>
  <p>The call was made with the <i>Flags</i> parameter
  containing the PORT_OPEN_MODIFY flag, and the port is already opened to be
  modified by another call.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_BAD_UNIT</p>
  <p>0x00000014</p>
  </td>
  <td>
  <p>The system cannot find the port for the receiving
  device by using the line identifier specified by the <i>DeviceId</i> parameter.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_INVALID_PARAMETER</p>
  <p>0x00000057</p>
  </td>
  <td>
  <p>The <i>FaxPortHandle</i> parameter is set to a NULL
  pointer value.<a id="Appendix_A_Target_188"></a><a aria-label="Product behavior note 188" href="056171e7-80bc-45ff-8107-66ba3abb2023#Appendix_A_188" data-linktype="relative-path">&lt;188&gt;</a></p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>Exceptions Thrown:</b> No exceptions are thrown
except those that are thrown by the underlying <span><a href="46aba9c4-ebb1-4b10-86ac-4bb3025657b9#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> protocol, <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>.</p></div>