aboutsummaryrefslogtreecommitdiffstats
path: root/api/session.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* api: use a logging alloc functionJason A. Donenfeld2020-11-041-5/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: use GetLastError() to report failures like standard Win32Simon Rozman2020-11-041-59/+64
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: use 'open' name since caller must close handleJason A. Donenfeld2020-11-031-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* example: rewrite and replace api's debug rundll32 functionalityJason A. Donenfeld2020-11-021-1/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: separate read-wait handle into other functionJason A. Donenfeld2020-11-021-3/+7
| | | | | | Makes the API a bit more clear. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: simplify and unify error messagesSimon Rozman2020-11-021-1/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* api: add debugging rundll32 entry pointJason A. Donenfeld2020-10-311-0/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: get rid of pch and make headers saneJason A. Donenfeld2020-10-311-1/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api expose Send.TailMoved event to clientsSimon Rozman2020-10-311-7/+6
| | | | | | This allows clients to use it in WaitForMultipleObjects(). Signed-off-by: Simon Rozman <simon@rozman.si>
* api: use proper iso atomic semanticsJason A. Donenfeld2020-10-311-5/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: selectively use temporary variable to prepare outputSimon Rozman2020-10-311-26/+26
| | | | | Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Simon Rozman <simon@rozman.si>
* api: remove security attributes debug trap doorJason A. Donenfeld2020-10-311-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: elevate only when needed for system operationsJason A. Donenfeld2020-10-311-9/+18
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* api: depretiate WintunIsPacketAvailable()Simon Rozman2020-10-311-6/+0
| | | | | | | Spinning on the WintunReceivePacket() while it returns ERROR_NO_MORE_ITEMS achieves the same. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: upgrade ring managementSimon Rozman2020-10-311-61/+134
| | | | | | | | | - Return pointer to ring buffer with packet data allowing clients to read/write directly. This eliminates one memcpy(). - Make sending/receiving packets thread-safe. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: switch to private heapSimon Rozman2020-10-301-4/+3
| | | | | | | We must not use the process heap, as it is changeable. Client may change it causing our HeapFree() to use wrong heap. Signed-off-by: Simon Rozman <simon@rozman.si>
* api: add ring managementSimon Rozman2020-10-301-0/+213
Rather than every client reinvent the art of using the Wintun and its ring buffers, we offer helper structs and functions to unify and simplify Wintun usage. Signed-off-by: Simon Rozman <simon@rozman.si>