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
6c2d4f10
Commit
6c2d4f10
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 _fstat64.
parent
f2f45d5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
file.c
dlls/msvcrt/file.c
+11
-5
No files found.
dlls/msvcrt/file.c
View file @
6c2d4f10
...
...
@@ -1651,25 +1651,29 @@ int CDECL MSVCRT__fileno(MSVCRT_FILE* file)
*/
int
CDECL
MSVCRT__fstat64
(
int
fd
,
struct
MSVCRT__stat64
*
buf
)
{
ioinfo
*
info
=
get_ioinfo
(
fd
);
DWORD
dw
;
DWORD
type
;
BY_HANDLE_FILE_INFORMATION
hfi
;
HANDLE
hand
=
msvcrt_fdtoh
(
fd
);
TRACE
(
":fd (%d) stat (%p)
\n
"
,
fd
,
buf
);
if
(
hand
==
INVALID_HANDLE_VALUE
)
TRACE
(
":fd (%d) stat (%p)
\n
"
,
fd
,
buf
);
if
(
info
->
handle
==
INVALID_HANDLE_VALUE
)
{
release_ioinfo
(
info
);
return
-
1
;
}
if
(
!
buf
)
{
WARN
(
":failed-NULL buf
\n
"
);
msvcrt_set_errno
(
ERROR_INVALID_PARAMETER
);
release_ioinfo
(
info
);
return
-
1
;
}
memset
(
&
hfi
,
0
,
sizeof
(
hfi
));
memset
(
buf
,
0
,
sizeof
(
struct
MSVCRT__stat64
));
type
=
GetFileType
(
hand
);
type
=
GetFileType
(
info
->
handle
);
if
(
type
==
FILE_TYPE_PIPE
)
{
buf
->
st_dev
=
buf
->
st_rdev
=
fd
;
...
...
@@ -1684,10 +1688,11 @@ int CDECL MSVCRT__fstat64(int fd, struct MSVCRT__stat64* buf)
}
else
/* FILE_TYPE_DISK etc. */
{
if
(
!
GetFileInformationByHandle
(
hand
,
&
hfi
))
if
(
!
GetFileInformationByHandle
(
info
->
handle
,
&
hfi
))
{
WARN
(
":failed-last error (%d)
\n
"
,
GetLastError
());
msvcrt_set_errno
(
ERROR_INVALID_PARAMETER
);
release_ioinfo
(
info
);
return
-
1
;
}
buf
->
st_mode
=
S_IFREG
|
0444
;
...
...
@@ -1702,6 +1707,7 @@ int CDECL MSVCRT__fstat64(int fd, struct MSVCRT__stat64* buf)
}
TRACE
(
":dwFileAttributes = 0x%x, mode set to 0x%x
\n
"
,
hfi
.
dwFileAttributes
,
buf
->
st_mode
);
release_ioinfo
(
info
);
return
0
;
}
...
...
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