server: Add FileFsDeviceInformation implementation for named pipes.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c
index c448526..897c44b 100644
--- a/dlls/ntdll/tests/pipe.c
+++ b/dlls/ntdll/tests/pipe.c
@@ -1115,25 +1115,21 @@
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 );
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 6dd2fd6..d0ec38f 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -156,6 +156,7 @@
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 @@
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 @@
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 @@
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;