Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Turns out that we won't use this enum for anything else than attribute values, and `Slice` always corresponds to a resident attribute value, so reflect that in the naming.
Index keys still use slices without this enum.
|
|
This makes `NtfsFile::directory_index` and `NtfsFile::name` work even if the attributes they are looking for are part of an Attribute List.
We keep a fast path for the few attribute types that are always resident.
|
|
This greatly reduces the number of heap allocations when traversing an index.
|
|
This prevents naming collisions with NTFS fields called "data".
|
|
This is where things get dirty. As NTFS requires us to fix up records, we can't continue our previous design of avoiding dynamic allocations and reading everything on demand via `io::Read`.
Instead, we now read an entire record (usually not larger than 4 KiB), fix it up, and store it in a `Vec`.
This required changes almost everywhere.
It should be noted that many non-resident attributes are not part of a record, which is why structured values are now implemented differently depending on the attribute type.
On the plus side, many structures need less borrowing now, which makes them more comfortable to use.
I have also added missing sanity checks with precise errors where appropriate.
|
|
This enables all structured values to access filesystem-wide information such as the cluster size, which will soon be needed for `NtfsIndexAllocation`.
|
|
This introduces a `NewNtfsStructuredValue` trait for the `new` function of all structured values.
Indexes later need that to return the structured value specified by a type parameter.
We also have to pass an explicit length and can't just rely on the end of the passed `NtfsAttributeValue`/`NtfsAttributeValueAttached`.
For structured values of non-resident attributes, we have to store an `NtfsAttributeValue` instead of an absolute byte position, in order to let a structured value read additional data (e.g. the name of an `NtfsFileName`).
The `NtfsAttributeValue` properly moves between data runs while reading.
|
|
|
|
refactor many affected parts.
|
|
|
|
|
|
files, resident attributes, StandardInformation and FileName structures, string and time parsing, with real filesystem tests for all of that.
|