Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9a4cfbc3
Commit
9a4cfbc3
authored
Dec 05, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use fd critical section in _eof.
parent
d1040304
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
file.c
dlls/msvcrt/file.c
+16
-7
No files found.
dlls/msvcrt/file.c
View file @
9a4cfbc3
...
...
@@ -1081,29 +1081,38 @@ int CDECL MSVCRT__dup(int od)
*/
int
CDECL
MSVCRT__eof
(
int
fd
)
{
ioinfo
*
info
=
get_ioinfo
(
fd
);
DWORD
curpos
,
endpos
;
LONG
hcurpos
,
hendpos
;
HANDLE
hand
=
msvcrt_fdtoh
(
fd
);
TRACE
(
":fd (%d) handle (%p)
\n
"
,
fd
,
hand
);
TRACE
(
":fd (%d) handle (%p)
\n
"
,
fd
,
info
->
handle
);
if
(
hand
==
INVALID_HANDLE_VALUE
)
if
(
info
->
handle
==
INVALID_HANDLE_VALUE
)
{
release_ioinfo
(
info
);
return
-
1
;
}
if
(
get_ioinfo_nolock
(
fd
)
->
wxflag
&
WX_ATEOF
)
return
TRUE
;
if
(
info
->
wxflag
&
WX_ATEOF
)
{
release_ioinfo
(
info
);
return
TRUE
;
}
/* Otherwise we do it the hard way */
hcurpos
=
hendpos
=
0
;
curpos
=
SetFilePointer
(
hand
,
0
,
&
hcurpos
,
FILE_CURRENT
);
endpos
=
SetFilePointer
(
hand
,
0
,
&
hendpos
,
FILE_END
);
curpos
=
SetFilePointer
(
info
->
handle
,
0
,
&
hcurpos
,
FILE_CURRENT
);
endpos
=
SetFilePointer
(
info
->
handle
,
0
,
&
hendpos
,
FILE_END
);
if
(
curpos
==
endpos
&&
hcurpos
==
hendpos
)
{
/* FIXME: shouldn't WX_ATEOF be set here? */
release_ioinfo
(
info
);
return
TRUE
;
}
SetFilePointer
(
hand
,
curpos
,
&
hcurpos
,
FILE_BEGIN
);
SetFilePointer
(
info
->
handle
,
curpos
,
&
hcurpos
,
FILE_BEGIN
);
release_ioinfo
(
info
);
return
FALSE
;
}
...
...
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