ConvertInterfaceNameToLuidA (NETIOAPI) (Compact 2013)

3/26/2014

This function converts an ANSI network interface name to the locally unique identifier (LUID) for the interface.

Syntax

NETIOAPI_API
  ConvertInterfaceNameToLuidA(
    IN const CHAR*  InterfaceName,
    OUT NET_LUID*  InterfaceLuid
    );

Parameters

  • InterfaceName
    A pointer to a NULL-terminated ANSI string that contains the network interface name.
  • InterfaceLuid
    A pointer to the NET_LUID structure for this interface.

Return Value

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

Error Code

Meaning

ERROR_BUFFER_OVERFLOW

The length of the ANSI interface name is invalid. ConvertInterfaceNameToLuidA returns this error if the InterfaceName parameter exceeds the maximum allowed string length for this parameter.

STATUS_INVALID_NAME

The interface name is invalid. ConvertInterfaceNameToLuidA returns this error if the InterfaceName parameter contains an invalid interface name.

STATUS_INVALID_PARAMETER

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

Remarks

The ConvertInterfaceNameToLuidA 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, 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. The Ntddndis.h and Ifdef.h header files are automatically included in the Netioapi.h header file. You should not use the Ntddndis.h and Ifdef.h header files directly.

Use the ConvertInterfaceNameToLuidW (NETIOAPI) function to convert a Unicode interface name to a LUID.

See Also

Reference

IP Helper Kernel-Mode Functions
ConvertInterfaceAliasToLuid (NETIOAPI)
ConvertInterfaceGuidToLuid (NETIOAPI)
ConvertInterfaceIndexToLuid (NETIOAPI)
ConvertInterfaceLuidToGuid (NETIOAPI)
ConvertInterfaceLuidToIndex (NETIOAPI)
ConvertInterfaceLuidToNameA (NETIOAPI)
ConvertInterfaceLuidToNameW (NETIOAPI)
ConvertInterfaceNameToLuidW (NETIOAPI)
NET_LUID