iphlpapi: Implement ConvertInterfaceLuidToGuid() 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
13e596b3fe
commit
3bee9c080b
|
@ -3213,20 +3213,17 @@ DWORD WINAPI ConvertInterfaceIndexToLuid(NET_IFINDEX index, NET_LUID *luid)
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI ConvertInterfaceLuidToGuid(const NET_LUID *luid, GUID *guid)
|
DWORD WINAPI ConvertInterfaceLuidToGuid(const NET_LUID *luid, GUID *guid)
|
||||||
{
|
{
|
||||||
DWORD ret;
|
DWORD err;
|
||||||
MIB_IFROW row;
|
|
||||||
|
|
||||||
TRACE("(%p %p)\n", luid, guid);
|
TRACE( "(%p %p)\n", luid, guid );
|
||||||
|
|
||||||
if (!luid || !guid) return ERROR_INVALID_PARAMETER;
|
if (!luid || !guid) 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, guid, sizeof(*guid),
|
||||||
|
FIELD_OFFSET(struct nsi_ndis_ifinfo_static, if_guid) );
|
||||||
memset( guid, 0, sizeof(*guid) );
|
if (err) memset( guid, 0, sizeof(*guid) );
|
||||||
guid->Data1 = luid->Info.NetLuidIndex;
|
return err;
|
||||||
memcpy( guid->Data4+2, "NetDev", 6 );
|
|
||||||
return NO_ERROR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
|
|
Loading…
Reference in New Issue