From 8ddf736b58c687868c393b35a613169c8b4d660d Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 10 May 2015 10:17:29 +0000 Subject: [PATCH] [NTFS] Handle IRP_MJ_DIRECTORY_CONTROL with the dispatch routine svn path=/trunk/; revision=67615 --- reactos/drivers/filesystems/ntfs/dirctl.c | 48 ++++++--------------- reactos/drivers/filesystems/ntfs/dispatch.c | 4 ++ reactos/drivers/filesystems/ntfs/ntfs.c | 2 +- reactos/drivers/filesystems/ntfs/ntfs.h | 6 +-- 4 files changed, 20 insertions(+), 40 deletions(-) diff --git a/reactos/drivers/filesystems/ntfs/dirctl.c b/reactos/drivers/filesystems/ntfs/dirctl.c index 94c1cfa59be..9bb0403b5f5 100644 --- a/reactos/drivers/filesystems/ntfs/dirctl.c +++ b/reactos/drivers/filesystems/ntfs/dirctl.c @@ -436,52 +436,30 @@ NtfsQueryDirectory(PNTFS_IRP_CONTEXT IrpContext) NTSTATUS -NTAPI -NtfsFsdDirectoryControl(PDEVICE_OBJECT DeviceObject, - PIRP Irp) +NtfsDirectoryControl(PNTFS_IRP_CONTEXT IrpContext) { - PNTFS_IRP_CONTEXT IrpContext = NULL; NTSTATUS Status = STATUS_UNSUCCESSFUL; DPRINT1("NtfsDirectoryControl() called\n"); - FsRtlEnterFileSystem(); - ASSERT(DeviceObject); - ASSERT(Irp); - - NtfsIsIrpTopLevel(Irp); - - IrpContext = NtfsAllocateIrpContext(DeviceObject, Irp); - if (IrpContext) + switch (IrpContext->MinorFunction) { - switch (IrpContext->MinorFunction) - { - case IRP_MN_QUERY_DIRECTORY: - Status = NtfsQueryDirectory(IrpContext); - break; + case IRP_MN_QUERY_DIRECTORY: + Status = NtfsQueryDirectory(IrpContext); + break; - case IRP_MN_NOTIFY_CHANGE_DIRECTORY: - DPRINT1("IRP_MN_NOTIFY_CHANGE_DIRECTORY\n"); - Status = STATUS_NOT_IMPLEMENTED; - break; + case IRP_MN_NOTIFY_CHANGE_DIRECTORY: + DPRINT1("IRP_MN_NOTIFY_CHANGE_DIRECTORY\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; - default: - Status = STATUS_INVALID_DEVICE_REQUEST; - break; - } + default: + Status = STATUS_INVALID_DEVICE_REQUEST; + break; } - else - Status = STATUS_INSUFFICIENT_RESOURCES; - Irp->IoStatus.Status = Status; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + IrpContext->Irp->IoStatus.Information = 0; - if (IrpContext) - ExFreePoolWithTag(IrpContext, 'PRIN'); - - IoSetTopLevelIrp(NULL); - FsRtlExitFileSystem(); return Status; } diff --git a/reactos/drivers/filesystems/ntfs/dispatch.c b/reactos/drivers/filesystems/ntfs/dispatch.c index 11d833af91a..6f573773437 100644 --- a/reactos/drivers/filesystems/ntfs/dispatch.c +++ b/reactos/drivers/filesystems/ntfs/dispatch.c @@ -72,6 +72,10 @@ NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject, case IRP_MJ_QUERY_INFORMATION: Status = NtfsQueryInformation(IrpContext); break; + + case IRP_MJ_DIRECTORY_CONTROL: + Status = NtfsDirectoryControl(IrpContext); + break; } } else diff --git a/reactos/drivers/filesystems/ntfs/ntfs.c b/reactos/drivers/filesystems/ntfs/ntfs.c index f43185d9299..304b2904b8f 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.c +++ b/reactos/drivers/filesystems/ntfs/ntfs.c @@ -126,7 +126,7 @@ NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject) DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = NtfsFsdDispatch; DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = NtfsFsdDispatch; DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] = NtfsFsdDispatch; - DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = NtfsFsdDirectoryControl; + DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = NtfsFsdDispatch; DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = NtfsFsdFileSystemControl; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = NtfsFsdDeviceControl; diff --git a/reactos/drivers/filesystems/ntfs/ntfs.h b/reactos/drivers/filesystems/ntfs/ntfs.h index 2eccf7ddf57..07fc6371950 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.h +++ b/reactos/drivers/filesystems/ntfs/ntfs.h @@ -541,10 +541,8 @@ NtfsFsdDeviceControl(PDEVICE_OBJECT DeviceObject, /* dirctl.c */ -DRIVER_DISPATCH NtfsFsdDirectoryControl; -NTSTATUS NTAPI -NtfsFsdDirectoryControl(PDEVICE_OBJECT DeviceObject, - PIRP Irp); +NTSTATUS +NtfsDirectoryControl(PNTFS_IRP_CONTEXT IrpContext); /* dispatch.c */