Browse Source

[iso] add udf_setpos() support in libcdio

* This is needed for wimlib libcdio integration.
* Also fix a signed/unsigned warning in iso.c.
pull/2746/head
Pete Batard 3 months ago
parent
commit
c288f2fe57
No known key found for this signature in database GPG Key ID: 38E0CF5E69EDD671
  1. 2
      src/iso.c
  2. 2
      src/libcdio/cdio/udf.h
  3. 14
      src/libcdio/udf/udf_fs.c
  4. 10
      src/rufus.rc

2
src/iso.c

@ -1496,7 +1496,7 @@ int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_f
uprintf("Error reading UDF file %s", iso_file);
goto out;
}
buf_size = (DWORD)MIN(file_length, read_size);
buf_size = (DWORD)MIN(file_length, (int64_t)read_size);
if (!WriteFileWithRetry(file_handle, buf, buf_size, &wr_size, WRITE_RETRIES)) {
uprintf(" Error writing file %s: %s", dest_file, WindowsErrorString());
goto out;

2
src/libcdio/cdio/udf.h

@ -190,6 +190,8 @@ extern "C" {
bool udf_get_lba(const udf_file_entry_t *p_udf_fe,
/*out*/ uint32_t *start, /*out*/ uint32_t *end);
bool udf_setpos(udf_dirent_t* p_udf_dirent, off_t offset);
#ifdef __cplusplus
}
#endif /* __cplusplus */

14
src/libcdio/udf/udf_fs.c

@ -770,3 +770,17 @@ udf_dirent_free(udf_dirent_t *p_udf_dirent)
}
return true;
}
/*!
Seek to a specific offset in a UDF file. Must be a multiple of UDF_BLOCKSIZE.
*/
bool
udf_setpos(udf_dirent_t* p_udf_dirent, off_t offset)
{
if (!p_udf_dirent)
return false;
if (offset % UDF_BLOCKSIZE || offset > uint64_from_le(p_udf_dirent->fe.info_len))
return false;
p_udf_dirent->p_udf->i_position = offset;
return true;
}

10
src/rufus.rc

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 4.8.2236"
CAPTION "Rufus 4.8.2237"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -407,8 +407,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,8,2236,0
PRODUCTVERSION 4,8,2236,0
FILEVERSION 4,8,2237,0
PRODUCTVERSION 4,8,2237,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -426,13 +426,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "4.8.2236"
VALUE "FileVersion", "4.8.2237"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2025 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-4.8.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "4.8.2236"
VALUE "ProductVersion", "4.8.2237"
END
END
BLOCK "VarFileInfo"

Loading…
Cancel
Save