TransactionCallNamedPipeRequest.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_CALL_NMPIPE Request
  15. /// </summary>
  16. public class TransactionCallNamedPipeRequest : TransactionSubcommand
  17. {
  18. // Setup:
  19. public ushort Priority;
  20. // Data:
  21. public byte[] WriteData;
  22. public TransactionCallNamedPipeRequest() : base()
  23. {
  24. }
  25. public TransactionCallNamedPipeRequest(byte[] setup, byte[] data) : base()
  26. {
  27. Priority = LittleEndianConverter.ToUInt16(setup, 2);
  28. WriteData = data;
  29. }
  30. public override byte[] GetSetup()
  31. {
  32. byte[] setup = new byte[4];
  33. LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
  34. LittleEndianWriter.WriteUInt16(setup, 2, Priority);
  35. return setup;
  36. }
  37. public override byte[] GetData(bool isUnicode)
  38. {
  39. return WriteData;
  40. }
  41. public override TransactionSubcommandName SubcommandName
  42. {
  43. get
  44. {
  45. return TransactionSubcommandName.TRANS_CALL_NMPIPE;
  46. }
  47. }
  48. }
  49. }