Documentation for MIB_IPFORWARDROW
structure being interestingly vague on this particular point, except for a mention of Windows Vista/Server 2008:
On Windows Vista and Windows Server 2008, the route metric specified in the dwForwardMetric1 member of the MIB_IPFORWARDROW structure represents a combination of the route metric added to the interface metric specified in the Metric member of the MIB_IPINTERFACE_ROW structure of the associated interface. So the dwForwardMetric1 member of the MIB_IPFORWARDROW structure should be equal to or greater than Metric member of the associated MIB_IPINTERFACE_ROW structure.
What about Win10 and onwards?
With MIB_IPFORWARD_ROW2
for example, it states pretty clearly that its Metric
field should be added to MIB_IPINTERFACE_ROW
Metric
:
The route metric offset value for this IP route entry. Note the actual route metric used to compute the route preference is the summation of interface metric specified in the Metric member of the MIB_IPINTERFACE_ROW structure and the route metric offset specified in this member.
I'd like to avoid unnecessary calculation of route preference, but does dwForwardMetric1 include both interface and route metrics on win10/11 ?