ConvertInterfaceLuidToAlias function

The ConvertInterfaceLuidToAlias function converts a locally unique identifier (LUID) for a network interface to an interface alias.

Syntax

IPHLPAPI_DLL_LINKAGE _NETIOAPI_SUCCESS_ NETIOAPI_API ConvertInterfaceLuidToAlias(
  const NET_LUID *InterfaceLuid,
  PWSTR          InterfaceAlias,
  SIZE_T         Length
);

Parameters

InterfaceLuid

A pointer to a NET_LUID for a network interface.

InterfaceAlias

A pointer to a buffer to hold the NULL-terminated Unicode string containing the alias name of the network interface when the function returns successfully.

Length

The length, in characters, of the buffer pointed to by the InterfaceAlias parameter. This value must be large enough to accommodate the alias name of the network interface and the terminating NULL character. The maximum required length is NDIS_IF_MAX_STRING_SIZE + 1.

Return Value

On success, ConvertInterfaceLuidToAlias returns NO_ERROR. Any nonzero return value indicates failure.

Error code Meaning
ERROR_INVALID_PARAMETER
One of the parameters was invalid. This error is returned if either the InterfaceLuid or InterfaceAlias parameter was NULL or if the InterfaceLuid parameter was invalid.
ERROR_NOT_ENOUGH_MEMORY
Not enough storage is available to process this command. This error is returned if the size of the buffer pointed to by the InterfaceAlias parameter was not large enough as specified in the Length parameter to hold the alias name.

Remarks

The ConvertInterfaceLuidToAlias function is available on Windows Vistaand later.

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

The maximum length of the alias name for a network interface, NDIS_IF_MAX_STRING_SIZE, without the terminating NULL is declared in the Ntddndis.h header file. The NDIS_IF_MAX_STRING_SIZE is defined to be the IF_MAX_STRING_SIZE constant defined in the Ifdef.h header file. The Ntddndis.h and Ifdef.h header files are automatically included in the Netioapi.h header file which is automatically included by the Iphlpapi.h header file. The Ntddndis.h, Ifdef.h, and Netioapi.h header files should never be used directly.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header netioapi.h (include Iphlpapi.h)
Library Iphlpapi.lib
DLL Iphlpapi.dll

See Also

ConvertInterfaceAliasToLuid

ConvertInterfaceGuidToLuid

ConvertInterfaceIndexToLuid

ConvertInterfaceLuidToGuid

ConvertInterfaceLuidToIndex

ConvertInterfaceLuidToNameA

ConvertInterfaceLuidToNameW

ConvertInterfaceNameToLuidA

ConvertInterfaceNameToLuidW

NET_LUID

if_indextoname

if_nametoindex