TransactionWriteNamedPipeResponse.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Copyright (C) 2014-2019 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. /// TRANS_WRITE_NMPIPE Response
  15. /// </summary>
  16. public class TransactionWriteNamedPipeResponse : TransactionSubcommand
  17. {
  18. public const int ParametersLength = 2;
  19. // Parameters;
  20. public ushort BytesWritten;
  21. public TransactionWriteNamedPipeResponse() : base()
  22. {}
  23. public TransactionWriteNamedPipeResponse(byte[] parameters) : base()
  24. {
  25. BytesWritten = LittleEndianConverter.ToUInt16(parameters, 0);
  26. }
  27. public override byte[] GetParameters()
  28. {
  29. return LittleEndianConverter.GetBytes(BytesWritten);
  30. }
  31. public override TransactionSubcommandName SubcommandName
  32. {
  33. get
  34. {
  35. return TransactionSubcommandName.TRANS_WRITE_NMPIPE;
  36. }
  37. }
  38. }
  39. }