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

Function Ext2SetFileInformation

Ext4Fsd/fileinfo.c:499–1060  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497
498
499NTSTATUS
500Ext2SetFileInformation (IN PEXT2_IRP_CONTEXT IrpContext)
501{
502 PDEVICE_OBJECT DeviceObject;
503 NTSTATUS Status = STATUS_UNSUCCESSFUL;
504 PEXT2_VCB Vcb = NULL;
505 PFILE_OBJECT FileObject = NULL;
506 PEXT2_FCB Fcb = NULL;
507 PEXT2_CCB Ccb = NULL;
508 PEXT2_MCB Mcb = NULL;
509 PIRP Irp = NULL;
510 PIO_STACK_LOCATION IoStackLocation = NULL;
511 FILE_INFORMATION_CLASS FileInformationClass;
512
513 ULONG NotifyFilter = 0;
514
515 ULONG Length;
516 PVOID Buffer;
517
518 BOOLEAN FcbMainResourceAcquired = FALSE;
519 BOOLEAN FcbPagingIoResourceAcquired = FALSE;
520
521 __try {
522
523 ASSERT(IrpContext != NULL);
524
525 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
526 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
527 DeviceObject = IrpContext->DeviceObject;
528
529 //
530 // This request is not allowed on the main device object
531 //
532 if (IsExt2FsDevice(DeviceObject)) {
533 Status = STATUS_INVALID_DEVICE_REQUEST;
534 __leave;
535 }
536
537 /* check io stack location of irp stack */
538 Irp = IrpContext->Irp;
539 IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
540 FileInformationClass =
541 IoStackLocation->Parameters.SetFile.FileInformationClass;
542 Length = IoStackLocation->Parameters.SetFile.Length;
543 Buffer = Irp->AssociatedIrp.SystemBuffer;
544
545 /* check Vcb */
546 Vcb = (PEXT2_VCB) DeviceObject->DeviceExtension;
547 ASSERT(Vcb != NULL);
548 ASSERT((Vcb->Identifier.Type == EXT2VCB) &&
549 (Vcb->Identifier.Size == sizeof(EXT2_VCB)));
550 if (!IsMounted(Vcb)) {
551 Status = STATUS_INVALID_DEVICE_REQUEST;
552 __leave;
553 }
554
555 if (FlagOn(Vcb->Flags, VCB_VOLUME_LOCKED)) {
556 Status = STATUS_ACCESS_DENIED;

Callers 1

Ext2DispatchRequestFunction · 0.85

Calls 14

Ext2CheckFileAccessFunction · 0.85
Ext2IsFastIoPossibleFunction · 0.85
Ext2LinuxTimeFunction · 0.85
Ext2NtTimeFunction · 0.85
Ext2SaveInodeFunction · 0.85
Ext2ExpandFileFunction · 0.85
Ext2TruncateFileFunction · 0.85
Ext2SaveSuperFunction · 0.85
Ext2SetDispositionInfoFunction · 0.85
Ext2SetRenameInfoFunction · 0.85
Ext2SetLinkInfoFunction · 0.85
Ext2NotifyReportChangeFunction · 0.85

Tested by

no test coverage detected