Share via


GetBestInterfaceEx (Windows Embedded CE 6.0)

1/6/2010

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.

Syntax

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

Parameters

  • pDestAddr
    [in] The destination IP address from a sockaddr structure for which to retrieve the interface that has the best route.
  • pdwBestIfIndex
    [out] Pointer to the index of the interface that has the best route to the address specified by the dwDestAddr parameter.

Return Value

Returns NO_ERROR if successful. If the function fails, it returns an error code. For a complete list of error codes, see Error Values or the SDK header file Winerror.h.

Requirements

Header iphlpapi.h
Library Iphlpapi.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

IP Helper Functions
sockaddr
GetBestInterface