diff --git a/reactos/drivers/filesystems/ntfs/devctl.c b/reactos/drivers/filesystems/ntfs/devctl.c index 115ef9273f9..aeb11130776 100644 --- a/reactos/drivers/filesystems/ntfs/devctl.c +++ b/reactos/drivers/filesystems/ntfs/devctl.c @@ -33,14 +33,16 @@ /* FUNCTIONS ****************************************************************/ NTSTATUS -NTAPI -NtfsFsdDeviceControl(PDEVICE_OBJECT DeviceObject, - PIRP Irp) +NtfsDeviceControl(PNTFS_IRP_CONTEXT IrpContext) { PDEVICE_EXTENSION DeviceExt; + PIRP Irp = IrpContext->Irp; - DeviceExt = DeviceObject->DeviceExtension; + DeviceExt = IrpContext->DeviceObject->DeviceExtension; IoSkipCurrentIrpStackLocation(Irp); + /* Lower driver will complete - we don't have to */ + IrpContext->Flags &= ~IRPCONTEXT_COMPLETE; + return IoCallDriver(DeviceExt->StorageDevice, Irp); } diff --git a/reactos/drivers/filesystems/ntfs/dispatch.c b/reactos/drivers/filesystems/ntfs/dispatch.c index 370b9ded998..8899e3094e6 100644 --- a/reactos/drivers/filesystems/ntfs/dispatch.c +++ b/reactos/drivers/filesystems/ntfs/dispatch.c @@ -80,6 +80,10 @@ NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject, case IRP_MJ_READ: Status = NtfsRead(IrpContext); break; + + case IRP_MJ_DEVICE_CONTROL: + Status = NtfsDeviceControl(IrpContext); + break; } } else diff --git a/reactos/drivers/filesystems/ntfs/ntfs.c b/reactos/drivers/filesystems/ntfs/ntfs.c index 918bcb389b5..70cf82819ae 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.c +++ b/reactos/drivers/filesystems/ntfs/ntfs.c @@ -128,7 +128,7 @@ NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject) DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] = NtfsFsdDispatch; DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = NtfsFsdDispatch; DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = NtfsFsdFileSystemControl; - DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = NtfsFsdDeviceControl; + DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = NtfsFsdDispatch; return; } diff --git a/reactos/drivers/filesystems/ntfs/ntfs.h b/reactos/drivers/filesystems/ntfs/ntfs.h index 1d2d204b08f..a31f6c22363 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.h +++ b/reactos/drivers/filesystems/ntfs/ntfs.h @@ -536,10 +536,8 @@ NtfsFsdCreate(PDEVICE_OBJECT DeviceObject, /* devctl.c */ -DRIVER_DISPATCH NtfsFsdDeviceControl; -NTSTATUS NTAPI -NtfsFsdDeviceControl(PDEVICE_OBJECT DeviceObject, - PIRP Irp); +NTSTATUS +NtfsDeviceControl(PNTFS_IRP_CONTEXT IrpContext); /* dirctl.c */