server: Use server_get_file_info for all info classes not implemented on client side.

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:06 +02:00 committed by Alexandre Julliard
parent 1e8d17d0a4
commit 04094a6669
10 changed files with 33 additions and 23 deletions

View File

@ -2200,7 +2200,7 @@ static NTSTATUS server_get_file_info( HANDLE handle, IO_STATUS_BLOCK *io, void *
io->Information = wine_server_reply_size( reply ); io->Information = wine_server_reply_size( reply );
} }
SERVER_END_REQ; SERVER_END_REQ;
if (io->u.Status == STATUS_OBJECT_TYPE_MISMATCH) if (io->u.Status == STATUS_NOT_IMPLEMENTED)
FIXME( "Unsupported info class %x\n", info_class ); FIXME( "Unsupported info class %x\n", info_class );
return io->u.Status; return io->u.Status;
@ -2305,10 +2305,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
if (class <= 0 || class >= FileMaximumInformation) if (class <= 0 || class >= FileMaximumInformation)
return io->u.Status = STATUS_INVALID_INFO_CLASS; return io->u.Status = STATUS_INVALID_INFO_CLASS;
if (!info_sizes[class]) if (!info_sizes[class])
{ return server_get_file_info( hFile, io, ptr, len, class );
FIXME("Unsupported class (%d)\n", class);
return io->u.Status = STATUS_NOT_IMPLEMENTED;
}
if (len < info_sizes[class]) if (len < info_sizes[class])
return io->u.Status = STATUS_INFO_LENGTH_MISMATCH; return io->u.Status = STATUS_INFO_LENGTH_MISMATCH;

View File

@ -187,7 +187,7 @@ static const struct fd_ops dir_fd_ops =
no_fd_read, /* read */ no_fd_read, /* read */
no_fd_write, /* write */ no_fd_write, /* write */
no_fd_flush, /* flush */ no_fd_flush, /* flush */
no_fd_get_file_info, /* get_file_info */ default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */ no_fd_get_volume_info, /* get_volume_info */
default_fd_ioctl, /* ioctl */ default_fd_ioctl, /* ioctl */
default_fd_queue_async, /* queue_async */ default_fd_queue_async, /* queue_async */

View File

@ -209,7 +209,7 @@ static const struct fd_ops device_file_fd_ops =
device_file_read, /* read */ device_file_read, /* read */
device_file_write, /* write */ device_file_write, /* write */
device_file_flush, /* flush */ device_file_flush, /* flush */
no_fd_get_file_info, /* get_file_info */ default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */ no_fd_get_volume_info, /* get_volume_info */
device_file_ioctl, /* ioctl */ device_file_ioctl, /* ioctl */
default_fd_queue_async, /* queue_async */ default_fd_queue_async, /* queue_async */

View File

@ -2175,6 +2175,12 @@ void no_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_
set_error( STATUS_OBJECT_TYPE_MISMATCH ); set_error( STATUS_OBJECT_TYPE_MISMATCH );
} }
/* 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 );
}
/* default get_volume_info() routine */ /* default get_volume_info() routine */
void no_fd_get_volume_info( struct fd *fd, unsigned int info_class ) void no_fd_get_volume_info( struct fd *fd, unsigned int info_class )
{ {

View File

@ -107,7 +107,7 @@ static const struct fd_ops file_fd_ops =
no_fd_read, /* read */ no_fd_read, /* read */
no_fd_write, /* write */ no_fd_write, /* write */
file_flush, /* flush */ file_flush, /* flush */
no_fd_get_file_info, /* get_file_info */ default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */ no_fd_get_volume_info, /* get_volume_info */
default_fd_ioctl, /* ioctl */ default_fd_ioctl, /* ioctl */
default_fd_queue_async, /* queue_async */ default_fd_queue_async, /* queue_async */

View File

@ -112,6 +112,7 @@ extern int no_fd_read( struct fd *fd, struct async *async, file_pos_t pos );
extern int no_fd_write( struct fd *fd, struct async *async, file_pos_t pos ); extern int no_fd_write( struct fd *fd, struct async *async, file_pos_t pos );
extern int no_fd_flush( struct fd *fd, struct async *async ); extern int no_fd_flush( struct fd *fd, struct async *async );
extern void no_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class ); extern void no_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class );
extern void default_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class );
extern void no_fd_get_volume_info( struct fd *fd, unsigned int info_class ); extern void no_fd_get_volume_info( struct fd *fd, unsigned int info_class );
extern int no_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ); extern int no_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
extern int default_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ); extern int default_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );

View File

@ -104,7 +104,7 @@ static const struct fd_ops mailslot_fd_ops =
no_fd_read, /* read */ no_fd_read, /* read */
no_fd_write, /* write */ no_fd_write, /* write */
no_fd_flush, /* flush */ no_fd_flush, /* flush */
no_fd_get_file_info, /* get_file_info */ default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */ no_fd_get_volume_info, /* get_volume_info */
default_fd_ioctl, /* ioctl */ default_fd_ioctl, /* ioctl */
mailslot_queue_async, /* queue_async */ mailslot_queue_async, /* queue_async */
@ -159,7 +159,7 @@ static const struct fd_ops mail_writer_fd_ops =
no_fd_read, /* read */ no_fd_read, /* read */
no_fd_write, /* write */ no_fd_write, /* write */
no_fd_flush, /* flush */ no_fd_flush, /* flush */
no_fd_get_file_info, /* get_file_info */ default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */ no_fd_get_volume_info, /* get_volume_info */
default_fd_ioctl, /* ioctl */ default_fd_ioctl, /* ioctl */
default_fd_queue_async, /* queue_async */ default_fd_queue_async, /* queue_async */
@ -214,7 +214,7 @@ static const struct fd_ops mailslot_device_fd_ops =
no_fd_read, /* read */ no_fd_read, /* read */
no_fd_write, /* write */ no_fd_write, /* write */
no_fd_flush, /* flush */ no_fd_flush, /* flush */
no_fd_get_file_info, /* get_file_info */ default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */ no_fd_get_volume_info, /* get_volume_info */
default_fd_ioctl, /* ioctl */ default_fd_ioctl, /* ioctl */
default_fd_queue_async, /* queue_async */ default_fd_queue_async, /* queue_async */

View File

@ -271,7 +271,7 @@ static const struct fd_ops named_pipe_device_fd_ops =
no_fd_read, /* read */ no_fd_read, /* read */
no_fd_write, /* write */ no_fd_write, /* write */
no_fd_flush, /* flush */ no_fd_flush, /* flush */
no_fd_get_file_info, /* get_file_info */ default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */ no_fd_get_volume_info, /* get_volume_info */
named_pipe_device_ioctl, /* ioctl */ named_pipe_device_ioctl, /* ioctl */
default_fd_queue_async, /* queue_async */ default_fd_queue_async, /* queue_async */
@ -520,12 +520,6 @@ static void pipe_end_get_file_info( struct fd *fd, obj_handle_t handle, unsigned
struct pipe_end *pipe_end = get_fd_user( fd ); struct pipe_end *pipe_end = get_fd_user( fd );
struct named_pipe *pipe = pipe_end->pipe; struct named_pipe *pipe = pipe_end->pipe;
if (!pipe)
{
set_error( STATUS_PIPE_DISCONNECTED );
return;
}
switch (info_class) switch (info_class)
{ {
case FileNameInformation: case FileNameInformation:
@ -540,13 +534,13 @@ static void pipe_end_get_file_info( struct fd *fd, obj_handle_t handle, unsigned
return; return;
} }
name = get_object_name( &pipe->obj, &name_len );
/* FIXME: We should be able to return on unlinked pipe */ /* FIXME: We should be able to return on unlinked pipe */
if (!name) if (!pipe || !(name = get_object_name( &pipe->obj, &name_len )))
{ {
set_error( STATUS_PIPE_DISCONNECTED ); set_error( STATUS_PIPE_DISCONNECTED );
return; return;
} }
reply_size = offsetof( FILE_NAME_INFORMATION, FileName[name_len/sizeof(WCHAR) + 1] ); reply_size = offsetof( FILE_NAME_INFORMATION, FileName[name_len/sizeof(WCHAR) + 1] );
if (reply_size > get_reply_max_size()) if (reply_size > get_reply_max_size())
{ {
@ -577,6 +571,12 @@ static void pipe_end_get_file_info( struct fd *fd, obj_handle_t handle, unsigned
return; return;
} }
if (!pipe)
{
set_error( STATUS_PIPE_DISCONNECTED );
return;
}
if (!(pipe_info = set_reply_data_size( sizeof(*pipe_info) ))) return; if (!(pipe_info = set_reply_data_size( sizeof(*pipe_info) ))) return;
pipe_info->ReadMode = (pipe_end->flags & NAMED_PIPE_MESSAGE_STREAM_READ) pipe_info->ReadMode = (pipe_end->flags & NAMED_PIPE_MESSAGE_STREAM_READ)
? FILE_PIPE_MESSAGE_MODE : FILE_PIPE_BYTE_STREAM_MODE; ? FILE_PIPE_MESSAGE_MODE : FILE_PIPE_BYTE_STREAM_MODE;
@ -600,6 +600,12 @@ static void pipe_end_get_file_info( struct fd *fd, obj_handle_t handle, unsigned
return; return;
} }
if (!pipe)
{
set_error( STATUS_PIPE_DISCONNECTED );
return;
}
if (!(pipe_info = set_reply_data_size( sizeof(*pipe_info) ))) return; if (!(pipe_info = set_reply_data_size( sizeof(*pipe_info) ))) return;
pipe_info->NamedPipeType = (pipe_end->flags & NAMED_PIPE_MESSAGE_STREAM_WRITE) != 0; pipe_info->NamedPipeType = (pipe_end->flags & NAMED_PIPE_MESSAGE_STREAM_WRITE) != 0;
switch (pipe->sharing) switch (pipe->sharing)
@ -626,7 +632,7 @@ static void pipe_end_get_file_info( struct fd *fd, obj_handle_t handle, unsigned
break; break;
} }
default: default:
no_fd_get_file_info( fd, handle, info_class ); default_fd_get_file_info( fd, handle, info_class );
} }
} }

View File

@ -114,7 +114,7 @@ static const struct fd_ops serial_fd_ops =
no_fd_read, /* read */ no_fd_read, /* read */
no_fd_write, /* write */ no_fd_write, /* write */
no_fd_flush, /* flush */ no_fd_flush, /* flush */
no_fd_get_file_info, /* get_file_info */ default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */ no_fd_get_volume_info, /* get_volume_info */
serial_ioctl, /* ioctl */ serial_ioctl, /* ioctl */
serial_queue_async, /* queue_async */ serial_queue_async, /* queue_async */

View File

@ -167,7 +167,7 @@ static const struct fd_ops sock_fd_ops =
no_fd_read, /* read */ no_fd_read, /* read */
no_fd_write, /* write */ no_fd_write, /* write */
no_fd_flush, /* flush */ no_fd_flush, /* flush */
no_fd_get_file_info, /* get_file_info */ default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */ no_fd_get_volume_info, /* get_volume_info */
sock_ioctl, /* ioctl */ sock_ioctl, /* ioctl */
sock_queue_async, /* queue_async */ sock_queue_async, /* queue_async */