Am Mittwoch, 25. November 2015 schrieb Jamie Taylor:
Interesting. Does GetAdaptersInfo return a non-null PIP_ADAPTER_INFO when there are no adapters on the (virtual) machine? How about GetIpAddrTable?
GetAdaptersInfo fails with ERROR_NO_DATA in this case. GetIpAddrTable returns the loopback IP address.
Does the list of addresses returned by gethostbyname(gethostname()) include the loopback address when there _are_ other adapters configured with IPv4 addresses?
No. (However, if there is a loopback adapter added manually, its address is returned, just like with all other adapters.)
(And if there are multiple loopback adapters installed/configured then are all of their addresses included?)
Yes.
Full test results in a Windows 8.1 VMware VM are here: http://pastebin.com/EjD5rec1
Joachim