123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Utilities;
- namespace SMBLibrary.SMB1
- {
-
-
-
-
- public class WriteAndXResponse : SMBAndXCommand
- {
- public const int ParametersLength = 12;
-
-
-
-
- public uint Count;
- public ushort Available;
- public ushort Reserved;
- public WriteAndXResponse() : base()
- {}
- public WriteAndXResponse(byte[] buffer, int offset): base(buffer, offset, false)
- {
- Count = LittleEndianConverter.ToUInt16(this.SMBParameters, 4);
- Available = LittleEndianConverter.ToUInt16(this.SMBParameters, 6);
- ushort countHigh = LittleEndianConverter.ToUInt16(this.SMBParameters, 8);
- Reserved = LittleEndianConverter.ToUInt16(this.SMBParameters, 10);
- Count |= (uint)(countHigh << 16);
- }
- public override byte[] GetBytes(bool isUnicode)
- {
- this.SMBParameters = new byte[ParametersLength];
- ushort counthHigh = (ushort)(Count >> 16);
- LittleEndianWriter.WriteUInt16(this.SMBParameters, 4, (ushort)(Count & 0xFFFF));
- LittleEndianWriter.WriteUInt16(this.SMBParameters, 6, Available);
- LittleEndianWriter.WriteUInt16(this.SMBParameters, 8, counthHigh);
- LittleEndianWriter.WriteUInt16(this.SMBParameters, 10, Reserved);
- return base.GetBytes(isUnicode);
- }
- public override CommandName CommandName
- {
- get
- {
- return CommandName.SMB_COM_WRITE_ANDX;
- }
- }
- }
- }
|