Export (0) Print
Expand All
Expand Minimize

GetBestRoute function

The GetBestRoute function retrieves the best route to the specified destination IP address.

Syntax


DWORD GetBestRoute(
  _In_   DWORD dwDestAddr,
  _In_   DWORD dwSourceAddr,
  _Out_  PMIB_IPFORWARDROW pBestRoute
);

Parameters

dwDestAddr [in]

Destination IP address for which to obtain the best route.

dwSourceAddr [in]

Source IP address. This IP address corresponds to an interface on the local computer. If multiple best routes to the destination address exist, the function selects the route that uses this interface.

This parameter is optional. The caller may specify zero for this parameter.

pBestRoute [out]

Pointer to a MIB_IPFORWARDROW structure containing the best route for the IP address specified by dwDestAddr.

Return value

If the function succeeds, the return value is NO_ERROR.

If the function fails, use FormatMessage to obtain the message string for the returned error.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Iphlpapi.h

Library

Iphlpapi.lib

DLL

Iphlpapi.dll

See also

IP Helper Start Page
IP Helper Function Reference
GetBestInterface
MIB_IPFORWARDROW

 

 

Community Additions

ADD
Show:
© 2014 Microsoft