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

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

            this.smbParameters.WordCount = packet.SmbParameters.WordCount;
            this.smbParameters.FID       = packet.SmbParameters.FID;
            this.smbParameters.Mode      = packet.SmbParameters.Mode;
            this.smbParameters.Offset    = packet.SmbParameters.Offset;
            this.smbData.ByteCount       = packet.SmbData.ByteCount;
        }
        /// <summary>
        /// to create a Seek request packet.
        /// </summary>
        /// <param name="messageId">This field SHOULD be the multiplex ID that is used to associate a response with a
        /// request.</param>
        /// <param name="uid">This field SHOULD identify the authenticated instance of the user.</param>
        /// <param name="treeId">This field identifies the subdirectory (or tree) on the server that the client is
        /// accessing.</param>
        /// <param name="flags">An 8-bit field of 1-bit flags describing various features in effect for the
        /// message</param>
        /// <param name="flags2">A 16-bit field of 1-bit flags that represent various features in effect for the
        /// message. Unspecified bits are reserved and MUST be zero.</param>
        /// <param name="fid">The File ID of the open file within which to seek</param>
        /// <param name="mode">The seek mode. Possible values are 0,1,2</param>
        /// <param name="offset">A 32-bit signed long value indicating the file position, relative to the position
        /// indicated in Mode, to which to set the updated file pointer.</param>
        /// <returns>a Seek request packet</returns>
        public SmbSeekRequestPacket CreateSeekRequest(
            ushort messageId,
            ushort uid,
            ushort treeId,
            SmbFlags flags,
            SmbFlags2 flags2,
            ushort fid,
            SeekModeValues mode,
            int offset)
        {
            SmbSeekRequestPacket packet = new SmbSeekRequestPacket();

            packet.SmbHeader = CifsMessageUtils.CreateSmbHeader(SmbCommand.SMB_COM_SEEK,
                messageId, uid, treeId, flags, flags2);

            SMB_COM_SEEK_Request_SMB_Parameters smbParameters = new SMB_COM_SEEK_Request_SMB_Parameters();
            smbParameters.FID = fid;
            smbParameters.Mode = (ushort)mode;
            smbParameters.Offset = offset;
            smbParameters.WordCount = (byte)(Marshal.SizeOf(smbParameters) / NumBytesOfWord);

            SMB_COM_SEEK_Request_SMB_Data smbData = new SMB_COM_SEEK_Request_SMB_Data();
            smbData.ByteCount = 0;

            packet.SmbParameters = smbParameters;
            packet.SmbData = smbData;

            return packet;
        }
        public SmbSeekResponsePacket CreateSeekResponse(
            CifsServerPerConnection connection,
            SmbSeekRequestPacket request)
        {
            SmbSeekResponsePacket response = new SmbSeekResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            SMB_COM_SEEK_Response_SMB_Parameters smbParameters = response.SmbParameters;
            smbParameters.Offset = (uint)request.SmbParameters.Offset;
            smbParameters.WordCount = (byte)(TypeMarshal.GetBlockMemorySize(smbParameters) / 2);
            response.SmbParameters = smbParameters;

            return response;
        }