Skip to content

Commit

Permalink
driver: move init-only functions into INIT segment
Browse files Browse the repository at this point in the history
  • Loading branch information
rozmansi authored and zx2c4 committed May 5, 2021
1 parent aba41fc commit 4eb306a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions driver/wintun.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,12 @@ TunForceHandlesClosed(_Inout_ DEVICE_OBJECT *DeviceObject)
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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4eb306a

Please sign in to comment.