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
23ed6477
Commit
23ed6477
authored
Mar 17, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Avoid depending on the mount manager in fstat().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4d7b49ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
file.c
dlls/msvcrt/file.c
+14
-11
No files found.
dlls/msvcrt/file.c
View file @
23ed6477
...
...
@@ -1754,7 +1754,6 @@ int CDECL _fstat64(int fd, struct _stat64* buf)
ioinfo
*
info
=
get_ioinfo
(
fd
);
DWORD
dw
;
DWORD
type
;
BY_HANDLE_FILE_INFORMATION
hfi
;
TRACE
(
":fd (%d) stat (%p)
\n
"
,
fd
,
buf
);
if
(
info
->
handle
==
INVALID_HANDLE_VALUE
)
...
...
@@ -1771,7 +1770,6 @@ int CDECL _fstat64(int fd, struct _stat64* buf)
return
-
1
;
}
memset
(
&
hfi
,
0
,
sizeof
(
hfi
));
memset
(
buf
,
0
,
sizeof
(
struct
_stat64
));
type
=
GetFileType
(
info
->
handle
);
if
(
type
==
FILE_TYPE_PIPE
)
...
...
@@ -1788,25 +1786,30 @@ int CDECL _fstat64(int fd, struct _stat64* buf)
}
else
/* FILE_TYPE_DISK etc. */
{
if
(
!
GetFileInformationByHandle
(
info
->
handle
,
&
hfi
))
FILE_BASIC_INFORMATION
basic_info
;
FILE_STANDARD_INFORMATION
std_info
;
IO_STATUS_BLOCK
io
;
NTSTATUS
status
;
if
((
status
=
NtQueryInformationFile
(
info
->
handle
,
&
io
,
&
basic_info
,
sizeof
(
basic_info
),
FileBasicInformation
))
||
(
status
=
NtQueryInformationFile
(
info
->
handle
,
&
io
,
&
std_info
,
sizeof
(
std_info
),
FileStandardInformation
)))
{
WARN
(
":failed-
last error (%d)
\n
"
,
GetLastError
()
);
WARN
(
":failed-
error %x
\n
"
,
status
);
msvcrt_set_errno
(
ERROR_INVALID_PARAMETER
);
release_ioinfo
(
info
);
return
-
1
;
}
buf
->
st_mode
=
_S_IFREG
|
0444
;
if
(
!
(
hfi
.
dw
FileAttributes
&
FILE_ATTRIBUTE_READONLY
))
if
(
!
(
basic_info
.
FileAttributes
&
FILE_ATTRIBUTE_READONLY
))
buf
->
st_mode
|=
0222
;
buf
->
st_size
=
((
__int64
)
hfi
.
nFileSizeHigh
<<
32
)
+
hfi
.
nFileSizeLow
;
RtlTimeToSecondsSince1970
((
LARGE_INTEGER
*
)
&
hfi
.
ft
LastAccessTime
,
&
dw
);
buf
->
st_size
=
std_info
.
EndOfFile
.
QuadPart
;
RtlTimeToSecondsSince1970
((
LARGE_INTEGER
*
)
&
basic_info
.
LastAccessTime
,
&
dw
);
buf
->
st_atime
=
dw
;
RtlTimeToSecondsSince1970
((
LARGE_INTEGER
*
)
&
hfi
.
ft
LastWriteTime
,
&
dw
);
RtlTimeToSecondsSince1970
((
LARGE_INTEGER
*
)
&
basic_info
.
LastWriteTime
,
&
dw
);
buf
->
st_mtime
=
buf
->
st_ctime
=
dw
;
buf
->
st_nlink
=
hfi
.
nNumberOfLinks
;
buf
->
st_nlink
=
std_info
.
NumberOfLinks
;
TRACE
(
":dwFileAttributes = 0x%x, mode set to 0x%x
\n
"
,
basic_info
.
FileAttributes
,
buf
->
st_mode
);
}
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