MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2IsVolumeDirty

Function Ext2IsVolumeDirty

Ext4Fsd/fsctl.c:615–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615NTSTATUS
616Ext2IsVolumeDirty (
617 IN PEXT2_IRP_CONTEXT IrpContext
618)
619{
620 NTSTATUS status = STATUS_SUCCESS;
621 PIRP Irp;
622 PEXTENDED_IO_STACK_LOCATION IrpSp;
623 PULONG VolumeState;
624
625 __try {
626
627 Irp = IrpContext->Irp;
628 IrpSp = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp);
629
630 //
631 // Get a pointer to the output buffer. Look at the system buffer field in th
632 // irp first. Then the Irp Mdl.
633 //
634
635 if (Irp->AssociatedIrp.SystemBuffer != NULL) {
636
637 VolumeState = Irp->AssociatedIrp.SystemBuffer;
638
639 } else if (Irp->MdlAddress != NULL) {
640
641 VolumeState = MmGetSystemAddressForMdl( Irp->MdlAddress );
642
643 } else {
644
645 status = STATUS_INVALID_USER_BUFFER;
646 __leave;
647 }
648
649 if (IrpSp->Parameters.FileSystemControl.OutputBufferLength < sizeof(ULONG)) {
650 status = STATUS_INVALID_PARAMETER;
651 __leave;
652 }
653
654 *VolumeState = 0;
655
656 } __finally {
657
658 if (!IrpContext->ExceptionInProgress) {
659 Ext2CompleteIrpContext(IrpContext, status);
660 }
661 }
662
663 return status;
664}
665
666
667NTSTATUS

Callers 1

Ext2UserFsRequestFunction · 0.85

Calls 1

Ext2CompleteIrpContextFunction · 0.85

Tested by

no test coverage detected