Transaction2QueryFSInformationRequest.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. /// TRANS2_QUERY_FS_INFORMATION Request
  15. /// </summary>
  16. public class Transaction2QueryFSInformationRequest : Transaction2Subcommand
  17. {
  18. public int ParametersLength = 2;
  19. public QueryFSInformationLevel InformationLevel;
  20. public Transaction2QueryFSInformationRequest() : base()
  21. {
  22. }
  23. public Transaction2QueryFSInformationRequest(byte[] parameters, byte[] data, bool isUnicode) : base()
  24. {
  25. InformationLevel = (QueryFSInformationLevel)LittleEndianConverter.ToUInt16(parameters, 0);
  26. }
  27. public override byte[] GetSetup()
  28. {
  29. return LittleEndianConverter.GetBytes((ushort)SubcommandName);
  30. }
  31. public override byte[] GetParameters(bool isUnicode)
  32. {
  33. byte[] parameters = new byte[ParametersLength];
  34. LittleEndianWriter.WriteUInt16(parameters, 0, (ushort)InformationLevel);
  35. return parameters;
  36. }
  37. public override Transaction2SubcommandName SubcommandName
  38. {
  39. get
  40. {
  41. return Transaction2SubcommandName.TRANS2_QUERY_FS_INFORMATION;
  42. }
  43. }
  44. }
  45. }