server: Use default_fd_get_file_info for FileAccessInformation implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-10-23 17:45:21 +02:00 committed by Alexandre Julliard
parent 04094a6669
commit 8b8eba7e6c
2 changed files with 21 additions and 21 deletions

View File

@ -2236,7 +2236,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
sizeof(FILE_STANDARD_INFORMATION), /* FileStandardInformation */
sizeof(FILE_INTERNAL_INFORMATION), /* FileInternalInformation */
sizeof(FILE_EA_INFORMATION), /* FileEaInformation */
sizeof(FILE_ACCESS_INFORMATION), /* FileAccessInformation */
0, /* FileAccessInformation */
sizeof(FILE_NAME_INFORMATION), /* FileNameInformation */
sizeof(FILE_RENAME_INFORMATION)-sizeof(WCHAR), /* FileRenameInformation */
0, /* FileLinkInformation */
@ -2309,13 +2309,10 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
if (len < info_sizes[class])
return io->u.Status = STATUS_INFO_LENGTH_MISMATCH;
if (class != FileAccessInformation)
if ((io->u.Status = server_get_unix_fd( hFile, 0, &fd, &needs_close, NULL, NULL )))
{
if ((io->u.Status = server_get_unix_fd( hFile, 0, &fd, &needs_close, NULL, NULL )))
{
if (io->u.Status != STATUS_BAD_DEVICE_TYPE) return io->u.Status;
return server_get_file_info( hFile, io, ptr, len, class );
}
if (io->u.Status != STATUS_BAD_DEVICE_TYPE) return io->u.Status;
return server_get_file_info( hFile, io, ptr, len, class );
}
switch (class)
@ -2358,19 +2355,6 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
info->EaSize = 0;
}
break;
case FileAccessInformation:
{
FILE_ACCESS_INFORMATION *info = ptr;
SERVER_START_REQ( get_object_info )
{
req->handle = wine_server_obj_handle( hFile );
io->u.Status = wine_server_call( req );
if (io->u.Status == STATUS_SUCCESS)
info->AccessFlags = reply->access;
}
SERVER_END_REQ;
}
break;
case FileEndOfFileInformation:
if (fd_get_file_info( fd, &st, &attr ) == -1) io->u.Status = FILE_GetNtStatus();
else fill_file_info( &st, attr, ptr, class );

View File

@ -2178,7 +2178,23 @@ void no_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_
/* default get_file_info() routine */
void default_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class )
{
set_error( STATUS_NOT_IMPLEMENTED );
switch (info_class)
{
case FileAccessInformation:
{
FILE_ACCESS_INFORMATION info;
if (get_reply_max_size() < sizeof(info))
{
set_error( STATUS_INFO_LENGTH_MISMATCH );
return;
}
info.AccessFlags = get_handle_access( current->process, handle );
set_reply_data( &info, sizeof(info) );
break;
}
default:
set_error( STATUS_NOT_IMPLEMENTED );
}
}
/* default get_volume_info() routine */