[FASTFAT_NEW] Simplify unsupported NT6.2+ workarounds

This commit is contained in:
Serge Gautherie 2020-06-15 06:57:04 +02:00 committed by Victor Perevertkin
parent 1ceed5ad5a
commit ab2b7a6bc6
9 changed files with 9 additions and 105 deletions

View file

@ -2727,11 +2727,7 @@ Return Value:
// Map the MDL.
//
#ifndef __REACTOS__
Buffer = MmGetSystemAddressForMdlSafe(Mdl, HighPagePriority|MdlMappingNoExecute);
#else
Buffer = MmGetSystemAddressForMdlSafe(Mdl, HighPagePriority);
#endif
if (!Buffer) {
NT_ASSERT( FALSE );
ZeroingStatus = STATUS_INSUFFICIENT_RESOURCES;

View file

@ -1057,11 +1057,7 @@ Return Value:
// that this will be only a single page.
//
#ifndef __REACTOS__
if (MmGetSystemAddressForMdlSafe( Mdl, NormalPagePriority | MdlMappingNoExecute ) == NULL) {
#else
if (MmGetSystemAddressForMdlSafe( Mdl, NormalPagePriority ) == NULL) {
#endif
FatRaiseStatus( IrpContext, STATUS_INSUFFICIENT_RESOURCES );
}
@ -1395,11 +1391,7 @@ Return Value:
// Allocate the local buffer
//
#ifndef __REACTOS__
DiskBuffer = FsRtlAllocatePoolWithTag( NonPagedPoolNxCacheAligned,
#else
DiskBuffer = FsRtlAllocatePoolWithTag( NonPagedPoolCacheAligned,
#endif
(ULONG) ROUND_TO_PAGES( SectorSize ),
TAG_IO_BUFFER );
@ -2775,11 +2767,7 @@ Return Value:
// If we can't get pool, oh well....
//
#ifndef __REACTOS__
Packet = ExAllocatePoolWithTag(NonPagedPoolNx, sizeof(CLEAN_AND_DIRTY_VOLUME_PACKET), ' taF');
#else
Packet = ExAllocatePoolWithTag(NonPagedPool, sizeof(CLEAN_AND_DIRTY_VOLUME_PACKET), ' taF');
#endif
if ( Packet ) {
@ -3407,11 +3395,7 @@ Return Value:
} else {
#ifndef __REACTOS__
PVOID Address = MmGetSystemAddressForMdlSafe( Irp->MdlAddress, NormalPagePriority | MdlMappingNoExecute );
#else
PVOID Address = MmGetSystemAddressForMdlSafe( Irp->MdlAddress, NormalPagePriority );
#endif
if (Address == NULL) {
@ -3476,11 +3460,7 @@ Return Value:
UserBuffer = FatMapUserBuffer( IrpContext, Irp );
#ifndef __REACTOS__
Irp->AssociatedIrp.SystemBuffer = FsRtlAllocatePoolWithQuotaTag( NonPagedPoolNx,
#else
Irp->AssociatedIrp.SystemBuffer = FsRtlAllocatePoolWithQuotaTag( NonPagedPool,
#endif
BufferLength,
TAG_IO_USER_BUFFER );

View file

@ -264,11 +264,7 @@ Return Value:
// Allocate the zero page
//
#ifndef __REACTOS__
FatData.ZeroPage = ExAllocatePoolWithTag( NonPagedPoolNx, PAGE_SIZE, 'ZtaF' );
#else
FatData.ZeroPage = ExAllocatePoolWithTag( NonPagedPool, PAGE_SIZE, 'ZtaF' );
#endif
if (FatData.ZeroPage == NULL) {
IoDeleteDevice (FatDiskFileSystemDeviceObject);
IoDeleteDevice (FatCdromFileSystemDeviceObject);
@ -388,11 +384,7 @@ Return Value:
ExInitializeNPagedLookasideList( &FatIrpContextLookasideList,
NULL,
NULL,
#ifndef __REACTOS__
POOL_NX_ALLOCATION | POOL_RAISE_IF_ALLOCATION_FAILURE,
#else
POOL_RAISE_IF_ALLOCATION_FAILURE,
#endif
sizeof(IRP_CONTEXT),
TAG_IRP_CONTEXT,
MaxDepth );
@ -400,11 +392,7 @@ Return Value:
ExInitializeNPagedLookasideList( &FatNonPagedFcbLookasideList,
NULL,
NULL,
#ifndef __REACTOS__
POOL_NX_ALLOCATION | POOL_RAISE_IF_ALLOCATION_FAILURE,
#else
POOL_RAISE_IF_ALLOCATION_FAILURE,
#endif
sizeof(NON_PAGED_FCB),
TAG_FCB_NONPAGED,
MaxDepth );
@ -412,11 +400,7 @@ Return Value:
ExInitializeNPagedLookasideList( &FatEResourceLookasideList,
NULL,
NULL,
#ifndef __REACTOS__
POOL_NX_ALLOCATION | POOL_RAISE_IF_ALLOCATION_FAILURE,
#else
POOL_RAISE_IF_ALLOCATION_FAILURE,
#endif
sizeof(ERESOURCE),
TAG_ERESOURCE,
MaxDepth );

View file

@ -40,6 +40,15 @@ Abstract:
#ifdef __REACTOS__
// Downgrade unsupported NT6.2+ features.
#undef MdlMappingNoExecute
#define MdlMappingNoExecute 0
#define NonPagedPoolNx NonPagedPool
#define NonPagedPoolNxCacheAligned NonPagedPoolCacheAligned
#undef POOL_NX_ALLOCATION
#define POOL_NX_ALLOCATION 0
// Moved up: needed in 'fatstruc.h'.
typedef enum _TYPE_OF_OPEN {
UnopenedFileObject = 1,

View file

@ -2117,11 +2117,7 @@ Return Value:
try_return( Status = STATUS_WRONG_VOLUME );
}
#ifndef __REACTOS__
BootSector = FsRtlAllocatePoolWithTag(NonPagedPoolNxCacheAligned,
#else
BootSector = FsRtlAllocatePoolWithTag(NonPagedPoolCacheAligned,
#endif
(ULONG) ROUND_TO_PAGES( SectorSize ),
TAG_VERIFY_BOOTSECTOR);
@ -2212,11 +2208,7 @@ Return Value:
RootDirectorySize = FatBytesPerCluster(&Bpb);
}
#ifndef __REACTOS__
RootDirectory = FsRtlAllocatePoolWithTag( NonPagedPoolNxCacheAligned,
#else
RootDirectory = FsRtlAllocatePoolWithTag( NonPagedPoolCacheAligned,
#endif
(ULONG) ROUND_TO_PAGES( RootDirectorySize ),
TAG_VERIFY_ROOTDIR);
@ -4009,11 +4001,7 @@ Return Value:
} else if (Irp->MdlAddress != NULL) {
#ifndef __REACTOS__
VolumeState = MmGetSystemAddressForMdlSafe( Irp->MdlAddress, LowPagePriority | MdlMappingNoExecute );
#else
VolumeState = MmGetSystemAddressForMdlSafe( Irp->MdlAddress, LowPagePriority );
#endif
if (VolumeState == NULL) {
@ -4829,11 +4817,7 @@ Return Value:
try_leave( Status = STATUS_FILE_CORRUPT_ERROR);
}
#ifndef __REACTOS__
*MappingPairs = FsRtlAllocatePoolWithTag( NonPagedPoolNx,
#else
*MappingPairs = FsRtlAllocatePoolWithTag( NonPagedPool,
#endif
(Index + 2) * (2 * sizeof(LARGE_INTEGER)),
TAG_OUTPUT_MAPPINGPAIRS );
@ -6087,11 +6071,7 @@ Return Value:
if (Buffer == NULL) {
#ifndef __REACTOS__
Buffer = FsRtlAllocatePoolWithTag( NonPagedPoolNx,
#else
Buffer = FsRtlAllocatePoolWithTag( NonPagedPool,
#endif
BufferSize,
TAG_DEFRAG_BUFFER );
}
@ -7979,11 +7959,7 @@ FatVerifyLookupFatEntry (
FatVerifyIndexIsValid( IrpContext, Vcb, FatIndex);
#ifndef __REACTOS__
Buffer = FsRtlAllocatePoolWithTag( NonPagedPoolNxCacheAligned,
#else
Buffer = FsRtlAllocatePoolWithTag( NonPagedPoolCacheAligned,
#endif
PAGE_SIZE,
TAG_ENTRY_LOOKUP_BUFFER );

View file

@ -685,11 +685,7 @@ Return Value:
if (!Wait) {
IrpContext->FatIoContext =
#ifndef __REACTOS__
FsRtlAllocatePoolWithTag( NonPagedPoolNx,
#else
FsRtlAllocatePoolWithTag( NonPagedPool,
#endif
sizeof(FAT_IO_CONTEXT),
TAG_FAT_IO_CONTEXT );

View file

@ -556,11 +556,7 @@ Return Value:
// Initialize the performance counters.
//
#ifndef __REACTOS__
Vcb->Statistics = FsRtlAllocatePoolWithTag( NonPagedPoolNx,
#else
Vcb->Statistics = FsRtlAllocatePoolWithTag( NonPagedPool,
#endif
sizeof(FILE_SYSTEM_STATISTICS) * FatData.NumberProcessors,
TAG_VCB_STATS );
UnwindStatistics = Vcb->Statistics;
@ -579,11 +575,7 @@ Return Value:
// of the storage stack on demand.
//
#ifndef __REACTOS__
Vcb->SwapVpb = FsRtlAllocatePoolWithTag( NonPagedPoolNx,
#else
Vcb->SwapVpb = FsRtlAllocatePoolWithTag( NonPagedPool,
#endif
sizeof( VPB ),
TAG_VPB );
@ -1047,11 +1039,7 @@ Return Value:
// have to continually reference through the Vcb
//
#ifndef __REACTOS__
UnwindStorage[0] = Dcb = Vcb->RootDcb = FsRtlAllocatePoolWithTag( NonPagedPoolNx,
#else
UnwindStorage[0] = Dcb = Vcb->RootDcb = FsRtlAllocatePoolWithTag( NonPagedPool,
#endif
sizeof(DCB),
TAG_FCB );
@ -1144,11 +1132,7 @@ Return Value:
// directory is a fixed size so we can set it everything up now.
//
#ifndef __REACTOS__
FsRtlInitializeLargeMcb( &Dcb->Mcb, NonPagedPoolNx );
#else
FsRtlInitializeLargeMcb( &Dcb->Mcb, NonPagedPool );
#endif
UnwindMcb = &Dcb->Mcb;
if (FatIsFat32(Vcb)) {
@ -1333,13 +1317,8 @@ Return Value:
if (IsPagingFile) {
#ifndef __REACTOS__
PoolType = NonPagedPoolNx;
Fcb = UnwindStorage[0] = FsRtlAllocatePoolWithTag( NonPagedPoolNx,
#else
PoolType = NonPagedPool;
Fcb = UnwindStorage[0] = FsRtlAllocatePoolWithTag( NonPagedPool,
#endif
sizeof(FCB),
TAG_FCB );
} else {

View file

@ -709,11 +709,7 @@ Return Value:
// If we couldn't get pool, oh well....
//
#ifndef __REACTOS__
Packet = ExAllocatePoolWithTag(NonPagedPoolNx, sizeof(CLEAN_AND_DIRTY_VOLUME_PACKET), ' taF');
#else
Packet = ExAllocatePoolWithTag(NonPagedPool, sizeof(CLEAN_AND_DIRTY_VOLUME_PACKET), ' taF');
#endif
if ( Packet ) {

View file

@ -447,11 +447,7 @@ Return Value:
if (!Wait) {
IrpContext->FatIoContext =
#ifndef __REACTOS__
FsRtlAllocatePoolWithTag( NonPagedPoolNx,
#else
FsRtlAllocatePoolWithTag( NonPagedPool,
#endif
sizeof(FAT_IO_CONTEXT),
TAG_FAT_IO_CONTEXT );
@ -1662,11 +1658,7 @@ Return Value:
if (!FcbOrDcb->NonPaged->OutstandingAsyncEvent) {
FcbOrDcb->NonPaged->OutstandingAsyncEvent =
#ifndef __REACTOS__
FsRtlAllocatePoolWithTag( NonPagedPoolNx,
#else
FsRtlAllocatePoolWithTag( NonPagedPool,
#endif
sizeof(KEVENT),
TAG_EVENT );
@ -2420,11 +2412,7 @@ Return Value:
// Get pool and initialize the timer and DPC
//
#ifndef __REACTOS__
FlushContext = FsRtlAllocatePoolWithTag( NonPagedPoolNx,
#else
FlushContext = FsRtlAllocatePoolWithTag( NonPagedPool,
#endif
sizeof(DEFERRED_FLUSH_CONTEXT),
TAG_DEFERRED_FLUSH_CONTEXT );