GetAdaptersAddresses

This function retrieves the addresses associated with the adapters on the local computer.

DWORD WINAPI GetAdaptersAddresses(
  ULONG Family,
  DWORD Flags,
  PVOID Reserved,
  PIP_ADAPTER_ADDRESSES pAdapterAddresses,
  PULONG pOutBufLen
);

Parameters

  • Family
    [in] Specifies the address family of the addresses to retrieve. The following table shows the possible values for this parameter.
    Value Description
    AF_INET Return only IPv4 addresses.
    AF_INET6 Return only IPv6 addresses.
    F_UNSPEC Return addresses from all address families.
  • Flags
    [in] Specifies the type of the addresses to retrieve. The following table shows the possible values. This parameter is zero or a combination of these values.
    Value Description
    GAA_FLAG_INCLUDE_PREFIX Return the IPv6 address prefix.
    GAA_FLAG_SKIP_UNICAST Do not return unicast addresses.
    GAA_FLAG_SKIP_ANYCAST Do not return anycast addresses.
    GAA_FLAG_SKIP_FRIENDLY_NAME Do not return the adapter's friendly name.
    GAA_FLAG_SKIP_MULTICAST Do not return multicast addresses.
    GAA_FLAG_SKIP_DNS_SERVER Do not return addresses of DNS servers.
  • Reserved
    [in] Reserved parameter.
  • pAdapterAddresses
    [in, out] Pointer to a buffer. On successful return, this buffer contains the address information.
  • pOutBufLen
    [out] Pointer to a ULONG variable that specifies the size, in bytes, of the buffer pointed to by pAdapterAddresses.

Remarks

The information returned by this function includes information for IPv6 interfaces.

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

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.