ConvertInterfaceNameToLuidW function

The ConvertInterfaceNameToLuidW function converts a Unicode network interface name to the locally unique identifier (LUID) for the interface.

Note  The ConvertInterfaceXxx API family enumerates identifiers over all interfaces bound to TCP/IP, which may include virtual miniports, lightweight filters, tunnel adapters, and physical interfaces.

Syntax


NETIOAPI_API ConvertInterfaceNameToLuidW(
  _In_   const WCHAR *InterfaceName,
  _Out_  NET_LUID *InterfaceLuid
);

Parameters

InterfaceName [in]

A pointer to a NULL-terminated Unicode string that contains the network interface name.

InterfaceLuid [out]

A pointer to the NET_LUID union for this interface.

Return value

ConvertInterfaceNameToLuidW returns STATUS_SUCCESS if the function succeeds. If the function fails, ConvertInterfaceNameToLuidW returns one of the following error codes:

Return codeDescription
STATUS_INVALID_NAME

The interface name is invalid. ConvertInterfaceNameToLuidW returns this error if the InterfaceName parameter contains an invalid name or the length of the InterfaceName parameter exceeds the maximum allowed string length for this parameter.

STATUS_INVALID_PARAMETER

One of the parameters is invalid. ConvertInterfaceNameToLuidW returns this error if the InterfaceLuid parameter is NULL.

 

Remarks

The ConvertInterfaceNameToLuidW function is protocol-independent and works with network interfaces for both the IPv6 and IPv4 protocols.

The maximum length of the network interface name, NDIS_IF_MAX_STRING_SIZE, without the terminating NULL character, is defined in the Ntddndis.h header file. NDIS_IF_MAX_STRING_SIZE is defined to be the IF_MAX_STRING_SIZE constant, which is defined in the Ifdef.h header file.

Note  The Ntddndis.h and Ifdef.h header files are automatically included in the Netioapi.h header file. You should never use the Ntddndis.h and Ifdef.h header files directly.

Use the ConvertInterfaceNameToLuidA function to convert an ANSI interface name to a LUID.

Requirements

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

Netioapi.h (include Netioapi.h)

IRQL

PASSIVE_LEVEL

See also

ConvertInterfaceAliasToLuid
ConvertInterfaceGuidToLuid
ConvertInterfaceIndexToLuid
ConvertInterfaceLuidToGuid
ConvertInterfaceLuidToIndex
ConvertInterfaceLuidToNameA
ConvertInterfaceLuidToNameW
ConvertInterfaceNameToLuidA
NET_LUID

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft