WriteRawInterimResponse.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  2. *
  3. * You can redistribute this program and/or modify it under the terms of
  4. * the GNU Lesser Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. */
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Text;
  10. using Utilities;
  11. namespace SMBLibrary.SMB1
  12. {
  13. /// <summary>
  14. /// SMB_COM_WRITE_RAW Interim Response
  15. /// </summary>
  16. public class WriteRawInterimResponse : SMB1Command
  17. {
  18. public const ushort ParametersLength = 2;
  19. // Parameters;
  20. public ushort Available;
  21. public WriteRawInterimResponse() : base()
  22. {}
  23. public WriteRawInterimResponse(byte[] buffer, int offset) : base(buffer, offset, false)
  24. {
  25. Available = LittleEndianConverter.ToUInt16(this.SMBParameters, 0);
  26. }
  27. public override byte[] GetBytes(bool isUnicode)
  28. {
  29. this.SMBParameters = new byte[ParametersLength];
  30. LittleEndianWriter.WriteUInt16(this.SMBParameters, 0, Available);
  31. return base.GetBytes(isUnicode);
  32. }
  33. public override CommandName CommandName
  34. {
  35. get
  36. {
  37. return CommandName.SMB_COM_WRITE_RAW;
  38. }
  39. }
  40. }
  41. }