iphlpapi: Implement if_nametoindex() using the ConvertInterface* functions.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7bdd9894f4
commit
259f7c7c47
|
@ -3357,13 +3357,18 @@ DWORD WINAPI ConvertLengthToIpv4Mask(ULONG mask_len, ULONG *mask)
|
||||||
*/
|
*/
|
||||||
IF_INDEX WINAPI IPHLP_if_nametoindex(const char *name)
|
IF_INDEX WINAPI IPHLP_if_nametoindex(const char *name)
|
||||||
{
|
{
|
||||||
IF_INDEX idx;
|
IF_INDEX index;
|
||||||
|
NET_LUID luid;
|
||||||
|
DWORD err;
|
||||||
|
|
||||||
TRACE("(%s)\n", name);
|
TRACE( "(%s)\n", name );
|
||||||
if (getInterfaceIndexByName(name, &idx) == NO_ERROR)
|
|
||||||
return idx;
|
|
||||||
|
|
||||||
return 0;
|
err = ConvertInterfaceNameToLuidA( name, &luid );
|
||||||
|
if (err) return 0;
|
||||||
|
|
||||||
|
err = ConvertInterfaceLuidToIndex( &luid, &index );
|
||||||
|
if (err) index = 0;
|
||||||
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
|
|
Loading…
Reference in New Issue