<div class="content" name="FaxObs_OpenPort" uuid="2c8a37ec-7c13-4a2c-93b7-cf19534846c2"><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 <a href="9430f7e2-d21d-4a38-a859-367b74f68a1a" data-linktype="relative-path">3.1.4.2.2</a>) method call
used to connect to the fax server.</p><p><b>DeviceId: </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>)
variable that contains the line identifier for the receiving device (port). The
client SHOULD call the <b>FaxObs_EnumPorts</b> (section <a href="d9e71aba-137d-455b-9ca8-8d89c89b2db7" data-linktype="relative-path">3.1.4.2.15</a>) 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>0x00000000</td>
  <td>No port access mode flags are specified.</td>
 </tr><tr>
  <td>PORT_OPEN_QUERY 0x00000001</td>
  <td>The port access mode that is required to obtain a fax port handle. This access level is also required to call the FaxObs_GetPort (section 3.1.4.2.16) method to query fax port information.&lt;186&gt;</td>
 </tr><tr>
  <td>PORT_OPEN_MODIFY 0x00000002</td>
  <td>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 FaxObs_SetPort (section 3.1.4.2.17) method. This access mode also includes the allowance that is associated with the PORT_OPEN_QUERY access mode.&lt;187&gt;</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 <a href="46c77dee-7306-4b22-a407-070b221ae620" data-linktype="relative-path">2.2.74</a>) 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 <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 caller does not have the FAX_PORT_QUERY access rights required for this operation.</td>
 </tr><tr>
  <td>ERROR_INVALID_HANDLE 0x00000006</td>
  <td>The call was made with the Flags parameter containing the PORT_OPEN_MODIFY flag, and the port is already opened to be modified by another call.</td>
 </tr><tr>
  <td>ERROR_BAD_UNIT 0x00000014</td>
  <td>The system cannot find the port for the receiving device by using the line identifier specified by the DeviceId parameter.</td>
 </tr><tr>
  <td>ERROR_INVALID_PARAMETER 0x00000057</td>
  <td>The FaxPortHandle parameter is set to a NULL pointer value.&lt;188&gt;</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>