GetNumberOfInterfaces function (iphlpapi.h)

The GetNumberOfInterfaces functions retrieves the number of interfaces on the local computer.

Syntax

IPHLPAPI_DLL_LINKAGE DWORD GetNumberOfInterfaces(
  [out] PDWORD pdwNumIf
);

Parameters

[out] pdwNumIf

Pointer to a DWORD variable that receives the number of interfaces on the local computer.

Return value

If the function succeeds, the return value is NO_ERROR.

If the function fails, use FormatMessage to obtain the message string for the returned error.

Remarks

The GetNumberOfInterfaces function returns the number of interfaces on the local computer, including the loopback interface. This number is one more than the number of adapters returned by the GetAdaptersInfo and GetInterfaceInfo functions because these functions do not return information about the loopback interface.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header iphlpapi.h
Library Iphlpapi.lib
DLL Iphlpapi.dll

See also

GetAdaptersInfo

GetIfEntry

GetInterfaceInfo

IP Helper Function Reference

IP Helper Start Page