| 1567 | } |
| 1568 | |
| 1569 | NTSTATUS |
| 1570 | Ext2SetReparsePoint (IN PEXT2_IRP_CONTEXT IrpContext) |
| 1571 | { |
| 1572 | PIRP Irp = NULL; |
| 1573 | PIO_STACK_LOCATION IrpSp; |
| 1574 | |
| 1575 | PDEVICE_OBJECT DeviceObject; |
| 1576 | |
| 1577 | PEXT2_VCB Vcb = NULL; |
| 1578 | PEXT2_FCB Fcb = NULL; |
| 1579 | PEXT2_CCB Ccb = NULL; |
| 1580 | PEXT2_MCB Mcb = NULL; |
| 1581 | |
| 1582 | NTSTATUS Status = STATUS_UNSUCCESSFUL; |
| 1583 | |
| 1584 | PVOID InputBuffer; |
| 1585 | ULONG InputBufferLength; |
| 1586 | ULONG BytesWritten = 0; |
| 1587 | |
| 1588 | PEXT2_FCB ParentDcb = NULL; /* Dcb of it's current parent */ |
| 1589 | PEXT2_MCB ParentMcb = NULL; |
| 1590 | |
| 1591 | PREPARSE_DATA_BUFFER RDB; |
| 1592 | |
| 1593 | UNICODE_STRING UniName; |
| 1594 | OEM_STRING OemName; |
| 1595 | |
| 1596 | PCHAR OemNameBuffer = NULL; |
| 1597 | int OemNameLength = 0, i; |
| 1598 | |
| 1599 | BOOLEAN MainResourceAcquired = FALSE; |
| 1600 | BOOLEAN FcbLockAcquired = FALSE; |
| 1601 | |
| 1602 | __try { |
| 1603 | |
| 1604 | Ccb = IrpContext->Ccb; |
| 1605 | ASSERT(Ccb != NULL); |
| 1606 | ASSERT((Ccb->Identifier.Type == EXT2CCB) && |
| 1607 | (Ccb->Identifier.Size == sizeof(EXT2_CCB))); |
| 1608 | DeviceObject = IrpContext->DeviceObject; |
| 1609 | Vcb = (PEXT2_VCB) DeviceObject->DeviceExtension; |
| 1610 | Fcb = IrpContext->Fcb; |
| 1611 | Mcb = Fcb->Mcb; |
| 1612 | Irp = IrpContext->Irp; |
| 1613 | IrpSp = IoGetCurrentIrpStackLocation(Irp); |
| 1614 | |
| 1615 | ExAcquireResourceExclusiveLite(&Vcb->FcbLock, TRUE); |
| 1616 | FcbLockAcquired = TRUE; |
| 1617 | |
| 1618 | ParentMcb = Mcb->Parent; |
| 1619 | ParentDcb = ParentMcb->Fcb; |
| 1620 | if (ParentDcb == NULL) { |
| 1621 | ParentDcb = Ext2AllocateFcb(Vcb, ParentMcb); |
| 1622 | } |
| 1623 | if (ParentDcb) { |
| 1624 | Ext2ReferXcb(&ParentDcb->ReferenceCount); |
| 1625 | } |
| 1626 |
no test coverage detected