try_return( ntStatus);
}
+ else if( pFcb->Header.NodeTypeCode == AFS_INVALID_FCB)
+ {
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSQueryFileInfo request against Invalid Fcb\n");
+
+ try_return( ntStatus = STATUS_ACCESS_DENIED);
+ }
+
//
// Process the request
//
break;
}
+ case FileNormalizedNameInformation:
case FileNameInformation:
{
}
}
}
- __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+ __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
{
AFSDbgLogMsg( 0,
0,
"EXCEPTION - AFSQueryFileInfo\n");
+ AFSDumpTraceFilesFnc();
+
ntStatus = STATUS_UNSUCCESSFUL;
if( bReleaseMain)
"AFSSetFileInfo Request failed due to read only volume\n",
Irp);
+ try_return( ntStatus = STATUS_MEDIA_WRITE_PROTECTED);
+ }
+
+ if( pFcb->Header.NodeTypeCode == AFS_INVALID_FCB &&
+ FileInformationClass != FileDispositionInformation)
+ {
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSSetFileInfo request against Invalid Fcb\n");
+
try_return( ntStatus = STATUS_ACCESS_DENIED);
}
}
}
}
- __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+ __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
{
AFSDbgLogMsg( 0,
0,
"EXCEPTION - AFSSetFileInfo\n");
+ AFSDumpTraceFilesFnc();
+
ntStatus = STATUS_UNSUCCESSFUL;
+
+ if( bReleaseMain)
+ {
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
+ }
}
AFSCompleteRequest( Irp,
if( NT_SUCCESS( AFSRetrieveFileAttributes( pParentDirectoryCB,
DirectoryCB,
&uniParentPath,
- NULL,
+ pCcb->NameArray,
&pCcb->AuthGroup,
&stFileInfo)))
{
- ulFileAttribs = stFileInfo.FileAttributes;
- ulFileAttribs |= FILE_ATTRIBUTE_REPARSE_POINT;
+ if ( ulFileAttribs == FILE_ATTRIBUTE_NORMAL)
+ {
+
+ ulFileAttribs = FILE_ATTRIBUTE_REPARSE_POINT;
+ }
+ else
+ {
+
+ ulFileAttribs |= FILE_ATTRIBUTE_REPARSE_POINT;
+ }
+
+ if ( stFileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ {
+
+ ulFileAttribs |= FILE_ATTRIBUTE_DIRECTORY;
+ }
}
AFSAcquireShared( &pFcb->NPFcb->Resource,
if( NT_SUCCESS( AFSRetrieveFileAttributes( pParentDirectoryCB,
DirectoryCB,
&uniParentPath,
- NULL,
+ pCcb->NameArray,
&pCcb->AuthGroup,
&stFileInfo)))
{
- ulFileAttribs = stFileInfo.FileAttributes;
+
+ if ( ulFileAttribs == FILE_ATTRIBUTE_NORMAL)
+ {
+
+ ulFileAttribs = FILE_ATTRIBUTE_REPARSE_POINT;
+ }
+ else
+ {
+
+ ulFileAttribs |= FILE_ATTRIBUTE_REPARSE_POINT;
+ }
+
+ if ( stFileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ {
+
+ ulFileAttribs |= FILE_ATTRIBUTE_DIRECTORY;
+ }
}
AFSAcquireShared( &pFcb->NPFcb->Resource,
if( NT_SUCCESS( AFSRetrieveFileAttributes( pParentDirectoryCB,
DirectoryCB,
&uniParentPath,
- NULL,
+ pCcb->NameArray,
&pCcb->AuthGroup,
&stFileInfo)))
{
- ulFileAttribs = stFileInfo.FileAttributes;
- ulFileAttribs |= FILE_ATTRIBUTE_REPARSE_POINT;
+ if ( ulFileAttribs == FILE_ATTRIBUTE_NORMAL)
+ {
+
+ ulFileAttribs = FILE_ATTRIBUTE_REPARSE_POINT;
+ }
+ else
+ {
+
+ ulFileAttribs |= FILE_ATTRIBUTE_REPARSE_POINT;
+ }
+
+ if ( stFileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ {
+
+ ulFileAttribs |= FILE_ATTRIBUTE_DIRECTORY;
+ }
}
AFSAcquireShared( &pFcb->NPFcb->Resource,
if( NT_SUCCESS( AFSRetrieveFileAttributes( pParentDirectoryCB,
DirectoryCB,
&uniParentPath,
- NULL,
+ pCcb->NameArray,
&pCcb->AuthGroup,
&stFileInfo)))
{
- ulFileAttribs = stFileInfo.FileAttributes;
- ulFileAttribs |= FILE_ATTRIBUTE_REPARSE_POINT;
+ if ( ulFileAttribs == FILE_ATTRIBUTE_NORMAL)
+ {
+
+ ulFileAttribs = FILE_ATTRIBUTE_REPARSE_POINT;
+ }
+ else
+ {
+
+ ulFileAttribs |= FILE_ATTRIBUTE_REPARSE_POINT;
+ }
+
+ if ( stFileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ {
+
+ ulFileAttribs |= FILE_ATTRIBUTE_DIRECTORY;
+ }
}
AFSAcquireShared( &pFcb->NPFcb->Resource,
if( BooleanFlagOn( DirectoryCB->ObjectInformation->FileAttributes, FILE_ATTRIBUTE_REPARSE_POINT))
{
- Buffer->ReparseTag = IO_REPARSE_TAG_OPENAFS_DFS;
+ Buffer->ReparseTag = IO_REPARSE_TAG_SURROGATE|IO_REPARSE_TAG_OPENAFS_DFS;
}
*Length -= sizeof( FILE_ATTRIBUTE_TAG_INFORMATION);
try_return( ntStatus = STATUS_DIRECTORY_NOT_EMPTY);
}
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSSetDispositionInfo Setting PENDING_DELETE on DirEntry %p Name %wZ\n",
+ DirectoryCB,
+ &DirectoryCB->NameInformation.FileName);
+
+ SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_PENDING_DELETE);
}
- else
+ else if( pFcb->Header.NodeTypeCode == AFS_FILE_FCB)
{
//
}
//
+ // Set PENDING_DELETE before CcPurgeCacheSection to avoid a
+ // deadlock with Trend Micro's Enterprise anti-virus product
+ // which attempts to open the file which is being deleted.
+ //
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSSetDispositionInfo Setting PENDING_DELETE on DirEntry %p Name %wZ\n",
+ DirectoryCB,
+ &DirectoryCB->NameInformation.FileName);
+
+ SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_PENDING_DELETE);
+
+ //
// Purge the cache as well
//
if( pFcb->NPFcb->SectionObjectPointers.DataSectionObject != NULL)
{
- CcPurgeCacheSection( &pFcb->NPFcb->SectionObjectPointers,
- NULL,
- 0,
- TRUE);
+ if ( !CcPurgeCacheSection( &pFcb->NPFcb->SectionObjectPointers,
+ NULL,
+ 0,
+ TRUE))
+ {
+
+ SetFlag( pFcb->Flags, AFS_FCB_FLAG_PURGE_ON_CLOSE);
+ }
}
}
-
- AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSSetDispositionInfo Setting PENDING_DELETE on DirEntry %p Name %wZ\n",
- DirectoryCB,
- &DirectoryCB->NameInformation.FileName);
-
- SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_PENDING_DELETE);
}
else
{
{
NTSTATUS ntStatus = STATUS_SUCCESS;
+ AFSDeviceExt *pDeviceExt = (AFSDeviceExt *)AFSRDRDeviceObject->DeviceExtension;
PIO_STACK_LOCATION pIrpSp = IoGetCurrentIrpStackLocation( Irp);
IO_STATUS_BLOCK stIoSb = {0,0};
AFSFcb *pSrcFcb = NULL, *pTargetDcb = NULL, *pTargetFcb = NULL;
AFSCcb *pSrcCcb = NULL, *pTargetDirCcb = NULL;
PFILE_OBJECT pSrcFileObj = pIrpSp->FileObject;
PFILE_OBJECT pTargetFileObj = pIrpSp->Parameters.SetFile.FileObject;
+ PFILE_OBJECT pTargetParentFileObj = NULL;
PFILE_RENAME_INFORMATION pRenameInfo = NULL;
- UNICODE_STRING uniTargetName, uniSourceName;
+ UNICODE_STRING uniTargetName, uniSourceName, uniTargetParentName;
BOOLEAN bReplaceIfExists = FALSE;
UNICODE_STRING uniShortName;
AFSDirectoryCB *pTargetDirEntry = NULL;
AFSObjectInfoCB *pSrcParentObject = NULL, *pTargetParentObject = NULL;
AFSFileID stNewFid, stTmpTargetFid;
ULONG ulNotificationAction = 0, ulNotifyFilter = 0;
- UNICODE_STRING uniFullTargetPath;
+ UNICODE_STRING uniFullTargetName;
BOOLEAN bCommonParent = FALSE;
- BOOLEAN bReleaseVolumeLock = FALSE;
BOOLEAN bReleaseTargetDirLock = FALSE;
BOOLEAN bReleaseSourceDirLock = FALSE;
+ BOOLEAN bDereferenceTargetParentObject = FALSE;
PERESOURCE pSourceDirLock = NULL;
+ LONG lCount;
__Enter
{
pSrcCcb = (AFSCcb *)pSrcFileObj->FsContext2;
pSrcObject = pSrcFcb->ObjectInformation;
+ pSrcParentObject = pSrcFcb->ObjectInformation->ParentObjectInformation;
//
// Perform some basic checks to ensure FS integrity
try_return( ntStatus = STATUS_ACCESS_DENIED);
}
}
- else
- {
- if( pSrcFcb->OpenHandleCount > 1)
- {
+ //
+ // Extract off the final component name from the Fcb
+ //
- AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
- AFS_TRACE_LEVEL_ERROR,
- "AFSSetRenameInfo Attempt to rename directory with open references %wZ\n",
- &pSrcCcb->DirectoryCB->NameInformation.FileName);
+ uniSourceName.Length = (USHORT)pSrcCcb->DirectoryCB->NameInformation.FileName.Length;
+ uniSourceName.MaximumLength = uniSourceName.Length;
- try_return( ntStatus = STATUS_ACCESS_DENIED);
- }
- }
+ uniSourceName.Buffer = pSrcCcb->DirectoryCB->NameInformation.FileName.Buffer;
//
// Resolve the target fileobject
if( pTargetFileObj == NULL)
{
- //
- // This is a simple rename. Here the target directory is the same as the source parent directory
- // and the name is retrieved from the system buffer information
- //
-
pRenameInfo = (PFILE_RENAME_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
- pTargetParentObject = pSrcFcb->ObjectInformation->ParentObjectInformation;
+ if ( pRenameInfo->RootDirectory)
+ {
- pTargetDcb = pTargetParentObject->Fcb;
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_ERROR,
+ "AFSSetRenameInfo Handle provided but no FileObject ntStatus INVALID_PARAMETER\n");
+
+ try_return( ntStatus = STATUS_INVALID_PARAMETER);
+ }
+ else
+ {
+
+ uniFullTargetName.Length = (USHORT)pRenameInfo->FileNameLength;
+
+ uniFullTargetName.Buffer = (PWSTR)&pRenameInfo->FileName;
+
+ AFSRetrieveFinalComponent( &uniFullTargetName,
+ &uniTargetName);
+
+ AFSRetrieveParentPath( &uniFullTargetName,
+ &uniTargetParentName);
+
+ if ( uniTargetParentName.Length == 0)
+ {
+
+ //
+ // This is a simple rename. Here the target directory is the same as the source parent directory
+ // and the name is retrieved from the system buffer information
+ //
+
+ pTargetParentObject = pSrcParentObject;
+ }
+ else
+ {
+ //
+ // uniTargetParentName contains the directory the renamed object
+ // will be moved to. Must obtain the TargetParentObject.
+ //
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_ERROR,
+ "AFSSetRenameInfo Attempt to move %wZ to %wZ -- not yet supported (NOT_SAME_DEVICE)\n",
+ &pSrcCcb->DirectoryCB->NameInformation.FileName,
+ &uniFullTargetName);
+
+ try_return( ntStatus = STATUS_NOT_SAME_DEVICE);
+ }
+ }
- uniTargetName.Length = (USHORT)pRenameInfo->FileNameLength;
- uniTargetName.Buffer = (PWSTR)&pRenameInfo->FileName;
+ pTargetDcb = pTargetParentObject->Fcb;
}
else
{
}
//
+ // 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
//
try_return( ntStatus = STATUS_NOT_SAME_DEVICE);
}
- AFSAcquireExcl( pTargetParentObject->VolumeCB->VolumeLock,
- TRUE);
-
- bReleaseVolumeLock = TRUE;
-
ulTargetCRC = AFSGenerateCRC( &uniTargetName,
FALSE);
bReleaseTargetDirLock = TRUE;
- if( pTargetParentObject != pSrcFcb->ObjectInformation->ParentObjectInformation)
+ if( pTargetParentObject != pSrcParentObject)
{
- AFSAcquireExcl( pSrcFcb->ObjectInformation->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
+ AFSAcquireExcl( pSrcParentObject->Specific.Directory.DirectoryNodeHdr.TreeLock,
TRUE);
bReleaseSourceDirLock = TRUE;
- pSourceDirLock = pSrcFcb->ObjectInformation->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock;
+ pSourceDirLock = pSrcParentObject->Specific.Directory.DirectoryNodeHdr.TreeLock;
}
AFSLocateCaseSensitiveDirEntry( pTargetParentObject->Specific.Directory.DirectoryNodeHdr.CaseSensitiveTreeHead,
&pTargetDirEntry);
}
- if( pTargetDirEntry == NULL && RtlIsNameLegalDOS8Dot3( &uniTargetName,
+ if ( !BooleanFlagOn( pDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DISABLE_SHORTNAMES) &&
+ pTargetDirEntry == NULL && RtlIsNameLegalDOS8Dot3( &uniTargetName,
NULL,
NULL))
{
ASSERT( pTargetParentObject == pTargetDirEntry->ObjectInformation->ParentObjectInformation);
- InterlockedIncrement( &pTargetDirEntry->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pTargetDirEntry->OpenReferenceCount);
if( !bReplaceIfExists)
{
}
//
- // 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
&stNewFid))
{
+ AFSAcquireExcl( pSrcObject->VolumeCB->ObjectInfoTree.TreeLock,
+ TRUE);
+
//
// Remove the old information entry
//
else
{
- AFSInsertHashEntry( pSrcObject->VolumeCB->ObjectInfoTree.TreeHead,
- &pSrcObject->TreeEntry);
+ if ( !NT_SUCCESS( AFSInsertHashEntry( pSrcObject->VolumeCB->ObjectInfoTree.TreeHead,
+ &pSrcObject->TreeEntry)))
+ {
+
+ //
+ // Lost a race, an ObjectInfo object already exists for this FID.
+ // Let this copy be garbage collected.
+ //
+
+ ClearFlag( pSrcObject->Flags, AFS_OBJECT_INSERTED_HASH_TREE);
+ }
}
+
+ AFSReleaseResource( pSrcObject->VolumeCB->ObjectInfoTree.TreeLock);
}
//
pSrcCcb->DirectoryCB->CaseInsensitiveTreeEntry.HashIndex = AFSGenerateCRC( &pSrcCcb->DirectoryCB->NameInformation.FileName,
TRUE);
- if( pSrcCcb->DirectoryCB->NameInformation.ShortNameLength > 0 &&
+ if( !BooleanFlagOn( pDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DISABLE_SHORTNAMES) &&
+ pSrcCcb->DirectoryCB->NameInformation.ShortNameLength > 0 &&
!RtlIsNameLegalDOS8Dot3( &pSrcCcb->DirectoryCB->NameInformation.FileName,
NULL,
NULL))
if( pSrcCcb->DirectoryCB->ObjectInformation->ParentObjectInformation != pTargetParentObject)
{
- InterlockedDecrement( &pSrcCcb->DirectoryCB->ObjectInformation->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
+ lCount = InterlockedDecrement( &pSrcCcb->DirectoryCB->ObjectInformation->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
- InterlockedDecrement( &pSrcCcb->DirectoryCB->ObjectInformation->ParentObjectInformation->Specific.Directory.ChildOpenReferenceCount);
+ lCount = InterlockedDecrement( &pSrcCcb->DirectoryCB->ObjectInformation->ParentObjectInformation->Specific.Directory.ChildOpenReferenceCount);
- InterlockedIncrement( &pTargetParentObject->Specific.Directory.ChildOpenHandleCount);
+ lCount = InterlockedIncrement( &pTargetParentObject->Specific.Directory.ChildOpenHandleCount);
- InterlockedIncrement( &pTargetParentObject->Specific.Directory.ChildOpenReferenceCount);
+ lCount = InterlockedIncrement( &pTargetParentObject->Specific.Directory.ChildOpenReferenceCount);
pSrcCcb->DirectoryCB->ObjectInformation->ParentObjectInformation = pTargetParentObject;
ASSERT( pTargetDirEntry->OpenReferenceCount > 0);
- InterlockedDecrement( &pTargetDirEntry->OpenReferenceCount); // The count we added above
+ lCount = InterlockedDecrement( &pTargetDirEntry->OpenReferenceCount); // The count we added above
- if( pTargetDirEntry->OpenReferenceCount == 0)
+ if( lCount == 0)
{
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
if( pTargetDirEntry != NULL)
{
- InterlockedDecrement( &pTargetDirEntry->OpenReferenceCount);
- }
-
- if( bReleaseVolumeLock)
- {
- AFSReleaseResource( pTargetParentObject->VolumeCB->VolumeLock);
+ lCount = InterlockedDecrement( &pTargetDirEntry->OpenReferenceCount);
}
if( bReleaseTargetDirLock)
}
}
+ if ( bDereferenceTargetParentObject)
+ {
+
+ ObDereferenceObject( pTargetParentFileObj);
+ }
+
return ntStatus;
}
//
// If this is a truncation we need to grab the paging IO resource.
//
+
AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSSetAllocationInfo Acquiring Fcb PagingIo lock %08lX EXCL %08lX\n",
bReleasePaging = TRUE;
+ //
+ // Must drop the Fcb Resource. When changing the file size
+ // a deadlock can occur with Trend Micro's filter if the file
+ // size is set to zero.
+ //
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
pFcb->Header.AllocationSize = pBuffer->AllocationSize;
//
// Tell Cc if allocation is increased.
//
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSSetAllocationInfo Acquiring Fcb PagingIo lock %08lX EXCL %08lX\n",
+ &pFcb->NPFcb->PagingResource,
+ PsGetCurrentThread());
+
+ AFSAcquireExcl( &pFcb->NPFcb->PagingResource,
+ TRUE);
+
+ bReleasePaging = TRUE;
+
+ //
+ // Must drop the Fcb Resource. When changing the file size
+ // a deadlock can occur with Trend Micro's filter if the file
+ // size is set to zero.
+ //
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
+
bTellCc = pBuffer->AllocationSize.QuadPart > pFcb->Header.AllocationSize.QuadPart;
pFcb->Header.AllocationSize = pBuffer->AllocationSize;
{
AFSReleaseResource( &pFcb->NPFcb->PagingResource);
+
+ AFSAcquireExcl( &pFcb->NPFcb->Resource,
+ TRUE);
}
return ntStatus;
}
else
{
+
//
// If this is a truncation we need to grab the paging
// IO resource.
bReleasePaging = TRUE;
+ //
+ // Must drop the Fcb Resource. When changing the file size
+ // a deadlock can occur with Trend Micro's filter if the file
+ // size is set to zero.
+ //
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
+
pFcb->Header.AllocationSize = pBuffer->EndOfFile;
pFcb->Header.FileSize = pBuffer->EndOfFile;
}
else
{
+
//
// extending the file, move EOF
//
+ //
+ // If this is a truncation we need to grab the paging
+ // IO resource.
+ //
+ AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSSetAllocationInfo Acquiring Fcb PagingIo lock %08lX EXCL %08lX\n",
+ &pFcb->NPFcb->PagingResource,
+ PsGetCurrentThread());
+
+ AFSAcquireExcl( &pFcb->NPFcb->PagingResource,
+ TRUE);
+
+ bReleasePaging = TRUE;
+
+ //
+ // Must drop the Fcb Resource. When changing the file size
+ // a deadlock can occur with Trend Micro's filter if the file
+ // size is set to zero.
+ //
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
+
pFcb->Header.FileSize = pBuffer->EndOfFile;
pFcb->ObjectInformation->EndOfFile = pBuffer->EndOfFile;
{
AFSReleaseResource( &pFcb->NPFcb->PagingResource);
+
+ AFSAcquireExcl( &pFcb->NPFcb->Resource,
+ TRUE);
}
return ntStatus;
pBasic->LastAccessTime.QuadPart = 0;
pBasic->ChangeTime.QuadPart = 0;
pBasic->LastWriteTime.QuadPart = 0;
- pBasic->FileAttributes = FILE_ATTRIBUTE_SYSTEM;
+ pBasic->FileAttributes = FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
*Length -= sizeof( FILE_BASIC_INFORMATION);
}
break;
}
+ case FileNormalizedNameInformation:
case FileNameInformation:
{