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
f2f45d5f
Commit
f2f45d5f
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 _chsize_s.
parent
fa6de597
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
file.c
dlls/msvcrt/file.c
+5
-6
No files found.
dlls/msvcrt/file.c
View file @
f2f45d5f
...
@@ -1377,18 +1377,17 @@ int CDECL MSVCRT__fseek_nolock(MSVCRT_FILE* file, MSVCRT_long offset, int whence
...
@@ -1377,18 +1377,17 @@ int CDECL MSVCRT__fseek_nolock(MSVCRT_FILE* file, MSVCRT_long offset, int whence
*/
*/
int
CDECL
MSVCRT__chsize_s
(
int
fd
,
__int64
size
)
int
CDECL
MSVCRT__chsize_s
(
int
fd
,
__int64
size
)
{
{
ioinfo
*
info
;
__int64
cur
,
pos
;
__int64
cur
,
pos
;
HANDLE
handle
;
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
TRACE
(
"(fd=%d, size=%s)
\n
"
,
fd
,
wine_dbgstr_longlong
(
size
));
TRACE
(
"(fd=%d, size=%s)
\n
"
,
fd
,
wine_dbgstr_longlong
(
size
));
if
(
!
MSVCRT_CHECK_PMT
(
size
>=
0
))
return
MSVCRT_EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
size
>=
0
))
return
MSVCRT_EINVAL
;
LOCK_FILES
();
handle
=
msvcrt_fdtoh
(
fd
);
info
=
get_ioinfo
(
fd
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
if
(
info
->
handle
!=
INVALID_HANDLE_VALUE
)
{
{
/* save the current file pointer */
/* save the current file pointer */
cur
=
MSVCRT__lseeki64
(
fd
,
0
,
SEEK_CUR
);
cur
=
MSVCRT__lseeki64
(
fd
,
0
,
SEEK_CUR
);
...
@@ -1397,7 +1396,7 @@ int CDECL MSVCRT__chsize_s(int fd, __int64 size)
...
@@ -1397,7 +1396,7 @@ int CDECL MSVCRT__chsize_s(int fd, __int64 size)
pos
=
MSVCRT__lseeki64
(
fd
,
size
,
SEEK_SET
);
pos
=
MSVCRT__lseeki64
(
fd
,
size
,
SEEK_SET
);
if
(
pos
>=
0
)
if
(
pos
>=
0
)
{
{
ret
=
SetEndOfFile
(
handle
);
ret
=
SetEndOfFile
(
info
->
handle
);
if
(
!
ret
)
msvcrt_set_errno
(
GetLastError
());
if
(
!
ret
)
msvcrt_set_errno
(
GetLastError
());
}
}
...
@@ -1406,7 +1405,7 @@ int CDECL MSVCRT__chsize_s(int fd, __int64 size)
...
@@ -1406,7 +1405,7 @@ int CDECL MSVCRT__chsize_s(int fd, __int64 size)
}
}
}
}
UNLOCK_FILES
(
);
release_ioinfo
(
info
);
return
ret
?
0
:
*
MSVCRT__errno
();
return
ret
?
0
:
*
MSVCRT__errno
();
}
}
...
...
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