/// <summary>
        /// Deep copy constructor.
        /// </summary>
        public SmbQueryInformation2RequestPacket(SmbQueryInformation2RequestPacket 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 SmbQueryInformation2RequestPacket(SmbQueryInformation2RequestPacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.smbParameters.WordCount = packet.SmbParameters.WordCount;
            this.smbParameters.FID = packet.SmbParameters.FID;
            this.smbData.ByteCount = packet.SmbData.ByteCount;
        }
        /// <summary>
        /// to create a QueryInformation2 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">This field MUST be a valid FID that the client has obtained through a previous SMB
        /// command which successfully opened the file</param>
        /// <returns>a QueryInformation2 request packet</returns>
        public SmbQueryInformation2RequestPacket CreateQueryInformation2Request(
            ushort messageId,
            ushort uid,
            ushort treeId,
            SmbFlags flags,
            SmbFlags2 flags2,
            ushort fid)
        {
            SmbQueryInformation2RequestPacket packet = new SmbQueryInformation2RequestPacket();

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

            SMB_COM_QUERY_INFORMATION2_Request_SMB_Parameters smbParameters =
                new SMB_COM_QUERY_INFORMATION2_Request_SMB_Parameters();
            smbParameters.FID = fid;
            smbParameters.WordCount = (byte)(Marshal.SizeOf(smbParameters) / NumBytesOfWord);

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

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

            return packet;
        }
        public SmbQueryInformation2ResponsePacket CreateQueryInformation2Response(
            CifsServerPerConnection connection,
            SmbQueryInformation2RequestPacket request,
            SmbDate createDate,
            SmbTime createTime,
            SmbDate lastAccessDate,
            SmbTime lastAccessTime,
            SmbDate lastWriteDate,
            SmbTime lastWriteTime,
            uint fileDataSize,
            uint fileAllocationSize,
            SmbFileAttributes fileAttributes)
        {
            SmbQueryInformation2ResponsePacket response = new SmbQueryInformation2ResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            SMB_COM_QUERY_INFORMATION2_Response_SMB_Parameters smbParameters = response.SmbParameters;
            smbParameters.CreateDate = createDate;
            smbParameters.CreationTime = createTime;
            smbParameters.LastAccessDate = lastAccessDate;
            smbParameters.LastAccessTime = lastAccessTime;
            smbParameters.LastWriteDate = lastWriteDate;
            smbParameters.LastWriteTime = lastWriteTime;
            smbParameters.FileDataSize = fileDataSize;
            smbParameters.FileAllocationSize = fileAllocationSize;
            smbParameters.FileAttributes = fileAttributes;
            smbParameters.WordCount = (byte)(TypeMarshal.GetBlockMemorySize(smbParameters) / 2);
            response.SmbParameters = smbParameters;

            return response;
        }