/// <summary>
        /// Deep copy constructor.
        /// </summary>
        public SmbTrans2FindNext2FinalResponsePacket(SmbTrans2FindNext2FinalResponsePacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.trans2Parameters.SearchCount    = packet.trans2Parameters.SearchCount;
            this.trans2Parameters.EndOfSearch    = packet.trans2Parameters.EndOfSearch;
            this.trans2Parameters.EaErrorOffset  = packet.trans2Parameters.EaErrorOffset;
            this.trans2Parameters.LastNameOffset = packet.trans2Parameters.LastNameOffset;

            this.trans2Data.Data    = packet.trans2Data.Data;
            this.informationLevel   = packet.informationLevel;
            this.isResumeKeyExisted = packet.isResumeKeyExisted;
        }
        /// <summary>
        /// Deep copy constructor.
        /// </summary>
        public SmbTrans2FindNext2FinalResponsePacket(SmbTrans2FindNext2FinalResponsePacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.trans2Parameters.SearchCount = packet.trans2Parameters.SearchCount;
            this.trans2Parameters.EndOfSearch = packet.trans2Parameters.EndOfSearch;
            this.trans2Parameters.EaErrorOffset = packet.trans2Parameters.EaErrorOffset;
            this.trans2Parameters.LastNameOffset = packet.trans2Parameters.LastNameOffset;

            this.trans2Data.Data = packet.trans2Data.Data;
            this.informationLevel = packet.informationLevel;
            this.isResumeKeyExisted = packet.isResumeKeyExisted;
        }
        public SmbTrans2FindNext2FinalResponsePacket CreateTrans2FindNext2FinalResponse(
            CifsServerPerConnection connection,
            SmbTrans2FindNext2RequestPacket request,
            ushort endOfSearch,
            Array findInformationLevel)
        {
            if (findInformationLevel != null &&
                !CheckInformationLevel(request.Trans2Parameters.InformationLevel, findInformationLevel))
            {
                throw new InvalidCastException("The findInformationLevel must correspond with "
                    + request.Trans2Parameters.InformationLevel);
            }
            bool isResumeKeyExisted = (request.Trans2Parameters.Flags & Trans2FindFlags.SMB_FIND_RETURN_RESUME_KEYS)
                == Trans2FindFlags.SMB_FIND_RETURN_RESUME_KEYS;
            SmbTrans2FindNext2FinalResponsePacket response = new SmbTrans2FindNext2FinalResponsePacket(
                request.Trans2Parameters.InformationLevel, isResumeKeyExisted);
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            TRANS2_FIND_NEXT2_Response_Trans2_Parameters trans2Parameters = response.Trans2Parameters;
            trans2Parameters.SearchCount = (ushort)(findInformationLevel != null ? findInformationLevel.Length : 0);
            trans2Parameters.EndOfSearch = endOfSearch;
            response.Trans2Parameters = trans2Parameters;

            TRANS2_FIND_NEXT2_Response_Trans2_Data trans2Data = response.Trans2Data;
            trans2Data.Data = findInformationLevel;
            response.Trans2Data = trans2Data;

            response.UpdateCountAndOffset();

            return response;
        }