Freigeben über


GetIfTable2 (Compact 2013)

3/26/2014

This function retrieves the MIB-II interface table.

Syntax

NETIOAPI_API GetIfTable2(
  __out  PMIB_IF_TABLE2* Table
);

Parameters

  • Table
    A pointer to a buffer that receives the table of interfaces in a MIB_IF_TABLE2 structure.

Return Value

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value is one of the following error codes.

Return code

Description

ERROR_NOT_ENOUGH_MEMORY

Insufficient memory resources are available to complete the operation.

Other

Use FormatMessage to obtain the message string for the returned error.

Remarks

The GetIfTable2 function enumerates the logical and physical interfaces on a local system and returns this information in a MIB_IF_TABLE2 structure. GetIfTable2 is an enhanced version of the GetIfTable function.

A similar GetIfTable2Ex function can be used to specify the level of interfaces to return. Calling the GetIfTable2Ex function that has the Level parameter set to MibIfTableNormal retrieves the same results as calling the GetIfTable2 function.

Interfaces are returned in a MIB_IF_TABLE2 structure in the buffer pointed to by the Table parameter. The MIB_IF_TABLE2 structure contains an interface count and an array of MIB_IF_ROW2 structures for each interface. Memory is allocated by the GetIfTable2 function for the MIB_IF_TABLE2 structure and the MIB_IF_ROW2 entries in this structure. When these returned structures are no longer required, free the memory by calling the FreeMibTable.

Note that the returned MIB_IF_TABLE2 structure pointed to by the Table parameter may contain padding for alignment between the NumEntries member and the first MIB_IF_ROW2 array entry in the Table member of the MIB_IF_TABLE2 structure. Padding for alignment may also be present between the MIB_IF_ROW2 array entries. Any access to a MIB_IF_ROW2 array entry should assume padding may exist.

See Also

Reference

IP Helper Functions
FreeMibTable
GetIfTable
GetIfTable2Ex
MIB_IF_TABLE2
MIB_IF_ROW2

Other Resources

IP Helper