FileID.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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 Utilities;
  9. namespace SMBLibrary.SMB2
  10. {
  11. /// <summary>
  12. /// [MS-SMB2] 2.2.14.1 - SMB2_FILEID
  13. /// </summary>
  14. public struct FileID
  15. {
  16. public const int Length = 16;
  17. public ulong Persistent;
  18. public ulong Volatile;
  19. public FileID(byte[] buffer, int offset)
  20. {
  21. Persistent = LittleEndianConverter.ToUInt64(buffer, offset + 0);
  22. Volatile = LittleEndianConverter.ToUInt64(buffer, offset + 8);
  23. }
  24. public void WriteBytes(byte[] buffer, int offset)
  25. {
  26. LittleEndianWriter.WriteUInt64(buffer, offset + 0, Persistent);
  27. LittleEndianWriter.WriteUInt64(buffer, offset + 8, Volatile);
  28. }
  29. }
  30. }