diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-03 12:31:49 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-03 12:31:49 +0100 |
commit | 2af7fbd64aeea5c178c94054270e716be0b2a344 (patch) | |
tree | edcaefd722abf1f9640c577a7c82503ef87418ed | |
parent | api: add pool/driver removal for uninstaller semantics (diff) | |
download | wintun-2af7fbd64aeea5c178c94054270e716be0b2a344.tar.xz wintun-2af7fbd64aeea5c178c94054270e716be0b2a344.zip |
api: use 'open' name since caller must close handle
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | api/adapter.c | 2 | ||||
-rw-r--r-- | api/adapter.h | 4 | ||||
-rw-r--r-- | api/exports.def | 2 | ||||
-rw-r--r-- | api/session.c | 2 | ||||
-rw-r--r-- | api/wintun.h | 2 | ||||
-rw-r--r-- | example/example.c | 4 |
7 files changed, 9 insertions, 9 deletions
@@ -34,7 +34,7 @@ Manage the network adapters using following functions: - `WintunEnumAdapters()` enumerates all existing adapters. - `WintunGetAdapter()` gets existing adapter handle. - `WintunFreeAdapter()` frees adapter handle. -- `WintunGetAdapterDeviceObject()` opens adapter device object. +- `WintunOpenAdapterDeviceObject()` opens adapter device object. - `WintunGetAdapterGUID()` gets adapter GUID. - `WintunGetAdapterLUID()` gets adapter LUID. - `WintunGetAdapterName()` gets adapter name. diff --git a/api/adapter.c b/api/adapter.c index 8cd244d..3db3174 100644 --- a/api/adapter.c +++ b/api/adapter.c @@ -781,7 +781,7 @@ WintunGetAdapterLUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ NET_LUID *Luid) } WINTUN_STATUS WINAPI -WintunGetAdapterDeviceObject(_In_ const WINTUN_ADAPTER *Adapter, _Out_ HANDLE *Handle) +WintunOpenAdapterDeviceObject(_In_ const WINTUN_ADAPTER *Adapter, _Out_ HANDLE *Handle) { return GetDeviceObject(Adapter->DevInstanceID, Handle); } diff --git a/api/adapter.h b/api/adapter.h index cb64af7..40c087a 100644 --- a/api/adapter.h +++ b/api/adapter.h @@ -35,10 +35,10 @@ void WINAPI WintunFreeAdapter(_In_ WINTUN_ADAPTER *Adapter); /** - * @copydoc WINTUN_GET_ADAPTER_DEVICE_OBJECT_FUNC + * @copydoc WINTUN_OPEN_ADAPTER_DEVICE_OBJECT_FUNC */ WINTUN_STATUS WINAPI -WintunGetAdapterDeviceObject(_In_ const WINTUN_ADAPTER *Adapter, _Out_ HANDLE *Handle); +WintunOpenAdapterDeviceObject(_In_ const WINTUN_ADAPTER *Adapter, _Out_ HANDLE *Handle); /** * @copydoc WINTUN_CREATE_ADAPTER_FUNC diff --git a/api/exports.def b/api/exports.def index dd7f9bb..10c82c2 100644 --- a/api/exports.def +++ b/api/exports.def @@ -8,7 +8,7 @@ EXPORTS WintunEnumAdapters WintunFreeAdapter WintunGetAdapter - WintunGetAdapterDeviceObject + WintunOpenAdapterDeviceObject WintunGetAdapterGUID WintunGetAdapterLUID WintunGetAdapterName diff --git a/api/session.c b/api/session.c index ddfa61d..ebb8d59 100644 --- a/api/session.c +++ b/api/session.c @@ -110,7 +110,7 @@ WintunStartSession( goto cleanupSendTailMoved; } - Result = WintunGetAdapterDeviceObject(Adapter, &s->Handle); + Result = WintunOpenAdapterDeviceObject(Adapter, &s->Handle); if (Result != ERROR_SUCCESS) { LOG(WINTUN_LOG_ERR, L"Failed to open adapter device object"); diff --git a/api/wintun.h b/api/wintun.h index 8725b00..353c1e9 100644 --- a/api/wintun.h +++ b/api/wintun.h @@ -147,7 +147,7 @@ typedef WINTUN_STATUS(WINAPI *WINTUN_GET_ADAPTER_FUNC)( * @return ERROR_SUCCESS on success; Win32 error code otherwise. */ typedef WINTUN_STATUS( - WINAPI *WINTUN_GET_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. diff --git a/example/example.c b/example/example.c index fb84da7..ad919c9 100644 --- a/example/example.c +++ b/example/example.c @@ -18,7 +18,7 @@ static WINTUN_DELETE_POOL_DRIVER_FUNC WintunDeletePoolDriver; static WINTUN_ENUM_ADAPTERS_FUNC WintunEnumAdapters;
static WINTUN_FREE_ADAPTER_FUNC WintunFreeAdapter;
static WINTUN_GET_ADAPTER_FUNC WintunGetAdapter;
-static WINTUN_GET_ADAPTER_DEVICE_OBJECT_FUNC WintunGetAdapterDeviceObject;
+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_NAME_FUNC WintunGetAdapterName;
@@ -261,7 +261,7 @@ InitializeWintun(void) X(WintunDeletePoolDriver, WINTUN_DELETE_POOL_DRIVER_FUNC) ||
X(WintunEnumAdapters, WINTUN_ENUM_ADAPTERS_FUNC) || X(WintunFreeAdapter, WINTUN_FREE_ADAPTER_FUNC) ||
X(WintunGetAdapter, WINTUN_GET_ADAPTER_FUNC) ||
- X(WintunGetAdapterDeviceObject, WINTUN_GET_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(WintunGetAdapterName, WINTUN_GET_ADAPTER_NAME_FUNC) ||
|