From: Torge Matthies tmatthies@codeweavers.com
Signed-off-by: Torge Matthies tmatthies@codeweavers.com --- dlls/ntdll/unix/file.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 8814da1aac4..e24e77716d6 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1570,6 +1570,13 @@ static BOOL fd_is_mount_point( int fd, const struct stat *st ) }
+/* get the stat info for a file (by file descriptor) */ +static int fd_get_file_stat( int fd, struct stat *st ) +{ + return fstat( fd, st ); +} + + /* get the stat info and file attributes for a file (by file descriptor) */ static int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULONG *attr ) { @@ -1577,7 +1584,7 @@ static int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULON int attr_len, ret;
*attr = 0; - ret = fstat( fd, st ); + ret = fd_get_file_stat( fd, st ); if (ret == -1) return ret; *attr |= get_file_attributes( st ); /* consider mount points to be reparse points (IO_REPARSE_TAG_MOUNT_POINT) */ @@ -4361,10 +4368,10 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, { FILE_STANDARD_INFORMATION *info = ptr;
- if (fd_get_file_info( fd, options, &st, &attr ) == -1) status = errno_to_status( errno ); + if (fd_get_file_stat( fd, &st ) == -1) status = errno_to_status( errno ); else { - fill_file_info( &st, attr, info, class ); + fill_file_info( &st, 0, info, class ); info->DeletePending = FALSE; /* FIXME */ } } @@ -4378,8 +4385,8 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, } break; case FileInternalInformation: - if (fd_get_file_info( fd, options, &st, &attr ) == -1) status = errno_to_status( errno ); - else fill_file_info( &st, attr, ptr, class ); + if (fd_get_file_stat( fd, &st ) == -1) status = errno_to_status( errno ); + else fill_file_info( &st, 0, ptr, class ); break; case FileEaInformation: { @@ -4388,8 +4395,8 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, } break; case FileEndOfFileInformation: - if (fd_get_file_info( fd, options, &st, &attr ) == -1) status = errno_to_status( errno ); - else fill_file_info( &st, attr, ptr, class ); + if (fd_get_file_stat( fd, &st ) == -1) status = errno_to_status( errno ); + else fill_file_info( &st, 0, ptr, class ); break; case FileAllInformation: { @@ -4504,7 +4511,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, } break; case FileIdInformation: - if (fd_get_file_info( fd, options, &st, &attr ) == -1) status = errno_to_status( errno ); + if (fd_get_file_stat( fd, &st ) == -1) status = errno_to_status( errno ); else { struct mountmgr_unix_drive drive;