Share via


ConvertInterfaceLuidToNameW (NETIOAPI) (Compact 2013)

3/26/2014

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

Syntax

NETIOAPI_API
  ConvertInterfaceLuidToNameW(
    IN const NET_LUID*  InterfaceLuid,
    __out_ecount(Length) PWSTR  InterfaceName,
    __in SIZE_T  Length
    );

Parameters

  • InterfaceLuid
    A pointer to a NET_LUID structure for the network interface.
  • InterfaceName
    A pointer to a buffer to hold the NULL-terminated Unicode string. If ConvertInterfaceLuidToNameW returns successfully, InterfaceName contains the Unicode interface name.
  • Length
    The length of the buffer that the InterfaceName parameter points to. This value must be large enough to hold the interface name and the terminating NULL character. The maximum allowed length is NDIS_IF_MAX_STRING_SIZE + 1. For more information about NDIS_IF_MAX_STRING_SIZE, see the following Remarks section.

Return Value

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

Error Code

Meaning

STATUS_INVALID_PARAMETER

One of the parameters is invalid. ConvertInterfaceLuidToNameW returns this error if either InterfaceLuid or InterfaceName is NULL, or if InterfaceLuid is invalid.

STATUS_NOT_ENOUGH_MEMORY

ConvertInterfaceLuidToNameW returns this error if the InterfaceName buffer was not as large as specified in the Length parameter. Therefore, the buffer could not hold the interface name.

Remarks

The ConvertInterfaceLuidToNameW 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. The 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 ConvertInterfaceLuidToNameA (NETIOAPI) to convert a network interface LUID to an ANSI interface name.

See Also

Reference

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