Commit 259f7c7c authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

iphlpapi: Implement if_nametoindex() using the ConvertInterface* functions.

parent 7bdd9894
......@@ -3357,13 +3357,18 @@ DWORD WINAPI ConvertLengthToIpv4Mask(ULONG mask_len, ULONG *mask)
*/
IF_INDEX WINAPI IPHLP_if_nametoindex(const char *name)
{
IF_INDEX idx;
IF_INDEX index;
NET_LUID luid;
DWORD err;
TRACE("(%s)\n", name);
if (getInterfaceIndexByName(name, &idx) == NO_ERROR)
return idx;
TRACE( "(%s)\n", name );
return 0;
err = ConvertInterfaceNameToLuidA( name, &luid );
if (err) return 0;
err = ConvertInterfaceLuidToIndex( &luid, &index );
if (err) index = 0;
return index;
}
/******************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment