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

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

            this.smbParameters.WordCount = packet.SmbParameters.WordCount;
            this.smbParameters.SearchHandle = packet.SmbParameters.SearchHandle;
            this.smbData.ByteCount = packet.SmbData.ByteCount;
        }
        /// <summary>
        /// to create a FindClose2 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="searchHandle">A search handle, also known as a Search ID (SID). This MUST be the SID value
        /// returned in the initial TRANS2_FIND_FIRST2 subcommand request</param>
        /// <returns>a FindClose2 request packet</returns>
        public SmbFindClose2RequestPacket CreateFindClose2Request(
            ushort messageId,
            ushort uid,
            ushort treeId,
            SmbFlags flags,
            SmbFlags2 flags2,
            ushort searchHandle)
        {
            SmbFindClose2RequestPacket packet = new SmbFindClose2RequestPacket();

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

            SMB_COM_FIND_CLOSE2_Request_SMB_Parameters smbParameters =
                new SMB_COM_FIND_CLOSE2_Request_SMB_Parameters();
            smbParameters.SearchHandle = searchHandle;
            smbParameters.WordCount = (byte)(Marshal.SizeOf(smbParameters) / NumBytesOfWord);

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

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

            return packet;
        }
        public SmbFindClose2ResponsePacket CreateFindClose2Response(
            CifsServerPerConnection connection,
            SmbFindClose2RequestPacket request)
        {
            SmbFindClose2ResponsePacket response = new SmbFindClose2ResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            return response;
        }