server: Retrieve ioctl data directly from the request.

This commit is contained in:
Alexandre Julliard 2015-05-05 12:02:59 +09:00
parent 165dd1ff36
commit 6f2ed23c16
5 changed files with 22 additions and 28 deletions

View file

@ -128,7 +128,7 @@ static struct object *device_open_file( struct object *obj, unsigned int access,
unsigned int sharing, unsigned int options );
static enum server_fd_type device_get_fd_type( struct fd *fd );
static obj_handle_t device_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data,
int blocking, const void *data, data_size_t size );
int blocking );
static const struct object_ops device_ops =
{
@ -311,7 +311,7 @@ static struct irp_call *find_irp_call( struct device *device, struct thread *thr
}
static obj_handle_t device_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data,
int blocking, const void *data, data_size_t size )
int blocking )
{
struct device *device = get_fd_user( fd );
struct irp_call *irp;
@ -323,7 +323,8 @@ static obj_handle_t device_ioctl( struct fd *fd, ioctl_code_t code, const async_
return 0;
}
if (!(irp = create_irp( device, IRP_MJ_DEVICE_CONTROL, data, size, get_reply_max_size() )))
if (!(irp = create_irp( device, IRP_MJ_DEVICE_CONTROL, get_req_data(), get_req_data_size(),
get_reply_max_size() )))
return 0;
irp->code = code;

View file

@ -2164,16 +2164,14 @@ static void unmount_device( struct fd *device_fd )
release_object( device );
}
obj_handle_t no_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
int blocking, const void *data, data_size_t size )
obj_handle_t no_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async, int blocking )
{
set_error( STATUS_OBJECT_TYPE_MISMATCH );
return 0;
}
/* default ioctl() routine */
obj_handle_t default_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
int blocking, const void *data, data_size_t size )
obj_handle_t default_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async, int blocking )
{
switch(code)
{
@ -2301,8 +2299,7 @@ DECL_HANDLER(ioctl)
if (fd)
{
reply->wait = fd->fd_ops->ioctl( fd, req->code, &req->async, req->blocking,
get_req_data(), get_req_data_size() );
reply->wait = fd->fd_ops->ioctl( fd, req->code, &req->async, req->blocking );
reply->options = fd->options;
release_object( fd );
}

View file

@ -42,8 +42,7 @@ struct fd_ops
/* get file information */
enum server_fd_type (*get_fd_type)(struct fd *fd);
/* perform an ioctl on the file */
obj_handle_t (*ioctl)(struct fd *fd, ioctl_code_t code, const async_data_t *async, int blocking,
const void *data, data_size_t size);
obj_handle_t (*ioctl)(struct fd *fd, ioctl_code_t code, const async_data_t *async, int blocking );
/* queue an async operation */
void (*queue_async)(struct fd *, const async_data_t *data, int type, int count);
/* selected events for async i/o need an update */
@ -86,10 +85,8 @@ extern void default_poll_event( struct fd *fd, int event );
extern struct async *fd_queue_async( struct fd *fd, const async_data_t *data, int type );
extern void fd_async_wake_up( struct fd *fd, int type, unsigned int status );
extern void fd_reselect_async( struct fd *fd, struct async_queue *queue );
extern obj_handle_t no_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
int blocking, const void *data, data_size_t size );
extern obj_handle_t default_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
int blocking, const void *data, data_size_t size );
extern obj_handle_t no_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async, int blocking );
extern obj_handle_t default_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async, int blocking );
extern void no_fd_queue_async( struct fd *fd, const async_data_t *data, int type, int count );
extern void default_fd_queue_async( struct fd *fd, const async_data_t *data, int type, int count );
extern void default_fd_reselect_async( struct fd *fd, struct async_queue *queue );

View file

@ -144,7 +144,7 @@ static void pipe_server_destroy( struct object *obj);
static void pipe_server_flush( struct fd *fd, struct event **event );
static enum server_fd_type pipe_server_get_fd_type( struct fd *fd );
static obj_handle_t pipe_server_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
int blocking, const void *data, data_size_t size );
int blocking );
static const struct object_ops pipe_server_ops =
{
@ -227,8 +227,8 @@ static struct object *named_pipe_device_open_file( struct object *obj, unsigned
unsigned int sharing, unsigned int options );
static void named_pipe_device_destroy( struct object *obj );
static enum server_fd_type named_pipe_device_get_fd_type( struct fd *fd );
static obj_handle_t named_pipe_device_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data,
int blocking, const void *data, data_size_t size );
static obj_handle_t named_pipe_device_ioctl( struct fd *fd, ioctl_code_t code,
const async_data_t *async_data, int blocking );
static const struct object_ops named_pipe_device_ops =
{
@ -591,7 +591,7 @@ static enum server_fd_type pipe_client_get_fd_type( struct fd *fd )
}
static obj_handle_t pipe_server_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data,
int blocking, const void *data, data_size_t size )
int blocking )
{
struct pipe_server *server = get_fd_user( fd );
struct async *async;
@ -672,7 +672,7 @@ static obj_handle_t pipe_server_ioctl( struct fd *fd, ioctl_code_t code, const a
return 0;
default:
return default_fd_ioctl( fd, code, async_data, blocking, data, size );
return default_fd_ioctl( fd, code, async_data, blocking );
}
}
@ -868,8 +868,8 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc
return &client->obj;
}
static obj_handle_t named_pipe_device_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data,
int blocking, const void *data, data_size_t size )
static obj_handle_t named_pipe_device_ioctl( struct fd *fd, ioctl_code_t code,
const async_data_t *async_data, int blocking )
{
struct named_pipe_device *device = get_fd_user( fd );
@ -877,7 +877,8 @@ static obj_handle_t named_pipe_device_ioctl( struct fd *fd, ioctl_code_t code, c
{
case FSCTL_PIPE_WAIT:
{
const FILE_PIPE_WAIT_FOR_BUFFER *buffer = data;
const FILE_PIPE_WAIT_FOR_BUFFER *buffer = get_req_data();
data_size_t size = get_req_data_size();
obj_handle_t wait_handle = 0;
struct named_pipe *pipe;
struct pipe_server *server;
@ -931,7 +932,7 @@ static obj_handle_t named_pipe_device_ioctl( struct fd *fd, ioctl_code_t code, c
}
default:
return default_fd_ioctl( fd, code, async_data, blocking, data, size );
return default_fd_ioctl( fd, code, async_data, blocking );
}
}

View file

@ -130,8 +130,7 @@ static void sock_destroy_ifchange_q( struct sock *sock );
static int sock_get_poll_events( struct fd *fd );
static void sock_poll_event( struct fd *fd, int event );
static enum server_fd_type sock_get_fd_type( struct fd *fd );
static obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
int blocking, const void *data, data_size_t size );
static obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async, int blocking );
static void sock_queue_async( struct fd *fd, const async_data_t *data, int type, int count );
static void sock_reselect_async( struct fd *fd, struct async_queue *queue );
static void sock_cancel_async( struct fd *fd, struct process *process, struct thread *thread, client_ptr_t iosb );
@ -534,8 +533,7 @@ static enum server_fd_type sock_get_fd_type( struct fd *fd )
return FD_TYPE_SOCKET;
}
obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data,
int blocking, const void *data, data_size_t size )
obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data, int blocking )
{
struct sock *sock = get_fd_user( fd );
obj_handle_t wait_handle = 0;