AFSLocateCaseInsensitiveDirEntry( pTargetParentObject->Specific.Directory.DirectoryNodeHdr.CaseInsensitiveTreeHead,
ulTargetCRC,
&pTargetDirEntry);
- }
- if ( !BooleanFlagOn( pDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DISABLE_SHORTNAMES) &&
- pTargetDirEntry == NULL && RtlIsNameLegalDOS8Dot3( &uniTargetName,
- NULL,
- NULL))
- {
- //
- // Try the short name
- //
- AFSLocateShortNameDirEntry( pTargetParentObject->Specific.Directory.ShortNameTree,
- ulTargetCRC,
- &pTargetDirEntry);
+ if ( pTargetDirEntry == NULL)
+ {
+
+ if ( !BooleanFlagOn( pDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DISABLE_SHORTNAMES) &&
+ RtlIsNameLegalDOS8Dot3( &uniTargetName,
+ NULL,
+ NULL))
+ {
+ //
+ // Try the short name
+ //
+ AFSLocateShortNameDirEntry( pTargetParentObject->Specific.Directory.ShortNameTree,
+ ulTargetCRC,
+ &pTargetDirEntry);
+ }
+ }
+ else
+ {
+ //
+ // Here we have a match on the case insensitive lookup for the name. If there
+ // Is more than one link entry for this node then fail the lookup request
+ //
+
+ if( !BooleanFlagOn( pTargetDirEntry->Flags, AFS_DIR_ENTRY_CASE_INSENSTIVE_LIST_HEAD) ||
+ pTargetDirEntry->CaseInsensitiveList.fLink != NULL)
+ {
+
+ pTargetDirEntry = NULL;
+
+ try_return(ntStatus = STATUS_OBJECT_NAME_COLLISION);
+ }
+ }
}
//
AFSLocateCaseInsensitiveDirEntry( pTargetParentObject->Specific.Directory.DirectoryNodeHdr.CaseInsensitiveTreeHead,
ulTargetCRC,
&pTargetDirEntry);
- }
- if ( !BooleanFlagOn( pDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DISABLE_SHORTNAMES) &&
- pTargetDirEntry == NULL && RtlIsNameLegalDOS8Dot3( &uniTargetName,
- NULL,
- NULL))
- {
- //
- // Try the short name
- //
- AFSLocateShortNameDirEntry( pTargetParentObject->Specific.Directory.ShortNameTree,
- ulTargetCRC,
- &pTargetDirEntry);
+ if ( pTargetDirEntry == NULL)
+ {
+
+ if ( !BooleanFlagOn( pDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DISABLE_SHORTNAMES) &&
+ RtlIsNameLegalDOS8Dot3( &uniTargetName,
+ NULL,
+ NULL))
+ {
+ //
+ // Try the short name
+ //
+ AFSLocateShortNameDirEntry( pTargetParentObject->Specific.Directory.ShortNameTree,
+ ulTargetCRC,
+ &pTargetDirEntry);
+ }
+ }
+ else
+ {
+ //
+ // Here we have a match on the case insensitive lookup for the name. If there
+ // Is more than one link entry for this node then fail the lookup request
+ //
+
+ if( !BooleanFlagOn( pTargetDirEntry->Flags, AFS_DIR_ENTRY_CASE_INSENSTIVE_LIST_HEAD) ||
+ pTargetDirEntry->CaseInsensitiveList.fLink != NULL)
+ {
+
+ pTargetDirEntry = NULL;
+
+ try_return(ntStatus = STATUS_OBJECT_NAME_COLLISION);
+ }
+ }
}
//
&pDirEntry);
}
}
+ else
+ {
+
+ //
+ // Here we have a match on the case insensitive lookup for the name. If there
+ // Is more than one link entry for this node then fail the lookup request
+ //
+
+ if( !BooleanFlagOn( pDirEntry->Flags, AFS_DIR_ENTRY_CASE_INSENSTIVE_LIST_HEAD) ||
+ pDirEntry->CaseInsensitiveList.fLink != NULL)
+ {
+
+ AFSReleaseResource( ParentDirectoryCB->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
+
+ try_return(ntStatus = STATUS_OBJECT_NAME_COLLISION);
+ }
+ }
}
if( pDirEntry != NULL)
//
// Here we have a match on the case insensitive lookup for the name. If there
- // Is more than one link entry for this node then fail the lookup request
- //
+ // Is more than one link entry for this node then fail the lookup request
+ //
- pCurrentObject = pDirEntry->ObjectInformation;
+ if( !BooleanFlagOn( pDirEntry->Flags, AFS_DIR_ENTRY_CASE_INSENSTIVE_LIST_HEAD) ||
+ pDirEntry->CaseInsensitiveList.fLink != NULL)
+ {
- if( !BooleanFlagOn( pDirEntry->Flags, AFS_DIR_ENTRY_CASE_INSENSTIVE_LIST_HEAD) ||
- pDirEntry->CaseInsensitiveList.fLink != NULL)
- {
+ AFSReleaseResource( pParentDirEntry->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
- //
- // Increment our dir entry ref count since we will decrement it on exit
- //
+ pDirEntry = NULL;
- lCount = InterlockedIncrement( &pDirEntry->DirOpenReferenceCount);
+ try_return(ntStatus = STATUS_OBJECT_NAME_COLLISION);
+ }
- AFSDbgTrace(( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSLocateNameEntry Increment5 count on %wZ DE %p Ccb %p Cnt %d\n",
- &pDirEntry->NameInformation.FileName,
- pDirEntry,
- NULL,
- lCount));
-
- AFSReleaseResource( pParentDirEntry->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
-
- try_return(ntStatus = STATUS_OBJECT_NAME_COLLISION);
- }
- }
- }
+ pCurrentObject = pDirEntry->ObjectInformation;
+ }
+ }
if( pDirEntry != NULL)
{
}
}
}
+ else
+ {
+
+ //
+ // Here we have a match on the case insensitive lookup for the name. If there
+ // Is more than one link entry for this node then fail the lookup request
+ //
+
+ if( !BooleanFlagOn( pDirEntry->Flags, AFS_DIR_ENTRY_CASE_INSENSTIVE_LIST_HEAD) ||
+ pDirEntry->CaseInsensitiveList.fLink != NULL)
+ {
+
+ AFSReleaseResource( AFSGlobalRoot->ObjectInformation.Specific.Directory.DirectoryNodeHdr.TreeLock);
+
+ bReleaseTreeLock = FALSE;
+
+ pDirEntry = NULL;
+
+ try_return(ntStatus = STATUS_OBJECT_NAME_COLLISION);
+ }
+ }
}
if( bReleaseTreeLock)
{
- AFSReleaseResource( AFSGlobalRoot->ObjectInformation.Specific.Directory.DirectoryNodeHdr.TreeLock);
- }
+ AFSReleaseResource( AFSGlobalRoot->ObjectInformation.Specific.Directory.DirectoryNodeHdr.TreeLock);
+
+ bReleaseTreeLock = FALSE;
+ }
//
// Be sure we are starting from the correct volume
try_return( ntStatus);
}
+
+ //
+ // Here we have a match on the case insensitive lookup for the name. If there
+ // Is more than one link entry for this node then fail the lookup request
+ //
+
+ if( !BooleanFlagOn( pShareDirEntry->Flags, AFS_DIR_ENTRY_CASE_INSENSTIVE_LIST_HEAD) ||
+ pShareDirEntry->CaseInsensitiveList.fLink != NULL)
+ {
+
+ AFSReleaseResource( AFSGlobalRoot->ObjectInformation.Specific.Directory.DirectoryNodeHdr.TreeLock);
+
+ pShareDirEntry = NULL;
+
+ try_return(ntStatus = STATUS_OBJECT_NAME_COLLISION);
+ }
}
lCount = InterlockedIncrement( &pShareDirEntry->DirOpenReferenceCount);