| 613 | } |
| 614 | |
| 615 | NTSTATUS |
| 616 | Ext2IsVolumeDirty ( |
| 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 | |
| 667 | NTSTATUS |
no test coverage detected