MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / hd_update_geometry

Function hd_update_geometry

src/hdaccess.c:2034–2056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2032}
2033
2034void hd_update_geometry(disk_t *disk, const int verbose)
2035{
2036 if(disk->autodetect!=0)
2037 {
2038 unsigned char *buffer=(unsigned char *)MALLOC(disk->sector_size);
2039 if((unsigned)disk->pread(disk, buffer, disk->sector_size, 0) == disk->sector_size)
2040 {
2041 if(verbose>1)
2042 {
2043 log_trace("autoset_geometry\n");
2044 }
2045 autoset_geometry(disk,buffer,1);
2046 }
2047 free(buffer);
2048 }
2049#ifdef DJGPP
2050 if(disk->description==disk_description)
2051 {
2052 struct info_disk_struct*data=(struct info_disk_struct*)disk->data;
2053 data->geo_phys.cylinders=disk->geom.cylinders;
2054 }
2055#endif
2056}
2057
2058void hd_update_all_geometry(const list_disk_t * list_disk, const int verbose)
2059{

Callers 3

hd_update_all_geometryFunction · 0.85
change_arch_type_cliFunction · 0.85
change_arch_type_ncursesFunction · 0.85

Calls 2

MALLOCFunction · 0.85
autoset_geometryFunction · 0.85

Tested by

no test coverage detected