FileNameAttributeRecord.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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 DiskAccessLibrary.FileSystems.NTFS
  12. {
  13. // FileName attribute is always resident
  14. public class FileNameAttributeRecord : ResidentAttributeRecord // This is the record itself (the data that is contained in the attribute)
  15. {
  16. public const int FixedLength = 0x42;
  17. public FileNameRecord Record;
  18. public FileNameAttributeRecord(byte[] buffer, int offset) : base(buffer, offset)
  19. {
  20. Record = new FileNameRecord(this.Data, 0);
  21. }
  22. public override byte[] GetBytes(int bytesPerCluster)
  23. {
  24. this.Data = Record.GetBytes();
  25. return base.GetBytes(bytesPerCluster);
  26. }
  27. }
  28. }