VOID NTAPI FFSDeQueueCloseRequest( IN PVOID Context) { PFFS_IRP_CONTEXT IrpContext; PAGED_CODE(); IrpContext = (PFFS_IRP_CONTEXT) Context; ASSERT(IrpContext); ASSERT((IrpContext->Identifier.Type == FFSICX) && (IrpContext->Identifier.Size == sizeof(FFS_IRP_CONTEXT))); _SEH2_TRY { _SEH2_TRY { FsRtlEnterFileSystem(); FFSClose(IrpContext); } _SEH2_EXCEPT (FFSExceptionFilter(IrpContext, _SEH2_GetExceptionInformation())) { FFSExceptionHandler(IrpContext); } _SEH2_END; } _SEH2_FINALLY { FsRtlExitFileSystem(); } _SEH2_END; }
VOID FFSDeQueueRequest( IN PVOID Context) { PFFS_IRP_CONTEXT IrpContext; IrpContext = (PFFS_IRP_CONTEXT) Context; ASSERT(IrpContext); ASSERT((IrpContext->Identifier.Type == FFSICX) && (IrpContext->Identifier.Size == sizeof(FFS_IRP_CONTEXT))); __try { __try { FsRtlEnterFileSystem(); if (!IrpContext->IsTopLevel) { IoSetTopLevelIrp((PIRP) FSRTL_FSP_TOP_LEVEL_IRP); } FFSDispatchRequest(IrpContext); } __except (FFSExceptionFilter(IrpContext, GetExceptionInformation())) { FFSExceptionHandler(IrpContext); } } __finally { IoSetTopLevelIrp(NULL); FsRtlExitFileSystem(); } }
NTSTATUS FFSBuildRequest( PDEVICE_OBJECT DeviceObject, PIRP Irp) { BOOLEAN AtIrqlPassiveLevel = FALSE; BOOLEAN IsTopLevelIrp = FALSE; PFFS_IRP_CONTEXT IrpContext = NULL; NTSTATUS Status = STATUS_UNSUCCESSFUL; __try { __try { #if DBG FFSDbgPrintCall(DeviceObject, Irp); #endif AtIrqlPassiveLevel = (KeGetCurrentIrql() == PASSIVE_LEVEL); if (AtIrqlPassiveLevel) { FsRtlEnterFileSystem(); } if (!IoGetTopLevelIrp()) { IsTopLevelIrp = TRUE; IoSetTopLevelIrp(Irp); } IrpContext = FFSAllocateIrpContext(DeviceObject, Irp); if (!IrpContext) { Status = STATUS_INSUFFICIENT_RESOURCES; Irp->IoStatus.Status = Status; FFSCompleteRequest(Irp, TRUE, IO_NO_INCREMENT); } else { if ((IrpContext->MajorFunction == IRP_MJ_CREATE) && !AtIrqlPassiveLevel) { FFSBreakPoint(); } Status = FFSDispatchRequest(IrpContext); } } __except (FFSExceptionFilter(IrpContext, GetExceptionInformation())) { Status = FFSExceptionHandler(IrpContext); } } __finally { if (IsTopLevelIrp) { IoSetTopLevelIrp(NULL); } if (AtIrqlPassiveLevel) { FsRtlExitFileSystem(); } } return Status; }