private void VerifyNetlogonValidationSamInfo4()

in TestSuites/ADFamily/src/Adapter/MS-NRPC/ServerRoleCaptureCode.cs [3199:4632]


        private void VerifyNetlogonValidationSamInfo4(
            HRESULT hresult,
            _NETLOGON_VALIDATION_SAM_INFO4 validationSamInfo,
            _NETLOGON_LOGON_INFO_CLASS logonLevel,
            long expectedPasswordLastSet,
            string expectedEffectiveName,
            string expectedLogonScript,
            string expectedProfilePath,
            string expectedHomeDirectory,
            string expectedHomeDirectoryDrive,
            ushort expectedBadPasswordCount,
            ushort expectedLogonCount)
        {
            if (hresult == HRESULT.ERROR_SUCCESS)
            {
                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1665");

                // Verify MS-NRPC requirement: MS-NRPC_R1665.
                Site.CaptureRequirementIfAreEqual<string>(
                    PrimaryDomainDnsName,
                    GetRpcUnicodeString(validationSamInfo.DnsLogonDomainName),
                    1665,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]DnsLogonDomainName:  Contains the fully qualified
                    domain name (FQDN) of the domain of the user account.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1666");

                // Verify MS-NRPC requirement: MS-NRPC_R1666.
                Site.CaptureRequirementIfAreEqual<string>(
                    DomainAdminUPN.ToLower(CultureInfo.InvariantCulture),
                    GetRpcUnicodeString(validationSamInfo.Upn).ToLower(CultureInfo.InvariantCulture),
                    1666,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]Upn:  Contains the user principal name (UPN).");

                _OLD_LARGE_INTEGER logonTime = validationSamInfo.LogonTime;
                _RPC_UNICODE_STRING logonScript = validationSamInfo.LogonScript;

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonInteractiveInformation)
                {
                    // Convert the _RPC_UNICODE_STRING structure to string.
                    string actualLogonScript = GetRpcUnicodeString(logonScript);
                    bool isLogonScriptValid;
                    if (null == expectedLogonScript)
                    {
                        isLogonScriptValid = null == actualLogonScript;
                    }
                    else
                    {
                        isLogonScriptValid = (logonScript.GetType() == typeof(_RPC_UNICODE_STRING))
                           && actualLogonScript.Equals(expectedLogonScript, StringComparison.OrdinalIgnoreCase);
                    }

                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        @"Verify MS-NRPC_R104495,
                        actual LogonScript: {0},
                        expected LogonScript: {1}",
                        actualLogonScript,
                        expectedLogonScript);

                    // Verify MS-NRPC requirement:  MS-NRPC_R104495.
                    Site.CaptureRequirementIfIsTrue(
                        isLogonScriptValid,
                        "MS-PAC",
                        104495,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]LogonScript:  A RPC_UNICODE_STRING structure
                        that contains the user account's scriptPath attribute ([MS-ADA3] section 2.231) value for
                        interactive logon");
                }

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonNetworkInformation)
                {
                    // Verify requirement : MS-NRPC_R104496, MS-NRPC_R104497.
                    string isR104496Implemented = Site.Properties["MS_NRPC.SHOULDMAY.R104496Implementation"];
                    if (PDCIsWindows)
                    {
                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104497,
                            LogonScript.Length: {0}",
                            logonScript.Length);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104497.
                        Site.CaptureRequirementIfAreEqual<ushort>(
                            0,
                            logonScript.Length,
                            "MS-PAC",
                            104497,
                            @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]LogonScript: in Windows,[it]is zero for
                            network logon.");

                        if (null == isR104496Implemented)
                        {
                            Site.Properties.Add("MS_NRPC.SHOULDMAY.R104496Implementation", bool.TrueString);
                            isR104496Implemented = bool.TrueString;
                        }
                    }

                    if (null != isR104496Implemented)
                    {
                        bool implement = bool.Parse(isR104496Implemented);
                        bool isSatisfied = logonScript.Length == 0;

                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104496,
                            LogonScript.Length: {0}",
                            logonScript.Length);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104496.
                        Site.CaptureRequirementIfAreEqual<bool>(
                            implement,
                            isSatisfied,
                            "MS-PAC",
                            104496,
                            string.Format(CultureInfo.InvariantCulture, 
                                @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]LogonScript:
                                SHOULD be zero for network logon.
                                This requirement is {0} implemented.",
                                implement ? string.Empty : "not"));
                    }
                }

                _OLD_LARGE_INTEGER passwordLastSet = validationSamInfo.PasswordLastSet;

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonInteractiveInformation)
                {
                    // Convert _OLD_LARGE_INTEGER structure to Int64.
                    long actualPasswordLastSetInt = GetInt64ValueFromOldLargeInteger(passwordLastSet);

                    // Type _OLD_LARGE_INTEGER in NRPC is corresponding to type FILETIME in PAC.
                    bool isPasswordLastSetValid = (passwordLastSet.GetType() == typeof(_OLD_LARGE_INTEGER))
                        && actualPasswordLastSetInt.Equals(expectedPasswordLastSet);

                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        @"Verify MS-NRPC_R104474,
                        actual PasswordLastSet: {0},
                        expected PasswordLastSet: {1}",
                        actualPasswordLastSetInt,
                        expectedPasswordLastSet);

                    // Verify MS-NRPC requirement:  MS-NRPC_R104474.
                    Site.CaptureRequirementIfIsTrue(
                        isPasswordLastSetValid,
                        "MS-PAC",
                        104474,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]PasswordLastSet:  A FILETIME structure
                        that contains the user account's pwdLastSet attribute ([MS-ADA3] section 2.174) value
                        for interactive logon");
                }

                _OLD_LARGE_INTEGER passwordCanChange = validationSamInfo.PasswordCanChange;

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonInteractiveInformation)
                {
                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        "Verify MS-NRPC_R104479");

                    // Verify MS-NRPC requirement:  MS-NRPC_R104479.
                    // Type _OLD_LARGE_INTEGER in NRPC is corresponding to type FILETIME in PAC.
                    // It's only used to verify the type not the content because other
                    // protocol is used to get the content.
                    Site.CaptureRequirementIfAreEqual<Type>(
                        typeof(_OLD_LARGE_INTEGER),
                        passwordCanChange.GetType(),
                        "MS-PAC",
                        104479,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]PasswordCanChange: A FILETIME structure that
                        contains the time at which the client's password is allowed to change for interactive logon");
                }

                _OLD_LARGE_INTEGER passwordMustChange = validationSamInfo.PasswordMustChange;

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonInteractiveInformation)
                {
                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        "Verify MS-NRPC_R104483");

                    // Verify MS-NRPC requirement:  MS-NRPC_R104483.
                    // Type _OLD_LARGE_INTEGER in NRPC is corresponding to type FILETIME in PAC.
                    // It's only used to verify the type not the content because other
                    // protocol is used to get the content.
                    Site.CaptureRequirementIfAreEqual<Type>(
                        typeof(_OLD_LARGE_INTEGER),
                        passwordMustChange.GetType(),
                        "MS-PAC",
                        104483,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]PasswordMustChange: A FILETIME structure that
                        contains the time at which the client's password expires for interactive logon.");
                }

                _RPC_UNICODE_STRING effectiveName = validationSamInfo.EffectiveName;

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonInteractiveInformation)
                {
                    // Convert the _RPC_UNICODE_STRING structure to string.
                    string actualEffectiveName = GetRpcUnicodeString(effectiveName);
                    bool isEffectiveNameValid;
                    if (null == expectedEffectiveName)
                    {
                        isEffectiveNameValid = null == actualEffectiveName;
                    }
                    else
                    {
                        isEffectiveNameValid = (effectiveName.GetType() == typeof(_RPC_UNICODE_STRING))
                            && actualEffectiveName.Equals(expectedEffectiveName, StringComparison.OrdinalIgnoreCase);
                    }

                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        @"Verify MS-NRPC_R104488,
                        actual EffectiveName: {0},
                        expected EffectiveName: {1}",
                        actualEffectiveName,
                        expectedEffectiveName);

                    // Verify MS-NRPC requirement:  MS-NRPC_R104488.
                    Site.CaptureRequirementIfIsTrue(
                        isEffectiveNameValid,
                        "MS-PAC",
                        104488,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]EffectiveName:  A RPC_UNICODE_STRING structure
                        that contains the user account's samAccountName attribute ([MS-ADA3] section 2.221) value for
                        interactive logon");
                }

                _RPC_UNICODE_STRING fullName = validationSamInfo.FullName;

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonInteractiveInformation)
                {
                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        "Verify MS-NRPC_R104491");

                    // Verify MS-NRPC requirement:  MS-NRPC_R104491.
                    // It's only used to verify the type not the content because other
                    // protocol is used to get the content.
                    Site.CaptureRequirementIfAreEqual<Type>(
                        typeof(_RPC_UNICODE_STRING),
                        fullName.GetType(),
                        "MS-PAC",
                        104491,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]FullName:  A RPC_UNICODE_STRING structure
                        that contains the user account's full name for interactive logon");
                }

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonNetworkInformation)
                {
                    // Verify requirement : MS-NRPC_R104492, MS-NRPC_R104493.
                    string isR104492Implemented = Site.Properties["MS_NRPC.SHOULDMAY.R104492Implementation"];
                    if (PDCIsWindows)
                    {
                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104493,
                            FullName.Length: {0}",
                            fullName.Length);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104493.
                        Site.CaptureRequirementIfAreEqual<ushort>(
                            0,
                            fullName.Length,
                            "MS-PAC",
                            104493,
                            @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]FullName: in Windows,[it] is zero
                            for network logon.");

                        if (null == isR104492Implemented)
                        {
                            Site.Properties.Add("MS_NRPC.SHOULDMAY.R104492Implementation", bool.TrueString);
                            isR104492Implemented = bool.TrueString;
                        }
                    }

                    if (null != isR104492Implemented)
                    {
                        bool implement = bool.Parse(isR104492Implemented);
                        bool isSatisfied = fullName.Length == 0;

                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104492,
                            FullName.Length: {0}",
                            fullName.Length);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104492.
                        Site.CaptureRequirementIfAreEqual<bool>(
                            implement,
                            isSatisfied,
                            "MS-PAC",
                            104492,
                            string.Format(CultureInfo.InvariantCulture, 
                                @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]FullName:
                                SHOULD be zero for network logon.
                                This requirement is {0} implemented.",
                                implement ? string.Empty : "not"));
                    }
                }

                _RPC_UNICODE_STRING profilePath = validationSamInfo.ProfilePath;

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonInteractiveInformation)
                {
                    // Convert the _RPC_UNICODE_STRING structure to string.
                    string actualProfilePath = GetRpcUnicodeString(profilePath);
                    bool isProfilePathValid;
                    if (null == expectedProfilePath)
                    {
                        isProfilePathValid = null == actualProfilePath;
                    }
                    else
                    {
                        isProfilePathValid = (profilePath.GetType() == typeof(_RPC_UNICODE_STRING))
                           && actualProfilePath.Equals(expectedProfilePath, StringComparison.OrdinalIgnoreCase);
                    }

                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        @"Verify MS-NRPC_R104498,
                        actual ProfilePath: {0},
                        expected ProfilePath: {1}",
                        actualProfilePath,
                        expectedProfilePath);

                    // Verify MS-NRPC requirement:  MS-NRPC_R104498.
                    Site.CaptureRequirementIfIsTrue(
                        isProfilePathValid,
                        "MS-PAC",
                        104498,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ProfilePath: A RPC_UNICODE_STRING structure
                        that contains the user account's profilePath attribute ([MS-ADA3] section 2.166) value for
                        interactive logon");
                }

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonNetworkInformation)
                {
                    // Verify requirement : MS-NRPC_R104500, MS-NRPC_R104501.
                    string isR104500Implemented = Site.Properties["MS_NRPC.SHOULDMAY.R104500Implementation"];
                    if (PDCIsWindows)
                    {
                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104501,
                            ProfilePath.Length: {0}",
                            profilePath.Length);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104501.
                        Site.CaptureRequirementIfAreEqual<ushort>(
                            0,
                            profilePath.Length,
                            "MS-PAC",
                            104501,
                            @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ProfilePath: in Windows,[it] is zero
                            for network logon.");

                        if (null == isR104500Implemented)
                        {
                            Site.Properties.Add("MS_NRPC.SHOULDMAY.R104500Implementation", bool.TrueString);
                            isR104500Implemented = bool.TrueString;
                        }
                    }

                    if (null != isR104500Implemented)
                    {
                        bool implement = bool.Parse(isR104500Implemented);
                        bool isSatisfied = profilePath.Length == 0;

                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104500,
                            ProfilePath.Length: {0}",
                            profilePath.Length);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104500.
                        Site.CaptureRequirementIfAreEqual<bool>(
                            implement,
                            isSatisfied,
                            "MS-PAC",
                            104500,
                            string.Format(CultureInfo.InvariantCulture, 
                                @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ProfilePath:
                                SHOULD be zero for network logon.
                                This requirement is {0} implemented.",
                                implement ? string.Empty : "not"));
                    }
                }

                _RPC_UNICODE_STRING homeDirectoryDrive = validationSamInfo.HomeDirectoryDrive;

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonInteractiveInformation)
                {
                    // Convert the _RPC_UNICODE_STRING structure to string.
                    string actualHomeDirectoryDrive = GetRpcUnicodeString(homeDirectoryDrive);
                    bool isHomeDirectoryDriveValid;
                    if (null == expectedHomeDirectoryDrive)
                    {
                        isHomeDirectoryDriveValid = null == actualHomeDirectoryDrive;
                    }
                    else
                    {
                        isHomeDirectoryDriveValid = (homeDirectoryDrive.GetType() == typeof(_RPC_UNICODE_STRING))
                            && actualHomeDirectoryDrive.Equals(
                                                                expectedHomeDirectoryDrive,
                                                                StringComparison.OrdinalIgnoreCase);
                    }

                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        @"Verify MS-NRPC_R104507,
                        actual HomeDirectoryDrive: {0},
                        expected HomeDirectoryDrive: {1}",
                        actualHomeDirectoryDrive,
                        expectedHomeDirectoryDrive);

                    // Verify MS-NRPC requirement:  MS-NRPC_R104507.
                    Site.CaptureRequirementIfIsTrue(
                        isHomeDirectoryDriveValid,
                        "MS-PAC",
                        104507,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]HomeDirectoryDrive: A RPC_UNICODE_STRING
                        structure that contains the user account's HomeDrive attribute ([MS-ADA1] section 2.296)
                        value for interactive logon");
                }

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonNetworkInformation)
                {
                    // Verify requirement : NRPC_R104508, MS-NRPC_R104509.
                    string isR104508Implemented = Site.Properties["MS_NRPC.SHOULDMAY.R104508Implementation"];
                    if (PDCIsWindows)
                    {
                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104509,
                            HomeDirectoryDrive.Length: {0}",
                            homeDirectoryDrive.Length);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104509.
                        Site.CaptureRequirementIfAreEqual<ushort>(
                            0,
                            homeDirectoryDrive.Length,
                            "MS-PAC",
                            104509,
                            @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]HomeDirectoryDrive: in Windows,[it] is zero
                            for network logon.");

                        if (null == isR104508Implemented)
                        {
                            Site.Properties.Add("MS_NRPC.SHOULDMAY.R104508Implementation", bool.TrueString);
                            isR104508Implemented = bool.TrueString;
                        }
                    }

                    if (null != isR104508Implemented)
                    {
                        bool implement = bool.Parse(isR104508Implemented);
                        bool isSatisfied = homeDirectoryDrive.Length == 0;

                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104508,
                            HomeDirectoryDrive.Length: {0}",
                            homeDirectoryDrive.Length);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104508.
                        Site.CaptureRequirementIfAreEqual<bool>(
                            implement,
                            isSatisfied,
                            "MS-PAC",
                            104508,
                            string.Format(CultureInfo.InvariantCulture, 
                                @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]HomeDirectoryDrive:
                                SHOULD be zero for network logon.
                                This requirement is {0} implemented.",
                                implement ? string.Empty : "not"));
                    }
                }

                _RPC_UNICODE_STRING homeDirectory = validationSamInfo.HomeDirectory;

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonInteractiveInformation)
                {
                    // Convert the _RPC_UNICODE_STRING structure to string.
                    string actualHomeDirectory = GetRpcUnicodeString(homeDirectory);
                    bool isHomeDirectoryValid;
                    if (null == expectedHomeDirectory)
                    {
                        isHomeDirectoryValid = null == actualHomeDirectory;
                    }
                    else
                    {
                        isHomeDirectoryValid = (homeDirectory.GetType() == typeof(_RPC_UNICODE_STRING))
                           && actualHomeDirectory.Equals(expectedHomeDirectory, StringComparison.OrdinalIgnoreCase);
                    }

                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        "Verify MS-NRPC_R104503");

                    // Verify MS-NRPC requirement:  MS-NRPC_R104503.
                    Site.CaptureRequirementIfIsTrue(
                        isHomeDirectoryValid,
                        "MS-PAC",
                        104503,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]HomeDirectory: A RPC_UNICODE_STRING structure
                        that contains the user account's HomeDirectory attribute ([MS-ADA1] section  2.295) value for
                        interactive logon");
                }

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonNetworkInformation)
                {
                    // Verify requirement : MS-NRPC_R104504, MS-NRPC_R104505.
                    string isR104504Implemented = Site.Properties["MS_NRPC.SHOULDMAY.R104504Implementation"];
                    if (PDCIsWindows)
                    {
                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104505,
                            HomeDirectory.Length: {0}",
                            homeDirectory.Length);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104505.
                        Site.CaptureRequirementIfAreEqual<ushort>(
                            0,
                            homeDirectory.Length,
                            "MS-PAC",
                            104505,
                            @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]HomeDirectory: in Windows,[it]is zero for
                            network logon.");

                        if (null == isR104504Implemented)
                        {
                            Site.Properties.Add("SHOULDMAY.", bool.TrueString);
                            isR104504Implemented = bool.TrueString;
                        }
                    }

                    if (null != isR104504Implemented)
                    {
                        bool implement = bool.Parse(isR104504Implemented);
                        bool isSatisfied = homeDirectory.Length == 0;

                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104504,
                            HomeDirectory.Length: {0}",
                            homeDirectory.Length);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104504.
                        Site.CaptureRequirementIfAreEqual<bool>(
                            implement,
                            isSatisfied,
                            "MS-PAC",
                            104504,
                            string.Format(CultureInfo.InvariantCulture, 
                                @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]HomeDirectory:
                                SHOULD be zero for network logon.
                                This requirement is {0} implemented.",
                                implement ? string.Empty : "not"));
                    }
                }

                ushort badPasswordCount = validationSamInfo.BadPasswordCount;

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonInteractiveInformation)
                {
                    bool isBadPasswordCountValid = (badPasswordCount.GetType() == typeof(ushort))
                        && badPasswordCount.Equals(expectedBadPasswordCount);

                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        @"Verify MS-NRPC_R104513,
                        actual BadPasswordCount: {0},
                        expected BadPasswordCount: {1}",
                        badPasswordCount,
                        expectedBadPasswordCount);

                    // Verify MS-NRPC requirement:  MS-NRPC_R104513.
                    Site.CaptureRequirementIfIsTrue(
                        isBadPasswordCountValid,
                        "MS-PAC",
                        104513,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]BadPasswordCount: A 16-bit unsigned integer
                        that contains the user account's badPwdCount attribute ([MS-ADA1] section 2.83) value for
                        interactive logon");
                }

                if (logonLevel == _NETLOGON_LOGON_INFO_CLASS.NetlogonNetworkInformation)
                {
                    // Verify requirement : MS-NRPC_R104514, MS-NRPC_R104515.
                    string isR104514Implemented = Site.Properties["MS_NRPC.SHOULDMAY.R104514Implementation"];
                    if (PDCIsWindows)
                    {
                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104515,
                            BadPasswordCount: {0}",
                            badPasswordCount);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104515.
                        Site.CaptureRequirementIfAreEqual<ushort>(
                            0,
                            badPasswordCount,
                            "MS-PAC",
                            104515,
                            @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]BadPasswordCount:In Windows,[it] is zero
                            for network logon.");

                        if (null == isR104514Implemented)
                        {
                            Site.Properties.Add("MS_NRPC.SHOULDMAY.R104514Implementation", bool.TrueString);
                            isR104514Implemented = bool.TrueString;
                        }
                    }

                    if (null != isR104514Implemented)
                    {
                        bool implement = bool.Parse(isR104514Implemented);
                        bool isSatisfied = badPasswordCount == 0;

                        // Add the debug information.
                        Site.Log.Add(
                            LogEntryKind.Debug,
                            @"Verify MS-NRPC_R104514,
                            BadPasswordCount: {0}",
                            badPasswordCount);

                        // Verify MS-NRPC requirement:  MS-NRPC_R104514.
                        Site.CaptureRequirementIfAreEqual<bool>(
                            implement,
                            isSatisfied,
                            "MS-PAC",
                            104514,
                            string.Format(CultureInfo.InvariantCulture, 
                                @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]BadPasswordCount:
                                SHOULD be zero for network logon.
                                This requirement is {0} implemented.",
                                implement ? string.Empty : "not"));
                    }
                }

                if (validationSamInfo.ExtraSids != null)
                {
                    for (int i = 0; i < validationSamInfo.ExtraSids.Length; ++i)
                    {
                        if (hresult == HRESULT.ERROR_SUCCESS)
                        {
                            // Verify MS-NRPC requirement: MS-NRPC_R1608.
                            // Stack has changed pointer to corresponding structure.
                            // This structure is generated based on the IDL from the TD.
                            // If the method using this field as parameter executes successfully,
                            // it indicates that this field is the type defined in the TD.
                            Site.CaptureRequirement(
                                1608,
                                @"[In NETLOGON_SID_AND_ATTRIBUTES structure]Sid: 
                                A pointer to a security identifier (SID).");
                        }
                    }
                }

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R104455");

                // Verify MS-NRPC requirement:  MS-NRPC_R104455.
                // Type _OLD_LARGE_INTEGER in NRPC is corresponding to type FILETIME in PAC.
                Site.CaptureRequirementIfAreEqual<Type>(
                    typeof(_OLD_LARGE_INTEGER),
                    validationSamInfo.LogonTime.GetType(),
                    "MS-PAC",
                    104455,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]LogonTime:  
                    A FILETIME structure that contains the user account's 
                    lastLogon attribute ([MS-ADA1] section 2.351) value.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R104458");

                // Verify MS-NRPC requirement:  MS-NRPC_R104458.
                // Type _OLD_LARGE_INTEGER in NRPC is corresponding to type FILETIME in PAC.
                Site.CaptureRequirementIfAreEqual<Type>(
                    typeof(_OLD_LARGE_INTEGER),
                    validationSamInfo.LogoffTime.GetType(),
                    "MS-PAC",
                    104458,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]LogoffTime:  A FILETIME structure that contains the
                    time the client's logon session should expire.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R104465");

                // Verify MS-NRPC requirement:  MS-NRPC_R104465.
                // Type _OLD_LARGE_INTEGER in NRPC is corresponding to type FILETIME in PAC.
                // It's only used to verify the type not the content because other protocol is used to get the content.
                Site.CaptureRequirementIfAreEqual<Type>(
                    typeof(_OLD_LARGE_INTEGER),
                    validationSamInfo.LogoffTime.GetType(),
                    "MS-PAC",
                    104465,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]KickOffTime:  A FILETIME structure that contains
                    LogoffTime minus the user account's forceLogoff attribute ([MS-ADA1] section 2.233) value.");

                bool isLogonCountValid = (validationSamInfo.LogonCount.GetType() == typeof(ushort))
                    && (validationSamInfo.LogonCount == expectedLogonCount);

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R104512,
                    actual LogonCount: {0},
                    expected LogonCount: {1}",
                    validationSamInfo.LogonCount,
                    expectedLogonCount);

                // Verify MS-NRPC requirement:  MS-NRPC_R104512.
                // The expectedLogonCount is the LogonCount attribute value.
                Site.CaptureRequirementIfIsTrue(
                    isLogonCountValid,
                    "MS-PAC",
                    104512,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]LogonCount: A 16-bit unsigned integer that contains
                    the user account's LogonCount attribute ([MS-ADA1] section 2.375) value.");

                bool isUserIdValid = (validationSamInfo.UserId.GetType() == typeof(uint))
                    && (validationSamInfo.UserId == DomainAdminRid);

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R104516,
                    UserId: {0},
                    accountRid: {1}",
                    validationSamInfo.UserId,
                    DomainAdminRid);

                // Verify MS-NRPC requirement:  MS-NRPC_R104516.
                Site.CaptureRequirementIfIsTrue(
                    isUserIdValid,
                    "MS-PAC",
                    104516,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure ]UserId:  A 32-bit unsigned integer that contains
                    the RID of the account.");

                bool isPrimaryGroupRidValid = (validationSamInfo.PrimaryGroupId.GetType() == typeof(uint))
                    && (validationSamInfo.PrimaryGroupId == PrimaryGroupRid);

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R104518,
                    PrimaryGroupId.: {0},
                    primaryGroupRid: {1}",
                    validationSamInfo.PrimaryGroupId,
                    PrimaryGroupRid);

                // Verify MS-NRPC requirement:  MS-NRPC_R104518.
                Site.CaptureRequirementIfIsTrue(
                    isPrimaryGroupRidValid,
                    "MS-PAC",
                    104518,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure ]PrimaryGroupId:  A 32-bit unsigned integer that
                    contains the RID for the primary group to which this account belongs.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R104519");

                // Verify MS-NRPC requirement:  MS-NRPC_R104519.
                Site.CaptureRequirementIfAreEqual<uint>(
                    validationSamInfo.GroupCount,
                    (uint)validationSamInfo.GroupIds.Length,
                    "MS-PAC",
                    104519,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure ]GroupCount: The number of groups in this list
                    [the list of GROUP_MEMBERSHIP (section 2.2.2) structures] MUST be equal to GroupCount.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R104520");

                // Verify MS-NRPC requirement:  MS-NRPC_R104520.
                Site.CaptureRequirementIfAreEqual<uint>(
                    validationSamInfo.GroupCount,
                    (uint)validationSamInfo.GroupIds.Length,
                    "MS-PAC",
                    104520,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure ]GroupIds:The number of groups in this list MUST be
                    equal to GroupCount.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R104521");

                // Verify MS-NRPC requirement:  MS-NRPC_R104521.
                Site.CaptureRequirementIfAreEqual<Type>(
                    typeof(uint),
                    validationSamInfo.UserFlags.GetType(),
                    "MS-PAC",
                    104521,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]UserFlags:  A 32-bit unsigned integer that contains
                    a set of bit flags that describe the user's logon information.");

                // The value of set A to L bits.
                uint specifiedFlags = (uint)(0x00000001
                    | 0x00000002
                    | 0x00000008
                    | 0x00000020
                    | 0x00000040
                    | 0x00000080
                    | 0x00000100
                    | 0x00000200
                    | 0x00000400
                    | 0x00000800
                    | 0x00001000
                    | 0x00002000);

                uint allOtherFlagValue = validationSamInfo.UserFlags & (~specifiedFlags);

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R104522,
                    UserFlags: {0}",
                    validationSamInfo.UserFlags);

                // Verify MS-NRPC requirement:  MS-NRPC_R104522.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    allOtherFlagValue,
                    "MS-PAC",
                    104522,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure ] UserFlags: All other bits[except the set of
                    A to L bits] MUST be set to zero");

                // Convert LogonDomainName value to string.
                string actualLogonDomainName = GetRpcUnicodeString(validationSamInfo.LogonDomainName);
                bool isLogonDomainNameValid =
                    (validationSamInfo.LogonDomainName.GetType() == typeof(_RPC_UNICODE_STRING))
                    && actualLogonDomainName.Equals(primaryDomainNetBiosName, StringComparison.OrdinalIgnoreCase);

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R104525,
                    actual LogonDomainName: {0},
                    expected LogonDomainName: {1}",
                    actualLogonDomainName,
                    primaryDomainNetBiosName);

                // Verify MS-NRPC requirement:  MS-NRPC_R104525.
                Site.CaptureRequirementIfIsTrue(
                    isLogonDomainNameValid,
                    "MS-PAC",
                    104525,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure ]LogonDomainName:  A RPC_UNICODE_STRING structure
                    that contains the NetBIOS name of the domain to which this account belongs.");

                string actualSid = GetStringFromRpcSid(validationSamInfo.LogonDomainId[0]);

                // LogonDomainId array has only one element.
                bool isLogonDomainIdValid = (validationSamInfo.LogonDomainId.GetType() == typeof(_RPC_SID[]))
                    && actualSid.Equals(PrimaryDomainSID);

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R104526,
                    actual LogonDomainId: {0},
                    expected LogonDomainId: {1}",
                    actualSid,
                    PrimaryDomainSID);

                // Verify MS-NRPC requirement:  MS-NRPC_R104526.
                Site.CaptureRequirementIfIsTrue(
                    isLogonDomainIdValid,
                    "MS-PAC",
                    104526,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure ]LogonDomainId:  A SID structure that contains the SID
                    for the domain specified in LogonDomainName.");

                // Initial the allSidCountInExtraSids to 0.
                int allSidCountInExtraSids = 0;

                // Get all sid count present in ExtraSids.
                for (int i = 0; i < validationSamInfo.ExtraSids.Length; i++)
                {
                    allSidCountInExtraSids += validationSamInfo.ExtraSids[i].Sid.Length;

                    // Verify Attributes member in NETLOGON_SID_AND_ATTRIBUTES structure.
                    this.VerifyAttributesInNetlogonSidAndAttributes(validationSamInfo.ExtraSids[i].Attributes, hresult);
                }

                bool isSidCountValid = (validationSamInfo.SidCount.GetType() == typeof(uint))
                    && (validationSamInfo.SidCount == (uint)allSidCountInExtraSids);

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R104527,
                    SidCount: {0},
                    allSidCount: {1}",
                    validationSamInfo.SidCount,
                    allSidCountInExtraSids);

                // Verify MS-NRPC requirement:  MS-NRPC_R104527.
                Site.CaptureRequirementIfIsTrue(
                    isSidCountValid,
                    "MS-PAC",
                    104527,
                    @"[In NETLOGON_VALIDATION_SAM_INFO2 structure]SidCount:  A 32-bit unsigned integer that contains
                    the total number of SIDs present in the ExtraSids member.");

                if (validationSamInfo.SidCount != 0)
                {
                    // Add the debug information.
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        "Verify MS-NRPC_R104528");

                    // Bit D corresponding to the last 6 bit, the value is 0x0020.
                    uint valueDBit = 0x0020;

                    // Verify MS-NRPC requirement:  MS-NRPC_R104528.
                    Site.CaptureRequirementIfAreEqual<uint>(
                        valueDBit,
                        validationSamInfo.UserFlags & valueDBit,
                        "MS-PAC",
                        104528,
                        @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]SidCount: If this member is not zero then the D
                        bit MUST be set in the UserFlags member.");
                }

                // Get the actual logon server name value.
                string actualLogonServerValue = GetRpcUnicodeString(validationSamInfo.LogonServer);

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R104524,
                    actual LogonServer: {0},
                    expected LogonServer: {1}",
                    actualLogonServerValue,
                    Site.Properties["Common.WritableDC1.NetbiosName"]);

                bool isVerifyR104524 = (validationSamInfo.LogonServer.GetType() == typeof(_RPC_UNICODE_STRING))
                    && actualLogonServerValue.Equals(
                                                      Site.Properties["Common.WritableDC1.NetbiosName"],
                                                      StringComparison.OrdinalIgnoreCase);

                // Verify MS-NRPC requirement:  MS-NRPC_R104524.
                // KDC is PDC in our test environment.
                Site.CaptureRequirementIfIsTrue(
                    isVerifyR104524,
                    "MS-PAC",
                    104524,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure ]LogonServer:  A RPC_UNICODE_STRING structure
                    that contains the NetBIOS name of the Kerberos KDC that performed the authentication server
                    (AS) ticket request.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R104529");

                // Verify MS-NRPC requirement:  MS-NRPC_R104529.
                // _NETLOGON_SID_AND_ATTRIBUTES is corresponding to KERB_SID_AND_ATTRIBUTES,
                // it is only used to verify the type not the content.
                Site.CaptureRequirementIfAreEqual<Type>(
                    typeof(_NETLOGON_SID_AND_ATTRIBUTES[]),
                    validationSamInfo.ExtraSids.GetType(),
                    "MS-PAC",
                    104529,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExtraSids: A pointer to a list of
                    KERB_SID_AND_ATTRIBUTES (section 2.2.1) structures that contain a list of SIDs corresponding
                    to groups in domains other than the account domain to which the principal belongs.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R104532");

                // Verify MS-NRPC requirement:  MS-NRPC_R104532.
                // It is only used to verify the type not the content.
                Site.CaptureRequirementIfAreEqual<Type>(
                    typeof(uint),
                    validationSamInfo.UserAccountControl.GetType(),
                    "MS-PAC",
                    104532,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]UserAccountControl:  A 32-bit unsigned integer that
                    contains a set of bit flags that represent information about this account.");

                #region unused string-type dummy fields

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1667");


                // Verify MS-NRPC requirement: MS-NRPC_R1667
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString1.Length,
                    1667,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString1:  MUST contain 0 for the
                    Length field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1668");

                // Verify MS-NRPC requirement: MS-NRPC_R1668.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString1.MaximumLength,
                    1668,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString1:  [MUST contain]0 for the
                    MaximumLength field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R1669,
                    Buffer field of ExpansionString1: expected value is null, actual value: {0}",
                    validationSamInfo.ExpansionString1.Buffer);

                // Verify MS-NRPC requirement: MS-NRPC_R1669.
                Site.CaptureRequirementIfIsNull(
                    validationSamInfo.ExpansionString1.Buffer,
                    1669,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString1:  [MUST contain]NULL for the
                    Buffer field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1672");

                // Verify MS-NRPC requirement: MS-NRPC_R1672.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString2.Length,
                    1672,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString2:  MUST contain 0 for the
                    Length field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1673");

                // Verify MS-NRPC requirement: MS-NRPC_R1673.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString2.MaximumLength,
                    1673,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString2:  [MUST contain]0 for the
                    MaximumLength field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R1674,
                    Buffer field of ExpansionString2: expected value is null, actual value: {0}",
                    validationSamInfo.ExpansionString2.Buffer);

                // Verify MS-NRPC requirement: MS-NRPC_R1674.
                Site.CaptureRequirementIfIsNull(
                    validationSamInfo.ExpansionString2.Buffer,
                    1674,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString2:  [MUST contain]NULL for the
                    Buffer field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1677");

                // Verify MS-NRPC requirement: MS-NRPC_R1677.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString3.Length,
                    1677,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString3:  MUST contain 0 for the
                    Length field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1678");

                // Verify MS-NRPC requirement: MS-NRPC_R1678.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString3.MaximumLength,
                    1678,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString3:  [MUST contain]0 for the
                    MaximumLength field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R1679,
                    Buffer field of ExpansionString3: expected value is null, actual value: {0}",
                    validationSamInfo.ExpansionString3.Buffer);

                // Verify MS-NRPC requirement: MS-NRPC_R1679.
                Site.CaptureRequirementIfIsNull(
                    validationSamInfo.ExpansionString3.Buffer,
                    1679,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString3:  [MUST contain] NULL for the
                    Buffer field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1682");

                // Verify MS-NRPC requirement: MS-NRPC_R1682.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString4.Length,
                    1682,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString4:  MUST contain 0 for the
                    Length field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1683");

                // Verify MS-NRPC requirement: MS-NRPC_R1683.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString4.MaximumLength,
                    1683,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString4:  [MUST contain]0 for the
                    MaximumLength field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R1684,
                    Buffer field of ExpansionString4: expected value is null, actual value: {0}",
                    validationSamInfo.ExpansionString4.Buffer);

                // Verify MS-NRPC requirement: MS-NRPC_R1684.
                Site.CaptureRequirementIfIsNull(
                    validationSamInfo.ExpansionString4.Buffer,
                    1684,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString4:  [MUST contain]NULL for the
                    Buffer field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1687");

                // Verify MS-NRPC requirement: MS-NRPC_RR1687.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString5.Length,
                    1687,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString5:  MUST contain 0 for the
                    Length field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1688");

                // Verify MS-NRPC requirement: MS-NRPC_R1688.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString5.MaximumLength,
                    1688,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString5:  [MUST contain]0 for the
                    MaximumLength field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R1689,
                    Buffer field of ExpansionString5: expected value is null, actual value: {0}",
                    validationSamInfo.ExpansionString5.Buffer);

                // Verify MS-NRPC requirement: MS-NRPC_R1689.
                Site.CaptureRequirementIfIsNull(
                    validationSamInfo.ExpansionString5.Buffer,
                    1689,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString5:  [MUST contain]NULL for the
                    Buffer field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1692");

                // Verify MS-NRPC requirement: MS-NRPC_RR1692.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString6.Length,
                    1692,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString6:  MUST contain 0 for the
                    Length field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1693");

                // Verify MS-NRPC requirement: MS-NRPC_R1693.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString6.MaximumLength,
                    1693,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString6:  [MUST contain]0 for the
                    MaximumLength field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R1694,
                    Buffer field of ExpansionString6: expected value is null, actual value: {0}",
                    validationSamInfo.ExpansionString6.Buffer);

                // Verify MS-NRPC requirement: MS-NRPC_R1694.
                Site.CaptureRequirementIfIsNull(
                    validationSamInfo.ExpansionString6.Buffer,
                    1694,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString6:  [MUST contain]NULL for the
                    Buffer field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1697");

                // Verify MS-NRPC requirement: MS-NRPC_RR1697.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString7.Length,
                    1697,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString7:  MUST contain 0 for the
                    Length field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1698");

                // Verify MS-NRPC requirement: MS-NRPC_R1698.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString7.MaximumLength,
                    1698,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString7:  [MUST contain]0 for the
                    MaximumLength field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R1699,
                    Buffer field of ExpansionString7: expected value is null, actual value: {0}",
                    validationSamInfo.ExpansionString7.Buffer);

                // Verify MS-NRPC requirement: MS-NRPC_R1699.
                Site.CaptureRequirementIfIsNull(
                    validationSamInfo.ExpansionString7.Buffer,
                    1699,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString7:  [MUST contain]NULL for the
                    Buffer field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1702");

                // Verify MS-NRPC requirement: MS-NRPC_R1702.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString8.Length,
                    1702,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString8:  MUST contain 0 for the
                    Length field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1703");

                // Verify MS-NRPC requirement: MS-NRPC_R1703.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString8.MaximumLength,
                    1703,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString8:  [MUST contain]0 for the
                    MaximumLength field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R1704,
                    Buffer field of ExpansionString8: expected value is null, actual value is {0}",
                    validationSamInfo.ExpansionString8.Buffer);

                // Verify MS-NRPC requirement: MS-NRPC_R1704.
                Site.CaptureRequirementIfIsNull(
                    validationSamInfo.ExpansionString8.Buffer,
                    1704,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString8:  [MUST contain]NULL for the
                    Buffer field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1707");

                // Verify MS-NRPC requirement: MS-NRPC_R1707.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString9.Length,
                    1707,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString9:  MUST contain 0 for the
                    Length field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1708");

                // Verify MS-NRPC requirement: MS-NRPC_R1708.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString9.MaximumLength,
                    1708,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString9:  [MUST contain]0 for the
                    MaximumLength field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R1709,
                    Buffer field of ExpansionString9: expected value is null, actual value is {0}",
                    validationSamInfo.ExpansionString9.Buffer);

                // Verify MS-NRPC requirement: MS-NRPC_R1709.
                Site.CaptureRequirementIfIsNull(
                    validationSamInfo.ExpansionString9.Buffer,
                    1709,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString9:  [MUST contain]NULL for the
                    Buffer field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1712");

                // Verify MS-NRPC requirement: MS-NRPC_R1712.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString10.Length,
                    1712,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString10:  MUST contain 0 for the
                    Length field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    "Verify MS-NRPC_R1713");

                // Verify MS-NRPC requirement: MS-NRPC_R1713.
                Site.CaptureRequirementIfAreEqual<uint>(
                    0,
                    validationSamInfo.ExpansionString10.MaximumLength,
                    1713,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString10:  [MUST contain]0 for the
                    MaximumLength field.");

                // Add the debug information.
                Site.Log.Add(
                    LogEntryKind.Debug,
                    @"Verify MS-NRPC_R1714,
                    Buffer field of ExpansionString10: expected value is null, actual value: {0}",
                    validationSamInfo.ExpansionString10.Buffer);

                // Verify MS-NRPC requirement: MS-NRPC_R1714.
                Site.CaptureRequirementIfIsNull(
                    validationSamInfo.ExpansionString10.Buffer,
                    1714,
                    @"[In NETLOGON_VALIDATION_SAM_INFO4 structure]ExpansionString10:  [MUST contain] NULL for the
                    Buffer field.");

                #endregion
            }
        }