From ddacb5491aadb2a013a80cb5d45e23fec85c5d68 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 2 Nov 2020 18:34:49 +0100 Subject: api: pass around NET_LUID instead of LUID Signed-off-by: Jason A. Donenfeld --- api/adapter.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'api/adapter.c') diff --git a/api/adapter.c b/api/adapter.c index 973316e..5953e9b 100644 --- a/api/adapter.c +++ b/api/adapter.c @@ -774,10 +774,11 @@ WintunGetAdapterGUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ GUID *Guid) } void WINAPI -WintunGetAdapterLUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ LUID *Luid) +WintunGetAdapterLUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ NET_LUID *Luid) { - *(LONGLONG *)Luid = (((LONGLONG)Adapter->LuidIndex & ((1 << 24) - 1)) << 24) | - (((LONGLONG)Adapter->IfType & ((1 << 16) - 1)) << 48); + Luid->Info.Reserved = 0; + Luid->Info.NetLuidIndex = Adapter->LuidIndex; + Luid->Info.IfType = Adapter->IfType; } WINTUN_STATUS WINAPI -- cgit v1.2.3-59-g8ed1b