summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:19:07 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:19:07 +0100
commitfa13fc13895ef45bc3fc2dd6186dc2ab04b822b5 (patch)
tree73dc2fd33c3337362eefa3dab8a6b7f6a359573c
parentde48834911c9712950ce557f51c38500741d7d6d (diff)
New prototype for test_NTFS()
-rw-r--r--src/ntfs.c6
-rw-r--r--src/ntfs.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/ntfs.c b/src/ntfs.c
index 89017fe..5c0a14f 100644
--- a/src/ntfs.c
+++ b/src/ntfs.c
@@ -52,7 +52,7 @@ static void ntfs_get_volume_name(disk_t *disk_car, partition_t *partition, const
unsigned int ntfs_sector_size(const struct ntfs_boot_sector *ntfs_header)
{ return (ntfs_header->sector_size[1]<<8)+ntfs_header->sector_size[0]; }
-int check_NTFS(disk_t *disk_car,partition_t *partition,const int verbose,const int dump_ind)
+int check_NTFS(disk_t *disk_car, partition_t *partition, const int verbose, const int dump_ind)
{
unsigned char *buffer=(unsigned char*)MALLOC(DEFAULT_SECTOR_SIZE);
/* log_trace("check_NTFS part_offset=%llu\n",(long long unsigned)partition->part_offset); */
@@ -111,6 +111,7 @@ int recover_NTFS(disk_t *disk_car, const struct ntfs_boot_sector*ntfs_header,par
static void set_NTFS_info(disk_t *disk_car, const struct ntfs_boot_sector*ntfs_header, partition_t *partition)
{
+ partition->upart_type=UP_NTFS;
partition->fsname[0]='\0';
partition->blocksize=ntfs_header->sectors_per_cluster*ntfs_sector_size(ntfs_header);
if(partition->sb_offset==0)
@@ -120,7 +121,7 @@ static void set_NTFS_info(disk_t *disk_car, const struct ntfs_boot_sector*ntfs_h
ntfs_get_volume_name(disk_car, partition, ntfs_header);
}
-int test_NTFS(const disk_t *disk_car,const struct ntfs_boot_sector*ntfs_header, partition_t *partition,const int verbose, const int dump_ind)
+int test_NTFS(const disk_t *disk_car, const struct ntfs_boot_sector*ntfs_header, const partition_t *partition, const int verbose, const int dump_ind)
{
if(le16(ntfs_header->marker)!=0xAA55 ||
le16(ntfs_header->reserved)>0 ||
@@ -180,7 +181,6 @@ int test_NTFS(const disk_t *disk_car,const struct ntfs_boot_sector*ntfs_header,
log_info("Info: size boot_sector %lu, partition %lu\n",(long unsigned)part_size,(long unsigned)(partition->part_size/disk_car->sector_size));
}
}
- partition->upart_type=UP_NTFS;
return 0;
}
diff --git a/src/ntfs.h b/src/ntfs.h
index 173865c..d403679 100644
--- a/src/ntfs.h
+++ b/src/ntfs.h
@@ -241,13 +241,13 @@ typedef struct {
} __attribute__((gcc_struct, __packed__)) TD_INDEX_ROOT;
-int check_NTFS(disk_t *disk_car,partition_t *partition,const int verbose,const int dump_ind);
+int check_NTFS(disk_t *disk_car, partition_t *partition, const int verbose, const int dump_ind);
int log_ntfs2_info(const struct ntfs_boot_sector *nh1, const struct ntfs_boot_sector *nh2);
int log_ntfs_info(const struct ntfs_boot_sector *ntfs_header);
int is_ntfs(const partition_t *partition);
int is_part_ntfs(const partition_t *partition);
int recover_NTFS(disk_t *disk_car, const struct ntfs_boot_sector*ntfs_header,partition_t *partition,const int verbose, const int dump_ind, const int backup);
-int test_NTFS(const disk_t *disk_car,const struct ntfs_boot_sector*ntfs_header, partition_t *partition,const int verbose, const int dump_ind);
+int test_NTFS(const disk_t *disk_car, const struct ntfs_boot_sector*ntfs_header, const partition_t *partition, const int verbose, const int dump_ind);
#define NTFS_GETU8(p) (*(const uint8_t*)(p))
#define NTFS_GETU16(p) (le16(*(const uint16_t*)(p)))
#define NTFS_GETU32(p) (le32(*(const uint32_t*)(p)))