[NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)

* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally
* Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it
* Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC)
* Place INIT_FUNCTION before the return type (required by MSVC)
* Make sure declarations and implementations share the same modifiers (required by MSVC)
* Add a global linker option to suppress warnings about defined but unused INIT section
* Merge INIT section into .text in freeldr
This commit is contained in:
Timo Kreuzer 2018-12-30 12:19:11 +01:00 committed by GitHub
parent 7c66247343
commit 71fefa32db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 522 additions and 296 deletions

View file

@ -577,6 +577,7 @@ PipCallDriverAddDevice(
IN PDRIVER_OBJECT DriverObject
);
INIT_FUNCTION
NTSTATUS
NTAPI
IopInitializePlugPlayServices(
@ -692,6 +693,7 @@ IoDestroyDriverList(
VOID
);
INIT_FUNCTION
NTSTATUS
IopInitPlugPlayEvents(VOID);
@ -740,12 +742,14 @@ IopTraverseDeviceTree(
//
// PnP Routines
//
INIT_FUNCTION
NTSTATUS
NTAPI
IopUpdateRootKey(
VOID
);
INIT_FUNCTION
NTSTATUS
NTAPI
PiInitCacheGroupInformation(
@ -783,12 +787,14 @@ PnpRegSzToString(
//
// Initialization Routines
//
INIT_FUNCTION
NTSTATUS
NTAPI
IopCreateArcNames(
IN PLOADER_PARAMETER_BLOCK LoaderBlock
);
INIT_FUNCTION
NTSTATUS
NTAPI
IopReassignSystemRoot(
@ -796,6 +802,7 @@ IopReassignSystemRoot(
OUT PANSI_STRING NtBootPath
);
INIT_FUNCTION
BOOLEAN
NTAPI
IoInitSystem(
@ -986,11 +993,13 @@ IopShutdownBaseFileSystems(
//
// Boot logging support
//
INIT_FUNCTION
VOID
IopInitBootLog(
IN BOOLEAN StartBootLog
);
INIT_FUNCTION
VOID
IopStartBootLog(
VOID
@ -1062,6 +1071,7 @@ RawFsIsRawFileSystemDeviceObject(
IN PDEVICE_OBJECT DeviceObject
);
INIT_FUNCTION
NTSTATUS
NTAPI
RawFsDriverEntry(
@ -1094,12 +1104,14 @@ PnpRootRegisterDevice(
//
// Driver Routines
//
INIT_FUNCTION
VOID
FASTCALL
IopInitializeBootDrivers(
VOID
);
INIT_FUNCTION
VOID
FASTCALL
IopInitializeSystemDrivers(
@ -1356,6 +1368,7 @@ IoSetIoCompletion(
//
// Ramdisk Routines
//
INIT_FUNCTION
NTSTATUS
NTAPI
IopStartRamdisk(