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:
-rw-r--r--src/error.rs10
-rw-r--r--src/index_record.rs4
2 files changed, 10 insertions, 4 deletions
diff --git a/src/error.rs b/src/error.rs
index fa62d8e..1836be3 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -76,8 +76,14 @@ pub enum NtfsError {
expected: &'static [u8],
actual: [u8; 4],
},
- /// The NTFS index record at byte position {position:#010x} should have a maximum of {expected} bytes, but it indicates {actual} bytes
- InvalidNtfsIndexSize {
+ /// The NTFS index record at byte position {position:#010x} indicates an allocated size of {expected} bytes, but the record only has a size of {actual} bytes
+ InvalidNtfsIndexAllocatedSize {
+ position: u64,
+ expected: u32,
+ actual: u32,
+ },
+ /// The NTFS index record at byte position {position:#010x} indicates a used size of {expected} bytes, but only {actual} bytes are allocated
+ InvalidNtfsIndexUsedSize {
position: u64,
expected: u32,
actual: u32,
diff --git a/src/index_record.rs b/src/index_record.rs
index 5b47aa1..b6120c1 100644
--- a/src/index_record.rs
+++ b/src/index_record.rs
@@ -131,7 +131,7 @@ impl<'n> NtfsIndexRecord<'n> {
// the size defined for all index records of this index.
let total_allocated_size = INDEX_RECORD_HEADER_SIZE + self.index_allocated_size();
if total_allocated_size > index_record_size {
- return Err(NtfsError::InvalidNtfsIndexSize {
+ return Err(NtfsError::InvalidNtfsIndexAllocatedSize {
position: self.record.position(),
expected: index_record_size,
actual: total_allocated_size,
@@ -142,7 +142,7 @@ impl<'n> NtfsIndexRecord<'n> {
// larger than the total allocated size.
let total_used_size = INDEX_RECORD_HEADER_SIZE + self.index_used_size();
if total_used_size > total_allocated_size {
- return Err(NtfsError::InvalidNtfsIndexSize {
+ return Err(NtfsError::InvalidNtfsIndexUsedSize {
position: self.record.position(),
expected: total_allocated_size,
actual: total_used_size,