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

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

            this.smbParameters.WordCount = packet.SmbParameters.WordCount;
            this.smbParameters.FID       = packet.SmbParameters.FID;
            this.smbData.ByteCount       = packet.SmbData.ByteCount;
        }
        /// <summary>
        /// server response the create request from client.
        /// </summary>
        /// <param name="treeConnect">the tree connect between server and client</param>
        /// <param name="requestPacket">the request</param>
        /// <returns>The file open object</returns>
        public override IFileServiceServerOpen SendCreateResponse(
            IFileServiceServerTreeConnect treeConnect,
            SmbFamilyPacket requestPacket)
        {
            CifsServerPerConnection cifsConnection = treeConnect.Session.Connection as CifsServerPerConnection;
            IFileServiceServerOpen  open           = null;
            SmbCreateResponsePacket response       = this.cifsServer.CreateDefaultResponse(cifsConnection, requestPacket
                                                                                           as SmbPacket) as SmbCreateResponsePacket;

            if (response != null)
            {
                this.cifsServer.SendPacket(response, cifsConnection);
                open = (treeConnect as CifsServerPerTreeConnect).GetOpen(response.SmbParameters.FID);
            }
            return(open);
        }
        public SmbCreateResponsePacket CreateCreateResponse(
            CifsServerPerConnection connection,
            SmbCreateRequestPacket request)
        {
            SmbCreateResponsePacket response = new SmbCreateResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            SMB_COM_CREATE_Response_SMB_Parameters smbParameters = response.SmbParameters;

            smbParameters.FID = (ushort)connection.GenerateFID();
            smbParameters.WordCount = (byte)(TypeMarshal.GetBlockMemorySize(smbParameters) / 2);
            response.SmbParameters = smbParameters;

            return response;
        }