<div class="content"><p> </p><p>This method returns the <span><a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> <span><a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_b91c1e27-e8e0-499b-8c65-738006af72ee" data-linktype="relative-path">endpoint</a></span>
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 <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>
section <span><a href="../ms-rpce/a01f5886-c485-4bcf-bb23-e0d755510ab7" data-linktype="relative-path">2</a></span>.</p><p><b>fIP: </b> Specifies the <span><a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_2bf10154-6cb6-401f-8b44-15644784dd4e" data-linktype="relative-path">connected network</a></span>
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>
  <p>0x00000000</p>
  </td>
  <td>
  <p>Causes the RPC endpoint port for an RPC over SPX
  protocol sequence, as specified in [MS-RPCE], to be returned.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000001</p>
  </td>
  <td>
  <p>Causes the RPC endpoint port for an RPC over TCP/IP
  protocol sequence, as specified in [MS-RPCE], to be returned.</p>
  </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 <span><a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_46da887f-3f66-4941-a854-e51c52cf4c56" data-linktype="relative-path">dynamic endpoints</a></span>,
the server MUST return the RPC endpoint port number. If the server is using
static endpoints, the server MUST return 0.</p></div>