diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-02 16:04:33 +0100 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2020-11-02 16:38:56 +0100 |
commit | c20e1683c21a1e281479f3caca1754b39820cd81 (patch) | |
tree | 742b13d4dd864676704559e05637f9487f260799 /api/wintun.h | |
parent | api: statically compile devpkey constants (diff) | |
download | wintun-c20e1683c21a1e281479f3caca1754b39820cd81.tar.xz wintun-c20e1683c21a1e281479f3caca1754b39820cd81.zip |
api: separate read-wait handle into other function
Makes the API a bit more clear.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'api/wintun.h')
-rw-r--r-- | api/wintun.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/api/wintun.h b/api/wintun.h index f39e33c..3cd4a47 100644 --- a/api/wintun.h +++ b/api/wintun.h @@ -234,18 +234,12 @@ typedef void *WINTUN_SESSION_HANDLE; * * @param Session Pointer to a variable to receive Wintun session handle * - * @param ReadWait Pointer to receive event handle to wait for available data when reading. Should - * WintunReceivePackets return ERROR_NO_MORE_ITEMS (after spinning on it for a while under heavy - * load), wait for this event to become signaled before retrying WintunReceivePackets. Do not call - * CloseHandle on this event - it is managed by the session. - * * @return ERROR_SUCCESS on success; Win32 error code otherwise. */ typedef WINTUN_STATUS(WINAPI *WINTUN_START_SESSION_FUNC)( _In_ WINTUN_ADAPTER_HANDLE Adapter, _In_ DWORD Capacity, - _Out_ WINTUN_SESSION_HANDLE *Session, - _Out_ HANDLE *ReadWait); + _Out_ WINTUN_SESSION_HANDLE *Session); /** * Ends Wintun session. @@ -255,6 +249,18 @@ typedef WINTUN_STATUS(WINAPI *WINTUN_START_SESSION_FUNC)( typedef void(WINAPI *WINTUN_END_SESSION_FUNC)(_In_ WINTUN_SESSION_HANDLE Session); /** + * Gets Wintun session's read-wait event handle. + * + * @param Session Wintun session handle obtained with WintunStartSession + * + * @return Pointer to receive event handle to wait for available data when reading. Should + * WintunReceivePackets return ERROR_NO_MORE_ITEMS (after spinning on it for a while under heavy + * load), wait for this event to become signaled before retrying WintunReceivePackets. Do not call + * CloseHandle on this event - it is managed by the session. + */ +typedef HANDLE(WINAPI *WINTUN_GET_READ_WAIT_EVENT_FUNC)(_In_ WINTUN_SESSION_HANDLE *Session); + +/** * Maximum IP packet size */ #define WINTUN_MAX_IP_PACKET_SIZE 0xFFFF |