Platform SDK: Internet Protocol Helper

GetAdapterIndex

The GetAdapterIndex function obtains the index of an adapter, given its name.

DWORD GetAdapterIndex(
  LPWSTR AdapterName,    // name of the adapter
  PULONG IfIndex         // index of the adapter
);

Parameters

AdapterName
Pointer to a Unicode string that contains the name of the adapter.
IfIndex
Pointer to a ULONG variable that, on successful return, points to the index of the adapter.

Return Values

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.

Requirements

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

See Also

MprConfigGetFriendlyName, MprConfigGetGuidName