NTTransactQuerySecurityDescriptorResponse.cs 1.4 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. /// NTTransactQuerySecurityDescription Response
  15. /// </summary>
  16. public class NTTransactQuerySecurityDescriptorResponse : NTTransactSubcommand
  17. {
  18. public const uint ParametersLength = 4;
  19. // Parameters:
  20. public uint LengthNeeded; // We might return STATUS_BUFFER_OVERFLOW without the SecurityDescriptor field
  21. // Data
  22. public SecurityDescriptor SecurityDescriptor;
  23. public NTTransactQuerySecurityDescriptorResponse()
  24. {
  25. }
  26. public NTTransactQuerySecurityDescriptorResponse(byte[] parameters, byte[] data)
  27. {
  28. LengthNeeded = LittleEndianConverter.ToUInt32(parameters, 0);
  29. if (data.Length == LengthNeeded)
  30. {
  31. SecurityDescriptor = new SecurityDescriptor(data, 0);
  32. }
  33. }
  34. public override NTTransactSubcommandName SubcommandName
  35. {
  36. get
  37. {
  38. return NTTransactSubcommandName.NT_TRANSACT_QUERY_SECURITY_DESC;
  39. }
  40. }
  41. }
  42. }