diff options
author | Colin Finck <colin@reactos.org> | 2021-05-05 08:14:06 +0300 |
---|---|---|
committer | Colin Finck <colin@reactos.org> | 2021-05-05 08:14:06 +0300 |
commit | 8ff664400cf226ffc778b19fc42c2c4c5eaea6ae (patch) | |
tree | 8cff23bd24cb5fe487d8107756a8208ff6e4b4c0 /src/structured_values/volume_information.rs | |
parent | 0402611794e8d86814e25eba8515d00e1685ce4b (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.rs | 5 |
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(), }); } |