Fix the FSDs to use the INIT_SECTION-style and add the alloc_text-s required for MSVC. Please make sure to add section declarations for both compilers for any new functions!

svn path=/trunk/; revision=69170
This commit is contained in:
Stefan Ginsberg
2015-09-10 12:00:28 +00:00
parent 317b564ba0
commit 7fc480a7c1
8 changed files with 53 additions and 17 deletions
+5 -1
View File
@@ -32,6 +32,10 @@
#define NDEBUG
#include <debug.h>
#if defined(ALLOC_PRAGMA)
#pragma alloc_text(INIT, DriverEntry)
#endif
/* GLOBALS ******************************************************************/
PCDFS_GLOBAL_DATA CdfsGlobalData;
@@ -39,7 +43,7 @@ PCDFS_GLOBAL_DATA CdfsGlobalData;
/* FUNCTIONS ****************************************************************/
INIT_FUNCTION
INIT_SECTION
NTSTATUS NTAPI
DriverEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath)
-2
View File
@@ -7,10 +7,8 @@
#ifdef __GNUC__
#define INIT_SECTION __attribute__((section ("INIT")))
#define INIT_FUNCTION INIT_SECTION
#else
#define INIT_SECTION /* Done via alloc_text for MSC */
#define INIT_FUNCTION INIT_SECTION
#endif
#define CDFS_BASIC_SECTOR 2048
+6 -1
View File
@@ -30,6 +30,11 @@
#define NDEBUG
#include <debug.h>
#if defined(ALLOC_PRAGMA)
#pragma alloc_text(INIT, DriverEntry)
#endif
/* GLOBALS *****************************************************************/
PVFAT_GLOBAL_DATA VfatGlobalData;
@@ -43,7 +48,7 @@ PVFAT_GLOBAL_DATA VfatGlobalData;
* RegistryPath = path to our configuration entries
* RETURNS: Success or failure
*/
INIT_FUNCTION
INIT_SECTION
NTSTATUS
NTAPI
DriverEntry(
@@ -8,10 +8,8 @@
#ifdef __GNUC__
#define INIT_SECTION __attribute__((section ("INIT")))
#define INIT_FUNCTION INIT_SECTION
#else
#define INIT_SECTION /* Done via alloc_text for MSC */
#define INIT_FUNCTION INIT_SECTION
#endif
#define USE_ROS_CC_AND_FS
+35 -5
View File
@@ -32,6 +32,36 @@
#define NDEBUG
#include <debug.h>
NTSTATUS
NTAPI
DriverEntry(
PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath
);
NTSTATUS
DfsDriverEntry(
PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath
);
VOID
MupInitializeData(
VOID
);
VOID
MupInitializeVcb(
PMUP_VCB Vcb
);
#if defined(ALLOC_PRAGMA)
#pragma alloc_text(INIT, DriverEntry)
#pragma alloc_text(INIT, DfsDriverEntry)
#pragma alloc_text(INIT, MupInitializeData)
#pragma alloc_text(INIT, MupInitializeVcb)
#endif
ERESOURCE MupGlobalLock;
ERESOURCE MupPrefixTableLock;
ERESOURCE MupCcbListLock;
@@ -53,9 +83,9 @@ NTSTATUS MupOrderedErrorList[] = { STATUS_UNSUCCESSFUL,
/* FUNCTIONS ****************************************************************/
INIT_FUNCTION
INIT_SECTION
VOID
MupInitializeData()
MupInitializeData(VOID)
{
ExInitializeResourceLite(&MupGlobalLock);
ExInitializeResourceLite(&MupPrefixTableLock);
@@ -79,7 +109,7 @@ MupUninitializeData()
ExDeleteResourceLite(&MupVcbLock);
}
INIT_FUNCTION
INIT_SECTION
VOID
MupInitializeVcb(PMUP_VCB Vcb)
{
@@ -2522,7 +2552,7 @@ MupUnload(PDRIVER_OBJECT DriverObject)
MupUninitializeData();
}
INIT_FUNCTION
INIT_SECTION
NTSTATUS
DfsDriverEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath)
@@ -2541,7 +2571,7 @@ DfsDriverEntry(PDRIVER_OBJECT DriverObject,
* RegistryPath = path to our configuration entries
* RETURNS: Success or failure
*/
INIT_FUNCTION
INIT_SECTION
NTSTATUS
NTAPI
DriverEntry(PDRIVER_OBJECT DriverObject,
-2
View File
@@ -8,10 +8,8 @@
#ifdef __GNUC__
#define INIT_SECTION __attribute__((section ("INIT")))
#define INIT_FUNCTION INIT_SECTION
#else
#define INIT_SECTION /* Done via alloc_text for MSC */
#define INIT_FUNCTION INIT_SECTION
#endif
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
+7 -2
View File
@@ -31,6 +31,11 @@
#define NDEBUG
#include <debug.h>
#if defined(ALLOC_PRAGMA)
#pragma alloc_text(INIT, DriverEntry)
#pragma alloc_text(INIT, NtfsInitializeFunctionPointers)
#endif
/* GLOBALS *****************************************************************/
PNTFS_GLOBAL_DATA NtfsGlobalData = NULL;
@@ -44,7 +49,7 @@ PNTFS_GLOBAL_DATA NtfsGlobalData = NULL;
* RegistryPath = path to our configuration entries
* RETURNS: Success or failure
*/
INIT_FUNCTION
INIT_SECTION
NTSTATUS
NTAPI
DriverEntry(PDRIVER_OBJECT DriverObject,
@@ -123,7 +128,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
* DriverObject = object describing this driver
* RETURNS: Nothing
*/
INIT_FUNCTION
INIT_SECTION
VOID
NTAPI
NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject)
-2
View File
@@ -6,10 +6,8 @@
#ifdef __GNUC__
#define INIT_SECTION __attribute__((section ("INIT")))
#define INIT_FUNCTION INIT_SECTION
#else
#define INIT_SECTION /* Done via alloc_text for MSC */
#define INIT_FUNCTION INIT_SECTION
#endif
#define CACHEPAGESIZE(pDeviceExt) \