#pragma warning( pop )
#endif
+#ifdef __REACTOS__
+// Downgrade unsupported NT6.2+ features.
+#undef MdlMappingNoExecute
+#define MdlMappingNoExecute 0
+#define NonPagedPoolNx NonPagedPool
+#define NonPagedPoolNxCacheAligned NonPagedPoolCacheAligned
+#endif
+
//**** x86 compiler bug ****
#if defined(_M_IX86)
// );
//
-#ifndef __REACTOS__
#define CdMapUserBuffer(IC, UB) { \
*(UB) = (PVOID) ( ((IC)->Irp->MdlAddress == NULL) ? \
(IC)->Irp->UserBuffer : \
} \
}
-#else
-#define CdMapUserBuffer(IC, UB) { \
- *(UB) = (PVOID) ( ((IC)->Irp->MdlAddress == NULL) ? \
- (IC)->Irp->UserBuffer : \
- (MmGetSystemAddressForMdlSafe( (IC)->Irp->MdlAddress, NormalPagePriority))); \
- if (NULL == *(UB)) { \
- CdRaiseStatus( (IC), STATUS_INSUFFICIENT_RESOURCES); \
- } \
- }
-
-#endif
-
#define CdLockUserBuffer(IC,BL,OP) { \
if ((IC)->Irp->MdlAddress == NULL) { \
//
#define CdPagedPool PagedPool
-#ifndef __REACTOS__
#define CdNonPagedPool NonPagedPoolNx
#define CdNonPagedPoolCacheAligned NonPagedPoolNxCacheAligned
-#else
-#define CdNonPagedPool NonPagedPool
-#define CdNonPagedPoolCacheAligned NonPagedPoolCacheAligned
-#endif
//
#include <ntstrsafe.h>
#include <intsafe.h>
+#ifdef __REACTOS__
+// Downgrade unsupported NT6.2+ features.
+#define NonPagedPoolNx NonPagedPool
+#define NonPagedPoolNxCacheAligned NonPagedPoolCacheAligned
+#endif
+
#define MODE_DATA_SIZE 192
#define SCSI_FLOPPY_TIMEOUT 20
#define SFLOPPY_SRB_LIST_SIZE 4
// Allocate request sense buffer.
//
-#ifndef __REACTOS__
senseData = ExAllocatePool(NonPagedPoolNxCacheAligned, SENSE_BUFFER_SIZE);
-#else
- senseData = ExAllocatePool(NonPagedPoolCacheAligned, SENSE_BUFFER_SIZE);
-#endif
if (senseData == NULL) {
//
Irp->IoStatus.Information = 0;
-#ifndef __REACTOS__
srb = ExAllocatePool(NonPagedPoolNx, SCSI_REQUEST_BLOCK_SIZE);
-#else
- srb = ExAllocatePool(NonPagedPool, SCSI_REQUEST_BLOCK_SIZE);
-#endif
if (srb == NULL) {
// Determine if the device is writable.
//
-#ifndef __REACTOS__
modeData = ExAllocatePool(NonPagedPoolNxCacheAligned, MODE_DATA_SIZE);
-#else
- modeData = ExAllocatePool(NonPagedPoolCacheAligned, MODE_DATA_SIZE);
-#endif
if (modeData == NULL) {
status = STATUS_INSUFFICIENT_RESOURCES;
// Allocate a Srb for the read command.
//
-#ifndef __REACTOS__
readData = ExAllocatePool(NonPagedPoolNx, geometry->BytesPerSector);
-#else
- readData = ExAllocatePool(NonPagedPool, geometry->BytesPerSector);
-#endif
if (readData == NULL) {
return STATUS_NO_MEMORY;
}
-#ifndef __REACTOS__
srb = ExAllocatePool(NonPagedPoolNx, SCSI_REQUEST_BLOCK_SIZE);
-#else
- srb = ExAllocatePool(NonPagedPool, SCSI_REQUEST_BLOCK_SIZE);
-#endif
if (srb == NULL) {
return(diskData->DriveType);
}
-#ifndef __REACTOS__
modeData = ExAllocatePool(NonPagedPoolNxCacheAligned, MODE_DATA_SIZE);
-#else
- modeData = ExAllocatePool(NonPagedPoolCacheAligned, MODE_DATA_SIZE);
-#endif
if (modeData == NULL) {
return(DRIVE_TYPE_NONE);
PAGED_CODE();
-#ifndef __REACTOS__
modeData = ExAllocatePool(NonPagedPoolNxCacheAligned, MODE_DATA_SIZE);
-#else
- modeData = ExAllocatePool(NonPagedPoolCacheAligned, MODE_DATA_SIZE);
-#endif
if (modeData == NULL) {
return(STATUS_INSUFFICIENT_RESOURCES);
// Allocate a Srb for the format command.
//
-#ifndef __REACTOS__
srb = ExAllocatePool(NonPagedPoolNx, SCSI_REQUEST_BLOCK_SIZE);
-#else
- srb = ExAllocatePool(NonPagedPool, SCSI_REQUEST_BLOCK_SIZE);
-#endif
if (srb == NULL) {
// Allocate a Srb for the format command.
//
-#ifndef __REACTOS__
srb = ExAllocatePool(NonPagedPoolNx, SCSI_REQUEST_BLOCK_SIZE);
-#else
- srb = ExAllocatePool(NonPagedPool, SCSI_REQUEST_BLOCK_SIZE);
-#endif
if (srb == NULL) {
return(STATUS_INSUFFICIENT_RESOURCES);
DebugPrint((2,"Sending SCSIOP_START_STOP_UNIT\n"));
-#ifndef __REACTOS__
context = ExAllocatePool(NonPagedPoolNx,
sizeof(COMPLETION_CONTEXT));
-#else
- context = ExAllocatePool(NonPagedPool,
- sizeof(COMPLETION_CONTEXT));
-#endif
if (context == NULL) {
context = NULL;
if (!overFlow) {
-#ifndef __REACTOS__
context = ExAllocatePool(NonPagedPoolNx, sizeNeeded);
-#else
- context = ExAllocatePool(NonPagedPool, sizeNeeded);
-#endif
}
if (context == NULL) {
driveMediaConstants->SectorsPerTrack *
driveMediaConstants->BytesPerSector;
-#ifndef __REACTOS__
buffer = ExAllocatePool(NonPagedPoolNxCacheAligned, length);
-#else
- buffer = ExAllocatePool(NonPagedPoolCacheAligned, length);
-#endif
if (buffer == NULL) {
return(STATUS_INSUFFICIENT_RESOURCES);
// Allocate an SRB for the SCSIOP_READ_FORMATTED_CAPACITY request
//
-#ifndef __REACTOS__
srb = ExAllocatePool(NonPagedPoolNx, SCSI_REQUEST_BLOCK_SIZE);
-#else
- srb = ExAllocatePool(NonPagedPool, SCSI_REQUEST_BLOCK_SIZE);
-#endif
if (srb == NULL)
{
ASSERT(dataTransferLength < 0x100);
-#ifndef __REACTOS__
dataBuffer = ExAllocatePool(NonPagedPoolNx, dataTransferLength);
-#else
- dataBuffer = ExAllocatePool(NonPagedPool, dataTransferLength);
-#endif
if (dataBuffer == NULL)
{
// Allocate an SRB for the SCSIOP_FORMAT_UNIT request
//
-#ifndef __REACTOS__
srb = ExAllocatePool(NonPagedPoolNx, SCSI_REQUEST_BLOCK_SIZE);
-#else
- srb = ExAllocatePool(NonPagedPool, SCSI_REQUEST_BLOCK_SIZE);
-#endif
if (srb == NULL)
{
// Allocate a transfer buffer for the SCSIOP_FORMAT_UNIT parameter list
//
-#ifndef __REACTOS__
parameterList = ExAllocatePool(NonPagedPoolNx,
sizeof(FORMAT_UNIT_PARAMETER_LIST));
-#else
- parameterList = ExAllocatePool(NonPagedPool,
- sizeof(FORMAT_UNIT_PARAMETER_LIST));
-#endif
if (parameterList == NULL)
{
return status;
}
-