Commit ecf7ed66 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Add a request to store the results of an ioctl asynchronously.

parent 0157f768
......@@ -3128,6 +3128,21 @@ struct ioctl_reply
struct set_ioctl_result_request
{
struct request_header __header;
obj_handle_t manager;
obj_handle_t handle;
unsigned int status;
/* VARARG(data,bytes); */
};
struct set_ioctl_result_reply
{
struct reply_header __header;
};
struct get_ioctl_result_request
{
struct request_header __header;
......@@ -5211,6 +5226,7 @@ enum request
REQ_register_async,
REQ_cancel_async,
REQ_ioctl,
REQ_set_ioctl_result,
REQ_get_ioctl_result,
REQ_create_named_pipe,
REQ_get_named_pipe_info,
......@@ -5473,6 +5489,7 @@ union generic_request
struct register_async_request register_async_request;
struct cancel_async_request cancel_async_request;
struct ioctl_request ioctl_request;
struct set_ioctl_result_request set_ioctl_result_request;
struct get_ioctl_result_request get_ioctl_result_request;
struct create_named_pipe_request create_named_pipe_request;
struct get_named_pipe_info_request get_named_pipe_info_request;
......@@ -5733,6 +5750,7 @@ union generic_reply
struct register_async_reply register_async_reply;
struct cancel_async_reply cancel_async_reply;
struct ioctl_reply ioctl_reply;
struct set_ioctl_result_reply set_ioctl_result_reply;
struct get_ioctl_result_reply get_ioctl_result_reply;
struct create_named_pipe_reply create_named_pipe_reply;
struct get_named_pipe_info_reply get_named_pipe_info_reply;
......@@ -5848,6 +5866,6 @@ union generic_reply
struct set_suspend_context_reply set_suspend_context_reply;
};
#define SERVER_PROTOCOL_VERSION 459
#define SERVER_PROTOCOL_VERSION 460
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
......@@ -531,6 +531,26 @@ DECL_HANDLER(get_next_device_request)
}
/* store results of an async ioctl */
DECL_HANDLER(set_ioctl_result)
{
struct ioctl_call *ioctl;
struct device_manager *manager;
if (!(manager = (struct device_manager *)get_handle_obj( current->process, req->manager,
0, &device_manager_ops )))
return;
if ((ioctl = (struct ioctl_call *)get_handle_obj( current->process, req->handle, 0, &ioctl_call_ops )))
{
set_ioctl_result( ioctl, req->status, get_req_data(), get_req_data_size() );
close_handle( current->process, req->handle ); /* avoid an extra round-trip for close */
release_object( ioctl );
}
release_object( manager );
}
/* retrieve results of an async ioctl */
DECL_HANDLER(get_ioctl_result)
{
......
......@@ -2262,6 +2262,15 @@ enum message_type
@END
/* Store results of an async ioctl */
@REQ(set_ioctl_result)
obj_handle_t manager; /* handle to the device manager */
obj_handle_t handle; /* handle to the ioctl */
unsigned int status; /* status of the ioctl */
VARARG(data,bytes); /* output data of the ioctl */
@END
/* Retrieve results of an async ioctl */
@REQ(get_ioctl_result)
obj_handle_t handle; /* handle to the device */
......
......@@ -248,6 +248,7 @@ DECL_HANDLER(set_serial_info);
DECL_HANDLER(register_async);
DECL_HANDLER(cancel_async);
DECL_HANDLER(ioctl);
DECL_HANDLER(set_ioctl_result);
DECL_HANDLER(get_ioctl_result);
DECL_HANDLER(create_named_pipe);
DECL_HANDLER(get_named_pipe_info);
......@@ -509,6 +510,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(req_handler)req_register_async,
(req_handler)req_cancel_async,
(req_handler)req_ioctl,
(req_handler)req_set_ioctl_result,
(req_handler)req_get_ioctl_result,
(req_handler)req_create_named_pipe,
(req_handler)req_get_named_pipe_info,
......@@ -1511,6 +1513,10 @@ C_ASSERT( sizeof(struct ioctl_request) == 64 );
C_ASSERT( FIELD_OFFSET(struct ioctl_reply, wait) == 8 );
C_ASSERT( FIELD_OFFSET(struct ioctl_reply, options) == 12 );
C_ASSERT( sizeof(struct ioctl_reply) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_ioctl_result_request, manager) == 12 );
C_ASSERT( FIELD_OFFSET(struct set_ioctl_result_request, handle) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_ioctl_result_request, status) == 20 );
C_ASSERT( sizeof(struct set_ioctl_result_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct get_ioctl_result_request, handle) == 12 );
C_ASSERT( FIELD_OFFSET(struct get_ioctl_result_request, user_arg) == 16 );
C_ASSERT( sizeof(struct get_ioctl_result_request) == 24 );
......
......@@ -2732,6 +2732,14 @@ static void dump_ioctl_reply( const struct ioctl_reply *req )
dump_varargs_bytes( ", out_data=", cur_size );
}
static void dump_set_ioctl_result_request( const struct set_ioctl_result_request *req )
{
fprintf( stderr, " manager=%04x", req->manager );
fprintf( stderr, ", handle=%04x", req->handle );
fprintf( stderr, ", status=%08x", req->status );
dump_varargs_bytes( ", data=", cur_size );
}
static void dump_get_ioctl_result_request( const struct get_ioctl_result_request *req )
{
fprintf( stderr, " handle=%04x", req->handle );
......@@ -4230,6 +4238,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_register_async_request,
(dump_func)dump_cancel_async_request,
(dump_func)dump_ioctl_request,
(dump_func)dump_set_ioctl_result_request,
(dump_func)dump_get_ioctl_result_request,
(dump_func)dump_create_named_pipe_request,
(dump_func)dump_get_named_pipe_info_request,
......@@ -4488,6 +4497,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
NULL,
NULL,
(dump_func)dump_ioctl_reply,
NULL,
(dump_func)dump_get_ioctl_result_reply,
(dump_func)dump_create_named_pipe_reply,
(dump_func)dump_get_named_pipe_info_reply,
......@@ -4746,6 +4756,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"register_async",
"cancel_async",
"ioctl",
"set_ioctl_result",
"get_ioctl_result",
"create_named_pipe",
"get_named_pipe_info",
......
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