FileAllocationInformation.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Copyright (C) 2014-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 System.Text;
  10. using Utilities;
  11. namespace SMBLibrary
  12. {
  13. /// <summary>
  14. /// [MS-FSCC] 2.4.4 - FileAllocationInformation
  15. /// </summary>
  16. public class FileAllocationInformation : FileInformation
  17. {
  18. public const int FixedLength = 8;
  19. public long AllocationSize;
  20. public FileAllocationInformation()
  21. {
  22. }
  23. public FileAllocationInformation(byte[] buffer, int offset)
  24. {
  25. AllocationSize = LittleEndianConverter.ToInt64(buffer, offset);
  26. }
  27. public override void WriteBytes(byte[] buffer, int offset)
  28. {
  29. LittleEndianWriter.WriteInt64(buffer, offset, AllocationSize);
  30. }
  31. public override FileInformationClass FileInformationClass
  32. {
  33. get
  34. {
  35. return FileInformationClass.FileAllocationInformation;
  36. }
  37. }
  38. public override int Length
  39. {
  40. get
  41. {
  42. return FixedLength;
  43. }
  44. }
  45. }
  46. }