/// <summary>
        /// Verify file standard information 
        /// </summary>
        /// <param name="info">An instance of FileStandardInformation</param>
        /// <param name="status">An instance of MessageStatus</param>
        private void VerifyFileStandardInformation(FileStandardInformation info, MessageStatus status)
        {
            if (this.fileSystem == FileSystem.NTFS)
            {
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSA_R46036 Actual FileSystem: {0}", fileSystem);

                //
                // Verify MS-FSA requirement: MS-FSA_R46036
                //
                Site.CaptureRequirementIfAreEqual <MessageStatus>(
                    MessageStatus.SUCCESS,
                    status,
                    46036,
                    @"[In FileStandardInformation] <58> Section 3.1.5.11.27: This algorithm is implemented by NTFS. ");
            }

            if (this.fileSystem == FileSystem.FAT
                || this.fileSystem == FileSystem.EXFAT
                || this.fileSystem == FileSystem.CDFS
                || this.fileSystem == FileSystem.UDFS)
            {
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSA_R4637");

                //
                // Verify MS-FSA requirement: MS-FSA_R4637
                //
                Site.CaptureRequirementIfAreEqual<uint>(
                    1,
                    info.NumberOfLinks,
                    4637,
                    @"[In FileStandardInformation] <58> Section 3.1.5.11.27:The FAT, EXFAT, CDFS, and UDFS file systems always return 1.");
            }

            if (info.NumberOfLinks == 0)
            {
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSA_R2746");

                //
                // Verify MS-FSA requirement: MS-FSA_R2746
                //
                Site.CaptureRequirementIfAreEqual<byte>(
                    1,
                    info.DeletePending,
                    2746,
                    @"[In FileStandardInformation,Pseudocode for the operation is as follows:]If alignmentInfo.NumberOfLinks is 0,
                    set alignmentInfo.DeletePending to 1.");
            }
        }
        private void AlternateDataStream_Query_FileStandardInformation(FileType fileType)
        {
            //Prerequisites: Create streams on a newly created file

            //Step 1: Query FILE_STANDARD_INFORMATION
            long byteCount;
            byte[] outputBuffer;
            FileStandardInformation fileStandardInfo = new FileStandardInformation();
            fileStandardInfo.Reserved = new byte[2] { 0x00, 0x00 };
            uint outputBufferSize = (uint)TypeMarshal.ToBytes<FileStandardInformation>(fileStandardInfo).Length;

            BaseTestSite.Log.Add(LogEntryKind.TestStep, "{0}. QueryFileInformation with FileInfoClass.FILE_STANDARD_INFORMATION", ++testStep);
            status = this.fsaAdapter.QueryFileInformation(FileInfoClass.FILE_STANDARD_INFORMATION, outputBufferSize, out byteCount, out outputBuffer);
            this.fsaAdapter.AssertIfNotSuccess(status, "QueryFileInformation with FileInfoClass.FILE_STANDARD_INFORMATION operation failed.");

            // Step 6: Verify FILE_STANDARD_INFORMATION
            fileStandardInfo = TypeMarshal.ToStruct<FileStandardInformation>(outputBuffer);
            BaseTestSite.Log.Add(LogEntryKind.TestStep, "{0}. Verify outputBuffer.EndOfFile", ++testStep);
            this.fsaAdapter.AssertAreEqual(this.Manager, dataStreamList[":" + dataStreamName1 + ":$DATA"], fileStandardInfo.EndOfFile,
                "EndOfFile specifies the offset to the byte immediately following the last valid byte in the file. Because this value is zero-based, it actually refers to the first free byte in the file. That is, it is the offset from the beginning of the file at which new bytes appended to the file will be written.");
        }
        /// <summary>
        ///  Verify the data type FileStandardInformation, which is defined in TD 2.4.38
        /// </summary>
        /// <param name="fileStandardInformation"> FileStandardInformation type data</param>
        /// <param name="isFileDeletionRequested"> Check if FileDeletion Requested</param>
        /// <param name="isDirector"> Check if is a Director</param>
        public void VerifyDataTypeFileStandardInformation(
            FileStandardInformation fileStandardInformation,
            bool isFileDeletionRequested,
            bool isDirector)
        {
            Site.DefaultProtocolDocShortName = "MS-FSCC";

            //
            // Add the debug information
            //
            Site.Log.Add(LogEntryKind.Debug,
                "Verify MS-FSCC_R1624, AllocationSize: {0};",
                fileStandardInformation.AllocationSize);
            //
            // Verify MS-FSCC requirement 1624
            //
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(Int64),
                fileStandardInformation.AllocationSize.GetType(),
                1624,
                @"[In FILE_STANDARD_INFORMATION]AllocationSize (8 bytes):  A 64-bit signed integer that contains
                the file allocation size in bytes.");
            //
            // Add the debug information
            //
            Site.Log.Add(LogEntryKind.Debug,
                "Verify MS-FSCC_R1626, AllocationSize: {0};",
                fileStandardInformation.AllocationSize);
            //
            // Verify MS-FSCC requirement 1626
            //
            // And the size of the AllocationSize is verified above, we didn't verify here again
            Site.CaptureRequirementIfIsTrue(
                (fileStandardInformation.AllocationSize >= 0),
                 1626,
                @"[In FILE_STANDARD_INFORMATION]AllocationSize (8 bytes):  The value of this field MUST be greater than or equal to 0.");

            //
            // Add the debug information
            //
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1628, EndOfFile: {0}", fileStandardInformation.EndOfFile);

            const int sizeOfEndOfFile = 8;
            //
            // Verify MS-FSCC requirement 1628
            //
            // As we parse the file by using the EndofFile, the sucessfully parsing have verified the actual value,
            // only verify the size of endoffile
            Site.CaptureRequirementIfAreEqual<int>(
                sizeOfEndOfFile,
                Marshal.SizeOf(fileStandardInformation.EndOfFile),
                1628,
                @"[In FILE_STANDARD_INFORMATION]EndOfFile (8 bytes):  EndOfFile specifies the offset to the byte
                immediately following the last valid byte in the file.");
            //
            // Add the debug information
            //
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1629, EndOfFile: {0}", fileStandardInformation.EndOfFile);

            //
            // Verify MS-FSCC requirement 1629
            //
            // As we parse the file by using the EndofFile, it's useless to verify the actual value if is valid
            // after parsing successfully, only verify the size of endoffile
            Site.CaptureRequirementIfAreEqual<int>(
                sizeOfEndOfFile,
                Marshal.SizeOf(fileStandardInformation.EndOfFile),
                1629,
                @"[In FILE_STANDARD_INFORMATION]EndOfFile (8 bytes):  Because this value is zero-based, it actually
                refers to the first free byte in the file. That is, it is the offset from the beginning of the file
                at which new bytes appended to the file will be written.");
            //
            // Add the debug information
            //
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1637, Reserved: {0}", fileStandardInformation.Reserved);
            //
            // Verify MS-FSCC requirement 1637
            //
            // As the reserved field is reserved, it can be any value, this rs will be only verified with size
            const int sizeOfReserved = 2;
            Site.CaptureRequirementIfAreEqual<int>(
                sizeOfReserved,
                fileStandardInformation.Reserved.Length,
                1637,
                @"[In FILE_STANDARD_INFORMATION]Reserved (2 bytes): This field is reserved.");
            //
            // Add the debug information
            //
            Site.Log.Add(LogEntryKind.Debug,
                "Verify MS-FSCC_R1630 EndOfFile: {0};",
                fileStandardInformation.EndOfFile);
            //
            // Verify MS-FSCC requirement 1630
            //
            // As the size of the EndOfFile is verified above, we didn't verify again here.
            Site.CaptureRequirementIfIsTrue(
                (fileStandardInformation.EndOfFile >= 0),
                1630,
                @"[In FILE_STANDARD_INFORMATION]EndOfFile (8 bytes):  The value of this field MUST be greater than
                or equal to 0.");
            //
            // Add the debug information
            //
            Site.Log.Add(LogEntryKind.Debug,
                "Verify MS-FSCC_R1631 ");
            //
            // Verify MS-FSCC requirement 1631
            //
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(UInt32),
                fileStandardInformation.NumberOfLinks.GetType(),
                1631,
                @"[In FILE_STANDARD_INFORMATION]NumberOfLinks (4 bytes):  A 32-bit unsigned integer that contains the
                number of non-deleted links to this file.");

            if (isFileDeletionRequested)
            {
                //
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug,
                    "Verify MS-FSCC_R1632 DeletePending: {0};",
                    fileStandardInformation.DeletePending);
                //
                // Verify MS-FSCC requirement 1632
                //
                bool isVerifyR1632 = (Marshal.SizeOf(fileStandardInformation.DeletePending) == 1 &&
                                         fileStandardInformation.DeletePending == 1);

                Site.CaptureRequirementIfIsTrue(
                    isVerifyR1632,
                    1632,
                    @"[In FILE_STANDARD_INFORMATION]DeletePending (1 byte):  An 8-bit field that MUST be set to 1 to
                     indicate that a file deletion has been requested.");
            }
            else
            {
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug,
                    "Verify MS-FSCC_R1633 DeletePending: {0};",
                    fileStandardInformation.DeletePending);
                //
                // Verify MS-FSCC requirement 1633
                //
                bool isVerifyR1633 = (Marshal.SizeOf(fileStandardInformation.DeletePending) == 1 &&
                                         fileStandardInformation.DeletePending == 0);

                Site.CaptureRequirementIfIsTrue(
                    isVerifyR1633,
                    1633,
                    @"[In FILE_STANDARD_INFORMATION]DeletePending (1 byte):   otherwise[if a file deletion has not been
                    requested],[it is set to] 0");
            }

            if (isDirector)
            {
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug,
                    "Verify MS-FSCC_R1634, Directory: {0};",
                    fileStandardInformation.Directory);
                //
                // Verify MS-FSCC requirement 1634
                //
                bool isVerifyR1634 = (Marshal.SizeOf(fileStandardInformation.Directory) == 1 &&
                                         fileStandardInformation.Directory == 1);

                Site.CaptureRequirementIfIsTrue(
                    isVerifyR1634,
                    1634,
                    @"[In FILE_STANDARD_INFORMATION]Directory (1 byte):  An 8-bit field that MUST be set to 1 to indicate
                    that the file is a director.");
            }
            else
            {
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug,
                    "Verify MS-FSCC_R1635 Directory: {0};",
                    fileStandardInformation.Directory);

                bool isVerifyR1635 = (Marshal.SizeOf(fileStandardInformation.Directory) == 1 &&
                                        fileStandardInformation.Directory == 0);
                //
                // Verify MS-FSCC requirement 1635
                //
                // And the size of the Directory is verified above, we didn't verify here again
                Site.CaptureRequirementIfIsTrue(
                    isVerifyR1635,
                    1635,
                    @"[In FILE_STANDARD_INFORMATION]Directory (1 byte):  otherwise[if the file is not a director],
                    [it is set to]0.");
            }
            //
            // Add the debug information
            //
            Site.Log.Add(LogEntryKind.Debug,
                "Verify MS-FSCC_R1636 , Reserved: {0};",
                BytesToString(fileStandardInformation.Reserved));
            //
            // Verify MS-FSCC requirement 1636
            //
            Site.CaptureRequirementIfAreEqual<int>(
                sizeOfReserved,
                fileStandardInformation.Reserved.Length,
                1636,
                @"[In FILE_STANDARD_INFORMATION]Reserved (2 bytes):  A 16-bit field.");

            // As the Reserved can be set to any value. we can capture this req1638 directly and the size here won't be verified again.
            Site.CaptureRequirement(
                1638,
                @"[In FILE_STANDARD_INFORMATION]Reserved (2 bytes): This field can be set to any value.");
            // FILE_STANDARD_INFORMATION has been defined as section 2.4.38
            // As all the elements in the FILE_STANDARD_INFORMATION have been verified above
            // This rs wii be captured directly
            Site.CaptureRequirement(
                979,
                @"[In FileAllInformation]StandardInformation (24 bytes):
                A FILE_STANDARD_INFORMATION structure specified in section 2.4.38.");
            // As all the elements in the FILE_STANDARD_INFORMATION have been verified above
            // This rs wii be captured directly
            Site.CaptureRequirement(
                1623,
                @"[In FileStandardInformation]The FILE_STANDARD_INFORMATION data element is as follows:
                [AllocationSize, ..., EndOfFile, ..., NumberOfLinks, DeletePending, Directory, Reserved].");

            Site.DefaultProtocolDocShortName = Site.Properties["ProtocolShortName"];
        }