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

            this.smbParameters.WordCount = packet.SmbParameters.WordCount;
            this.smbParameters.FID = packet.SmbParameters.FID;
            this.smbParameters.FileAttrs = packet.SmbParameters.FileAttrs;
            this.smbParameters.LastModified = packet.SmbParameters.LastModified;
            this.smbParameters.FileSize = packet.SmbParameters.FileSize;
            this.smbParameters.AccessMode = packet.SmbParameters.AccessMode;
            this.smbData.ByteCount = packet.SmbData.ByteCount;
        }
        /// <summary>
        /// Deep copy constructor.
        /// </summary>
        public SmbOpenResponsePacket(SmbOpenResponsePacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.smbParameters.WordCount    = packet.SmbParameters.WordCount;
            this.smbParameters.FID          = packet.SmbParameters.FID;
            this.smbParameters.FileAttrs    = packet.SmbParameters.FileAttrs;
            this.smbParameters.LastModified = packet.SmbParameters.LastModified;
            this.smbParameters.FileSize     = packet.SmbParameters.FileSize;
            this.smbParameters.AccessMode   = packet.SmbParameters.AccessMode;
            this.smbData.ByteCount          = packet.SmbData.ByteCount;
        }
        public SmbOpenResponsePacket CreateOpenResponse(
            CifsServerPerConnection connection,
            SmbOpenRequestPacket request,
            uint fileSize,
            UTime lastModified)
        {
            SmbOpenResponsePacket response = new SmbOpenResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            SMB_COM_OPEN_Response_SMB_Parameters smbParameters = response.SmbParameters;

            smbParameters.AccessMode = request.SmbParameters.AccessMode;
            smbParameters.FID = (ushort)connection.GenerateFID();
            smbParameters.FileAttrs = request.SmbParameters.SearchAttributes;
            smbParameters.FileSize = fileSize;
            smbParameters.LastModified = lastModified;

            smbParameters.WordCount = (byte)(TypeMarshal.GetBlockMemorySize(smbParameters) / 2);
            response.SmbParameters = smbParameters;

            return response;
        }