pSrcCcb = (AFSCcb *)pSrcFileObj->FsContext2;
pSrcObject = pSrcFcb->ObjectInformation;
+ pSrcParentObject = pSrcFcb->ObjectInformation->ParentObjectInformation;
//
// Perform some basic checks to ensure FS integrity
}
//
+ // Extract off the final component name from the Fcb
+ //
+
+ uniSourceName.Length = (USHORT)pSrcCcb->DirectoryCB->NameInformation.FileName.Length;
+ uniSourceName.MaximumLength = uniSourceName.Length;
+
+ uniSourceName.Buffer = pSrcCcb->DirectoryCB->NameInformation.FileName.Buffer;
+
+ //
// Resolve the target fileobject
//
pRenameInfo = (PFILE_RENAME_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
- pTargetParentObject = pSrcFcb->ObjectInformation->ParentObjectInformation;
+ pTargetParentObject = pSrcParentObject;
pTargetDcb = pTargetParentObject->Fcb;
}
//
+ // The quick check to see if they are not really performing a rename
+ // Do the names match? Only do this where the parent directories are
+ // the same
+ //
+
+ if( pTargetParentObject == pSrcParentObject)
+ {
+
+ if( FsRtlAreNamesEqual( &uniTargetName,
+ &uniSourceName,
+ FALSE,
+ NULL))
+ {
+ try_return( ntStatus = STATUS_SUCCESS);
+ }
+
+ bCommonParent = TRUE;
+ }
+ else
+ {
+
+ bCommonParent = FALSE;
+ }
+
+ //
// We do not allow cross-volume renames to occur
//
bReleaseTargetDirLock = TRUE;
- if( pTargetParentObject != pSrcFcb->ObjectInformation->ParentObjectInformation)
+ if( pTargetParentObject != pSrcParentObject)
{
AFSAcquireExcl( pSrcFcb->ObjectInformation->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
TRUE);
}
//
- // Extract off the final component name from the Fcb
- //
-
- uniSourceName.Length = (USHORT)pSrcCcb->DirectoryCB->NameInformation.FileName.Length;
- uniSourceName.MaximumLength = uniSourceName.Length;
-
- uniSourceName.Buffer = pSrcCcb->DirectoryCB->NameInformation.FileName.Buffer;
-
- //
- // The quick check to see if they are not really performing a rename
- // Do the names match? Only do this where the parent directories are
- // the same
- //
-
- if( pTargetParentObject == pSrcFcb->ObjectInformation->ParentObjectInformation)
- {
-
- bCommonParent = TRUE;
-
- if( FsRtlAreNamesEqual( &uniTargetName,
- &uniSourceName,
- FALSE,
- NULL))
- {
- try_return( ntStatus = STATUS_SUCCESS);
- }
- }
- else
- {
-
- bCommonParent = FALSE;
- }
-
- //
// We need to remove the DirEntry from the parent node, update the index
// and reinsert it into the parent tree. Note that for entries with the
// same parent we do not pull the node from the enumeration list