mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
applied NSPR Bug 1586070 - Read does not advance file position for files larger than 4GB on Win32. (See also bug 70765.) r=kaie
This commit is contained in:
parent
01a4bc1e3b
commit
97ea6ee957
1 changed files with 9 additions and 1 deletions
|
|
@ -2171,6 +2171,7 @@ _PR_MD_READ(PRFileDesc *fd, void *buf, PRInt32 len)
|
|||
int rv, err;
|
||||
LONG hiOffset = 0;
|
||||
LONG loOffset;
|
||||
LARGE_INTEGER offset; /* use for a normalized add of len to offset */
|
||||
|
||||
if (!fd->secret->md.sync_file_io) {
|
||||
PRThread *me = _PR_MD_CURRENT_THREAD();
|
||||
|
|
@ -2286,7 +2287,14 @@ _PR_MD_READ(PRFileDesc *fd, void *buf, PRInt32 len)
|
|||
return -1;
|
||||
}
|
||||
|
||||
SetFilePointer((HANDLE)f, me->md.blocked_io_bytes, 0, FILE_CURRENT);
|
||||
/* Apply the workaround from bug 70765 (see _PR_MD_WRITE)
|
||||
* to the reading code, too. */
|
||||
|
||||
offset.LowPart = me->md.overlapped.overlapped.Offset;
|
||||
offset.HighPart = me->md.overlapped.overlapped.OffsetHigh;
|
||||
offset.QuadPart += me->md.blocked_io_bytes;
|
||||
|
||||
SetFilePointer((HANDLE)f, offset.LowPart, &offset.HighPart, FILE_BEGIN);
|
||||
|
||||
PR_ASSERT(me->io_pending == PR_FALSE);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue