Author: pschweitzer
Date: Fri Sep 26 06:41:51 2014
New Revision: 64294
URL:
http://svn.reactos.org/svn/reactos?rev=64294&view=rev
Log:
[NTFS]
- Divert NtfsReadSectors() into NtfsReadDisk()
- Reimplement NtfsReadSectors() using NtfsReadDisk()
Modified:
trunk/reactos/drivers/filesystems/ntfs/blockdev.c
trunk/reactos/drivers/filesystems/ntfs/ntfs.h
Modified: trunk/reactos/drivers/filesystems/ntfs/blockdev.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/b…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/blockdev.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/blockdev.c [iso-8859-1] Fri Sep 26 06:41:51
2014
@@ -33,39 +33,32 @@
/* FUNCTIONS ****************************************************************/
NTSTATUS
-NtfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
- IN ULONG DiskSector,
- IN ULONG SectorCount,
- IN ULONG SectorSize,
- IN OUT PUCHAR Buffer,
- IN BOOLEAN Override)
+NtfsReadDisk(IN PDEVICE_OBJECT DeviceObject,
+ IN LONGLONG StartingOffset,
+ IN ULONG Length,
+ IN OUT PUCHAR Buffer,
+ IN BOOLEAN Override)
{
PIO_STACK_LOCATION Stack;
IO_STATUS_BLOCK IoStatus;
LARGE_INTEGER Offset;
- ULONG BlockSize;
KEVENT Event;
PIRP Irp;
NTSTATUS Status;
+
+ DPRINT("NtfsReadDisk(%p, %I64x, %u, %p, %d)\n", DeviceObject,
StartingOffset, Length, Buffer, Override);
KeInitializeEvent(&Event,
NotificationEvent,
FALSE);
- Offset.QuadPart = (LONGLONG)DiskSector * (LONGLONG)SectorSize;
- BlockSize = SectorCount * SectorSize;
-
- DPRINT("NtfsReadSectors(DeviceObject %p, DiskSector %d, Buffer %p)\n",
- DeviceObject, DiskSector, Buffer);
- DPRINT("Offset %I64x BlockSize %ld\n",
- Offset.QuadPart,
- BlockSize);
+ Offset.QuadPart = StartingOffset;
DPRINT("Building synchronous FSD Request...\n");
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ,
DeviceObject,
Buffer,
- BlockSize,
+ Length,
&Offset,
&Event,
&IoStatus);
@@ -93,9 +86,26 @@
Status = IoStatus.Status;
}
- DPRINT("NtfsReadSectors() done (Status %x)\n", Status);
+ DPRINT("NtfsReadDisk() done (Status %x)\n", Status);
return Status;
+}
+
+NTSTATUS
+NtfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG DiskSector,
+ IN ULONG SectorCount,
+ IN ULONG SectorSize,
+ IN OUT PUCHAR Buffer,
+ IN BOOLEAN Override)
+{
+ LONGLONG Offset;
+ ULONG BlockSize;
+
+ Offset = (LONGLONG)DiskSector * (LONGLONG)SectorSize;
+ BlockSize = SectorCount * SectorSize;
+
+ return NtfsReadDisk(DeviceObject, Offset, BlockSize, Buffer, Override);
}
Modified: trunk/reactos/drivers/filesystems/ntfs/ntfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/n…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Fri Sep 26 06:41:51 2014
@@ -386,6 +386,13 @@
/* blockdev.c */
NTSTATUS
+NtfsReadDisk(IN PDEVICE_OBJECT DeviceObject,
+ IN LONGLONG StartingOffset,
+ IN ULONG Length,
+ IN OUT PUCHAR Buffer,
+ IN BOOLEAN Override);
+
+NTSTATUS
NtfsReadSectors(IN PDEVICE_OBJECT DeviceObject,
IN ULONG DiskSector,
IN ULONG SectorCount,