Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/ntfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Finck <colin@reactos.org>2021-05-05 08:14:06 +0300
committerColin Finck <colin@reactos.org>2021-05-05 08:14:06 +0300
commit8ff664400cf226ffc778b19fc42c2c4c5eaea6ae (patch)
tree8cff23bd24cb5fe487d8107756a8208ff6e4b4c0 /src/structured_values/volume_information.rs
parent0402611794e8d86814e25eba8515d00e1685ce4b (diff)
Implement `NtfsAttributeValue::len` and use it for the structured values
Diffstat (limited to 'src/structured_values/volume_information.rs')
-rw-r--r--src/structured_values/volume_information.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/structured_values/volume_information.rs b/src/structured_values/volume_information.rs
index 8b075fa..4dc3cb1 100644
--- a/src/structured_values/volume_information.rs
+++ b/src/structured_values/volume_information.rs
@@ -42,17 +42,16 @@ impl NtfsVolumeInformation {
pub(crate) fn new<T>(
attribute_position: u64,
mut value_attached: NtfsAttributeValueAttached<'_, '_, T>,
- value_length: u64,
) -> Result<Self>
where
T: Read + Seek,
{
- if value_length < VOLUME_INFORMATION_SIZE {
+ if value_attached.len() < VOLUME_INFORMATION_SIZE {
return Err(NtfsError::InvalidAttributeSize {
position: attribute_position,
ty: NtfsAttributeType::StandardInformation,
expected: VOLUME_INFORMATION_SIZE,
- actual: value_length,
+ actual: value_attached.len(),
});
}