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

Function Ext2OverwriteEa

Ext4Fsd/create.c:690–833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688//
689
690NTSTATUS
691Ext2OverwriteEa(
692 PEXT2_IRP_CONTEXT IrpContext,
693 PEXT2_VCB Vcb,
694 PEXT2_FCB Fcb,
695 PIO_STATUS_BLOCK Iosb
696)
697{
698 PEXT2_MCB Mcb = NULL;
699 PIRP Irp;
700 PIO_STACK_LOCATION IrpSp;
701
702 struct ext4_xattr_ref xattr_ref;
703 BOOLEAN XattrRefAcquired = FALSE;
704 NTSTATUS Status = STATUS_UNSUCCESSFUL;
705
706 PFILE_FULL_EA_INFORMATION FullEa;
707 PCHAR EaBuffer;
708 ULONG EaBufferLength;
709
710 __try {
711
712 Irp = IrpContext->Irp;
713 IrpSp = IoGetCurrentIrpStackLocation(Irp);
714 Mcb = Fcb->Mcb;
715
716 EaBuffer = Irp->AssociatedIrp.SystemBuffer;
717 EaBufferLength = IrpSp->Parameters.Create.EaLength;
718
719 if (!Mcb)
720 __leave;
721
722 //
723 // Return peacefully if there is no EaBuffer provided.
724 //
725 if (!EaBuffer) {
726 Status = STATUS_SUCCESS;
727 __leave;
728 }
729
730 //
731 // If the caller specifies an EaBuffer, but has no knowledge about Ea,
732 // we reject the request.
733 //
734 if (EaBuffer != NULL &&
735 FlagOn(IrpSp->Parameters.Create.Options, FILE_NO_EA_KNOWLEDGE)) {
736 Status = STATUS_ACCESS_DENIED;
737 __leave;
738 }
739
740 //
741 // Check Ea Buffer validity.
742 //
743 Status = IoCheckEaBufferValidity((PFILE_FULL_EA_INFORMATION)EaBuffer,
744 EaBufferLength, (PULONG)&Iosb->Information);
745 if (!NT_SUCCESS(Status))
746 __leave;
747

Callers 2

Ext2CreateFileFunction · 0.85

Calls 6

Ext2WinntErrorFunction · 0.85
ext4_fs_get_xattr_refFunction · 0.85
ext4_xattr_purge_itemsFunction · 0.85
Ext2IsEaNameValidFunction · 0.85
ext4_fs_set_xattrFunction · 0.85
ext4_fs_put_xattr_refFunction · 0.85

Tested by

no test coverage detected