GetIfEntry2Ex function (netioapi.h)
The GetIfEntry2Ex function retrieves the specified level of information for the specified interface on the local computer.
IPHLPAPI_DLL_LINKAGE _NETIOAPI_SUCCESS_ NETIOAPI_API GetIfEntry2Ex( MIB_IF_ENTRY_LEVEL Level, PMIB_IF_ROW2 Row );
The level of interface information to retrieve. This parameter can be one of the values from the MIB_IF_ENTRY_LEVEL enumeration type defined in the Netioapi.h header file.
||The values of statistics and state returned in members of the MIB_IF_ROW2 structure pointed to by the Row parameter are returned from the top of the filter stack.|
||The values of state (without statistics) returned in members of the MIB_IF_ROW2 structure pointed to by the Row parameter are returned from the top of the filter stack.|
A pointer to a MIB_IF_ROW2 structure that, on successful return, receives information for an interface on the local computer. On input, the InterfaceLuid or the InterfaceIndex member of the MIB_IF_ROW2 must be set to the interface for which to retrieve information.
If the function succeeds, the return value is NO_ERROR.
If the function fails, the return value is one of the following error codes.
||The system cannot find the file specified. This error is returned if the network interface LUID or interface index specified by the InterfaceLuid or InterfaceIndex member of the MIB_IF_ROW2 pointed to by the Row parameter was not a value on the local machine.|
||An invalid parameter was passed to the function. This error is returned if a NULL parameter is passed in the Row parameter. This error is also returned if the both the InterfaceLuid and InterfaceIndex member of the MIB_IF_ROW2 pointed to by the Row parameter are unspecified.|
||Use the FormatMessage function to obtain the message string for the returned error.|
GetIfEntry2Ex function retrieves information for a specified interface on a local system and returns this information in a pointer to a
MIB_IF_ROW2 structure. GetIfEntry2Ex is an enhanced version of the GetIfEntry2 function that allows selecting the level of interface information to retrieve.
On input, at least one of the following members in the MIB_IF_ROW2 structure passed in the Row parameter must be initialized: InterfaceLuid or InterfaceIndex.
The fields are used in the order listed above. So if the InterfaceLuid is specified, then this member is used to determine the interface. If no value was set for the InterfaceLuid member (the value of this member was set to zero), then the InterfaceIndex member is next used to determine the interface.
On output, the remaining fields of the MIB_IF_ROW2 structure pointed to by the Row parameter are filled in.
Note that the Netioapi.h header file is automatically included in Iphlpapi.h header file, and should never be used directly.
|Minimum supported client||Windows 10, version 1703 [desktop apps only]|
|Minimum supported server||Windows Server 2016 [desktop apps only]|
|Header||netioapi.h (include Iphlpapi.h)|