FIXME: We can only handle one reparse point right now. */
| 1779 | |
| 1780 | /* FIXME: We can only handle one reparse point right now. */ |
| 1781 | NTSTATUS |
| 1782 | Ext2DeleteReparsePoint (IN PEXT2_IRP_CONTEXT IrpContext) |
| 1783 | { |
| 1784 | PIRP Irp = NULL; |
| 1785 | |
| 1786 | PDEVICE_OBJECT DeviceObject; |
| 1787 | |
| 1788 | PEXT2_VCB Vcb = NULL; |
| 1789 | PEXT2_FCB Fcb = NULL; |
| 1790 | PEXT2_CCB Ccb = NULL; |
| 1791 | PEXT2_MCB Mcb = NULL; |
| 1792 | |
| 1793 | PEXT2_FCB ParentDcb = NULL; /* Dcb of it's current parent */ |
| 1794 | PEXT2_MCB ParentMcb = NULL; |
| 1795 | |
| 1796 | NTSTATUS Status = STATUS_UNSUCCESSFUL; |
| 1797 | |
| 1798 | BOOLEAN FcbLockAcquired = FALSE; |
| 1799 | BOOLEAN MainResourceAcquired = FALSE; |
| 1800 | |
| 1801 | |
| 1802 | __try { |
| 1803 | |
| 1804 | Ccb = IrpContext->Ccb; |
| 1805 | ASSERT(Ccb != NULL); |
| 1806 | ASSERT((Ccb->Identifier.Type == EXT2CCB) && |
| 1807 | (Ccb->Identifier.Size == sizeof(EXT2_CCB))); |
| 1808 | DeviceObject = IrpContext->DeviceObject; |
| 1809 | Vcb = (PEXT2_VCB) DeviceObject->DeviceExtension; |
| 1810 | Mcb = IrpContext->Fcb->Mcb; |
| 1811 | Irp = IrpContext->Irp; |
| 1812 | |
| 1813 | ExAcquireResourceExclusiveLite(&Vcb->FcbLock, TRUE); |
| 1814 | FcbLockAcquired = TRUE; |
| 1815 | |
| 1816 | ParentMcb = Mcb->Parent; |
| 1817 | ParentDcb = ParentMcb->Fcb; |
| 1818 | if (ParentDcb == NULL) { |
| 1819 | ParentDcb = Ext2AllocateFcb(Vcb, ParentMcb); |
| 1820 | } |
| 1821 | if (ParentDcb) { |
| 1822 | Ext2ReferXcb(&ParentDcb->ReferenceCount); |
| 1823 | } |
| 1824 | |
| 1825 | if (!Mcb || !IsInodeSymLink(&Mcb->Inode) || |
| 1826 | !IsFlagOn(Ccb->Flags, CCB_OPEN_REPARSE_POINT)) { |
| 1827 | Status = STATUS_NOT_A_REPARSE_POINT; |
| 1828 | __leave; |
| 1829 | } |
| 1830 | |
| 1831 | Fcb = Ext2AllocateFcb (Vcb, Mcb); |
| 1832 | if (Fcb) { |
| 1833 | Ext2ReferXcb(&Fcb->ReferenceCount); |
| 1834 | } else { |
| 1835 | Status = STATUS_INSUFFICIENT_RESOURCES; |
| 1836 | __leave; |
| 1837 | } |
| 1838 |
no test coverage detected