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:
Diffstat (limited to 'src/upcase_table.rs')
-rw-r--r--src/upcase_table.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/upcase_table.rs b/src/upcase_table.rs
index 29796c7..5451656 100644
--- a/src/upcase_table.rs
+++ b/src/upcase_table.rs
@@ -36,7 +36,14 @@ impl UpcaseTable {
{
// Lookup the $UpCase file and its $DATA attribute.
let upcase_file = ntfs.file(fs, KnownNtfsFileRecordNumber::UpCase as u64)?;
- let data_attribute = upcase_file.attribute_by_ty(NtfsAttributeType::Data)?;
+ let data_item = upcase_file
+ .data(fs, "")
+ .ok_or(NtfsError::AttributeNotFound {
+ position: upcase_file.position(),
+ ty: NtfsAttributeType::Data,
+ })??;
+
+ let data_attribute = data_item.to_attribute();
if data_attribute.value_length() != UPCASE_TABLE_SIZE {
return Err(NtfsError::InvalidUpcaseTableSize {
expected: UPCASE_TABLE_SIZE,