wintun/api
Jason A. Donenfeld d9555bea1b api: discourage UaF on teardown
While it does make sense to make readers unblock by setting the read
event on teardown, this is something that consumers of the library
should do _before_ calling EndSession, not something that makes sense
for the library to do itself. The reason is that, in the hypothetical
case in which this makes sense, immediately after unblocking the reader
via SetEvent, the function goes on to free all of the memory that that
reader might want to use. So, rather, the proper shutdown flow is from
the application side, and looks like:

    Closing = true;
    SetEvent(WintunGetReadWaitEvent());
    WaitForReadersToReturn();
    WintunEndSession();

Alternatively, rather than using WaitForSingleObject on the read event,
consumers can WaitForMultipleObjects and include a shutdown event, which
is what the example code does.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-05-10 11:23:58 +02:00
..
adapter.c api: skip requested GUID if !win10 2021-05-05 11:25:44 +02:00
adapter.h global: bump copyright 2021-01-30 16:45:26 +01:00
api.vcxproj api: delay load remaining dlls to work around forwarder gotchas 2020-11-27 14:52:03 +01:00
api.vcxproj.filters api: include the rundll32 helpers the MSVC-typical way 2020-11-04 13:21:42 +01:00
elevate.c api: clean up NetSetup2 GUIDs 2021-05-05 11:17:39 +02:00
elevate.h api: clean up NetSetup2 GUIDs 2021-05-05 11:17:39 +02:00
entry.c global: bump copyright 2021-01-30 16:45:26 +01:00
entry.h global: bump copyright 2021-01-30 16:45:26 +01:00
exports.def api: remove WintunOpenAdapterDeviceObject 2020-11-05 16:58:43 +01:00
extract-driverver.js global: bump copyright 2021-01-30 16:45:26 +01:00
logger.c api: fix fallback log line printf template 2021-04-10 13:37:22 +02:00
logger.h api: upgrade logging 2021-02-16 04:19:21 +01:00
namespace.c api: upgrade logging 2021-02-16 04:19:21 +01:00
namespace.h global: bump copyright 2021-01-30 16:45:26 +01:00
nci.def api: make nci.lib work on x86 2020-11-02 11:38:02 +01:00
nci.h global: bump copyright 2021-01-30 16:45:26 +01:00
ntdll.h api: upgrade logging 2021-02-16 04:19:21 +01:00
pch.c global: bump copyright 2021-01-30 16:45:26 +01:00
registry.c api: clean up NetSetup2 GUIDs 2021-05-05 11:17:39 +02:00
registry.h api: clean up NetSetup2 GUIDs 2021-05-05 11:17:39 +02:00
resource.c api: upgrade logging 2021-02-16 04:19:21 +01:00
resource.h global: bump copyright 2021-01-30 16:45:26 +01:00
resources.rc Fix © in resources 2021-03-19 12:04:23 +01:00
rundll32_i.c api: upgrade logging 2021-02-16 04:19:21 +01:00
rundll32.c global: bump copyright 2021-01-30 16:45:26 +01:00
session.c api: discourage UaF on teardown 2021-05-10 11:23:58 +02:00
wintun.h api: make .h filenames lowercase for building with MinGW on Linux 2021-03-16 10:11:00 +01:00