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

Function Ext2SetEa

Ext4Fsd/ea.c:435–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435NTSTATUS
436Ext2SetEa (
437 IN PEXT2_IRP_CONTEXT IrpContext
438)
439{
440 PIRP Irp = NULL;
441 PIO_STACK_LOCATION IrpSp;
442
443 PDEVICE_OBJECT DeviceObject;
444
445 PEXT2_VCB Vcb = NULL;
446 PEXT2_FCB Fcb = NULL;
447 PEXT2_CCB Ccb = NULL;
448 PEXT2_MCB Mcb = NULL;
449
450 BOOLEAN MainResourceAcquired = FALSE;
451 BOOLEAN FcbLockAcquired = FALSE;
452 BOOLEAN XattrRefAcquired = FALSE;
453
454 NTSTATUS Status = STATUS_UNSUCCESSFUL;
455
456 struct ext4_xattr_ref xattr_ref;
457 PCHAR UserBuffer;
458 ULONG UserBufferLength;
459
460 PFILE_FULL_EA_INFORMATION FullEa;
461
462 __try {
463
464 Ccb = IrpContext->Ccb;
465 ASSERT(Ccb != NULL);
466 ASSERT((Ccb->Identifier.Type == EXT2CCB) &&
467 (Ccb->Identifier.Size == sizeof(EXT2_CCB)));
468 DeviceObject = IrpContext->DeviceObject;
469 Vcb = (PEXT2_VCB)DeviceObject->DeviceExtension;
470 Fcb = IrpContext->Fcb;
471 Mcb = Fcb->Mcb;
472 Irp = IrpContext->Irp;
473 IrpSp = IoGetCurrentIrpStackLocation(Irp);
474
475 Irp->IoStatus.Information = 0;
476
477 //
478 // Receive input parameter from caller
479 //
480 UserBufferLength = IrpSp->Parameters.SetEa.Length;
481 UserBuffer = Irp->UserBuffer;
482
483 // Check if the EA buffer provided is valid
484 Status = IoCheckEaBufferValidity((PFILE_FULL_EA_INFORMATION)UserBuffer,
485 UserBufferLength,
486 (PULONG)&Irp->IoStatus.Information);
487 if (!NT_SUCCESS(Status))
488 __leave;
489
490 ExAcquireResourceExclusiveLite(&Vcb->FcbLock, TRUE);
491 FcbLockAcquired = TRUE;
492

Callers 1

Ext2DispatchRequestFunction · 0.85

Calls 9

Ext2WinntErrorFunction · 0.85
ext4_fs_get_xattr_refFunction · 0.85
ext4_xattr_purge_itemsFunction · 0.85
Ext2IsEaNameValidFunction · 0.85
ext4_fs_put_xattr_refFunction · 0.85
Ext2NotifyReportChangeFunction · 0.85
Ext2QueueRequestFunction · 0.85
Ext2CompleteIrpContextFunction · 0.85

Tested by

no test coverage detected