NTTransactNotifyChangeResponse.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Copyright (C) 2017 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 Utilities;
  10. namespace SMBLibrary.SMB1
  11. {
  12. /// <summary>
  13. /// NT_TRANSACT_NOTIFY_CHANGE Response
  14. /// </summary>
  15. public class NTTransactNotifyChangeResponse : NTTransactSubcommand
  16. {
  17. // Parameters:
  18. public byte[] FileNotifyInformationBytes;
  19. public NTTransactNotifyChangeResponse() : base()
  20. {
  21. }
  22. public NTTransactNotifyChangeResponse(byte[] parameters) : base()
  23. {
  24. FileNotifyInformationBytes = parameters;
  25. }
  26. public override byte[] GetParameters(bool isUnicode)
  27. {
  28. return FileNotifyInformationBytes;
  29. }
  30. public List<FileNotifyInformation> GetFileNotifyInformation()
  31. {
  32. return FileNotifyInformation.ReadList(FileNotifyInformationBytes, 0);
  33. }
  34. public void SetFileNotifyInformation(List<FileNotifyInformation> notifyInformationList)
  35. {
  36. FileNotifyInformationBytes = FileNotifyInformation.GetBytes(notifyInformationList);
  37. }
  38. public override NTTransactSubcommandName SubcommandName
  39. {
  40. get
  41. {
  42. return NTTransactSubcommandName.NT_TRANSACT_NOTIFY_CHANGE;
  43. }
  44. }
  45. }
  46. }