[REACTOS] Addendum to 5c7ce4475e - Fix MSVC 2015 build

Put data into PAGEDATA or INITDATA sections
Keep section declaration for prototypes

CORE-17540
This commit is contained in:
Jérôme Gardou 2021-05-11 17:13:14 +02:00 committed by Jérôme Gardou
parent 03e824641e
commit 3adf450867
82 changed files with 1720 additions and 1789 deletions

View file

@ -26,16 +26,6 @@ static NTSTATUS NTAPI PciPowerControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Ir
static DRIVER_DISPATCH PciPnpControl;
static NTSTATUS NTAPI PciPnpControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
#ifdef ALLOC_PRAGMA
// Make the initialization routines discardable, so that they
// don't waste space
#pragma alloc_text(INIT, DriverEntry)
#endif /* ALLOC_PRAGMA */
/*** PUBLIC ******************************************************************/
PPCI_DRIVER_EXTENSION DriverExtension = NULL;
@ -204,6 +194,7 @@ PciUnload(
UNREFERENCED_PARAMETER(DriverObject);
}
CODE_SEG("INIT")
NTSTATUS
NTAPI
DriverEntry(

View file

@ -173,6 +173,8 @@ PdoPowerControl(
PDEVICE_OBJECT DeviceObject,
PIRP Irp);
CODE_SEG("INIT")
NTSTATUS
NTAPI
DriverEntry(

View file

@ -12,10 +12,6 @@
#define NDEBUG
#include <debug.h>
#if defined(ALLOC_PRAGMA)
#pragma alloc_text(INIT, VfatInitFastIoRoutines)
#endif
static FAST_IO_CHECK_IF_POSSIBLE VfatFastIoCheckIfPossible;
static

View file

@ -824,6 +824,7 @@ VfatSetExtendedAttributes(
/* fastio.c */
CODE_SEG("INIT")
VOID
VfatInitFastIoRoutines(
PFAST_IO_DISPATCH FastIoDispatch);
@ -1128,6 +1129,7 @@ VfatFileSystemControl(
/* iface.c */
CODE_SEG("INIT")
NTSTATUS
NTAPI
DriverEntry(

View file

@ -31,10 +31,6 @@
#define NDEBUG
#include <debug.h>
#if defined(ALLOC_PRAGMA)
#pragma alloc_text(INIT, DfsDriverEntry)
#endif
/* FUNCTIONS ****************************************************************/
NTSTATUS

View file

@ -51,6 +51,7 @@ DfsUnload(
PDRIVER_OBJECT DriverObject
);
CODE_SEG("INIT")
NTSTATUS
DfsDriverEntry(
PDRIVER_OBJECT DriverObject,

View file

@ -32,32 +32,6 @@
#define NDEBUG
#include <debug.h>
CODE_SEG("INIT")
NTSTATUS
NTAPI
DriverEntry(
PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath
);
CODE_SEG("INIT")
VOID
MupInitializeData(
VOID
);
CODE_SEG("INIT")
VOID
MupInitializeVcb(
PMUP_VCB Vcb
);
#if defined(ALLOC_PRAGMA)
#pragma alloc_text(INIT, DriverEntry)
#pragma alloc_text(INIT, MupInitializeData)
#pragma alloc_text(INIT, MupInitializeVcb)
#endif
ERESOURCE MupGlobalLock;
ERESOURCE MupPrefixTableLock;
ERESOURCE MupCcbListLock;

View file

@ -21,7 +21,7 @@
* FILE: drivers/filesystem/ntfs/ntfs.c
* PURPOSE: NTFS filesystem driver
* PROGRAMMER: Eric Kohl
* Pierre Schweitzer
* Pierre Schweitzer
*/
/* INCLUDES *****************************************************************/
@ -31,11 +31,6 @@
#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;
@ -129,10 +124,10 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
NtfsInitializeFunctionPointers(DriverObject);
/* Initialize CC functions array */
NtfsGlobalData->CacheMgrCallbacks.AcquireForLazyWrite = NtfsAcqLazyWrite;
NtfsGlobalData->CacheMgrCallbacks.ReleaseFromLazyWrite = NtfsRelLazyWrite;
NtfsGlobalData->CacheMgrCallbacks.AcquireForReadAhead = NtfsAcqReadAhead;
NtfsGlobalData->CacheMgrCallbacks.ReleaseFromReadAhead = NtfsRelReadAhead;
NtfsGlobalData->CacheMgrCallbacks.AcquireForLazyWrite = NtfsAcqLazyWrite;
NtfsGlobalData->CacheMgrCallbacks.ReleaseFromLazyWrite = NtfsRelLazyWrite;
NtfsGlobalData->CacheMgrCallbacks.AcquireForReadAhead = NtfsAcqReadAhead;
NtfsGlobalData->CacheMgrCallbacks.ReleaseFromReadAhead = NtfsRelReadAhead;
NtfsGlobalData->FastIoDispatch.SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH);
NtfsGlobalData->FastIoDispatch.FastIoCheckIfPossible = NtfsFastIoCheckIfPossible;
@ -164,7 +159,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
/*
* FUNCTION: Called within the driver entry to initialize the IRP functions array
* FUNCTION: Called within the driver entry to initialize the IRP functions array
* ARGUMENTS:
* DriverObject = object describing this driver
* RETURNS: Nothing

View file

@ -1276,8 +1276,10 @@ NtfsSetVolumeInformation(PNTFS_IRP_CONTEXT IrpContext);
/* ntfs.c */
CODE_SEG("INIT")
DRIVER_INITIALIZE DriverEntry;
CODE_SEG("INIT")
VOID
NTAPI
NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject);

File diff suppressed because it is too large Load diff

View file

@ -7,6 +7,8 @@
#include <fltkernel.h>
#include <pseh/pseh2.h>
#include <section_attribs.h>
#define DRIVER_NAME L"FltMgr"
#define FLT_MAJOR_VERSION 0x0200

View file

@ -16,10 +16,6 @@
/* GLOBALS ********************************************************************/
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, InPortInitializeMouse)
#endif
#define READ_MOUSE(DeviceExtension, Port) \
READ_PORT_UCHAR((DeviceExtension)->IoBase + (Port))
@ -338,6 +334,7 @@ InPortIsr(
}
}
CODE_SEG("PAGE")
VOID
NTAPI
InPortInitializeMouse(

View file

@ -14,17 +14,11 @@
/* GLOBALS ********************************************************************/
#ifdef ALLOC_PRAGMA
#pragma alloc_text(INIT, DriverEntry)
#pragma alloc_text(PAGE, InPortCreateClose)
#pragma alloc_text(PAGE, InPortAddDevice)
#pragma alloc_text(PAGE, InPortUnload)
#endif
UNICODE_STRING DriverRegistryPath;
/* FUNCTIONS ******************************************************************/
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortCreateClose(
@ -43,6 +37,7 @@ InPortCreateClose(
return STATUS_SUCCESS;
}
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortAddDevice(
@ -161,6 +156,7 @@ Failure:
return Status;
}
CODE_SEG("PAGE")
VOID
NTAPI
InPortUnload(
@ -204,6 +200,7 @@ InPortPower(
return Status;
}
CODE_SEG("INIT")
NTSTATUS
NTAPI
DriverEntry(

View file

@ -13,6 +13,8 @@
#include <wmistr.h>
#include <kbdmou.h>
#include <section_attribs.h>
#define INPORT_TAG 'tPnI'
typedef enum
@ -74,14 +76,18 @@ typedef struct _INPORT_DEVICE_EXTENSION
MOUSE_ATTRIBUTES MouseAttributes;
} INPORT_DEVICE_EXTENSION, *PINPORT_DEVICE_EXTENSION;
CODE_SEG("INIT")
DRIVER_INITIALIZE DriverEntry;
CODE_SEG("PAGE")
DRIVER_UNLOAD InPortUnload;
CODE_SEG("PAGE")
DRIVER_ADD_DEVICE InPortAddDevice;
_Dispatch_type_(IRP_MJ_CREATE)
_Dispatch_type_(IRP_MJ_CLOSE)
CODE_SEG("PAGE")
DRIVER_DISPATCH_PAGED InPortCreateClose;
_Dispatch_type_(IRP_MJ_INTERNAL_DEVICE_CONTROL)
@ -91,9 +97,11 @@ _Dispatch_type_(IRP_MJ_POWER)
DRIVER_DISPATCH_RAISED InPortPower;
_Dispatch_type_(IRP_MJ_SYSTEM_CONTROL)
CODE_SEG("PAGE")
DRIVER_DISPATCH_PAGED InPortWmi;
_Dispatch_type_(IRP_MJ_PNP)
CODE_SEG("PAGE")
DRIVER_DISPATCH_PAGED InPortPnp;
KSERVICE_ROUTINE InPortIsr;
@ -104,33 +112,39 @@ KSYNCHRONIZE_ROUTINE InPortStartMouse;
KSYNCHRONIZE_ROUTINE InPortStopMouse;
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortStartDevice(
_In_ PDEVICE_OBJECT DeviceObject,
_Inout_ PIRP Irp);
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortRemoveDevice(
_In_ PDEVICE_OBJECT DeviceObject,
_Inout_ PIRP Irp);
CODE_SEG("PAGE")
VOID
NTAPI
InPortInitializeMouse(
_In_ PINPORT_DEVICE_EXTENSION DeviceExtension);
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortWmiRegistration(
_Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension);
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortWmiDeRegistration(
_Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension);
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortQueryWmiRegInfo(
@ -141,6 +155,7 @@ InPortQueryWmiRegInfo(
_Inout_ PUNICODE_STRING MofResourceName,
_Out_opt_ PDEVICE_OBJECT *Pdo);
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortQueryWmiDataBlock(

View file

@ -12,16 +12,9 @@
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, InPortPnp)
#pragma alloc_text(PAGE, InPortStartDevice)
#pragma alloc_text(PAGE, InPortRemoveDevice)
#endif
/* FUNCTIONS ******************************************************************/
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortStartDevice(
@ -178,6 +171,7 @@ Complete:
return Status;
}
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortRemoveDevice(
@ -221,6 +215,7 @@ InPortRemoveDevice(
return Status;
}
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortPnp(

View file

@ -14,14 +14,6 @@
/* GLOBALS ********************************************************************/
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, InPortWmi)
#pragma alloc_text(PAGE, InPortWmiRegistration)
#pragma alloc_text(PAGE, InPortWmiDeRegistration)
#pragma alloc_text(PAGE, InPortQueryWmiRegInfo)
#pragma alloc_text(PAGE, InPortQueryWmiDataBlock)
#endif
GUID GuidWmiPortData = POINTER_PORT_WMI_STD_DATA_GUID;
WMIGUIDREGINFO InPortWmiGuidList[] =
@ -30,7 +22,7 @@ WMIGUIDREGINFO InPortWmiGuidList[] =
};
/* FUNCTIONS ******************************************************************/
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortQueryWmiRegInfo(
@ -57,6 +49,7 @@ InPortQueryWmiRegInfo(
return STATUS_SUCCESS;
}
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortQueryWmiDataBlock(
@ -119,6 +112,7 @@ Complete:
IO_NO_INCREMENT);
}
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortWmiRegistration(
@ -140,6 +134,7 @@ InPortWmiRegistration(
WMIREG_ACTION_REGISTER);
}
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortWmiDeRegistration(
@ -151,6 +146,7 @@ InPortWmiDeRegistration(
WMIREG_ACTION_DEREGISTER);
}
CODE_SEG("PAGE")
NTSTATUS
NTAPI
InPortWmi(

View file

@ -22,9 +22,11 @@ Revision History:
#include "disk.h"
#ifndef __REACTOS__
#ifdef ALLOC_DATA_PRAGMA
#pragma data_seg("PAGE")
#endif
#endif
/*
#define HackDisableTaggedQueuing (0x01)
@ -34,7 +36,9 @@ Revision History:
#define HackCauseNotReportableHack (0x10)
#define HackRequiresStartUnitCommand (0x20)
*/
#ifdef __REACTOS__
DATA_SEG("PAGEDATA")
#endif
CLASSPNP_SCAN_FOR_SPECIAL_INFO DiskBadControllers[] = {
{ "COMPAQ" , "PD-1" , NULL, 0x02 },
{ "CONNER" , "CP3500" , NULL, 0x02 },
@ -64,11 +68,17 @@ CLASSPNP_SCAN_FOR_SPECIAL_INFO DiskBadControllers[] = {
// Added MediaTypes in their own brace nesting level
// ======== ROS DIFF ========
#ifdef __REACTOS__
DATA_SEG("PAGECONS")
#endif
DISK_MEDIA_TYPES_LIST const DiskMediaTypesExclude[] = {
{ "HP" , "RDX" , NULL, 0, 0, {0 , 0 , 0 , 0 }},
{ NULL , NULL , NULL, 0, 0, {0 , 0 , 0 , 0 }}
};
#ifdef __REACTOS__
DATA_SEG("PAGECONS")
#endif
DISK_MEDIA_TYPES_LIST const DiskMediaTypes[] = {
{ "COMPAQ" , "PD-1 LF-1094" , NULL, 1, 1, {PC_5_RW , 0 , 0 , 0 }},
{ "HP" , NULL , NULL, 2, 2, {MO_5_WO , MO_5_RW, 0 , 0 }},
@ -83,6 +93,8 @@ DISK_MEDIA_TYPES_LIST const DiskMediaTypes[] = {
{ NULL , NULL , NULL, 0, 0, {0 , 0 , 0 , 0 }}
};
#ifndef __REACTOS__
#ifdef ALLOC_DATA_PRAGMA
#pragma data_seg()
#endif
#endif

View file

@ -469,6 +469,10 @@ extern CLASSPNP_SCAN_FOR_SPECIAL_INFO DiskBadControllers[];
extern const DISK_MEDIA_TYPES_LIST DiskMediaTypes[];
extern const DISK_MEDIA_TYPES_LIST DiskMediaTypesExclude[];
#if defined(__REACTOS__) && defined(_MSC_VER)
# pragma section("PAGECONS", read)
# pragma section("PAGEDATA", read,write)
#endif
//
// Macros
//
@ -477,7 +481,7 @@ extern const DISK_MEDIA_TYPES_LIST DiskMediaTypesExclude[];
// Routine prototypes.
//
DRIVER_INITIALIZE DriverEntry;
VOID

View file

@ -176,6 +176,7 @@ extern UNICODE_STRING Volume;
extern KEVENT UnloadEvent;
extern LONG Unloading;
CODE_SEG("INIT")
DRIVER_INITIALIZE DriverEntry;
VOID
@ -228,6 +229,7 @@ HasDriveLetter(
IN PDEVICE_INFORMATION DeviceInformation
);
CODE_SEG("INIT")
BOOLEAN
MountmgrReadNoAutoMount(
IN PUNICODE_STRING RegistryPath

View file

@ -29,11 +29,6 @@
#define NDEBUG
#include <debug.h>
#if defined(ALLOC_PRAGMA)
#pragma alloc_text(INIT, MountmgrReadNoAutoMount)
#pragma alloc_text(INIT, DriverEntry)
#endif
/* FIXME */
GUID MountedDevicesGuid = {0x53F5630D, 0xB6BF, 0x11D0, {0x94, 0xF2, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B}};

View file

@ -100,6 +100,7 @@ typedef struct _PARTITION_EXTENSION
UNICODE_STRING DeviceName;
} PARTITION_EXTENSION, *PPARTITION_EXTENSION;
CODE_SEG("PAGE")
NTSTATUS
PartitionCreateDevice(
_In_ PDEVICE_OBJECT FDObject,
@ -108,11 +109,13 @@ PartitionCreateDevice(
_In_ PARTITION_STYLE PartitionStyle,
_Out_ PDEVICE_OBJECT *PDO);
CODE_SEG("PAGE")
NTSTATUS
PartitionHandleRemove(
_In_ PPARTITION_EXTENSION PartExt,
_In_ BOOLEAN FinalRemove);
CODE_SEG("PAGE")
NTSTATUS
PartitionHandlePnp(
_In_ PDEVICE_OBJECT DeviceObject,