Author: ekohl
Date: Mon Jun 1 17:15:11 2015
New Revision: 67994
URL:
http://svn.reactos.org/svn/reactos?rev=67994&view=rev
Log:
[CDFS]
Queue IRP_MJ_READ, IRP_MJ_WRITE, IRP_MJ_CLOSE and IRP_MJ_CLEANUP IRPs.
Modified:
trunk/reactos/drivers/filesystems/cdfs/cdfs.c
trunk/reactos/drivers/filesystems/cdfs/cdfs.h
trunk/reactos/drivers/filesystems/cdfs/cleanup.c
trunk/reactos/drivers/filesystems/cdfs/close.c
trunk/reactos/drivers/filesystems/cdfs/dispatch.c
trunk/reactos/drivers/filesystems/cdfs/rw.c
Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/cdfs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cdfs.c [iso-8859-1] Mon Jun 1 17:15:11 2015
@@ -79,11 +79,11 @@
/* Initialize driver data */
DeviceObject->Flags = DO_DIRECT_IO;
- DriverObject->MajorFunction[IRP_MJ_CLOSE] = CdfsClose;
- DriverObject->MajorFunction[IRP_MJ_CLEANUP] = CdfsCleanup;
+ DriverObject->MajorFunction[IRP_MJ_CLOSE] = CdfsFsdDispatch;
+ DriverObject->MajorFunction[IRP_MJ_CLEANUP] = CdfsFsdDispatch;
DriverObject->MajorFunction[IRP_MJ_CREATE] = CdfsCreate;
- DriverObject->MajorFunction[IRP_MJ_READ] = CdfsRead;
- DriverObject->MajorFunction[IRP_MJ_WRITE] = CdfsWrite;
+ DriverObject->MajorFunction[IRP_MJ_READ] = CdfsFsdDispatch;
+ DriverObject->MajorFunction[IRP_MJ_WRITE] = CdfsFsdDispatch;
DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = CdfsFsdDispatch;
DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = CdfsFsdDispatch;
DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = CdfsFsdDispatch;
Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] Mon Jun 1 17:15:11 2015
@@ -281,22 +281,18 @@
/* cleanup.c */
-DRIVER_DISPATCH CdfsCleanup;
-
-NTSTATUS
-NTAPI
-CdfsCleanup(PDEVICE_OBJECT DeviceObject,
- PIRP Irp);
+NTSTATUS
+NTAPI
+CdfsCleanup(
+ PCDFS_IRP_CONTEXT IrpContext);
/* close.c */
-DRIVER_DISPATCH CdfsClose;
-
-NTSTATUS
-NTAPI
-CdfsClose(PDEVICE_OBJECT DeviceObject,
- PIRP Irp);
+NTSTATUS
+NTAPI
+CdfsClose(
+ PCDFS_IRP_CONTEXT IrpContext);
NTSTATUS
CdfsCloseFile(PDEVICE_EXTENSION DeviceExt,
@@ -488,19 +484,15 @@
/* rw.c */
-DRIVER_DISPATCH CdfsRead;
-
-NTSTATUS
-NTAPI
-CdfsRead(PDEVICE_OBJECT DeviceObject,
- PIRP Irp);
-
-DRIVER_DISPATCH CdfsWrite;
-
-NTSTATUS
-NTAPI
-CdfsWrite(PDEVICE_OBJECT DeviceObject,
- PIRP Irp);
+NTSTATUS
+NTAPI
+CdfsRead(
+ PCDFS_IRP_CONTEXT IrpContext);
+
+NTSTATUS
+NTAPI
+CdfsWrite(
+ PCDFS_IRP_CONTEXT IrpContext);
/* volinfo.c */
Modified: trunk/reactos/drivers/filesystems/cdfs/cleanup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/cleanup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cleanup.c [iso-8859-1] Mon Jun 1 17:15:11
2015
@@ -68,15 +68,23 @@
}
NTSTATUS NTAPI
-CdfsCleanup(PDEVICE_OBJECT DeviceObject,
- PIRP Irp)
+CdfsCleanup(
+ PCDFS_IRP_CONTEXT IrpContext)
{
+ PIRP Irp;
+ PDEVICE_OBJECT DeviceObject;
PDEVICE_EXTENSION DeviceExtension;
PIO_STACK_LOCATION Stack;
PFILE_OBJECT FileObject;
NTSTATUS Status;
DPRINT("CdfsCleanup() called\n");
+
+ ASSERT(IrpContext);
+
+ Irp = IrpContext->Irp;
+ DeviceObject = IrpContext->DeviceObject;
+ Stack = IrpContext->Stack;
if (DeviceObject == CdfsGlobalData->DeviceObject)
{
@@ -85,7 +93,6 @@
goto ByeBye;
}
- Stack = IoGetCurrentIrpStackLocation(Irp);
FileObject = Stack->FileObject;
DeviceExtension = DeviceObject->DeviceExtension;
@@ -97,12 +104,9 @@
ExReleaseResourceLite(&DeviceExtension->DirResource);
KeLeaveCriticalRegion();
-
ByeBye:
- Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = 0;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
return(Status);
}
Modified: trunk/reactos/drivers/filesystems/cdfs/close.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/close.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/close.c [iso-8859-1] Mon Jun 1 17:15:11 2015
@@ -76,15 +76,23 @@
NTSTATUS NTAPI
-CdfsClose(PDEVICE_OBJECT DeviceObject,
- PIRP Irp)
+CdfsClose(
+ PCDFS_IRP_CONTEXT IrpContext)
{
+ PIRP Irp;
+ PDEVICE_OBJECT DeviceObject;
PDEVICE_EXTENSION DeviceExtension;
PIO_STACK_LOCATION Stack;
PFILE_OBJECT FileObject;
NTSTATUS Status;
DPRINT("CdfsClose() called\n");
+
+ ASSERT(IrpContext);
+
+ Irp = IrpContext->Irp;
+ DeviceObject = IrpContext->DeviceObject;
+ Stack = IrpContext->Stack;
if (DeviceObject == CdfsGlobalData->DeviceObject)
{
@@ -93,17 +101,14 @@
goto ByeBye;
}
- Stack = IoGetCurrentIrpStackLocation(Irp);
FileObject = Stack->FileObject;
DeviceExtension = DeviceObject->DeviceExtension;
Status = CdfsCloseFile(DeviceExtension,FileObject);
ByeBye:
- Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = 0;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
return(Status);
}
Modified: trunk/reactos/drivers/filesystems/cdfs/dispatch.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/dispatch.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/dispatch.c [iso-8859-1] Mon Jun 1 17:15:11
2015
@@ -89,7 +89,7 @@
break;
case IRP_MJ_READ:
-// Status = CdfsRead(IrpContext);
+ Status = CdfsRead(IrpContext);
break;
case IRP_MJ_DEVICE_CONTROL:
@@ -97,15 +97,19 @@
break;
case IRP_MJ_WRITE:
-// Status = CdfsWrite(IrpContext);
+ Status = CdfsWrite(IrpContext);
break;
case IRP_MJ_CLOSE:
-// Status = CdfsClose(IrpContext);
+ Status = CdfsClose(IrpContext);
break;
case IRP_MJ_CREATE:
// Status = CdfsCreate(IrpContext);
+ break;
+
+ case IRP_MJ_CLEANUP:
+ Status = CdfsCleanup(IrpContext);
break;
case IRP_MJ_FILE_SYSTEM_CONTROL:
Modified: trunk/reactos/drivers/filesystems/cdfs/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/r…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/rw.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/rw.c [iso-8859-1] Mon Jun 1 17:15:11 2015
@@ -175,9 +175,11 @@
NTSTATUS NTAPI
-CdfsRead(PDEVICE_OBJECT DeviceObject,
- PIRP Irp)
+CdfsRead(
+ PCDFS_IRP_CONTEXT IrpContext)
{
+ PIRP Irp;
+ PDEVICE_OBJECT DeviceObject;
PDEVICE_EXTENSION DeviceExt;
PIO_STACK_LOCATION Stack;
PFILE_OBJECT FileObject;
@@ -187,10 +189,15 @@
ULONG ReturnedReadLength = 0;
NTSTATUS Status = STATUS_SUCCESS;
- DPRINT("CdfsRead(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+ DPRINT("CdfsRead(%p)\n", IrpContext);
+
+ ASSERT(IrpContext);
+
+ Irp = IrpContext->Irp;
+ DeviceObject = IrpContext->DeviceObject;
+ Stack = IrpContext->Stack;
DeviceExt = DeviceObject->DeviceExtension;
- Stack = IoGetCurrentIrpStackLocation(Irp);
FileObject = Stack->FileObject;
ReadLength = Stack->Parameters.Read.Length;
@@ -218,19 +225,21 @@
Irp->IoStatus.Information = 0;
}
- Irp->IoStatus.Status = Status;
- IoCompleteRequest(Irp,IO_NO_INCREMENT);
-
return(Status);
}
NTSTATUS NTAPI
-CdfsWrite(PDEVICE_OBJECT DeviceObject,
- PIRP Irp)
+CdfsWrite(
+ PCDFS_IRP_CONTEXT IrpContext)
{
- DPRINT("CdfsWrite(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
-
+ PIRP Irp;
+
+ DPRINT("CdfsWrite(%p)\n", IrpContext);
+
+ ASSERT(IrpContext);
+
+ Irp = IrpContext->Irp;
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
Irp->IoStatus.Information = 0;
return(STATUS_NOT_SUPPORTED);