From bb897872a1e9bca9edf2e4255bee241faa0991ac Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Wed, 2 Mar 2016 17:19:54 -0800 Subject: [PATCH] sys: FSP_MJ_ENTER: top level irp functionality --- src/sys/driver.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/sys/driver.h b/src/sys/driver.h index e8617d5b..c75daa82 100644 --- a/src/sys/driver.h +++ b/src/sys/driver.h @@ -131,11 +131,17 @@ extern __declspec(selectany) int fsp_bp = 1; { \ if (0 != fsp_top_level_irp) \ { \ - if (FSRTL_MAX_TOP_LEVEL_IRP_FLAG < (UINT_PTR)fsp_top_level_irp &&\ - IO_TYPE_IRP == fsp_top_level_irp->Type)\ - FspIrpSetTopFlags(Irp, FspIrpFlags(fsp_top_level_irp));\ - else \ + if (FSRTL_MAX_TOP_LEVEL_IRP_FLAG >= (UINT_PTR)fsp_top_level_irp)\ FspIrpSetTopFlags(Irp, FspFileNodeAcquireFull);\ + else if (IO_TYPE_IRP == fsp_top_level_irp->Type &&\ + 0 != IrpSp->FileObject && FspFileNodeIsValid(IrpSp->FileObject->FsContext))\ + { \ + PIO_STACK_LOCATION fsp_top_level_irpsp =\ + IoGetCurrentIrpStackLocation(fsp_top_level_irp);\ + if (0 != fsp_top_level_irpsp->FileObject &&\ + IrpSp->FileObject->FsContext == fsp_top_level_irpsp->FileObject->FsContext)\ + FspIrpSetTopFlags(Irp, FspIrpFlags(fsp_top_level_irp));\ + } \ } \ IoSetTopLevelIrp(Irp); \ if (!FspDeviceReference(IrpSp->DeviceObject))\