FileFsObjectIdInformation.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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
  11. {
  12. /// <summary>
  13. /// [MS-FSCC] 2.5.6 - FileFsObjectIdInformation
  14. /// </summary>
  15. public class FileFsObjectIdInformation : FileSystemInformation
  16. {
  17. public const int FixedLength = 64;
  18. public Guid ObjectID;
  19. public byte[] ExtendedInfo; //48 bytes
  20. public FileFsObjectIdInformation()
  21. {
  22. ExtendedInfo = new byte[48];
  23. }
  24. public FileFsObjectIdInformation(byte[] buffer, int offset)
  25. {
  26. LittleEndianConverter.ToGuid(buffer, offset + 0);
  27. ExtendedInfo = ByteReader.ReadBytes(buffer, offset + 16, 48);
  28. }
  29. public override void WriteBytes(byte[] buffer, int offset)
  30. {
  31. LittleEndianWriter.WriteGuidBytes(buffer, offset + 0, ObjectID);
  32. ByteWriter.WriteBytes(buffer, offset + 16, ExtendedInfo);
  33. }
  34. public override FileSystemInformationClass FileSystemInformationClass
  35. {
  36. get
  37. {
  38. return FileSystemInformationClass.FileFsObjectIdInformation;
  39. }
  40. }
  41. public override int Length
  42. {
  43. get
  44. {
  45. return FixedLength;
  46. }
  47. }
  48. }
  49. }