Commit b1e4d920 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Return void from the ioctl callback.

parent a36e2769
......@@ -204,7 +204,7 @@ static enum server_fd_type device_file_get_fd_type( struct fd *fd );
static void device_file_read( struct fd *fd, struct async *async, file_pos_t pos );
static void device_file_write( struct fd *fd, struct async *async, file_pos_t pos );
static void device_file_flush( struct fd *fd, struct async *async );
static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
static void device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
static void device_file_reselect_async( struct fd *fd, struct async_queue *queue );
static void device_file_get_volume_info( struct fd *fd, struct async *async, unsigned int info_class );
......@@ -596,17 +596,16 @@ static void free_irp_params( struct irp_call *irp )
}
/* queue an irp to the device */
static int queue_irp( struct device_file *file, const irp_params_t *params, struct async *async )
static void queue_irp( struct device_file *file, const irp_params_t *params, struct async *async )
{
struct irp_call *irp = create_irp( file, params, async );
if (!irp) return 0;
if (!irp) return;
fd_queue_async( file->fd, async, ASYNC_TYPE_WAIT );
irp->async = (struct async *)grab_object( async );
add_irp_to_queue( file->device->manager, irp, current );
release_object( irp );
async_set_unknown_status( async );
return 1;
}
static enum server_fd_type device_file_get_fd_type( struct fd *fd )
......@@ -659,7 +658,7 @@ static void device_file_flush( struct fd *fd, struct async *async )
queue_irp( file, &params, async );
}
static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
static void device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
{
struct device_file *file = get_fd_user( fd );
irp_params_t params;
......@@ -667,7 +666,7 @@ static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *as
memset( &params, 0, sizeof(params) );
params.ioctl.type = IRP_CALL_IOCTL;
params.ioctl.code = code;
return queue_irp( file, &params, async );
queue_irp( file, &params, async );
}
static void cancel_irp_call( struct irp_call *irp )
......
......@@ -2372,23 +2372,22 @@ void no_fd_get_volume_info( struct fd *fd, struct async *async, unsigned int inf
}
/* default ioctl() routine */
int no_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
void no_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
{
set_error( STATUS_OBJECT_TYPE_MISMATCH );
return 0;
}
/* default ioctl() routine */
int default_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
void default_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
{
switch(code)
{
case FSCTL_DISMOUNT_VOLUME:
unmount_device( fd );
return 1;
break;
default:
set_error( STATUS_NOT_SUPPORTED );
return 0;
}
}
......
......@@ -67,7 +67,7 @@ struct fd_ops
/* query volume info */
void (*get_volume_info)( struct fd *, struct async *, unsigned int );
/* perform an ioctl on the file */
int (*ioctl)(struct fd *fd, ioctl_code_t code, struct async *async );
void (*ioctl)(struct fd *fd, ioctl_code_t code, struct async *async );
/* queue an async operation */
void (*queue_async)(struct fd *, struct async *async, int type, int count);
/* selected events for async i/o need an update */
......@@ -115,8 +115,8 @@ extern void 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 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, struct async *async, unsigned int info_class );
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 void no_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
extern void default_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
extern void no_fd_queue_async( struct fd *fd, struct async *async, int type, int count );
extern void default_fd_queue_async( struct fd *fd, struct async *async, int type, int count );
extern void default_fd_reselect_async( struct fd *fd, struct async_queue *queue );
......
......@@ -63,7 +63,7 @@ static struct fd *serial_get_fd( struct object *obj );
static void serial_destroy(struct object *obj);
static enum server_fd_type serial_get_fd_type( struct fd *fd );
static int serial_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
static void serial_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
static void serial_queue_async( struct fd *fd, struct async *async, int type, int count );
static void serial_reselect_async( struct fd *fd, struct async_queue *queue );
......@@ -179,7 +179,7 @@ static enum server_fd_type serial_get_fd_type( struct fd *fd )
return FD_TYPE_SERIAL;
}
static int serial_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
static void serial_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
{
struct serial *serial = get_fd_user( fd );
......@@ -189,43 +189,42 @@ static int serial_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
if (get_reply_max_size() < sizeof(serial->timeouts))
{
set_error( STATUS_BUFFER_TOO_SMALL );
return 0;
return;
}
set_reply_data( &serial->timeouts, sizeof(serial->timeouts ));
return 1;
return;
case IOCTL_SERIAL_SET_TIMEOUTS:
if (get_req_data_size() < sizeof(serial->timeouts))
{
set_error( STATUS_BUFFER_TOO_SMALL );
return 0;
return;
}
memcpy( &serial->timeouts, get_req_data(), sizeof(serial->timeouts) );
return 1;
return;
case IOCTL_SERIAL_GET_WAIT_MASK:
if (get_reply_max_size() < sizeof(serial->eventmask))
{
set_error( STATUS_BUFFER_TOO_SMALL );
return 0;
return;
}
set_reply_data( &serial->eventmask, sizeof(serial->eventmask) );
return 1;
return;
case IOCTL_SERIAL_SET_WAIT_MASK:
if (get_req_data_size() < sizeof(serial->eventmask))
{
set_error( STATUS_BUFFER_TOO_SMALL );
return 0;
return;
}
serial->eventmask = *(unsigned int *)get_req_data();
serial->generation++;
fd_async_wake_up( serial->fd, ASYNC_TYPE_WAIT, STATUS_SUCCESS );
return 1;
return;
default:
set_error( STATUS_NOT_SUPPORTED );
return 0;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment