GetIfEntry2 function
The GetIfEntry2 function retrieves information for the specified interface on a local computer.
Important
For driver developers, it is recommended to use GetIfEntry2Ex with MibIfEntryNormalWithoutStatistics when possible, in order to avoid a deadlock when servicing NDIS OIDs.
Syntax
NETIOAPI_API GetIfEntry2(
_Inout_ PMIB_IF_ROW2 Row
);
Parameters
- Row [in, out]
A pointer to a MIB_IF_ROW2 structure that, on successful return, receives information for an interface on the local computer. On input, your driver must set the InterfaceLuid member or the InterfaceIndex member of the MIB_IF_ROW2 structure to the interface to retrieve information for.
Return value
GetIfEntry2 returns STATUS_SUCCESS if the function succeeds.
If the function fails, GetIfEntry2 returns one of the following error codes:
Return code | Description |
---|---|
STATUS_INVALID_PARAMETER | An invalid parameter was passed to the function. This error is returned if a NULL pointer is passed in the Row parameter. |
STATUS_NOT_FOUND | The specified interface could not be found. This error is returned if the function cannot find the network interface that is specified by the InterfaceLuid or InterfaceIndex member of the MIB_IF_ROW2 structure that the Row parameter points to. |
Other | Use the FormatMessage function to obtain the message string for the returned error. |
Remarks
On input, your driver must initialize at least the InterfaceLuid or InterfaceIndex member in the MIB_IF_ROW2 structure that is passed in the Row parameter. The members are used in the order that is listed earlier. So if InterfaceLuid is specified, 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), the InterfaceIndex member is next used to determine the interface.
On output, the remaining fields of the MIB_IF_ROW2 structure that the Row parameter points to are filled in.
Requirements
Target platform |
Universal |
Version |
Available in Windows Vista and later versions of the Windows operating systems. |
Header |
Netioapi.h (include Netioapi.h) |
Library |
Netio.lib |
IRQL |
< DISPATCH_LEVEL |