ConvertInterfaceIndexToLuid 函数将网络接口的本地索引转换为接口的本地唯一标识符(LUID)。
注意
ConvertInterfaceXxx API 系列枚举绑定到 TCP/IP 的所有接口的标识符,这些接口可能包括虚拟微型端口、轻型筛选器、隧道适配器和物理接口。
语法
NETIOAPI_API ConvertInterfaceIndexToLuid(
_In_ NET_IFINDEX InterfaceIndex,
_Out_ PNET_LUID InterfaceLuid
);
参数
InterfaceIndex [in]
网络接口的本地索引值。InterfaceLuid [out]
指向网络接口 NET_LUID 联合的指针。
返回值
ConvertInterfaceIndexToLuid 如果函数成功,则返回STATUS_SUCCESS。 如果函数失败,InterfaceLuid 参数设置为 NULL,ConvertInterfaceIndexToLuid 返回以下错误代码:
| 返回代码 | 描述 |
|---|---|
| STATUS_INVALID_PARAMETER | 其中一个参数无效。 ConvertInterfaceIndexToLuid 如果 InterfaceLuid 参数 NULL,或者如果 InterfaceIndex 参数无效,则返回此错误。 |
言论
ConvertInterfaceIndexToLuid 函数与协议无关,适用于 IPv6 和 IPv4 协议的网络接口。
要求
目标平台 |
通用 |
版本 |
在 Windows Vista 和更高版本的 Windows作系统中可用。 |
页眉 |
Netioapi.h (包括 Netioapi.h) |
图书馆 |
Netio.lib |
IRQL |
PASSIVE_LEVEL |