api: pass around NET_LUID instead of LUID

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-11-02 18:34:49 +01:00
parent f0f18ea4fb
commit ddacb5491a
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -7,6 +7,7 @@
#include <Windows.h>
#include <IPExport.h>
#include <ifdef.h>
#ifdef __cplusplus
extern "C" {
@ -157,7 +158,7 @@ typedef void(WINAPI *WINTUN_GET_ADAPTER_GUID_FUNC)(_In_ WINTUN_ADAPTER_HANDLE Ad
*
* @param Luid Pointer to LUID to receive adapter LUID.
*/
typedef void(WINAPI *WINTUN_GET_ADAPTER_LUID_FUNC)(_In_ WINTUN_ADAPTER_HANDLE Adapter, _Out_ LUID *Luid);
typedef void(WINAPI *WINTUN_GET_ADAPTER_LUID_FUNC)(_In_ WINTUN_ADAPTER_HANDLE Adapter, _Out_ NET_LUID *Luid);
/**
* Returns the name of the Wintun adapter.