aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2021-04-30 13:38:26 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-05-05 11:25:44 +0200
commit4eb306afb9c4fd70d4dbe389ce404fe2ece4e3d9 (patch)
treeeb8ed23f6bfd0dcd5c529a8b21de9c6f7d54665a
parentdriver: fix memory leak on pre-Windows 7 (diff)
downloadwintun-master.tar.xz
wintun-master.zip
driver: move init-only functions into INIT segmentHEADmaster
Reference: https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/writing-a-driverentry-routine Signed-off-by: Simon Rozman <simon@rozman.si>
-rw-r--r--driver/wintun.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/driver/wintun.c b/driver/wintun.c
index 6366ebd..3e615bb 100644
--- a/driver/wintun.c
+++ b/driver/wintun.c
@@ -838,6 +838,12 @@ cleanup:
return DidClose;
}
+_Must_inspect_result_
+static NTSTATUS TunInitializeDispatchSecurityDescriptor(VOID);
+#ifdef ALLOC_PRAGMA
+# pragma alloc_text(INIT, TunInitializeDispatchSecurityDescriptor)
+#endif
+_Use_decl_annotations_
static NTSTATUS TunInitializeDispatchSecurityDescriptor(VOID)
{
NTSTATUS Status;
@@ -1451,6 +1457,9 @@ TunUnload(PDRIVER_OBJECT DriverObject)
}
DRIVER_INITIALIZE DriverEntry;
+#ifdef ALLOC_PRAGMA
+# pragma alloc_text(INIT, DriverEntry)
+#endif
_Use_decl_annotations_
NTSTATUS
DriverEntry(DRIVER_OBJECT *DriverObject, UNICODE_STRING *RegistryPath)