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
ba757eae
Commit
ba757eae
authored
Jun 04, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use fd critical section in _write.
parent
eec7a565
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
file.c
dlls/msvcrt/file.c
+9
-1
No files found.
dlls/msvcrt/file.c
View file @
ba757eae
...
...
@@ -3283,7 +3283,7 @@ int CDECL _wutime(const MSVCRT_wchar_t* path, struct MSVCRT___utimbuf32 *t)
int
CDECL
MSVCRT__write
(
int
fd
,
const
void
*
buf
,
unsigned
int
count
)
{
DWORD
num_written
;
ioinfo
*
info
=
get_ioinfo
_nolock
(
fd
);
ioinfo
*
info
=
get_ioinfo
(
fd
);
HANDLE
hand
=
info
->
handle
;
/* Don't trace small writes, it gets *very* annoying */
...
...
@@ -3294,12 +3294,14 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count)
if
(
hand
==
INVALID_HANDLE_VALUE
)
{
*
MSVCRT__errno
()
=
MSVCRT_EBADF
;
release_ioinfo
(
info
);
return
-
1
;
}
if
(((
info
->
exflag
&
EF_UTF8
)
||
(
info
->
exflag
&
EF_UTF16
))
&&
count
&
1
)
{
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
release_ioinfo
(
info
);
return
-
1
;
}
...
...
@@ -3311,7 +3313,10 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count)
{
if
(
WriteFile
(
hand
,
buf
,
count
,
&
num_written
,
NULL
)
&&
(
num_written
==
count
))
{
release_ioinfo
(
info
);
return
num_written
;
}
TRACE
(
"WriteFile (fd %d, hand %p) failed-last error (%d)
\n
"
,
fd
,
hand
,
GetLastError
());
*
MSVCRT__errno
()
=
MSVCRT_ENOSPC
;
...
...
@@ -3402,6 +3407,7 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count)
if
(
!
conv_len
)
{
msvcrt_set_errno
(
GetLastError
());
MSVCRT_free
(
p
);
release_ioinfo
(
info
);
return
-
1
;
}
...
...
@@ -3433,6 +3439,7 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count)
if
(
!
WriteFile
(
hand
,
q
,
size
,
&
num_written
,
NULL
))
num_written
=
-
1
;
release_ioinfo
(
info
);
if
(
p
)
MSVCRT_free
(
p
);
if
(
num_written
!=
size
)
...
...
@@ -3445,6 +3452,7 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count)
return
count
;
}
release_ioinfo
(
info
);
return
-
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