Handle IRP_MJ_READ with the dispatch routine

svn path=/trunk/; revision=67634
This commit is contained in:
Pierre Schweitzer 2015-05-10 20:35:40 +00:00
parent 241a326520
commit edef9fdfae
4 changed files with 16 additions and 15 deletions

View file

@ -76,6 +76,10 @@ NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
case IRP_MJ_DIRECTORY_CONTROL:
Status = NtfsDirectoryControl(IrpContext);
break;
case IRP_MJ_READ:
Status = NtfsRead(IrpContext);
break;
}
}
else

View file

@ -121,7 +121,7 @@ NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject)
{
DriverObject->MajorFunction[IRP_MJ_CREATE] = NtfsFsdCreate;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = NtfsFsdClose;
DriverObject->MajorFunction[IRP_MJ_READ] = NtfsFsdRead;
DriverObject->MajorFunction[IRP_MJ_READ] = NtfsFsdDispatch;
DriverObject->MajorFunction[IRP_MJ_WRITE] = NtfsFsdWrite;
DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = NtfsFsdDispatch;
DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = NtfsFsdDispatch;

View file

@ -759,10 +759,8 @@ NtfsFileFlagsToAttributes(ULONG NtfsAttributes,
/* rw.c */
DRIVER_DISPATCH NtfsFsdRead;
NTSTATUS NTAPI
NtfsFsdRead(PDEVICE_OBJECT DeviceObject,
PIRP Irp);
NTSTATUS
NtfsRead(PNTFS_IRP_CONTEXT IrpContext);
DRIVER_DISPATCH NtfsFsdWrite;
NTSTATUS NTAPI

View file

@ -161,9 +161,7 @@ NtfsReadFile(PDEVICE_EXTENSION DeviceExt,
NTSTATUS
NTAPI
NtfsFsdRead(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
NtfsRead(PNTFS_IRP_CONTEXT IrpContext)
{
PDEVICE_EXTENSION DeviceExt;
PIO_STACK_LOCATION Stack;
@ -173,13 +171,17 @@ NtfsFsdRead(PDEVICE_OBJECT DeviceObject,
LARGE_INTEGER ReadOffset;
ULONG ReturnedReadLength = 0;
NTSTATUS Status = STATUS_SUCCESS;
PIRP Irp;
PDEVICE_OBJECT DeviceObject;
DPRINT("NtfsRead(DeviceObject %x, Irp %x)\n",DeviceObject,Irp);
DPRINT("NtfsRead(DeviceObject %p)\n", IrpContext);
DeviceObject = IrpContext->DeviceObject;
Irp = IrpContext->Irp;
Stack = IrpContext->Stack;
FileObject = IrpContext->FileObject;
DeviceExt = DeviceObject->DeviceExtension;
Stack = IoGetCurrentIrpStackLocation(Irp);
FileObject = Stack->FileObject;
ReadLength = Stack->Parameters.Read.Length;
ReadOffset = Stack->Parameters.Read.ByteOffset;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
@ -206,9 +208,6 @@ NtfsFsdRead(PDEVICE_OBJECT DeviceObject,
Irp->IoStatus.Information = 0;
}
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp,IO_NO_INCREMENT);
return Status;
}