#include <ntddscsi.h>
#include <mountdev.h>
#include <mountmgr.h>
+#include <ntiologc.h>
#include <include/class2.h>
#include <stdio.h>
#define NDEBUG
#include <debug.h>
-#define IO_WRITE_CACHE_ENABLED ((NTSTATUS)0x80040020L)
-#define IO_WRITE_CACHE_DISABLED ((NTSTATUS)0x80040022L)
#ifdef POOL_TAGGING
#ifdef ExAllocatePool
ULONG transferByteCount = currentIrpStack->Parameters.Read.Length;
LARGE_INTEGER startingOffset;
+ //
+ // HACK: How can we end here with null sector size?!
+ //
+
+ if (deviceExtension->DiskGeometry->Geometry.BytesPerSector == 0) {
+ DPRINT1("Hack! Received invalid sector size\n");
+ deviceExtension->DiskGeometry->Geometry.BytesPerSector = 512;
+ }
+
//
// Verify parameters of this request.
// Check that ending sector is within partition and
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
}
- DPRINT1("STATUS_INVALID_PARAMETER\n");
+ if (startingOffset.QuadPart > deviceExtension->PartitionLength.QuadPart) {
+ DPRINT1("Reading beyond partition end! startingOffset: %I64d, PartitionLength: %I64d\n", startingOffset.QuadPart, deviceExtension->PartitionLength.QuadPart);
+ }
+
+ if (transferByteCount & (deviceExtension->DiskGeometry->Geometry.BytesPerSector - 1)) {
+ DPRINT1("Not reading sectors! TransferByteCount: %lu, BytesPerSector: %lu\n", transferByteCount, deviceExtension->DiskGeometry->Geometry.BytesPerSector);
+ }
+
+ if (Irp->IoStatus.Status == STATUS_DEVICE_NOT_READY) {
+ DPRINT1("Failing due to device not ready!\n");
+ }
+
return STATUS_INVALID_PARAMETER;
}
PPARTITION_INFORMATION outputBuffer;
+ if (diskData->PartitionNumber == 0) {
+ DPRINT1("HACK: Handling partition 0 request!\n");
+ //ASSERT(FALSE);
+ }
+
//
// Update the geometry in case it has changed.
//
//
diskData->DriveNotReady = FALSE;
-// HACK: ReactOS partition numbers must be wrong (>0 part)
- if (diskData->PartitionType == 0 && (diskData->PartitionNumber > 0)) {
-
- status = STATUS_INVALID_DEVICE_REQUEST;
- break;
- }
outputBuffer =
(PPARTITION_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
status = STATUS_INFO_LENGTH_MISMATCH;
}
+#if 0 // HACK: ReactOS partition numbers must be wrong
else if (diskData->PartitionNumber == 0) {
//
status = STATUS_INVALID_DEVICE_REQUEST;
}
+#endif
else {
PPARTITION_INFORMATION_EX outputBuffer;
+ if (diskData->PartitionNumber == 0) {
+ DPRINT1("HACK: Handling partition 0 request!\n");
+ //ASSERT(FALSE);
+ }
+
//
// Update the geometry in case it has changed.
//