iphlpapi: Implement ConvertInterfaceGuidToLuid() 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:
parent
4add1d79e7
commit
13e596b3fe
|
@ -3164,20 +3164,31 @@ ULONG WINAPI GetTcp6Table2(PMIB_TCP6TABLE2 table, PULONG size, BOOL order)
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI ConvertInterfaceGuidToLuid(const GUID *guid, NET_LUID *luid)
|
DWORD WINAPI ConvertInterfaceGuidToLuid(const GUID *guid, NET_LUID *luid)
|
||||||
{
|
{
|
||||||
DWORD ret;
|
struct nsi_ndis_ifinfo_static *data;
|
||||||
MIB_IFROW row;
|
DWORD err, count, i;
|
||||||
|
NET_LUID *keys;
|
||||||
|
|
||||||
TRACE("(%s %p)\n", debugstr_guid(guid), luid);
|
TRACE( "(%s %p)\n", debugstr_guid(guid), luid );
|
||||||
|
|
||||||
if (!guid || !luid) return ERROR_INVALID_PARAMETER;
|
if (!guid || !luid) return ERROR_INVALID_PARAMETER;
|
||||||
|
luid->Value = 0;
|
||||||
|
|
||||||
row.dwIndex = guid->Data1;
|
err = NsiAllocateAndGetTable( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, (void **)&keys, sizeof(*keys),
|
||||||
if ((ret = GetIfEntry( &row ))) return ret;
|
NULL, 0, NULL, 0, (void **)&data, sizeof(*data), &count, 0 );
|
||||||
|
if (err) return err;
|
||||||
|
|
||||||
luid->Info.Reserved = 0;
|
err = ERROR_INVALID_PARAMETER;
|
||||||
luid->Info.NetLuidIndex = guid->Data1;
|
for (i = 0; i < count; i++)
|
||||||
luid->Info.IfType = row.dwType;
|
{
|
||||||
return NO_ERROR;
|
if (IsEqualGUID( &data[i].if_guid, guid ))
|
||||||
|
{
|
||||||
|
luid->Value = keys[i].Value;
|
||||||
|
err = ERROR_SUCCESS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
NsiFreeTable( keys, NULL, NULL, data );
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
|
|
Loading…
Reference in New Issue