New API calls isoburn_igopt_set_gpt_guid(), isoburn_igopt_get_gpt_guid()
This commit is contained in:
@@ -405,7 +405,7 @@ int isoburn_make_iso_write_opts(struct isoburn *out_o,
|
||||
IsoWriteOpts *wopts,
|
||||
int flag)
|
||||
{
|
||||
int ret, rec_mtime, new_img, lba, nwa, i;
|
||||
int ret, rec_mtime, new_img, lba, nwa, i, guid_mode;
|
||||
struct burn_drive *out_d;
|
||||
|
||||
new_img= flag&1;
|
||||
@@ -477,6 +477,10 @@ int isoburn_make_iso_write_opts(struct isoburn *out_o,
|
||||
opts->vol_creation_time, opts->vol_modification_time,
|
||||
opts->vol_expiration_time, opts->vol_effective_time,
|
||||
opts->vol_uuid);
|
||||
guid_mode= opts->gpt_guid_mode;
|
||||
if(opts->vol_uuid[0] == 0 && opts->gpt_guid_mode == 2)
|
||||
guid_mode= 0;
|
||||
iso_write_opts_set_gpt_guid(wopts, opts->gpt_guid, guid_mode);
|
||||
iso_write_opts_attach_jte(wopts, opts->libjte_handle);
|
||||
iso_write_opts_set_hfsp_serial_number(wopts, opts->hfsp_serial_number);
|
||||
|
||||
@@ -1175,6 +1179,8 @@ int isoburn_igopt_new(struct isoburn_imgen_opts **new_o, int flag)
|
||||
o->appended_as_gpt= 0;
|
||||
o->appended_as_apm= 0;
|
||||
o->part_like_isohybrid= 0;
|
||||
memset(o->gpt_guid, 0, 16);
|
||||
o->gpt_guid_mode= 0;
|
||||
memset(o->hfsp_serial_number, 0, 8);
|
||||
o->hfsp_block_size= 0;
|
||||
o->apm_block_size= 0;
|
||||
@@ -1804,6 +1810,32 @@ int isoburn_igopt_get_part_like_isohybrid(struct isoburn_imgen_opts *opts,
|
||||
}
|
||||
|
||||
|
||||
int isoburn_igopt_set_gpt_guid(struct isoburn_imgen_opts *opts,
|
||||
uint8_t guid[16], int mode)
|
||||
{
|
||||
if(mode < 0 || mode > 2) {
|
||||
isoburn_msgs_submit(NULL, 0x00060000,
|
||||
"Unrecognized GPT disk GUID setup mode. (0 ... 2)",
|
||||
0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
opts->gpt_guid_mode= mode;
|
||||
if(opts->gpt_guid_mode == 1)
|
||||
memcpy(opts->gpt_guid, guid, 16);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int isoburn_igopt_get_gpt_guid(struct isoburn_imgen_opts *opts,
|
||||
uint8_t guid[16], int *mode)
|
||||
{
|
||||
if(opts->gpt_guid_mode == 1)
|
||||
memcpy(guid, opts->gpt_guid, 16);
|
||||
*mode = opts->gpt_guid_mode;
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
int isoburn_igopt_set_disc_label(struct isoburn_imgen_opts *opts, char *label)
|
||||
{
|
||||
strncpy(opts->ascii_disc_label, label, Libisoburn_disc_label_sizE - 1);
|
||||
|
Reference in New Issue
Block a user