GetNumberOfInterfaces function

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

Syntax


DWORD GetNumberOfInterfaces(
  _Out_ PDWORD pdwNumIf
);

Parameters

pdwNumIf [out]

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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Iphlpapi.h

Library

Iphlpapi.lib

DLL

Iphlpapi.dll

See also

IP Helper Start Page
IP Helper Function Reference
GetAdaptersInfo
GetIfEntry
GetInterfaceInfo

 

 

Show: