server: Add FileFsDeviceInformation implementation for named pipes.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-10-02 16:42:24 +02:00 committed by Alexandre Julliard
parent 2ab2f31f18
commit 3f07c6e256
2 changed files with 25 additions and 6 deletions

View File

@ -1115,25 +1115,21 @@ static void test_volume_info(void)
memset( buffer, 0xaa, sizeof(buffer) );
status = pNtQueryVolumeInformationFile( read, &iosb, buffer, sizeof(buffer), FileFsDeviceInformation );
todo_wine {
ok( status == STATUS_SUCCESS, "NtQueryVolumeInformationFile failed: %x\n", status );
ok( iosb.Information == sizeof(*device_info), "Information = %lu\n", iosb.Information );
device_info = (FILE_FS_DEVICE_INFORMATION*)buffer;
ok( device_info->DeviceType == FILE_DEVICE_NAMED_PIPE, "DeviceType = %u\n", device_info->DeviceType );
ok( !(device_info->Characteristics & ~FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL),
"Characteristics = %x\n", device_info->Characteristics );
}
memset( buffer, 0xaa, sizeof(buffer) );
status = pNtQueryVolumeInformationFile( write, &iosb, buffer, sizeof(buffer), FileFsDeviceInformation );
todo_wine {
ok( status == STATUS_SUCCESS, "NtQueryVolumeInformationFile failed: %x\n", status );
ok( iosb.Information == sizeof(*device_info), "Information = %lu\n", iosb.Information );
device_info = (FILE_FS_DEVICE_INFORMATION*)buffer;
ok( device_info->DeviceType == FILE_DEVICE_NAMED_PIPE, "DeviceType = %u\n", device_info->DeviceType );
ok( !(device_info->Characteristics & ~FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL),
"Characteristics = %x\n", device_info->Characteristics );
}
CloseHandle( read );
CloseHandle( write );

View File

@ -156,6 +156,7 @@ static const struct object_ops named_pipe_ops =
static enum server_fd_type pipe_end_get_fd_type( struct fd *fd );
static int pipe_end_read( struct fd *fd, struct async *async, file_pos_t pos );
static int pipe_end_write( struct fd *fd, struct async *async_data, file_pos_t pos );
static void pipe_end_get_volume_info( struct fd *fd, unsigned int info_class );
static void pipe_end_queue_async( struct fd *fd, struct async *async, int type, int count );
static void pipe_end_reselect_async( struct fd *fd, struct async_queue *queue );
@ -196,7 +197,7 @@ static const struct fd_ops pipe_server_fd_ops =
pipe_end_read, /* read */
pipe_end_write, /* write */
pipe_server_flush, /* flush */
no_fd_get_volume_info, /* get_volume_info */
pipe_end_get_volume_info, /* get_volume_info */
pipe_server_ioctl, /* ioctl */
pipe_end_queue_async, /* queue_async */
pipe_end_reselect_async /* reselect_async */
@ -240,7 +241,7 @@ static const struct fd_ops pipe_client_fd_ops =
pipe_end_read, /* read */
pipe_end_write, /* write */
pipe_client_flush, /* flush */
no_fd_get_volume_info, /* get_volume_info */
pipe_end_get_volume_info, /* get_volume_info */
pipe_client_ioctl, /* ioctl */
pipe_end_queue_async, /* queue_async */
pipe_end_reselect_async /* reselect_async */
@ -685,6 +686,28 @@ static int pipe_client_flush( struct fd *fd, struct async *async )
return use_server_io( pipe_end ) ? pipe_end_flush( pipe_end, async ) : 1;
}
static void pipe_end_get_volume_info( struct fd *fd, unsigned int info_class )
{
switch (info_class)
{
case FileFsDeviceInformation:
{
static const FILE_FS_DEVICE_INFORMATION device_info =
{
FILE_DEVICE_NAMED_PIPE,
FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
};
if (get_reply_max_size() >= sizeof(device_info))
set_reply_data( &device_info, sizeof(device_info) );
else
set_error( STATUS_BUFFER_TOO_SMALL );
break;
}
default:
set_error( STATUS_NOT_IMPLEMENTED );
}
}
static void message_queue_read( struct pipe_end *pipe_end, struct iosb *iosb )
{
struct pipe_message *message;