Share via


GetBestInterfaceEx

This function retrieves the index of the interface that has the best route to the specified IP address. This function differs from the GetBestInterface function in that this function also supports the Internet Protocol version 6 (IPv6) protocol family.

DWORD GetBestInterfaceEX(
  struct sockaddr* pDestAddr, 
  PDWORD pdwBestIfIndex 
);

Parameters

  • pDestAddr
    [in] Specifies the destination IP address from a sockaddr structure for which to retrieve the interface that has the best route.
  • pdwBestIfIndex
    [out] Pointer to a DWORD variable. On successful return, this variable contains the index of the interface that has the best route to the address specified by the dwDestAddr parameter.

Return Values

If the function succeeds, the return value is NO_ERROR. If the function fails, an error code is returned.

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Iphlpapi.h.
Link Library: Iphlpapi.lib.

See Also

IPHelper Functions | sockaddr | GetBestInterface

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.