/// <summary>
 /// Deep copy constructor.
 /// </summary>
 public SmbWriteBulkRequestPacket(SmbWriteBulkRequestPacket packet)
     : base(packet)
 {
     this.InitDefaultValue();
 }
        /// <summary>
        /// to create a WriteBulk 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>
        /// <returns>a WriteBulk request packet</returns>
        public SmbWriteBulkRequestPacket CreateWriteBulkRequest(
            ushort messageId,
            ushort uid,
            ushort treeId,
            SmbFlags flags,
            SmbFlags2 flags2)
        {
            SmbWriteBulkRequestPacket packet = new SmbWriteBulkRequestPacket();

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

            return packet;
        }
 /// <summary>
 /// Deep copy constructor.
 /// </summary>
 public SmbWriteBulkRequestPacket(SmbWriteBulkRequestPacket packet)
     : base(packet)
 {
     this.InitDefaultValue();
 }
        public SmbWriteBulkResponsePacket CreateWriteBulkResponse(
            CifsServerPerConnection connection,
            SmbWriteBulkRequestPacket request)
        {
            SmbWriteBulkResponsePacket response = new SmbWriteBulkResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);
            SmbHeader smbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            if ((smbHeader.Flags2 & SmbFlags2.SMB_FLAGS2_NT_STATUS) == SmbFlags2.SMB_FLAGS2_NT_STATUS)
            {
                smbHeader.Status = (uint)NtStatus.STATUS_NOT_IMPLEMENTED;
            }
            else
            {
                SmbStatus smbStatus = new SmbStatus();
                smbStatus.ErrorClass = SmbErrorClass.ERRDOS;
                smbStatus.Reserved = 0;
                smbStatus.ErrorCode = (ushort)SmbErrorCodeOfERRDOS.ERRbadfunc;
                smbHeader.Status = smbStatus;
            }
            response.SmbHeader = smbHeader;

            return response;
        }