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

Function Ext2SetLinkInfo

Ext4Fsd/fileinfo.c:1650–1889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1648}
1649
1650NTSTATUS
1651Ext2SetLinkInfo(
1652 PEXT2_IRP_CONTEXT IrpContext,
1653 PEXT2_VCB Vcb,
1654 PEXT2_FCB Fcb,
1655 PEXT2_CCB Ccb
1656)
1657{
1658 PEXT2_MCB Mcb = Fcb->Mcb;
1659
1660 PEXT2_FCB TargetDcb = NULL; /* Dcb of target directory */
1661 PEXT2_MCB TargetMcb = NULL;
1662 PEXT2_FCB ParentDcb = NULL; /* Dcb of it's current parent */
1663 PEXT2_MCB ParentMcb = NULL;
1664
1665 PEXT2_FCB ExistingFcb = NULL; /* Target file Fcb if it exists*/
1666 PEXT2_MCB ExistingMcb = NULL;
1667 PEXT2_MCB LinkMcb = NULL; /* Mcb for new hardlink */
1668
1669 UNICODE_STRING FileName;
1670
1671 NTSTATUS Status;
1672
1673 PIRP Irp;
1674 PIO_STACK_LOCATION IrpSp;
1675
1676 PFILE_OBJECT FileObject;
1677 PFILE_OBJECT TargetObject;
1678
1679 BOOLEAN ReplaceIfExists;
1680 BOOLEAN bTargetRemoved = FALSE;
1681
1682 BOOLEAN bFcbLockAcquired = FALSE;
1683
1684 PFILE_LINK_INFORMATION FLI;
1685
1686 if (Ccb->SymLink) {
1687 Mcb = Ccb->SymLink;
1688 }
1689
1690 if (IsMcbDirectory(Mcb)) {
1691 Status = STATUS_INVALID_PARAMETER;
1692 goto errorout;
1693 }
1694
1695 Irp = IrpContext->Irp;
1696 IrpSp = IoGetCurrentIrpStackLocation(Irp);
1697
1698 FileObject = IrpSp->FileObject;
1699 TargetObject = IrpSp->Parameters.SetFile.FileObject;
1700 ReplaceIfExists = IrpSp->Parameters.SetFile.ReplaceIfExists;
1701
1702 FLI = (PFILE_LINK_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
1703
1704 if (TargetObject == NULL) {
1705
1706 UNICODE_STRING NewName;
1707

Callers 1

Ext2SetFileInformationFunction · 0.85

Calls 7

Ext2AllocateFcbFunction · 0.85
Ext2LookupFileFunction · 0.85
Ext2IsFileRemovableFunction · 0.85
Ext2DeleteFileFunction · 0.85
Ext2AddEntryFunction · 0.85
Ext2NotifyReportChangeFunction · 0.85
Ext2ReleaseFcbFunction · 0.85

Tested by

no test coverage detected