public override int GetHashCode() { unchecked { return((ByteCount.GetHashCode() * 397) ^ BitCount.GetHashCode()); } }
public void Reset() { _remainingFrameByteCount = ByteCount.Empty; _currentRegisteredSegmentEnd = (byte *)0; _currentBuffer = null; _currentFrame.Clear(); _pendingBuffers.Clear(); }
public HuffmanTreeNode(HuffmanTreeNode left, HuffmanTreeNode right) { Left = left; Right = right; Left.Parent = Right.Parent = this; if (ByteCount == null) ByteCount = new ByteCount(); this.ByteCount.Count = Left.ByteCount.Count + Right.ByteCount.Count; }
/// <summary> /// Lists all of the <see cref="WatchedFile"/>'s properties /// </summary> public override string ToString() { return(ShortPath + Environment.NewLine + " Size: " + ByteCount.ToString("n0") + " bytes" + Environment.NewLine + " Archive: " + Archive + Environment.NewLine + " Hidden: " + Hidden + Environment.NewLine + " Readonly: " + ReadOnly + Environment.NewLine + " Last Opened: " + LastOpened.ToString(DateFormatString) + Environment.NewLine + " Last Modified: " + LastModified.ToString(DateFormatString)); }
public override string ToString() { if (BitCount == 0) { return(ByteCount.ToString()); } var totalBitCount = TotalBitCount; return(totalBitCount == 1 ? "1 bit" : $"{totalBitCount} bits"); }
public HuffmanTreeNode(HuffmanTreeNode left, HuffmanTreeNode right) { Left = left; Right = right; Left.Parent = Right.Parent = this; if (ByteCount == null) { ByteCount = new ByteCount(); } this.ByteCount.Count = Left.ByteCount.Count + Right.ByteCount.Count; }
public static String format(ByteCount byteCount) { if (byteCount >= 1024 * 1024 * 1024) { return(String.Format("{0:n0} GiB", inGib(byteCount))); } if (byteCount >= 1024 * 1024) { return(String.Format("{0:n0} MiB", inMib(byteCount))); } if (byteCount >= 1024) { return(String.Format("{0:n0} KiB", inKib(byteCount))); } return(String.Format("{0:n0} B", byteCount)); }
// gibibyte = 1024 ^ 3 bytes #region gibibyte public static Double inGib(ByteCount byteCount) { return(byteCount / 1024f / 1024f / 1024f); }
public bool TryFrameNextMessage(RioBuffer rioBuffer, out List <BufferSegment> frame) { frame = null; var currentSegmentIsCompleted = _currentRegisteredSegmentEnd == _currentBufferSegment.Data; if (_remainingFrameByteCount.IsEmpty) { // the previous frame was framed entirely, we can reset it _currentFrame.Clear(); // we can release all pending buffers, but the current one must be kept if it is not entirely read ReleasePendingBuffers(currentSegmentIsCompleted); if (currentSegmentIsCompleted && _currentBuffer != null) { _currentRegisteredSegmentEnd = rioBuffer.Data; return(false); } } if (rioBuffer != _currentBuffer) { // a new buffer is submitted, we initialize a new frame segment _currentBufferSegment = new BufferSegment(rioBuffer.Data); _currentBuffer = rioBuffer; _pendingBuffers.Add(_currentBuffer); } _currentRegisteredSegmentEnd = rioBuffer.Data + rioBuffer.DataLength; // we need to read the length prefix of the frame, so we loop until we have the 4 bytes of data we need while (!_remainingFrameByteCount.IsComplete) { if (_currentBufferSegment.Data >= _currentRegisteredSegmentEnd) { return(false); } _remainingFrameByteCount.Push(_currentBufferSegment.Data); _currentBufferSegment = new BufferSegment(_currentBufferSegment.Data + 1, _currentBufferSegment.Length); } // we just finished to read the frame length and the buffer is completed, we can release it right away if (_currentFrame.Count == 0) { ReleasePendingBuffers(_currentBufferSegment.Data == _currentRegisteredSegmentEnd); } // at this point, we know the actual frame length // if the frame bytes span beyond the end of the current buffer, we trim the current frame part // to the end of the buffer and we return so that we can be provided another buffer var frameEnd = _currentBufferSegment.Data + _remainingFrameByteCount.Value; if (frameEnd > _currentRegisteredSegmentEnd) { var segmentLength = _currentBufferSegment.Length + (int)(_currentRegisteredSegmentEnd - _currentBufferSegment.Data); _currentBufferSegment = new BufferSegment(_currentBufferSegment.Data, segmentLength); _remainingFrameByteCount.Value -= _currentBufferSegment.Length; _currentFrame.Add(_currentBufferSegment); return(false); } // if the buffer contains enough data, we take as much as we need and mark the frame as completed _currentBufferSegment = new BufferSegment(_currentBufferSegment.Data, _currentBufferSegment.Length + _remainingFrameByteCount.Value); _currentFrame.Add(_currentBufferSegment); _currentBufferSegment = new BufferSegment(_currentBufferSegment.Data + _currentBufferSegment.Length); _remainingFrameByteCount = ByteCount.Empty; frame = _currentFrame; return(true); }
// megabyte = 1000 ^ 2 bytes #region megabyte public static Double inMb(ByteCount byteCount) { return(byteCount / 1000f / 1000f); }
public virtual Base MeetAt(ByteCount offset, Base other) => throw new DecompilationException($"Can't split this type at 0x{offset:X} to include {other}");
public Slot(ByteCount offset, Base type) { this.Offset = offset; this.Type = type; }
internal static MessageStatus WorkaroundQueryFileInfoPart1(FileSystem fileSystem, FileInfoClass fileInfoClass, OutputBufferSize outputBufferSize, ref ByteCount byteCount, ref OutputBuffer outputBuffer, MessageStatus returnedStatus, ITestSite site) { if (fileInfoClass == FileInfoClass.NOT_DEFINED_IN_FSCC || fileInfoClass == FileInfoClass.FILE_BOTH_DIR_INFORMATION || fileInfoClass == FileInfoClass.FILE_DIRECTORY_INFORMATION || fileInfoClass == FileInfoClass.FILE_FULL_DIR_INFORMATION || fileInfoClass == FileInfoClass.FILE_LINKS_INFORMATION || fileInfoClass == FileInfoClass.FILE_ID_BOTH_DIR_INFORMATION || fileInfoClass == FileInfoClass.FILE_ID_FULL_DIR_INFORMATION || fileInfoClass == FileInfoClass.FILE_ID_GLOBAL_TX_DIR_INFORMATION || fileInfoClass == FileInfoClass.FILE_NAME_INFORMATION || fileInfoClass == FileInfoClass.FILE_NAMES_INFORMATION || fileInfoClass == FileInfoClass.FILE_OBJECTID_INFORMATION || fileInfoClass == FileInfoClass.FILE_QUOTA_INFORMATION || fileInfoClass == FileInfoClass.FILE_REPARSE_POINT_INFORMATION || fileInfoClass == FileInfoClass.FILE_SFIO_RESERVE_INFORMATION || fileInfoClass == FileInfoClass.FILE_STANDARD_LINK_INFORMATION) { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(2749, MessageStatus.INVALID_INFO_CLASS, returnedStatus, site); } else if (fileInfoClass == FileInfoClass.FILE_ACCESS_INFORMATION && outputBufferSize == OutputBufferSize.NotLessThan) { outputBuffer = FsaUtility.TransferExpectedResult <OutputBuffer>(1421, new OutputBuffer(), outputBuffer, site); } else if (fileInfoClass == FileInfoClass.FILE_FULLEA_INFORMATION && outputBufferSize == OutputBufferSize.LessThan) { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(3994, MessageStatus.BUFFER_TOO_SMALL, returnedStatus, site); } else if (fileInfoClass == FileInfoClass.FILE_FULLEA_INFORMATION && returnedStatus == MessageStatus.NO_EAS_ON_FILE) { // For query FILE_FULLEA_INFORMATION, when server returns STATUS_NO_EAS_ON_FILE, this result is valid according to model design. // Transfer the return code and byteCount to make model test cases passed. byteCount = FsaUtility.TransferExpectedResult <ByteCount>(3992, ByteCount.SizeofFILE_FULL_EA_INFORMATION, byteCount, site); returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1187, MessageStatus.SUCCESS, returnedStatus, site); } else if (fileInfoClass == FileInfoClass.FILE_STREAM_INFORMATION && fileSystem == FileSystem.FAT32) { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1421, MessageStatus.SUCCESS, returnedStatus, site); } else if (fileInfoClass == FileInfoClass.FILE_COMPRESSION_INFORMATION && fileSystem == FileSystem.FAT32) { if (outputBufferSize == OutputBufferSize.NotLessThan) { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1421, MessageStatus.SUCCESS, returnedStatus, site); byteCount = FsaUtility.TransferExpectedResult <ByteCount>(1421, ByteCount.SizeofFILE_COMPRESSION_INFORMATION, byteCount, site); } else if (outputBufferSize == OutputBufferSize.LessThan) { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1489, MessageStatus.INFO_LENGTH_MISMATCH, returnedStatus, site); byteCount = FsaUtility.TransferExpectedResult <ByteCount>(1489, ByteCount.NotSet, byteCount, site); } } else if (fileInfoClass == FileInfoClass.FILE_ATTRIBUTETAG_INFORMATION && fileSystem == FileSystem.FAT32) { if (outputBufferSize == OutputBufferSize.NotLessThan) { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1421, MessageStatus.SUCCESS, returnedStatus, site); byteCount = FsaUtility.TransferExpectedResult <ByteCount>(1421, ByteCount.SizeofFILE_ATTRIBUTE_TAG_INFORMATION, byteCount, site); } else if (outputBufferSize == OutputBufferSize.LessThan) { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1445, MessageStatus.INFO_LENGTH_MISMATCH, returnedStatus, site); byteCount = FsaUtility.TransferExpectedResult <ByteCount>(1445, ByteCount.NotSet, byteCount, site); } } else if (fileInfoClass == FileInfoClass.FILE_FULLEA_INFORMATION && fileSystem != FileSystem.NTFS && outputBufferSize == OutputBufferSize.NotLessThan) { // FILE_FULL_EA_INFORMATION is only supported in NTFS, will failed with STATUS_INVALID_DEVICE_REQUEST in other file systems. // Transfer the return code and byteCount to make model test cases passed. byteCount = FsaUtility.TransferExpectedResult <ByteCount>(3992, ByteCount.SizeofFILE_FULL_EA_INFORMATION, byteCount, site); returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1187, MessageStatus.SUCCESS, returnedStatus, site); } else if (fileInfoClass == FileInfoClass.FILE_ALTERNATENAME_INFORMATION && fileSystem == FileSystem.REFS && outputBufferSize == OutputBufferSize.NotLessThan) { // REFS file system does not support FILE_ALTERNATENAME_INFORMATION, will failed with STATUS_OBJECT_NAME_NOT_FOUND // Transfer the return code and byteCount to make model test cases passed. byteCount = FsaUtility.TransferExpectedResult <ByteCount>(3992, ByteCount.FieldOffsetFILE_NAME_INFORMATION_FileNameAddOutputBuffer_FileNameLength, byteCount, site); returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1187, MessageStatus.SUCCESS, returnedStatus, site); } return(returnedStatus); }
internal static MessageStatus WorkAroundQueryFileInfoPart1(FileSystem fileSystem, FileInfoClass fileInfoClass, OutputBufferSize outputBufferSize, ref ByteCount byteCount, ref OutputBuffer outputBuffer, MessageStatus returnedStatus, ITestSite site) { if (fileInfoClass == FileInfoClass.NOT_DEFINED_IN_FSCC) { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1426, MessageStatus.INVALID_INFO_CLASS, returnedStatus, site); } else { switch (fileInfoClass) { case FileInfoClass.FILE_STANDARD_LINK_INFORMATION: { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(2749, MessageStatus.INVALID_INFO_CLASS, returnedStatus, site); break; } case FileInfoClass.FILE_LINKS_INFORMATION: { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1593, MessageStatus.INVALID_INFO_CLASS, returnedStatus, site); break; } case FileInfoClass.FILE_QUOTA_INFORMATION: { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(2524, MessageStatus.INVALID_INFO_CLASS, returnedStatus, site); break; } case FileInfoClass.FILE_SFIO_RESERVE_INFORMATION: { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(2734, MessageStatus.INVALID_INFO_CLASS, returnedStatus, site); break; } case FileInfoClass.FILE_OBJECTID_INFORMATION: { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1585, MessageStatus.INVALID_INFO_CLASS, returnedStatus, site); break; } case FileInfoClass.FILE_REPARSE_POINT_INFORMATION: { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(2558, MessageStatus.INVALID_INFO_CLASS, returnedStatus, site); break; } case FileInfoClass.FILE_NAME_INFORMATION: { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1591, MessageStatus.INVALID_INFO_CLASS, returnedStatus, site); break; } case FileInfoClass.FILE_FULLEA_INFORMATION: { // SMB server does not suport this operation, transfer return code to keep same model behavior if (returnedStatus == MessageStatus.INVALID_INFO_CLASS) { if (outputBufferSize == OutputBufferSize.LessThan) { returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(3899, MessageStatus.BUFFER_TOO_SMALL, returnedStatus, site); } else { byteCount = FsaUtility.TransferExpectedResult <ByteCount>(3992, ByteCount.SizeofFILE_FULL_EA_INFORMATION, byteCount, site); returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(3994, MessageStatus.SUCCESS, returnedStatus, site); } } break; } case FileInfoClass.FILE_ALTERNATENAME_INFORMATION: { if (fileSystem == FileSystem.REFS && outputBufferSize == OutputBufferSize.NotLessThan) { // REFS file system does not support FILE_ALTERNATENAME_INFORMATION, will failed with STATUS_OBJECT_NAME_NOT_FOUND // Transfer the return code and byteCount to make model test cases passed. byteCount = FsaUtility.TransferExpectedResult <ByteCount>(3992, ByteCount.FieldOffsetFILE_NAME_INFORMATION_FileNameAddOutputBuffer_FileNameLength, byteCount, site); returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(1187, MessageStatus.SUCCESS, returnedStatus, site); } break; } default: break; } } return(returnedStatus); }
protected override void DataCheck() { base.DataCheck(); if (!(ByteCount > 0 && ByteCount <= ByteCountLimit)) { throw new RffeOutOfRangeException("Byte count", "1", ByteCountLimit.ToString(), ByteCount.ToString()); } }
internal static MessageStatus WorkaroundQueryFileInfoPart1(FileSystem fileSystem, FileInfoClass fileInfoClass, OutputBufferSize outputBufferSize, ref ByteCount byteCount, ref OutputBuffer outputBuffer, MessageStatus returnedStatus, ITestSite site) { if (fileInfoClass == FileInfoClass.NOT_DEFINED_IN_FSCC || fileInfoClass == FileInfoClass.FILE_BOTH_DIR_INFORMATION || fileInfoClass == FileInfoClass.FILE_DIRECTORY_INFORMATION || fileInfoClass == FileInfoClass.FILE_FULL_DIR_INFORMATIO || fileInfoClass == FileInfoClass.FILE_LINKS_INFORMATION || fileInfoClass == FileInfoClass.FILE_ID_BOTH_DIR_INFORMATION || fileInfoClass == FileInfoClass.FILE_ID_FULL_DIR_INFORMATION || fileInfoClass == FileInfoClass.FILE_ID_GLOBAL_TX_DIR_INFORMATION || fileInfoClass == FileInfoClass.FILE_NAME_INFORMATION || fileInfoClass == FileInfoClass.FILE_NAMES_INFORMATION || fileInfoClass == FileInfoClass.FILE_OBJECTID_INFORMATION || fileInfoClass == FileInfoClass.FILE_QUOTA_INFORMATION || fileInfoClass == FileInfoClass.FILE_REPARSE_POINT_INFORMATION || fileInfoClass == FileInfoClass.FILE_SFIO_RESERVE_INFORMATION || fileInfoClass == FileInfoClass.FILE_STANDARD_LINK_INFORMATION) { returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(2749, MessageStatus.INVALID_INFO_CLASS, returnedStatus, site); } else if (fileInfoClass == FileInfoClass.FILE_ACCESS_INFORMATION && outputBufferSize == OutputBufferSize.NotLessThan) { outputBuffer = FsaUtility.TransferExpectedResult<OutputBuffer>(1421, new OutputBuffer(), outputBuffer, site); } else if (fileInfoClass == FileInfoClass.FILE_FULLEA_INFORMATION && outputBufferSize == OutputBufferSize.LessThan) { returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(3994, MessageStatus.BUFFER_TOO_SMALL, returnedStatus, site); } else if (fileInfoClass == FileInfoClass.FILE_FULLEA_INFORMATION && returnedStatus == MessageStatus.NO_EAS_ON_FILE) { // For query FILE_FULLEA_INFORMATION, when server returns STATUS_NO_EAS_ON_FILE, this result is valid according to model design. // Transfer the return code and byteCount to make model test cases passed. byteCount = FsaUtility.TransferExpectedResult<ByteCount>(3992, ByteCount.SizeofFILE_FULL_EA_INFORMATION, byteCount, site); returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(1187, MessageStatus.SUCCESS, returnedStatus, site); } else if (fileInfoClass == FileInfoClass.FILE_FULLEA_INFORMATION && fileSystem == FileSystem.REFS && outputBufferSize == OutputBufferSize.NotLessThan) { // REFS file system does not support FILE_FULLEA_INFORMATION, will failed with STATUS_INVALID_DEVICE_REQUEST // Transfer the return code and byteCount to make model test cases passed. byteCount = FsaUtility.TransferExpectedResult<ByteCount>(3992, ByteCount.SizeofFILE_FULL_EA_INFORMATION, byteCount, site); returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(1187, MessageStatus.SUCCESS, returnedStatus, site); } else if (fileInfoClass == FileInfoClass.FILE_ALTERNATENAME_INFORMATION && fileSystem == FileSystem.REFS && outputBufferSize == OutputBufferSize.NotLessThan) { // REFS file system does not support FILE_ALTERNATENAME_INFORMATION, will failed with STATUS_OBJECT_NAME_NOT_FOUND // Transfer the return code and byteCount to make model test cases passed. byteCount = FsaUtility.TransferExpectedResult<ByteCount>(3992, ByteCount.FieldOffsetFILE_NAME_INFORMATION_FileNameAddOutputBuffer_FileNameLength, byteCount, site); returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(1187, MessageStatus.SUCCESS, returnedStatus, site); } return returnedStatus; }
public static MessageStatus QueryFileInfoPart1( FileInfoClass fileInfoClass, OutputBufferSize outputBufferSize, out ByteCount byteCount, out OutputBuffer outputBuffer ) { byteCount = ByteCount.NotSet; outputBuffer = new OutputBuffer(); if (fileInfoClass == FileInfoClass.NOT_DEFINED_IN_FSCC) { Helper.CaptureRequirement(1426, @"[In Server Requests a Query of File Information ] If FileInformationClass is not defined in [MS-FSCC] section 2.4, the operation MUST be failed with STATUS_INVALID_INFO_CLASS."); return MessageStatus.INVALID_INFO_CLASS; } switch (fileInfoClass) { #region 3.1.5.11.1 FileAccessInformation case (FileInfoClass.FILE_ACCESS_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(1428, @"[In FileAccessInformation]Pseudocode for the operation is as follows: If OutputBufferSize is smaller than sizeof( FILE_ACCESS_INFORMATION ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } outputBuffer.AccessFlags = gOpenGrantedAccess; Helper.CaptureRequirement(1430, @"[In FileAccessInformation,Pseudocode for the operation is as follows:] OutputBuffer MUST be filled out as follows:OutputBuffer.AccessFlags set to Open.GrantedAccess."); byteCount = ByteCount.SizeofFILE_ACCESS_INFORMATION; Helper.CaptureRequirement(3967, @"[In FileAccessInformation]Upon successful completion of the operation, the object store MUST return: ByteCount set to sizeof( FILE_ACCESS_INFORMATION )."); Helper.CaptureRequirement(3968, @"[In FileAccessInformation]Upon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.2 FileAlignmentInformation case (FileInfoClass.FILE_ALIGNMENT_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(1433, @"[In FileAlignmentInformation]Pseudocode for the operation is as follows: If OutputBufferSize is smaller than sizeof( FILE_ALIGNMENT_INFORMATION ), the operation MUST be failed with Status STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.SizeofFILE_ALIGNMENT_INFORMATION; Helper.CaptureRequirement(1435, @"[In FileAlignmentInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:ByteCount set to sizeof( FILE_ALIGNMENT INFORMATION )."); Helper.CaptureRequirement(1436, @"[In FileAlignmentInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.3 FileAllInformation case (FileInfoClass.FILE_ALL_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(3970, @"[In FileAllInformation] Pseudocode for the operation is as follows: If OutputBufferSize is smaller than BlockAlign( FieldOffset( FILE_ALL_INFORMATION.NameInformation.FileName ) + 2, 8 ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.FieldOffsetFILE_ALL_INFORMATION_NameInformationAddNameInformationLength; Helper.CaptureRequirement(3980, @"[In FileAllInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return: ByteCount set to FieldOffset( FILE_ALL_INFORMATION.NameInformation ) + NameInformationLength."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.4 FileAlternateNameInformation case (FileInfoClass.FILE_ALTERNATENAME_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(1438, @"[In FileAlternateNameInformation]Pseudocode for the operation is as follows: If OutputBufferSize is smaller than BlockAlign( FieldOffset( FILE_NAME_INFORMATION.FileName ) + 2, 4 ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.FieldOffsetFILE_NAME_INFORMATION_FileNameAddOutputBuffer_FileNameLength; Helper.CaptureRequirement(1442, @"[In FileAlternateNameInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return: ByteCount set to FieldOffset( FILE_NAME_INFORMATION.FileName ) + OutputBuffer.FileNameLength."); Helper.CaptureRequirement(1443, @"[In FileAlternateNameInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.5 FileAttributeTagInformation case (FileInfoClass.FILE_ATTRIBUTETAG_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(1445, @"[In FileAttributeTagInformation,Pseudocode for the operation is as follows:] If OutputBufferSize is smaller than sizeof( FILE_ATTRIBUTE_TAG_INFORMATION ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.SizeofFILE_ATTRIBUTE_TAG_INFORMATION; Helper.CaptureRequirement(1464, @"[In FileAttributeTagInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:ByteCount set to sizeof(FILE_ATTRIBUTE_TAG_INFORMATION )."); Helper.CaptureRequirement(1465, @"[In FileAttributeTagInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.6 FileBasicInformation case (FileInfoClass.FILE_BASIC_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(1467, @"[In FileBasicInformation]Pseudocode for the operation is as follows:If OutputBufferSize is smaller than BlockAlign( sizeof( FILE_BASIC_INFORMATION ), 8 ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.SizeofFILE_BASIC_INFORMATION; Helper.CaptureRequirement(3982, @"[In FileBasicInformation]Upon successful completion of the operation, the object store MUST return:ByteCount set to sizeof( FILE_BASIC_INFORMATION )."); Helper.CaptureRequirement(3983, @"[In FileBasicInformation]Upon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.7 FileBothDirectoryInformation case (FileInfoClass.FILE_BOTH_DIR_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(1605, @"[In FileBothDirectoryInformation, This operation]MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.8 FileCompressionInformation case (FileInfoClass.FILE_COMPRESSION_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(1489, @"[In FileCompressionInformation]Pseudocode for the operation is as follows: If OutputBufferSize is smaller than sizeof( FILE_COMPRESSION_INFORMATION ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.SizeofFILE_COMPRESSION_INFORMATION; Helper.CaptureRequirement(3984, @"[In FileCompressionInformation]Upon successful completion of the operation, the object store MUST return:ByteCount set to sizeof(FILE_COMPRESSION_INFORMATION )."); Helper.CaptureRequirement(3985, @"[In FileCompressionInformation]Upon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.9 FileDirectoryInformation case (FileInfoClass.FILE_DIRECTORY_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(1603, @"[In FileDirectoryInformation,This operation ]MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.10 FileEaInformation case (FileInfoClass.FILE_EA_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(3986, @"[In FileEaInformation]Pseudocode for the operation is as follows: If OutputBufferSize is smaller than sizeof( FILE_EA_INFORMATION ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.SizeofFILE_EA_INFORMATION; Helper.CaptureRequirement(3987, @"[In FileEaInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:ByteCount set to sizeof( FILE_EA_INFORMATION )."); Helper.CaptureRequirement(3988, @"[In FileEaInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.11 FileFullDirectoryInformation case (FileInfoClass.FILE_FULL_DIR_INFORMATIO): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(1601, @"[In FileFullDirectoryInformation,This operation ]MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS, acctually ,it return INVALID_INFO_CLASS return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.12 FileFullEaInformation case (FileInfoClass.FILE_FULLEA_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(3994, @"[In FileFullEaInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:Status set to:STATUS_BUFFER_TOO_SMALL if OutputBufferSize is too small to hold Open.NextEaEntry. No entries are returned."); return MessageStatus.BUFFER_TOO_SMALL; } byteCount = ByteCount.SizeofFILE_FULL_EA_INFORMATION; Helper.CaptureRequirement(3992, @"[In FileFullEaInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:ByteCount set to the size, in bytes, of all FILE_FULL_EA_INFORMATION entries returned."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.13 FileHardLinkInformation case (FileInfoClass.FILE_LINKS_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(1593, @"[In FileHardLinkInformation,This operation] MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.14 FileIdBothDirectoryInformation case (FileInfoClass.FILE_ID_BOTH_DIR_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(1595, @"[In FileIdBothDirectoryInformation,This operation] MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.15 FileIdFullDirectoryInformation case (FileInfoClass.FILE_ID_FULL_DIR_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(1597, @"[In FileIdFullDirectoryInformation,This operation]MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.16 FileIdGlobalTxDirectoryInformation case (FileInfoClass.FILE_ID_GLOBAL_TX_DIR_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(1599, @"[In FileIdGlobalTxDirectoryInformation,This operation] MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.17 FileInternalInformation case (FileInfoClass.FILE_INTERNAL_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(1524, @"[In FileInternalInformation]Pseudocode for the operation is as follows: If OutputBufferSize is smaller than sizeof( FILE_INTERNAL_INFORMATION ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.SizeofFILE_INTERNAL_INFORMATION; Helper.CaptureRequirement(3997, @"[In FileInternalInformation]Upon successful completion of the operation, the object store MUST return: ByteCount set to sizeof( FILE_INTERNAL_INFORMATION )."); Helper.CaptureRequirement(3998, @"[In FileInternalInformation]Upon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.18 FileModeInformation case (FileInfoClass.FILE_MODE_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(1529, @"[In FileModeInformation]Pseudocode for the operation is as follows: If OutputBufferSize is smaller than sizeof(FILE_MODE_INFORMATION ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.SizeofFILE_MODE_INFORMATION; Helper.CaptureRequirement(4000, @"[In FileModeInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:ByteCount set to sizeof( FILE_MODE_INFORMATION )."); Helper.CaptureRequirement(4001, @"[In FileModeInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.19 FileNameInformation case (FileInfoClass.FILE_NAME_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(1591, @"[In FileNameInformation]This operation MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.20 FileNamesInformation case (FileInfoClass.FILE_NAMES_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(1587, @"[In FileNamesInformation]If used to query file information STATUS_NOT_SUPPORTED MUST be returned."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.21 FileNetworkOpenInformation case (FileInfoClass.FILE_NETWORKOPEN_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(4002, @"[In FileNetworkOpenInformation]Pseudocode for the operation is as follows: If OutputBufferSize is smaller than sizeof( FILE_NETWORK_OPEN_INFORMATION ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.SizeofFILE_NETWORK_OPEN_INFORMATION; Helper.CaptureRequirement(4004, @"[In FileNetworkOpenInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:ByteCount set to sizeof( FILE_NETWORK_OPEN_INFORMATION )."); Helper.CaptureRequirement(4005, @"[In FileNetworkOpenInformation,Pseudocode for the operation is as follows:]U pon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.22 FileObjectIdInformation case (FileInfoClass.FILE_OBJECTID_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(1585, @"[In FileObjectIdInformation,This operation]MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.23 FilePositionInformation case (FileInfoClass.FILE_POSITION_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(1561, @"[In FilePositionInformation]Pseudocode for the operation is as follows: If OutputBufferSize is less than the size, in bytes, of the FILE_POSITION_INFORMATION structure, the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } Helper.CaptureRequirement(1563, @"[In FilePositionInformation,Pseudocode for the operation is as follows:] The operation returns STATUS_SUCCESS.<57>"); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.24 FileQuotaInformation case (FileInfoClass.FILE_QUOTA_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(2525, @"[In FileQuotaInformation]If used to query file information STATUS_NOT_SUPPORTED MUST be returned."); Helper.CaptureRequirement(2524, @"[In FileQuotaInformation]This operation is not supported as a file information class, it is only supported as a directory enumeration class, see section 3.1.5.5.2."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.25 FileReparsePointInformation case (FileInfoClass.FILE_REPARSE_POINT_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(2559, @"[In FileReparsePointInformation ] If used to query file information STATUS_NOT_SUPPORTED MUST be returned."); Helper.CaptureRequirement(2558, @"[In FileReparsePointInformation ] This operation is not supported as a file information class, it is only supported as a directory enumeration class, see section 3.1.5.5.3."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.26 FileSfioReserveInformation case (FileInfoClass.FILE_SFIO_RESERVE_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(2734, @"[In FileSfioReserveInformation] This operation MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.27 FileStandardInformation case (FileInfoClass.FILE_STANDARD_INFORMATION): { if (outputBufferSize == OutputBufferSize.LessThan) { Helper.CaptureRequirement(4006, @"[In FileStandardInformation]Pseudocode for the operation is as follows: If OutputBufferSize is smaller than sizeof( FILE_STANDARD_INFORMATION ), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH."); return MessageStatus.INFO_LENGTH_MISMATCH; } byteCount = ByteCount.SizeofFILE_STANDARD_INFORMATION; Helper.CaptureRequirement(4007, @"[In FileStandardInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:ByteCount set to sizeof( FILE_STANDARD_INFORMATION )."); Helper.CaptureRequirement(4008, @"[In FileStandardInformation,Pseudocode for the operation is as follows:] Upon successful completion of the operation, the object store MUST return:Status set to STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion #region 3.1.5.11.28 FileStandardLinkInformation case (FileInfoClass.FILE_STANDARD_LINK_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); // This operation is not supported and MUST be failed with STATUS_NOT_SUPPORTED. Helper.CaptureRequirement(2749, @"[In FileStandardLinkInformation]This operation MUST be failed with STATUS_NOT_SUPPORTED."); //return MessageStatus.NOT_SUPPORTED; //this is a TD issue ,so change the return value to return MessageStatus.INVALID_INFO_CLASS; return MessageStatus.INVALID_INFO_CLASS; } #endregion #region 3.1.5.11.29 FileStreamInformation case (FileInfoClass.FILE_STREAM_INFORMATION): { Condition.IsTrue(outputBufferSize == OutputBufferSize.NotLessThan); Helper.CaptureRequirement(2625, @"[In FileStreamInformation,Pseudocode for the operation is as follows:] The operation returns STATUS_SUCCESS."); Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; } #endregion } Helper.CaptureRequirement(1421, @"[In Server Requests a Query of File Information ]On completion, the object store MUST return:[Status,OutputBuffer,ByteCount]."); return MessageStatus.SUCCESS; }