Skip to content

Commit 6629ef0

Browse files
committed
[wue] fix wimlib not being able to modify boot.wim's larger than 2 GB
* Thank the C standard for choosing not to "standardize" the size of long (as one would rightfully expect from a *standard*) and instead going for a "should be at least" super vague definition, that led to lseek() on Windows and UNIX effectively using different offset sizes, and programmers everywhere getting bitten when taking a UNIX codebase and porting it to Windows... * Closes #2837.
1 parent af58b1c commit 6629ef0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/rufus.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
3333
IDD_DIALOG DIALOGEX 12, 12, 232, 326
3434
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
3535
EXSTYLE WS_EX_ACCEPTFILES
36-
CAPTION "Rufus 4.12.2290"
36+
CAPTION "Rufus 4.12.2291"
3737
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
3838
BEGIN
3939
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@@ -408,8 +408,8 @@ END
408408
//
409409

410410
VS_VERSION_INFO VERSIONINFO
411-
FILEVERSION 4,12,2290,0
412-
PRODUCTVERSION 4,12,2290,0
411+
FILEVERSION 4,12,2291,0
412+
PRODUCTVERSION 4,12,2291,0
413413
FILEFLAGSMASK 0x3fL
414414
#ifdef _DEBUG
415415
FILEFLAGS 0x1L
@@ -427,13 +427,13 @@ BEGIN
427427
VALUE "Comments", "https://rufus.ie"
428428
VALUE "CompanyName", "Akeo Consulting"
429429
VALUE "FileDescription", "Rufus"
430-
VALUE "FileVersion", "4.12.2290"
430+
VALUE "FileVersion", "4.12.2291"
431431
VALUE "InternalName", "Rufus"
432432
VALUE "LegalCopyright", "� 2011-2025 Pete Batard (GPL v3)"
433433
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
434434
VALUE "OriginalFilename", "rufus-4.12.exe"
435435
VALUE "ProductName", "Rufus"
436-
VALUE "ProductVersion", "4.12.2290"
436+
VALUE "ProductVersion", "4.12.2291"
437437
END
438438
END
439439
BLOCK "VarFileInfo"

src/wimlib/file_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ off_t filedes_seek(struct filedes *fd, off_t offset)
346346
return -1;
347347
}
348348
if (fd->offset != offset) {
349-
if (lseek(fd->fd, offset, SEEK_SET) == -1)
349+
if (_lseeki64(fd->fd, offset, SEEK_SET) == -1)
350350
return -1;
351351
fd->offset = offset;
352352
}
@@ -360,5 +360,5 @@ bool filedes_is_seekable(struct filedes *fd)
360360
if (fd->is_udf || fd->is_iso)
361361
return false;
362362
#endif
363-
return !fd->is_pipe && lseek(fd->fd, 0, SEEK_CUR) != -1;
363+
return !fd->is_pipe && _lseeki64(fd->fd, 0, SEEK_CUR) != -1;
364364
}

src/wimlib/header.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ read_wim_header(WIMStruct *wim, struct wim_header *hdr)
9090
* actually reading from a pipe. */
9191
if (!in_fd->is_pipe) {
9292
ret = WIMLIB_ERR_READ;
93-
if (-1 == lseek(in_fd->fd, -WIM_HEADER_DISK_SIZE, SEEK_END))
93+
if (-1 == _lseeki64(in_fd->fd, -WIM_HEADER_DISK_SIZE, SEEK_END))
9494
goto read_error;
9595
ret = full_read(in_fd, &disk_hdr, sizeof(disk_hdr));
9696
if (ret)

0 commit comments

Comments
 (0)