api: remove guid getter

The iphlpapi takes both LUIDs and GUIDs but prefers LUIDs, so exposing
the NET_LUID makes sense. However, we were previously exposing the
configuration GUID, rather than the net GUID, which is confusing, so
just make it all go away.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-11-03 12:34:19 +01:00
parent 2af7fbd64a
commit 8963f7258e
4 changed files with 2 additions and 21 deletions

View File

@ -766,12 +766,6 @@ cleanupDeviceRegKey:
return Result; return Result;
} }
void WINAPI
WintunGetAdapterGUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ GUID *Guid)
{
memcpy(Guid, &Adapter->CfgInstanceID, sizeof(GUID));
}
void WINAPI void WINAPI
WintunGetAdapterLUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ NET_LUID *Luid) WintunGetAdapterLUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ NET_LUID *Luid)
{ {

View File

@ -9,7 +9,6 @@ EXPORTS
WintunFreeAdapter WintunFreeAdapter
WintunGetAdapter WintunGetAdapter
WintunOpenAdapterDeviceObject WintunOpenAdapterDeviceObject
WintunGetAdapterGUID
WintunGetAdapterLUID WintunGetAdapterLUID
WintunGetAdapterName WintunGetAdapterName
WintunGetReadWaitEvent WintunGetReadWaitEvent

View File

@ -149,15 +149,6 @@ typedef WINTUN_STATUS(WINAPI *WINTUN_GET_ADAPTER_FUNC)(
typedef WINTUN_STATUS( typedef WINTUN_STATUS(
WINAPI *WINTUN_OPEN_ADAPTER_DEVICE_OBJECT_FUNC)(_In_ WINTUN_ADAPTER_HANDLE Adapter, _Out_ HANDLE *Handle); WINAPI *WINTUN_OPEN_ADAPTER_DEVICE_OBJECT_FUNC)(_In_ WINTUN_ADAPTER_HANDLE Adapter, _Out_ HANDLE *Handle);
/**
* Returns the GUID of the adapter.
*
* @param Adapter Adapter handle obtained with WintunGetAdapter or WintunCreateAdapter
*
* @param Guid Pointer to GUID to receive adapter ID.
*/
typedef void(WINAPI *WINTUN_GET_ADAPTER_GUID_FUNC)(_In_ WINTUN_ADAPTER_HANDLE Adapter, _Out_ GUID *Guid);
/** /**
* Returns the LUID of the adapter. * Returns the LUID of the adapter.
* *

View File

@ -19,7 +19,6 @@ static WINTUN_ENUM_ADAPTERS_FUNC WintunEnumAdapters;
static WINTUN_FREE_ADAPTER_FUNC WintunFreeAdapter; static WINTUN_FREE_ADAPTER_FUNC WintunFreeAdapter;
static WINTUN_GET_ADAPTER_FUNC WintunGetAdapter; static WINTUN_GET_ADAPTER_FUNC WintunGetAdapter;
static WINTUN_OPEN_ADAPTER_DEVICE_OBJECT_FUNC WintunOpenAdapterDeviceObject; static WINTUN_OPEN_ADAPTER_DEVICE_OBJECT_FUNC WintunOpenAdapterDeviceObject;
static WINTUN_GET_ADAPTER_GUID_FUNC WintunGetAdapterGUID;
static WINTUN_GET_ADAPTER_LUID_FUNC WintunGetAdapterLUID; static WINTUN_GET_ADAPTER_LUID_FUNC WintunGetAdapterLUID;
static WINTUN_GET_ADAPTER_NAME_FUNC WintunGetAdapterName; static WINTUN_GET_ADAPTER_NAME_FUNC WintunGetAdapterName;
static WINTUN_SET_ADAPTER_NAME_FUNC WintunSetAdapterName; static WINTUN_SET_ADAPTER_NAME_FUNC WintunSetAdapterName;
@ -258,11 +257,9 @@ InitializeWintun(void)
return NULL; return NULL;
#define X(Name, Type) ((Name = (Type)GetProcAddress(Wintun, #Name)) == NULL) #define X(Name, Type) ((Name = (Type)GetProcAddress(Wintun, #Name)) == NULL)
if (X(WintunCreateAdapter, WINTUN_CREATE_ADAPTER_FUNC) || X(WintunDeleteAdapter, WINTUN_DELETE_ADAPTER_FUNC) || if (X(WintunCreateAdapter, WINTUN_CREATE_ADAPTER_FUNC) || X(WintunDeleteAdapter, WINTUN_DELETE_ADAPTER_FUNC) ||
X(WintunDeletePoolDriver, WINTUN_DELETE_POOL_DRIVER_FUNC) || X(WintunDeletePoolDriver, WINTUN_DELETE_POOL_DRIVER_FUNC) || X(WintunEnumAdapters, WINTUN_ENUM_ADAPTERS_FUNC) ||
X(WintunEnumAdapters, WINTUN_ENUM_ADAPTERS_FUNC) || X(WintunFreeAdapter, WINTUN_FREE_ADAPTER_FUNC) || X(WintunFreeAdapter, WINTUN_FREE_ADAPTER_FUNC) || X(WintunGetAdapter, WINTUN_GET_ADAPTER_FUNC) ||
X(WintunGetAdapter, WINTUN_GET_ADAPTER_FUNC) ||
X(WintunOpenAdapterDeviceObject, WINTUN_OPEN_ADAPTER_DEVICE_OBJECT_FUNC) || X(WintunOpenAdapterDeviceObject, WINTUN_OPEN_ADAPTER_DEVICE_OBJECT_FUNC) ||
X(WintunGetAdapterGUID, WINTUN_GET_ADAPTER_GUID_FUNC) ||
X(WintunGetAdapterLUID, WINTUN_GET_ADAPTER_LUID_FUNC) || X(WintunGetAdapterLUID, WINTUN_GET_ADAPTER_LUID_FUNC) ||
X(WintunGetAdapterName, WINTUN_GET_ADAPTER_NAME_FUNC) || X(WintunGetAdapterName, WINTUN_GET_ADAPTER_NAME_FUNC) ||
X(WintunSetAdapterName, WINTUN_SET_ADAPTER_NAME_FUNC) || X(WintunGetVersion, WINTUN_GET_VERSION_FUNC) || X(WintunSetAdapterName, WINTUN_SET_ADAPTER_NAME_FUNC) || X(WintunGetVersion, WINTUN_GET_VERSION_FUNC) ||