Share via

Does the ipconfig function return the addresses in the same order as the GetAdaptersAddresses function?

Michiel Saelen 56 Reputation points
2021-02-15T08:35:05.113+00:00

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
0 comments No comments

Answer accepted by question author

Castorix31 91,876 Reputation points
2021-02-15T08:44:32.487+00:00

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)

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.