Ejemplo n.º 1
0
        /// <summary>
        /// initialize the MsAvFlags of target info
        /// </summary>
        /// <param name="targetInfo">the target info collection</param>
        private void InitializeMsAvFlags(
            ICollection <AV_PAIR> targetInfo
            )
        {
            // update the MsvAvFlags of targetInfo
            if (NlmpUtility.AvPairContains(targetInfo, AV_PAIR_IDs.MsvAvFlags))
            {
                uint value = NlmpUtility.BytesToSecurityUInt32(
                    NlmpUtility.AvPairGetValue(targetInfo, AV_PAIR_IDs.MsvAvFlags)
                    );
                // if AvId field set to MsvAvFlags, set the 0x02 bit to 1.
                value |= 0x02;
                byte[] newValue = NlmpUtility.SecurityUInt32GetBytes(value);

                NlmpUtility.UpdateAvPair(targetInfo, AV_PAIR_IDs.MsvAvFlags, (ushort)newValue.Length, newValue);
            }
            else
            {
                // if AvId field set to MsvAvFlags, set the 0x02 bit to 1.
                uint   value    = 0x02;
                byte[] newValue = NlmpUtility.SecurityUInt32GetBytes(value);
                NlmpUtility.AddAVPair(targetInfo, AV_PAIR_IDs.MsvAvFlags, (ushort)newValue.Length, newValue);
            }
        }