If the method succeeds, the return value is the number of
network addresses that are configured for the local host. If the
method fails, the return value is INET_ERROR. To get extended error
information, call the GetLastError method.
If the nAddressFamily parameter is specified as
INET_ADDRESS_ANY, the application must be prepared to accept IPv6
addresses returned by this method. On Windows Vista and later
versions of the operating system, IPv6 support is enabled and the
local network adapter will have IPv6 addresses assigned to them by
default. For legacy applications that only recognize IPv4 addresses,
the nAddressFamily parameter should always be specified as
INET_ADDRESS_IPV4 to ensure that only IPv4 addresses are returned.
This method will ignore addresses that are bound to a disabled
interface, as well as those addresses bound to a virtual loopback
interface. For example, although the loopback address 127.0.0.1 is a
valid network address, it will not be included in list of addresses
returned by this method.
The first IPv4 or IPv6 address returned by this method is
typically the address assigned to the primary network adapter on the
local system. However, your application should not depend on addresses
being returned in any particular order. If the system has
virtualization software installed, this method may also include
the IP addresses assigned to any virtualized network adapters
installed by that software.