aboutsummaryrefslogtreecommitdiffstats
path: root/api/wintun.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-10-30 14:34:40 +0100
committerSimon Rozman <simon@rozman.si>2020-10-31 19:11:49 +0100
commit0a8bf9d1ff0f67bf3906b4cb5ef98a166a1a0bdb (patch)
tree439c904bbf7335f6a1b342dfcd59582e062cda5e /api/wintun.h
parentapi: only sleep after force closing handles if required (diff)
downloadwintun-0a8bf9d1ff0f67bf3906b4cb5ef98a166a1a0bdb.tar.xz
wintun-0a8bf9d1ff0f67bf3906b4cb5ef98a166a1a0bdb.zip
api: only force close handles if requested
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'api/wintun.h')
-rw-r--r--api/wintun.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/api/wintun.h b/api/wintun.h
index ff79d8a..8137155 100644
--- a/api/wintun.h
+++ b/api/wintun.h
@@ -52,15 +52,19 @@ typedef WINTUN_STATUS(WINAPI *WINTUN_CREATE_ADAPTER_FUNC)(
/**
* Deletes a Wintun adapter.
*
- * @param Adapter Adapter handle obtained with WintunGetAdapter or WintunCreateAdapter.
+ * @param Adapter Adapter handle obtained with WintunGetAdapter or WintunCreateAdapter.
*
- * @param RebootRequired Pointer to a boolean flag to be set to TRUE in case SetupAPI suggests a reboot. Must be
- * initialised to FALSE manually before this function is called.
+ * @param ForceCloseSessions Force close adapter handles that may be in use by other processes. Only set this to TRUE
+ * with extreme care, as this is resource intensive and may put processes into an undefined
+ * or unpredictable state. Most users should set this to FALSE.
+ *
+ * @param RebootRequired Pointer to a boolean flag to be set to TRUE in case SetupAPI suggests a reboot. Must be
+ * initialised to FALSE manually before this function is called.
*
* @return ERROR_SUCCESS on success or the adapter was not found; Win32 error code otherwise.
*/
typedef WINTUN_STATUS(
- WINAPI *WINTUN_DELETE_ADAPTER_FUNC)(_In_ WINTUN_ADAPTER_HANDLE Adapter, _Inout_ BOOL *RebootRequired);
+ WINAPI *WINTUN_DELETE_ADAPTER_FUNC)(_In_ WINTUN_ADAPTER_HANDLE Adapter, _In_ BOOL ForceCloseSessions, _Inout_ BOOL *RebootRequired);
/**
* Called by WintunEnumAdapters for each adapter in the pool.