Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6329d0d4
Commit
6329d0d4
authored
Apr 20, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Apr 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Avoid the use of SetFilePointerEx in _lseeki64.
parent
0a23fc7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
file.c
dlls/msvcrt/file.c
+6
-3
No files found.
dlls/msvcrt/file.c
View file @
6329d0d4
...
...
@@ -863,7 +863,7 @@ void msvcrt_free_io(void)
__int64
CDECL
MSVCRT__lseeki64
(
int
fd
,
__int64
offset
,
int
whence
)
{
HANDLE
hand
=
msvcrt_fdtoh
(
fd
);
LARGE_INTEGER
ofs
,
ret
;
LARGE_INTEGER
ofs
;
TRACE
(
":fd (%d) handle (%p)
\n
"
,
fd
,
hand
);
if
(
hand
==
INVALID_HANDLE_VALUE
)
...
...
@@ -881,13 +881,16 @@ __int64 CDECL MSVCRT__lseeki64(int fd, __int64 offset, int whence)
(
whence
==
SEEK_CUR
)
?
"SEEK_CUR"
:
(
whence
==
SEEK_END
)
?
"SEEK_END"
:
"UNKNOWN"
);
/* The MoleBox protection scheme expects msvcrt to use SetFilePointer only,
* so a LARGE_INTEGER offset cannot be passed directly via SetFilePointerEx. */
ofs
.
QuadPart
=
offset
;
if
(
SetFilePointerEx
(
hand
,
ofs
,
&
ret
,
whence
))
if
((
ofs
.
LowPart
=
SetFilePointer
(
hand
,
ofs
.
LowPart
,
&
ofs
.
HighPart
,
whence
))
!=
INVALID_SET_FILE_POINTER
||
GetLastError
()
==
ERROR_SUCCESS
)
{
MSVCRT_fdesc
[
fd
].
wxflag
&=
~
(
WX_ATEOF
|
WX_READEOF
);
/* FIXME: What if we seek _to_ EOF - is EOF set? */
return
ret
.
QuadPart
;
return
ofs
.
QuadPart
;
}
TRACE
(
":error-last error (%d)
\n
"
,
GetLastError
());
msvcrt_set_errno
(
GetLastError
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment