On Win10 I can run get-netinterface in powershell to display InterfaceMetric for each interface. Is there a C/C++ Win API that would let me retrieve it programmatically?
The metric can be set in adapter's TCP/IP settings:
On Win10 I can run get-netinterface in powershell to display InterfaceMetric for each interface. Is there a C/C++ Win API that would let me retrieve it programmatically?
The metric can be set in adapter's TCP/IP settings:
Is there a C/C++ Win API that would let me retrieve [InterfaceMetric] programmatically?
Use GetAdaptersAddresses()
. See the Ipv4Metric
and Ipv6Metric
members of the IP_ADAPTER_ADDRESSES
struct.