diff --git a/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp b/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp index 478d546746..c0645be9cb 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp @@ -245,17 +245,18 @@ AFSQueryFileInfo( IN PDEVICE_OBJECT LibDeviceObject, try_return( ntStatus); } - ntStatus = AFSQueryAccess( Irp, - pFcb, - &pAllInfo->AccessInformation, - &lLength); + // + // We skip setting AccessInformation since this is set by the IO Mgr prior + // to sending this request to the file system + // - if( !NT_SUCCESS( ntStatus)) + if( lLength < sizeof( FILE_ACCESS_INFORMATION)) { - - try_return( ntStatus); + try_return( ntStatus = STATUS_BUFFER_TOO_SMALL); } + lLength -= sizeof( FILE_ACCESS_INFORMATION); + ntStatus = AFSQueryPositionInfo( Irp, pFcb, &pAllInfo->PositionInformation, @@ -267,28 +268,29 @@ AFSQueryFileInfo( IN PDEVICE_OBJECT LibDeviceObject, try_return( ntStatus); } - ntStatus = AFSQueryMode( Irp, - pFcb, - &pAllInfo->ModeInformation, - &lLength); + // + // We skip setting ModeInformation and AlignmentInformation since this is set by the IO Mgr prior + // to sending this request to the file system + // - if( !NT_SUCCESS( ntStatus)) + if( lLength < sizeof( FILE_MODE_INFORMATION)) { - - try_return( ntStatus); + try_return( ntStatus = STATUS_BUFFER_TOO_SMALL); } - ntStatus = AFSQueryAlignment( Irp, - pFcb, - &pAllInfo->AlignmentInformation, - &lLength); + lLength -= sizeof( FILE_MODE_INFORMATION); - if( !NT_SUCCESS( ntStatus)) + if( lLength < sizeof( FILE_ALIGNMENT_INFORMATION)) { - - try_return( ntStatus); + try_return( ntStatus = STATUS_BUFFER_TOO_SMALL); } + lLength -= sizeof( FILE_ALIGNMENT_INFORMATION); + + // + // Populate the name information + // + ntStatus = AFSQueryNameInfo( Irp, pCcb->DirectoryCB, &pAllInfo->NameInformation, @@ -1125,96 +1127,6 @@ AFSQueryPositionInfo( IN PIRP Irp, return ntStatus; } -NTSTATUS -AFSQueryAccess( IN PIRP Irp, - IN AFSFcb *Fcb, - IN OUT PFILE_ACCESS_INFORMATION Buffer, - IN OUT PLONG Length) -{ - - UNREFERENCED_PARAMETER(Irp); - UNREFERENCED_PARAMETER(Fcb); - NTSTATUS ntStatus = STATUS_SUCCESS; - - if( *Length >= sizeof( FILE_ACCESS_INFORMATION)) - { - - RtlZeroMemory( Buffer, - *Length); - - Buffer->AccessFlags = 0; - - *Length -= sizeof( FILE_ACCESS_INFORMATION); - } - else - { - - ntStatus = STATUS_BUFFER_TOO_SMALL; - } - - return ntStatus; -} - -NTSTATUS -AFSQueryMode( IN PIRP Irp, - IN AFSFcb *Fcb, - IN OUT PFILE_MODE_INFORMATION Buffer, - IN OUT PLONG Length) -{ - - UNREFERENCED_PARAMETER(Irp); - UNREFERENCED_PARAMETER(Fcb); - NTSTATUS ntStatus = STATUS_SUCCESS; - - if( *Length >= sizeof( FILE_MODE_INFORMATION)) - { - - RtlZeroMemory( Buffer, - *Length); - - Buffer->Mode = 0; - - *Length -= sizeof( FILE_MODE_INFORMATION); - } - else - { - - ntStatus = STATUS_BUFFER_TOO_SMALL; - } - - return ntStatus; -} - -NTSTATUS -AFSQueryAlignment( IN PIRP Irp, - IN AFSFcb *Fcb, - IN OUT PFILE_ALIGNMENT_INFORMATION Buffer, - IN OUT PLONG Length) -{ - - UNREFERENCED_PARAMETER(Irp); - UNREFERENCED_PARAMETER(Fcb); - NTSTATUS ntStatus = STATUS_SUCCESS; - - if( *Length >= sizeof( FILE_ALIGNMENT_INFORMATION)) - { - - RtlZeroMemory( Buffer, - *Length); - - Buffer->AlignmentRequirement = 1; - - *Length -= sizeof( FILE_ALIGNMENT_INFORMATION); - } - else - { - - ntStatus = STATUS_BUFFER_TOO_SMALL; - } - - return ntStatus; -} - NTSTATUS AFSQueryNameInfo( IN PIRP Irp, IN AFSDirectoryCB *DirectoryCB, diff --git a/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h b/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h index f85396078f..55735e2126 100644 --- a/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h +++ b/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h @@ -797,24 +797,6 @@ AFSQueryStreamInfo( IN PIRP Irp, IN OUT FILE_STREAM_INFORMATION *Buffer, IN OUT PLONG Length); -NTSTATUS -AFSQueryAccess( IN PIRP Irp, - IN AFSFcb *Fcb, - IN OUT PFILE_ACCESS_INFORMATION Buffer, - IN OUT PLONG Length); - -NTSTATUS -AFSQueryMode( IN PIRP Irp, - IN AFSFcb *Fcb, - IN OUT PFILE_MODE_INFORMATION Buffer, - IN OUT PLONG Length); - -NTSTATUS -AFSQueryAlignment( IN PIRP Irp, - IN AFSFcb *Fcb, - IN OUT PFILE_ALIGNMENT_INFORMATION Buffer, - IN OUT PLONG Length); - NTSTATUS AFSQueryAttribTagInfo( IN PIRP Irp, IN AFSDirectoryCB *DirectoryCB,