If you trace ipconfig, you can see it calls GetAdaptersAddresses
(with flags GAA_FLAG_INCLUDE_GATEWAYS | GAA_FLAG_INCLUDE_WINS_INFO | GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST)
Does the ipconfig function return the addresses in the same order as the GetAdaptersAddresses function?
Michiel Saelen
56
Reputation points
Do we know if the GetAdaptersAddresses function (iphlpapi.h) will return the addresses in the same order as the ipconfig call?
GetAdaptersAddresses function (iphlpapi.h):
https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses
ipconfig:
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ipconfig
Windows development | Windows API - Win32
Windows for business | Windows Server | User experience | PowerShell
Answer accepted by question author
Castorix31
91,876
Reputation points