aboutsummaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-05 13:01:41 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-05 16:58:43 +0100
commite9e790605a606d7d2aea8fbfaf38f336c1492b79 (patch)
tree4a572e179fcde5e157d0fd15ba4b434eae1acb42 /api
parentREADME: improve code example (diff)
downloadwintun-e9e790605a606d7d2aea8fbfaf38f336c1492b79.tar.xz
wintun-e9e790605a606d7d2aea8fbfaf38f336c1492b79.zip
api: rename ReceiveRelease to ReleaseReceivePacket
This makes the API parallel: Wintun*Allocate*SendPacket -> WintunSendPacket WintunReceivePacket -> Wintun*Release*ReceivePacket Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'api')
-rw-r--r--api/exports.def2
-rw-r--r--api/session.c2
-rw-r--r--api/wintun.h12
3 files changed, 7 insertions, 9 deletions
diff --git a/api/exports.def b/api/exports.def
index 4ca739f..e3bedcd 100644
--- a/api/exports.def
+++ b/api/exports.def
@@ -14,7 +14,7 @@ EXPORTS
WintunGetReadWaitEvent
WintunGetRunningDriverVersion
WintunReceivePacket
- WintunReceiveRelease
+ WintunReleaseReceivePacket
WintunSendPacket
WintunSetAdapterName
WintunSetLogger
diff --git a/api/session.c b/api/session.c
index 867ac04..e854bde 100644
--- a/api/session.c
+++ b/api/session.c
@@ -222,7 +222,7 @@ cleanup:
}
void WINAPI
-WintunReceiveRelease(_In_ TUN_SESSION *Session, _In_ const BYTE *Packet)
+WintunReleaseReceivePacket(_In_ TUN_SESSION *Session, _In_ const BYTE *Packet)
{
EnterCriticalSection(&Session->Send.Lock);
TUN_PACKET *ReleasedBuffPacket = (TUN_PACKET *)(Packet - offsetof(TUN_PACKET, Data));
diff --git a/api/wintun.h b/api/wintun.h
index dd232fb..7a54aa0 100644
--- a/api/wintun.h
+++ b/api/wintun.h
@@ -41,7 +41,7 @@ typedef void *WINTUN_ADAPTER_HANDLE;
* @return If the function succeeds, the return value is the adapter handle. Must be released with WintunFreeAdapter. If
* the function fails, the return value is NULL. To get extended error information, call GetLastError.
*/
-typedef _Return_type_success_(return != NULL) WINTUN_ADAPTER_HANDLE (WINAPI *WINTUN_CREATE_ADAPTER_FUNC)(
+typedef _Return_type_success_(return != NULL) WINTUN_ADAPTER_HANDLE(WINAPI *WINTUN_CREATE_ADAPTER_FUNC)(
_In_z_ const WCHAR *Pool,
_In_z_ const WCHAR *Name,
_In_opt_ const GUID *RequestedGUID,
@@ -104,10 +104,8 @@ typedef BOOL(CALLBACK *WINTUN_ENUM_CALLBACK)(_In_ WINTUN_ADAPTER_HANDLE Adapter,
* @return If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To
* get extended error information, call GetLastError.
*/
-typedef _Return_type_success_(return != FALSE) BOOL(WINAPI *WINTUN_ENUM_ADAPTERS_FUNC)(
- _In_z_ const WCHAR *Pool,
- _In_ WINTUN_ENUM_CALLBACK Callback,
- _In_ LPARAM Param);
+typedef _Return_type_success_(return != FALSE) BOOL(
+ WINAPI *WINTUN_ENUM_ADAPTERS_FUNC)(_In_z_ const WCHAR *Pool, _In_ WINTUN_ENUM_CALLBACK Callback, _In_ LPARAM Param);
/**
* Releases Wintun adapter resources.
@@ -273,7 +271,7 @@ typedef HANDLE(WINAPI *WINTUN_GET_READ_WAIT_EVENT_FUNC)(_In_ WINTUN_SESSION_HAND
#define WINTUN_MAX_IP_PACKET_SIZE 0xFFFF
/**
- * Retrieves one or packet. After the packet content is consumed, call WintunReceiveRelease with Packet returned
+ * Retrieves one or packet. After the packet content is consumed, call WintunReleaseReceivePacket with Packet returned
* from this function to release internal buffer. This function is thread-safe.
*
* @param Session Wintun session handle obtained with WintunStartSession
@@ -297,7 +295,7 @@ typedef _Return_type_success_(return != NULL) _Ret_bytecount_(*PacketSize) BYTE
*
* @param Packet Packet obtained with WintunReceivePacket
*/
-typedef void(WINAPI *WINTUN_RECEIVE_RELEASE_FUNC)(_In_ WINTUN_SESSION_HANDLE Session, _In_ const BYTE *Packet);
+typedef void(WINAPI *WINTUN_RELEASE_RECEIVE_PACKET_FUNC)(_In_ WINTUN_SESSION_HANDLE Session, _In_ const BYTE *Packet);
/**
* Allocates memory for a packet to send. After the memory is filled with packet data, call WintunSendPacket to send