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
ffdd16cc
Commit
ffdd16cc
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 _locking.
parent
9a4cfbc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
file.c
dlls/msvcrt/file.c
+13
-7
No files found.
dlls/msvcrt/file.c
View file @
ffdd16cc
...
...
@@ -1252,16 +1252,20 @@ void CDECL MSVCRT__unlock_file(MSVCRT_FILE *file)
*/
int
CDECL
MSVCRT__locking
(
int
fd
,
int
mode
,
LONG
nbytes
)
{
ioinfo
*
info
=
get_ioinfo
(
fd
);
BOOL
ret
;
DWORD
cur_locn
;
HANDLE
hand
=
msvcrt_fdtoh
(
fd
);
TRACE
(
":fd (%d) handle (%p)
\n
"
,
fd
,
hand
);
if
(
hand
==
INVALID_HANDLE_VALUE
)
TRACE
(
":fd (%d) handle (%p)
\n
"
,
fd
,
info
->
handle
);
if
(
info
->
handle
==
INVALID_HANDLE_VALUE
)
{
release_ioinfo
(
info
);
return
-
1
;
}
if
(
mode
<
0
||
mode
>
4
)
{
release_ioinfo
(
info
);
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
return
-
1
;
}
...
...
@@ -1274,8 +1278,9 @@ int CDECL MSVCRT__locking(int fd, int mode, LONG nbytes)
(
mode
==
MSVCRT__LK_NBRLCK
)
?
"_LK_NBRLCK"
:
"UNKNOWN"
);
if
((
cur_locn
=
SetFilePointer
(
hand
,
0L
,
NULL
,
SEEK_CUR
))
==
INVALID_SET_FILE_POINTER
)
if
((
cur_locn
=
SetFilePointer
(
info
->
handle
,
0L
,
NULL
,
SEEK_CUR
))
==
INVALID_SET_FILE_POINTER
)
{
release_ioinfo
(
info
);
FIXME
(
"Seek failed
\n
"
);
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
/* FIXME */
return
-
1
;
...
...
@@ -1286,16 +1291,17 @@ int CDECL MSVCRT__locking(int fd, int mode, LONG nbytes)
ret
=
1
;
/* just to satisfy gcc */
while
(
nretry
--
)
{
ret
=
LockFile
(
hand
,
cur_locn
,
0L
,
nbytes
,
0L
);
ret
=
LockFile
(
info
->
handle
,
cur_locn
,
0L
,
nbytes
,
0L
);
if
(
ret
)
break
;
Sleep
(
1
);
}
}
else
if
(
mode
==
MSVCRT__LK_UNLCK
)
ret
=
UnlockFile
(
hand
,
cur_locn
,
0L
,
nbytes
,
0L
);
ret
=
UnlockFile
(
info
->
handle
,
cur_locn
,
0L
,
nbytes
,
0L
);
else
ret
=
LockFile
(
hand
,
cur_locn
,
0L
,
nbytes
,
0L
);
ret
=
LockFile
(
info
->
handle
,
cur_locn
,
0L
,
nbytes
,
0L
);
/* FIXME - what about error settings? */
release_ioinfo
(
info
);
return
ret
?
0
:
-
1
;
}
...
...
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