コード例 #1
0
        /// <summary>
        /// Verify data type FILE_MODE_INFORMATION
        /// </summary>
        /// <param name="fileModeInformation"> FILE_MODE_INFORMATION type data </param>
        public void VerifyDataTypeFileModeInformation(
            FILE_MODE_INFORMATION fileModeInformation)
        {
            Site.DefaultProtocolDocShortName = "MS-FSCC";

            //
            // Add the debug information
            //
            Site.Log.Add(LogEntryKind.Debug,
                "Verify MS-FSCC_R1402 the Mode is : {0};",
                fileModeInformation.Mode);

            //
            // Verify MS-FSCC requirement 1402
            //
            // as we cannot know how the mode specify on file creation or file open how the file will subsequently
            // be accessed from this rs, we only verify the type here

            Site.CaptureRequirementIfAreEqual<Type>(
                 typeof(Mode_Values),
                 fileModeInformation.Mode.GetType(),
                 1402,
                 @"[In FILE_MODE_INFORMATION]Mode (4 bytes):  A ULONG that MUST specify on file creation or
                 file open how the file will subsequently be accessed");

            //
            // Add the debug information
            //
            Site.Log.Add(LogEntryKind.Debug,"Verify MS-FSCC_R984");
            //
            // Verify requirement 984
            //
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(FILE_MODE_INFORMATION),
                fileModeInformation.GetType(),
                984,
                @"[In FileAllInformation]ModeInformation (4 bytes):
                A FILE_MODE_INFORMATION structure specified in section 2.4.24.");

            // As all the elements in the FILE_MODE_INFORMATION have been verified above
            // This rs will be captured directly
            Site.CaptureRequirement(
                1401,
                @"[In FileModeInformation]The FILE_MODE_INFORMATION data element is as follows:[Mode].");

            Site.DefaultProtocolDocShortName = Site.Properties["ProtocolShortName"];
        }
コード例 #2
0
        /// <summary>
        /// Verify the message syntax in FILE_MODE_INFORMATION
        /// </summary>
        /// <param name="fileModeInformation">A FILE_MODE_INFORMATION type structure.</param>
        /// <param name="isDeleteFile">A bool variable that means delete the file when the last handle to the file is closed.</param>
        protected void VerifyMessageSyntaxFileModeinformation(
            FILE_MODE_INFORMATION fileModeInformation,
            bool isDeleteFile)
        {
            Site.DefaultProtocolDocShortName = "MS-FSCC";
            if ((fileModeInformation.Mode & Mode_Values.FILE_DELETE_ON_CLOSE) == Mode_Values.FILE_DELETE_ON_CLOSE)
            {
                //
                // Add the debug information
                //
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1410,the value of Mode is {0}", fileModeInformation.Mode);

                //
                // Verify MS-FSCC requirement: MS-FSCC_R1410
                //

                Site.CaptureRequirementIfIsTrue(
                    isDeleteFile,
                    1410,
                    @"[In FILE_MODE_INFORMATION]Mode (4 bytes): When [value FILE_DELETE_ON_CLOSE 0x00001000 is] set, delete the file when the last handle to the file is closed.");
            }

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