You can use WSAIoctl() with the SIO_GET_INTERFACE_LIST command. It's not documented in the command list in the documentation, but it works. There is example code you can get from Microsoft here:
The only problam I had using it was that I passed in the address of an INTERFACE_INFO structure. It failed with WSAEFAULT, which the code it returns when the data structure you give it isn't large enough. The argument needed to be the address of an array of INTERFACE_INFO structures that was big enough to hold all of the interfaces present. Even if there is only one interface on your system, it will enumerate the loopback address also. The example code clarified it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.