Struct mft::attribute::x20::AttributeListEntry
source · pub struct AttributeListEntry {
pub attribute_type: u32,
pub record_length: u16,
pub name_length: u8,
pub name_offset: u8,
pub lowest_vcn: u64,
pub segment_reference: MftReference,
pub reserved: u16,
pub name: String,
}
Expand description
An AttributeListAttr is made up off multiple AttributeListEntry structs. https://docs.microsoft.com/en-us/windows/win32/devnotes/attribute-list-entry
Fields§
§attribute_type: u32
The attribute code
record_length: u16
This entry length
name_length: u8
Attribute name length (0 means no name)
name_offset: u8
Attribute name offset
lowest_vcn: u64
This member is zero unless the attribute requires multiple file record segments and unless this entry is a reference to a segment other than the first one. In this case, this value is the lowest VCN that is described by the referenced segment.
segment_reference: MftReference
The segments MFT reference
reserved: u16
The attribute’s id
name: String
The attribute’s name
Implementations§
source§impl AttributeListEntry
impl AttributeListEntry
sourcepub fn from_stream<S: Read + Seek>(stream: &mut S) -> Result<AttributeListEntry>
pub fn from_stream<S: Read + Seek>(stream: &mut S) -> Result<AttributeListEntry>
Create AttributeListEntry from a stream.
Example
Parse a raw buffer.
use mft::attribute::x20::AttributeListEntry;
let attribute_buffer: &[u8] = &[
0x10,0x00,0x00,0x00,0x20,0x00,0x00,0x1A,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x23,0x27,0x00,0x00,0x00,0x00,0x01,0x00,
0x00,0x00,0x12,0x07,0x80,0xF8,0xFF,0xFF
];
let attribute_entry = AttributeListEntry::from_stream(
&mut Cursor::new(attribute_buffer)
).unwrap();
assert_eq!(attribute_entry.attribute_type, 16);
assert_eq!(attribute_entry.record_length, 32);
assert_eq!(attribute_entry.name_length, 0);
assert_eq!(attribute_entry.name_offset, 26);
assert_eq!(attribute_entry.lowest_vcn, 0);
assert_eq!(attribute_entry.segment_reference.entry, 10019);
assert_eq!(attribute_entry.segment_reference.sequence, 1);
assert_eq!(attribute_entry.reserved, 0);
assert_eq!(attribute_entry.name, "".to_string());
Trait Implementations§
source§impl Clone for AttributeListEntry
impl Clone for AttributeListEntry
source§fn clone(&self) -> AttributeListEntry
fn clone(&self) -> AttributeListEntry
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more