次の方法で共有


GetIfTable (Compact 2013)

3/26/2014

This function retrieves the MIB-II interface table.

Syntax

DWORD GetIfTable(
  PMIB_IFTABLE pIfTable, 
  PULONG pdwSize, 
  BOOL bOrder 
);

Parameters

  • pIfTable
    [out] Pointer to a buffer that contains the interface table as a MIB_IFTABLE structure.
  • pdwSize
    [in, out] The size of the buffer pointed to by the pIfTable parameter. If the buffer is not large enough to hold the returned interface table, the function sets this parameter equal to the required buffer size.
  • bOrder
    [in] TRUE if the interface table should be sorted in ascending order by interface index, and FALSE otherwise.

Return Value

Return code

Description

NO_ERROR

The function succeeds.

ERROR_INSUFFICIENT_BUFFER

The buffer pointed to by the pIfTable parameter is not large enough. The required size is returned in the DWORD variable pointed to by the pdwSize parameter.

ERROR_INVALID_PARAMETER

The pdwSize parameter is NULL, or GetIfTable is unable to write to the memory pointed to by the pdwSize parameter.

ERROR_NOT_SUPPORTED

This function is not supported on the operating system that is used on the local system.

Other

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

Requirements

Header

iphlpapi.h

Library

Iphlpapi.lib

See Also

Reference

IP Helper Functions
GetIfEntry
GetIfEntry2
GetIfTable2
GetIfTable2Ex
GetNumberOfInterfaces
MIB_IFROW
MIB_IFTABLE
MIB_IF_ROW2
MIB_IF_TABLE2

Other Resources

IP Helper