iphlpapi: Implement if_indextoname() 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:
Huw Davies 2021-07-02 09:41:35 +01:00 committed by Alexandre Julliard
parent 259f7c7c47
commit 84a51219b5
1 changed files with 11 additions and 3 deletions

View File

@ -3374,11 +3374,19 @@ IF_INDEX WINAPI IPHLP_if_nametoindex(const char *name)
/******************************************************************
* if_indextoname (IPHLPAPI.@)
*/
PCHAR WINAPI IPHLP_if_indextoname(NET_IFINDEX index, PCHAR name)
char *WINAPI IPHLP_if_indextoname( NET_IFINDEX index, char *name )
{
TRACE("(%u, %p)\n", index, name);
NET_LUID luid;
DWORD err;
return getInterfaceNameByIndex(index, name);
TRACE( "(%u, %p)\n", index, name );
err = ConvertInterfaceIndexToLuid( index, &luid );
if (err) return NULL;
err = ConvertInterfaceLuidToNameA( &luid, name, IF_MAX_STRING_SIZE );
if (err) return NULL;
return name;
}
/******************************************************************