Platform SDK: Internet Protocol Helper

GetInterfaceInfo

The GetInterfaceInfo function obtains a list of the network interface adapters on the local system.

DWORD GetInterfaceInfo(
  PIP_INTERFACE_INFO pIfTable,    // buffer to receive info
  PULONG dwOutBufLen              // size of buffer 
);

Parameters

pIfTable
Pointer to a buffer that receives an IP_INTERFACE_INFO structure that contains the list of adapters. This buffer should be allocated by the caller.
dwOutBufLen
Pointer to a DWORD variable. If the buffer pointed to by the pIfTable parameter is NULL, or is not large enough to contain the list of adapters, GetInterfaceInfo returns the required size in this DWORD variable.

Return Values

If the function succeeds, the return value is NO_ERROR.

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

Value Meaning
ERROR_INVALID_PARAMETER The dwOutBufLen parameter is NULL, or GetInterfaceInterface is unable to write to the memory pointed to by the dwOutBufLen parameter.
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 dwOutBufLen parameter.
ERROR_NOT_SUPPORTED This function is not supported on the operating system in use on the local system.
Other Use FormatMessage to obtain the message string for the returned error.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in Iphlpapi.h.
  Library: Use Iphlpapi.lib.

See Also

IP_INTERFACE_INFO