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 9e511d6f8b7..42aa9c4811f 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1548,6 +1548,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 ) { @@ -1555,7 +1562,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) */ @@ -4339,10 +4346,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 */ } } @@ -4356,8 +4363,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: { @@ -4366,8 +4373,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: { @@ -4482,7 +4489,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;