mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
[NTFS]
Split NtfsFsdDispatch() in two. Now, NtfsFsdDispatch() will only take care of allocating the IRP context and complete the IRP in case it failed (that fixes a null-pointer dereference, just for the record). NtfsDispatch() will really dispatch the IRP to the internal functions. So that it can be called either directly from NtfsFsdDispatch() or by a queued IRP (to be implemented). svn path=/trunk/; revision=67875
This commit is contained in:
parent
c1600b9458
commit
ab8558bafd
1 changed files with 55 additions and 39 deletions
|
@ -33,32 +33,19 @@
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
/*
|
static
|
||||||
* FUNCTION: This function manages IRP for various major functions
|
|
||||||
* ARGUMENTS:
|
|
||||||
* DriverObject = object describing this driver
|
|
||||||
* Irp = IRP to be passed to internal functions
|
|
||||||
* RETURNS: Status of I/O Request
|
|
||||||
*/
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NtfsDispatch(PNTFS_IRP_CONTEXT IrpContext)
|
||||||
NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
|
|
||||||
PIRP Irp)
|
|
||||||
{
|
{
|
||||||
PNTFS_IRP_CONTEXT IrpContext = NULL;
|
PIRP Irp = IrpContext->Irp;
|
||||||
NTSTATUS Status = STATUS_UNSUCCESSFUL;
|
NTSTATUS Status = STATUS_UNSUCCESSFUL;
|
||||||
|
|
||||||
TRACE_(NTFS, "NtfsFsdDispatch()\n");
|
TRACE_(NTFS, "NtfsDispatch()\n");
|
||||||
|
|
||||||
FsRtlEnterFileSystem();
|
FsRtlEnterFileSystem();
|
||||||
ASSERT(DeviceObject);
|
|
||||||
ASSERT(Irp);
|
|
||||||
|
|
||||||
NtfsIsIrpTopLevel(Irp);
|
NtfsIsIrpTopLevel(Irp);
|
||||||
|
|
||||||
IrpContext = NtfsAllocateIrpContext(DeviceObject, Irp);
|
|
||||||
if (IrpContext)
|
|
||||||
{
|
|
||||||
switch (IrpContext->MajorFunction)
|
switch (IrpContext->MajorFunction)
|
||||||
{
|
{
|
||||||
case IRP_MJ_QUERY_VOLUME_INFORMATION:
|
case IRP_MJ_QUERY_VOLUME_INFORMATION:
|
||||||
|
@ -85,9 +72,6 @@ NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
|
||||||
Status = NtfsDeviceControl(IrpContext);
|
Status = NtfsDeviceControl(IrpContext);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
|
||||||
|
|
||||||
ASSERT((!(IrpContext->Flags & IRPCONTEXT_COMPLETE) && !(IrpContext->Flags & IRPCONTEXT_QUEUE)) ||
|
ASSERT((!(IrpContext->Flags & IRPCONTEXT_COMPLETE) && !(IrpContext->Flags & IRPCONTEXT_QUEUE)) ||
|
||||||
((IrpContext->Flags & IRPCONTEXT_COMPLETE) && !(IrpContext->Flags & IRPCONTEXT_QUEUE)) ||
|
((IrpContext->Flags & IRPCONTEXT_COMPLETE) && !(IrpContext->Flags & IRPCONTEXT_QUEUE)) ||
|
||||||
|
@ -107,3 +91,35 @@ NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FUNCTION: This function manages IRP for various major functions
|
||||||
|
* ARGUMENTS:
|
||||||
|
* DriverObject = object describing this driver
|
||||||
|
* Irp = IRP to be passed to internal functions
|
||||||
|
* RETURNS: Status of I/O Request
|
||||||
|
*/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
|
||||||
|
PIRP Irp)
|
||||||
|
{
|
||||||
|
PNTFS_IRP_CONTEXT IrpContext = NULL;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
TRACE_(NTFS, "NtfsFsdDispatch()\n");
|
||||||
|
|
||||||
|
IrpContext = NtfsAllocateIrpContext(DeviceObject, Irp);
|
||||||
|
if (IrpContext == NULL)
|
||||||
|
{
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
Irp->IoStatus.Status = Status;
|
||||||
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status = NtfsDispatch(IrpContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue