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

            this.trans2Parameters.SID            = packet.trans2Parameters.SID;
            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 SmbTrans2FindFirst2FinalResponsePacket(SmbTrans2FindFirst2FinalResponsePacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.trans2Parameters.SID = packet.trans2Parameters.SID;
            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 SmbTrans2FindFirst2FinalResponsePacket CreateTrans2FindFirst2FinalResponse(
            CifsServerPerConnection connection,
            SmbTrans2FindFirst2RequestPacket request,
            ushort endOfSearch,
            Array findInformationLevel)
        {
            if (findInformationLevel != null &&
                !CheckInformationLevel(request.Trans2Parameters.InformationLevel, findInformationLevel))
            {
                throw new InvalidCastException("The findInformationLevel must correspond with "
                    + request.Trans2Parameters.InformationLevel);
            }

            SmbTrans2FindFirst2FinalResponsePacket response = new SmbTrans2FindFirst2FinalResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            TRANS2_FIND_FIRST2_Response_Trans2_Parameters trans2Parameters = response.Trans2Parameters;
            trans2Parameters.SID = (ushort)connection.GenerateSID();
            trans2Parameters.SearchCount = (ushort)(findInformationLevel != null ? findInformationLevel.Length : 0);
            trans2Parameters.EndOfSearch = endOfSearch;
            response.Trans2Parameters = trans2Parameters;

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

            response.UpdateCountAndOffset();

            return response;
        }