Made Xorriso_obtain_indev_readsize() ready for long block adresses

This commit is contained in:
Thomas Schmitt 2024-03-21 09:44:51 +01:00
parent 5e03c659e3
commit 458b0cb3de
5 changed files with 11 additions and 9 deletions

View File

@ -3687,10 +3687,11 @@ int Xorriso_use_immed_bit(struct XorrisO *xorriso, int flag)
}
int Xorriso_obtain_indev_readsize(struct XorrisO *xorriso, uint32_t *blocks,
int Xorriso_obtain_indev_readsize(struct XorrisO *xorriso, off_t *blocks,
int flag)
{
int ret, num_data;
int ret;
off_t num_data;
struct burn_drive_info *dinfo;
struct burn_drive *drive;
enum burn_disc_status s;
@ -3703,7 +3704,7 @@ int Xorriso_obtain_indev_readsize(struct XorrisO *xorriso, uint32_t *blocks,
s= isoburn_disc_get_status(drive);
if(s == BURN_DISC_BLANK)
return(1);
ret= burn_get_read_capacity(drive, &num_data, 0);
ret= burn_get_read_capacity_v2(drive, &num_data, 0);
if(ret <= 0)
return(0);
*blocks= num_data;

View File

@ -1801,7 +1801,8 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
unsigned long int sa_options= 0, partno, id_tag, perms, start_cyl;
unsigned long int part_status, part_type, mbr_start_block, mbr_num_blocks;
unsigned long int partition_offset= 0;
uint32_t high_block= 0, indev_blocks;
uint32_t high_block= 0;
off_t indev_blocks;
char name[24], *textpt, *contentpt, *buf= NULL, part_type_text[37];
char **lines= NULL;
double num[8];
@ -2849,7 +2850,7 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
et_imgs[idx].extract_size <= 0) {
ret= Xorriso_obtain_indev_readsize(xorriso, &indev_blocks, 0);
if(ret > 0) {
if(indev_blocks > et_imgs[idx].lba &&
if(indev_blocks > (off_t) et_imgs[idx].lba &&
indev_blocks - et_imgs[idx].lba <= Xorriso_max_endless_uefi_sizE)
et_imgs[idx].extract_size= indev_blocks - et_imgs[idx].lba;
}

View File

@ -2421,7 +2421,7 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
int quality, bad_extract= 0;
off_t lba, count, blocks, spot;
int data_to_skip= 0;
uint32_t indev_blocks;
off_t indev_blocks;
off_t size= 0, file_base_bytes= 0, file_processed_bytes= 0, img_adr;
off_t new_file_base_bytes, upto_file_bytes, start_byte= 0;
off_t *section_sizes = NULL;
@ -2438,7 +2438,7 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
Xorriso_alloc_meM(section_sizes, off_t, 1);
start_lbas[0]= 0;
ret= Xorriso_obtain_indev_readsize(xorriso, &indev_blocks, 0);
if(ret > 0)
if(ret > 0 && indev_blocks <= 0x7ffffffe)
end_lbas[0]= indev_blocks - 1;
else
end_lbas[0]= 0x7ffffffe;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.03.20.215145"
#define Xorriso_timestamP "2024.03.21.084436"

View File

@ -674,7 +674,7 @@ int Xorriso_make_guid(struct XorrisO *xorriso, char *line, int flag);
int Xorriso_set_libisofs_now(struct XorrisO *xorriso, int flag);
int Xorriso_obtain_indev_readsize(struct XorrisO *xorriso, uint32_t *blocks,
int Xorriso_obtain_indev_readsize(struct XorrisO *xorriso, off_t *blocks,
int flag);
int Xorriso_assess_written_features(struct XorrisO *xorriso, char *mode,