次の方法で共有


CreateSortedAddressPairs (NETIOAPI) (Compact 2013)

3/26/2014

The CreateSortedAddressPairs function pairs the destination addresses from a supplied list of potential IP destination addresses together with the host machine's local IP addresses and sorts the pairs according to the preferred communication order.

Syntax

NETIOAPI_API
  CreateSortedAddressPairs(
    IN const  PSOCKADDR_IN6  SourceAddressList  OPTIONAL,
    IN ULONG  SourceAddressCount,
    IN const PSOCKADDR_IN6 DestinationAddressList,
    IN ULONG  DestinationAddressCount,
    IN ULONG  AddressSortOptions,
    OUT PSOCKADDR_IN6_PAIR*  SortedAddressPairList,
    OUT ULONG*  SortedAddressPairCount
    );

Parameters

  • SourceAddressList
    Reserved. This parameter must be NULL.
  • SourceAddressCount
    Reserved. This parameter must be zero.
  • DestinationAddressList
    A pointer to a list of potential destination addresses of type SOCKADDR_IN6.
  • DestinationAddressCount
    The number of addresses in the list that the DestinationAddressList parameter points to.
  • AddressSortOptions
    Reserved. This parameter must be zero.
  • SortedAddressPairList
    A pointer to a list of pairs of source and destination addresses, sorted in the preferred order of communication. For more information about this parameter, see the following Remarks section.
  • SortedAddressPairCount
    The number of address pairs in the list that the SortedAddressPairList parameter points to.

Return Value

Error Code

Meaning

STATUS_SUCCESS

The function succeeds.

STATUS_INVALID_PARAMETER

An invalid parameter was passed to the function

STATUS_NOT_ENOUGH_MEMORY

Insufficient memory resources were available to complete the operation

Other

Use the FormatMessage function to obtain the message string for the returned error

Remarks

The CreateSortedAddressPairs function automatically pairs the host machine's local addresses together with the supplied list of potential destination addresses to which the DestinationAddressList parameter points.

The returned list of pairs of addresses that the SortedAddressPairList parameter points to is sorted so that the address pairs that are best suited for communication between two peers occur earlier in the list.

The SortedAddressPairList parameter is of type PSOCKADDR_IN6_PAIR, which is defined in the Ws2ipdef.h header as follows:

  • SourceAddress
    The IP source address
  • DestinationAddress
    The IP destination address

See Also

Reference

IP Helper Kernel-Mode Functions

Other Resources

FormatMessage