summaryrefslogtreecommitdiffstats
path: root/src/ntfs.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-07-18 22:16:08 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-07-18 22:16:08 +0200
commit8585ef8e51b492783c7d4a3125beeacac1d4314a (patch)
treeec8cbc98265f903e2ca2063b78f93eb3c358ad23 /src/ntfs.c
parentcc3bc11be8d37123b2165510fe510c8ca5944385 (diff)
Store disk geometry in cylinders/heads_per_cylinder/sectors_per_head instead of CHS
Diffstat (limited to 'src/ntfs.c')
-rw-r--r--src/ntfs.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/ntfs.c b/src/ntfs.c
index 8f7ded0..2fc893a 100644
--- a/src/ntfs.c
+++ b/src/ntfs.c
@@ -140,20 +140,26 @@ int test_NTFS(const disk_t *disk_car,const struct ntfs_boot_sector*ntfs_header,
{
log_info("NTFS at %u/%u/%u\n", offset2cylinder(disk_car,partition->part_offset),offset2head(disk_car,partition->part_offset),offset2sector(disk_car,partition->part_offset));
}
- if(le16(ntfs_header->heads)!=disk_car->CHS.head+1)
+ if(le16(ntfs_header->heads)!=disk_car->geom.heads_per_cylinder)
{
- screen_buffer_add("Warning: Incorrect number of heads/cylinder %u (NTFS) != %u (HD)\n",le16(ntfs_header->heads),disk_car->CHS.head+1);
- log_warning("heads/cylinder %u (NTFS) != %u (HD)\n",le16(ntfs_header->heads),disk_car->CHS.head+1);
+ screen_buffer_add("Warning: Incorrect number of heads/cylinder %u (NTFS) != %u (HD)\n",
+ le16(ntfs_header->heads), disk_car->geom.heads_per_cylinder);
+ log_warning("heads/cylinder %u (NTFS) != %u (HD)\n",
+ le16(ntfs_header->heads), disk_car->geom.heads_per_cylinder);
}
- if(le16(ntfs_header->secs_track)!=disk_car->CHS.sector)
+ if(le16(ntfs_header->secs_track)!=disk_car->geom.sectors_per_head)
{
- screen_buffer_add("Warning: Incorrect number of sectors per track %u (NTFS) != %u (HD)\n",le16(ntfs_header->secs_track),disk_car->CHS.sector);
- log_warning("sect/track %u (NTFS) != %u (HD)\n",le16(ntfs_header->secs_track),disk_car->CHS.sector);
+ screen_buffer_add("Warning: Incorrect number of sectors per track %u (NTFS) != %u (HD)\n",
+ le16(ntfs_header->secs_track), disk_car->geom.sectors_per_head);
+ log_warning("sect/track %u (NTFS) != %u (HD)\n",
+ le16(ntfs_header->secs_track), disk_car->geom.sectors_per_head);
}
if(ntfs_sector_size(ntfs_header)!=disk_car->sector_size)
{
- screen_buffer_add("Warning: Incorrect number of bytes per sector %u (NTFS) != %u (HD)\n",ntfs_sector_size(ntfs_header),disk_car->sector_size);
- log_warning("Warning: Incorrect number of bytes per sector %u (NTFS) != %u (HD)\n",ntfs_sector_size(ntfs_header),disk_car->sector_size);
+ screen_buffer_add("Warning: Incorrect number of bytes per sector %u (NTFS) != %u (HD)\n",
+ ntfs_sector_size(ntfs_header), disk_car->sector_size);
+ log_warning("Warning: Incorrect number of bytes per sector %u (NTFS) != %u (HD)\n",
+ ntfs_sector_size(ntfs_header), disk_car->sector_size);
}
if(partition->part_size>0)