Expand Minimize

ConvertInterfaceNameToLuidW function

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

Syntax


NETIO_STATUS WINAPI ConvertInterfaceNameToLuidW(
  _In_   const WCHAR *InterfaceName,
  _Out_  PNET_LUID InterfaceLuid
);

Parameters

InterfaceName [in]

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

InterfaceLuid [out]

A pointer to the NET_LUID for this interface.

Return value

On success, ConvertInterfaceNameToLuidW returns NETIO_ERROR_SUCCESS. Any nonzero return value indicates failure.

Error codeMeaning
ERROR_INVALID_NAME

The interface name was invalid. This error is returned if the InterfaceName parameter contained an invalid name or the length of the InterfaceName parameter exceeded the maximum allowed string length for this parameter.

ERROR_INVALID_PARAMETER

One of the parameters was invalid. This error is returned if the InterfaceLuid parameter was NULL.

 

Remarks

The ConvertInterfaceNameToLuidW function is available on Windows Vista and later.

The ConvertInterfaceNameToLuidW function is protocol independent and works with network interfaces for both the IPv6 and IPv4 protocol. The ConvertInterfaceNameToLuidW converts a Unicode interface name to a LUID.

The ConvertInterfaceNameToLuidA converts an ANSI interface name to a LUID.

The maximum length of an interface name, 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]

Header

Netioapi.h (include Iphlpapi.h)

Library

Iphlpapi.lib

DLL

Iphlpapi.dll

See also

ConvertInterfaceAliasToLuid
ConvertInterfaceGuidToLuid
ConvertInterfaceIndexToLuid
ConvertInterfaceLuidToAlias
ConvertInterfaceLuidToGuid
ConvertInterfaceLuidToIndex
ConvertInterfaceLuidToNameA
ConvertInterfaceLuidToNameW
ConvertInterfaceNameToLuidA
if_indextoname
if_nametoindex
NET_LUID

 

 

Community Additions

ADD
Show:
© 2014 Microsoft