Exemple #1
0
 /// <summary>
 /// Deep copy constructor.
 /// </summary>
 public SmbNoAndxCommandResponsePacket(SmbNoAndxCommandResponsePacket packet)
     : base(packet)
 {
     this.InitDefaultValue();
 }
 /// <summary>
 /// Deep copy constructor.
 /// </summary>
 public SmbNoAndxCommandResponsePacket(SmbNoAndxCommandResponsePacket packet)
     : base(packet)
 {
     this.InitDefaultValue();
 }
        public SmbNoAndxCommandResponsePacket CreateNoAndxCommandResponse(
            CifsServerPerConnection connection,
            SmbNoAndxCommandRequestPacket request)
        {
            SmbNoAndxCommandResponsePacket response = new SmbNoAndxCommandResponsePacket();
            SmbHeader smbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            if ((smbHeader.Flags2 & SmbFlags2.SMB_FLAGS2_NT_STATUS) == SmbFlags2.SMB_FLAGS2_NT_STATUS)
            {
                smbHeader.Status = (uint)NTSTATUS.STATUS_SMB_BAD_COMMAND;
            }
            else
            {
                SmbStatus smbStatus = new SmbStatus();
                smbStatus.ErrorClass = SmbErrorClass.ERRSRV;
                smbStatus.Reserved = 0;
                smbStatus.ErrorCode = (ushort)SmbErrorCodeOfERRSRV.ERRbadcmd;
                smbHeader.Status = smbStatus;
            }
            response.SmbHeader = smbHeader;

            return response;
        }