<div class="content" name="S_DSGetServerPort" uuid="160c3aa2-2ce2-407d-83f5-9dc3caa2ce45"><p>This method returns the <a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> <a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_b91c1e27-e8e0-499b-8c65-738006af72ee" data-linktype="relative-path">endpoint</a> port for a
transport protocol. The client establishes a new binding to the server by using
the returned port number.</p><dl>
<dd>
<div><pre> unsigned long S_DSGetServerPort(
   [in] handle_t hBind,
   [in, range(0,1)] unsigned long fIP
 );
</pre></div>
</dd></dl><p><b>hBind: </b> MUST specify an RPC binding handle, as
specified in <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>
section <a href="../ms-rpce/a01f5886-c485-4bcf-bb23-e0d755510ab7" data-linktype="relative-path">2</a>.</p><p><b>fIP: </b> Specifies the <a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_2bf10154-6cb6-401f-8b44-15644784dd4e" data-linktype="relative-path">connected network</a> protocol
for which an RPC endpoint port is to be returned.</p><table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000</td>
  <td>Causes the RPC endpoint port for an RPC over SPX protocol sequence, as specified in [MS-RPCE], to be returned.</td>
 </tr><tr>
  <td>0x00000001</td>
  <td>Causes the RPC endpoint port for an RPC over TCP/IP protocol sequence, as specified in [MS-RPCE], to be returned.</td>
 </tr></tbody></table><p><b>Return Values: </b> If the method succeeds, the return
value is the RPC endpoint port number. If the method fails, the server MUST
return 0.</p><p><b>MQ_OK</b> (0x00000000)</p><p><b>Exceptions Thrown:</b> No exceptions are thrown beyond
those thrown by the underlying RPC protocol as specified in [MS-RPCE].</p><p>The server MUST support the RPC over TCP/IP protocol
sequence. The server MAY support the RPC over SPX protocol sequence.<a id="Appendix_A_Target_16"></a><a aria-label="Product behavior note 16" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_16" data-linktype="relative-path">&lt;16&gt;</a> If the server does not support
the RPC over SPX protocol sequence, the server MUST return 0 when the <i>fIP</i>
parameter is zero.</p><p>If the server is using <a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_46da887f-3f66-4941-a854-e51c52cf4c56" data-linktype="relative-path">dynamic endpoints</a>, the
server MUST return the RPC endpoint port number. If the server is using static
endpoints, the server MUST return 0.</p></div>