iphlpapi: Implement ConvertInterfaceLuidToIndex() on top of nsi.

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-06 10:11:49 +01:00 committed by Alexandre Julliard
parent a124b765b1
commit 4add1d79e7
1 changed files with 7 additions and 8 deletions

View File

@ -3223,18 +3223,17 @@ DWORD WINAPI ConvertInterfaceLuidToGuid(const NET_LUID *luid, GUID *guid)
*/ */
DWORD WINAPI ConvertInterfaceLuidToIndex(const NET_LUID *luid, NET_IFINDEX *index) DWORD WINAPI ConvertInterfaceLuidToIndex(const NET_LUID *luid, NET_IFINDEX *index)
{ {
DWORD ret; DWORD err;
MIB_IFROW row;
TRACE("(%p %p)\n", luid, index); TRACE( "(%p %p)\n", luid, index );
if (!luid || !index) return ERROR_INVALID_PARAMETER; if (!luid || !index) return ERROR_INVALID_PARAMETER;
row.dwIndex = luid->Info.NetLuidIndex; err = NsiGetParameter( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, luid, sizeof(*luid),
if ((ret = GetIfEntry( &row ))) return ret; NSI_PARAM_TYPE_STATIC, index, sizeof(*index),
FIELD_OFFSET(struct nsi_ndis_ifinfo_static, if_index) );
*index = luid->Info.NetLuidIndex; if (err) *index = 0;
return NO_ERROR; return err;
} }
/****************************************************************** /******************************************************************