I am using "GetAdaptersAddresses" function (using C++) to get the MAC address of the computer.
GetAdaptersAddresses returns a link list of PIP_ADAPTER_ADDRESSES for all the adapters connected to the system. I want to fetch the physical address of the Ethernet card specifically. Currently it comes at the first node of the list returned by the GetAdaptersAddresses and the MSDN document (https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses) does not specifically mentioned about the order of the adapters in the list, and could be changed based on the connected adapters. The order is not reliable. Moreover, the order is different on different machine.
Ethernet card is assured to be always connected to the device and the mac address is never changed. How to traverse the list to fetch the physical address of Ethernet card?
(I understand that the'Description' and 'Friendly name' can not be used as they can be changed)