Commit a7b3efde authored by Alexandre Julliard's avatar Alexandre Julliard

server: Store the async handle inside the async_data_t structure.

parent cb08534a
...@@ -2396,10 +2396,10 @@ NtNotifyChangeDirectoryFile( HANDLE FileHandle, HANDLE Event, ...@@ -2396,10 +2396,10 @@ NtNotifyChangeDirectoryFile( HANDLE FileHandle, HANDLE Event,
SERVER_START_REQ( read_directory_changes ) SERVER_START_REQ( read_directory_changes )
{ {
req->handle = wine_server_obj_handle( FileHandle );
req->filter = CompletionFilter; req->filter = CompletionFilter;
req->want_data = (Buffer != NULL); req->want_data = (Buffer != NULL);
req->subtree = WatchTree; req->subtree = WatchTree;
req->async.handle = wine_server_obj_handle( FileHandle );
req->async.callback = read_changes_apc; req->async.callback = read_changes_apc;
req->async.iosb = IoStatusBlock; req->async.iosb = IoStatusBlock;
req->async.arg = info; req->async.arg = info;
......
...@@ -652,14 +652,14 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent, ...@@ -652,14 +652,14 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
SERVER_START_REQ( register_async ) SERVER_START_REQ( register_async )
{ {
req->handle = wine_server_obj_handle( hFile );
req->type = ASYNC_TYPE_READ; req->type = ASYNC_TYPE_READ;
req->count = length; req->count = length;
req->async.handle = wine_server_obj_handle( hFile );
req->async.event = wine_server_obj_handle( hEvent );
req->async.callback = FILE_AsyncReadService; req->async.callback = FILE_AsyncReadService;
req->async.iosb = io_status; req->async.iosb = io_status;
req->async.arg = fileio; req->async.arg = fileio;
req->async.apc = fileio_apc; req->async.apc = fileio_apc;
req->async.event = wine_server_obj_handle( hEvent );
req->async.cvalue = cvalue; req->async.cvalue = cvalue;
status = wine_server_call( req ); status = wine_server_call( req );
} }
...@@ -976,14 +976,14 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent, ...@@ -976,14 +976,14 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
SERVER_START_REQ( register_async ) SERVER_START_REQ( register_async )
{ {
req->handle = wine_server_obj_handle( hFile );
req->type = ASYNC_TYPE_WRITE; req->type = ASYNC_TYPE_WRITE;
req->count = length; req->count = length;
req->async.handle = wine_server_obj_handle( hFile );
req->async.event = wine_server_obj_handle( hEvent );
req->async.callback = FILE_AsyncWriteService; req->async.callback = FILE_AsyncWriteService;
req->async.iosb = io_status; req->async.iosb = io_status;
req->async.arg = fileio; req->async.arg = fileio;
req->async.apc = fileio_apc; req->async.apc = fileio_apc;
req->async.event = wine_server_obj_handle( hEvent );
req->async.cvalue = cvalue; req->async.cvalue = cvalue;
status = wine_server_call( req ); status = wine_server_call( req );
} }
...@@ -1197,8 +1197,8 @@ static NTSTATUS server_ioctl_file( HANDLE handle, HANDLE event, ...@@ -1197,8 +1197,8 @@ static NTSTATUS server_ioctl_file( HANDLE handle, HANDLE event,
SERVER_START_REQ( ioctl ) SERVER_START_REQ( ioctl )
{ {
req->handle = wine_server_obj_handle( handle );
req->code = code; req->code = code;
req->async.handle = wine_server_obj_handle( handle );
req->async.callback = ioctl_completion; req->async.callback = ioctl_completion;
req->async.iosb = io; req->async.iosb = io;
req->async.arg = async; req->async.arg = async;
......
...@@ -1327,8 +1327,8 @@ static int WS2_register_async_shutdown( SOCKET s, int type ) ...@@ -1327,8 +1327,8 @@ static int WS2_register_async_shutdown( SOCKET s, int type )
SERVER_START_REQ( register_async ) SERVER_START_REQ( register_async )
{ {
req->handle = wine_server_obj_handle( wsa->hSocket );
req->type = type; req->type = type;
req->async.handle = wine_server_obj_handle( wsa->hSocket );
req->async.callback = WS2_async_shutdown; req->async.callback = WS2_async_shutdown;
req->async.iosb = &wsa->local_iosb; req->async.iosb = &wsa->local_iosb;
req->async.arg = wsa; req->async.arg = wsa;
...@@ -2780,8 +2780,8 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, ...@@ -2780,8 +2780,8 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
SERVER_START_REQ( register_async ) SERVER_START_REQ( register_async )
{ {
req->handle = wine_server_obj_handle( wsa->hSocket ); req->type = ASYNC_TYPE_WRITE;
req->type = ASYNC_TYPE_WRITE; req->async.handle = wine_server_obj_handle( wsa->hSocket );
req->async.callback = WS2_async_send; req->async.callback = WS2_async_send;
req->async.iosb = iosb; req->async.iosb = iosb;
req->async.arg = wsa; req->async.arg = wsa;
...@@ -4306,8 +4306,8 @@ INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, ...@@ -4306,8 +4306,8 @@ INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
SERVER_START_REQ( register_async ) SERVER_START_REQ( register_async )
{ {
req->handle = wine_server_obj_handle( wsa->hSocket ); req->type = ASYNC_TYPE_READ;
req->type = ASYNC_TYPE_READ; req->async.handle = wine_server_obj_handle( wsa->hSocket );
req->async.callback = WS2_async_recv; req->async.callback = WS2_async_recv;
req->async.iosb = iosb; req->async.iosb = iosb;
req->async.arg = wsa; req->async.arg = wsa;
......
...@@ -161,11 +161,12 @@ typedef struct ...@@ -161,11 +161,12 @@ typedef struct
typedef struct typedef struct
{ {
obj_handle_t handle;
obj_handle_t event;
void *callback; void *callback;
void *iosb; void *iosb;
void *arg; void *arg;
void *apc; void *apc;
obj_handle_t event;
apc_param_t cvalue; apc_param_t cvalue;
} async_data_t; } async_data_t;
...@@ -1651,7 +1652,6 @@ struct read_directory_changes_request ...@@ -1651,7 +1652,6 @@ struct read_directory_changes_request
{ {
struct request_header __header; struct request_header __header;
unsigned int filter; unsigned int filter;
obj_handle_t handle;
int subtree; int subtree;
int want_data; int want_data;
async_data_t async; async_data_t async;
...@@ -2671,7 +2671,6 @@ struct set_serial_info_reply ...@@ -2671,7 +2671,6 @@ struct set_serial_info_reply
struct register_async_request struct register_async_request
{ {
struct request_header __header; struct request_header __header;
obj_handle_t handle;
int type; int type;
int count; int count;
async_data_t async; async_data_t async;
...@@ -2701,7 +2700,6 @@ struct cancel_async_reply ...@@ -2701,7 +2700,6 @@ struct cancel_async_reply
struct ioctl_request struct ioctl_request
{ {
struct request_header __header; struct request_header __header;
obj_handle_t handle;
ioctl_code_t code; ioctl_code_t code;
async_data_t async; async_data_t async;
/* VARARG(in_data,bytes); */ /* VARARG(in_data,bytes); */
...@@ -5053,6 +5051,6 @@ union generic_reply ...@@ -5053,6 +5051,6 @@ union generic_reply
struct set_window_layered_info_reply set_window_layered_info_reply; struct set_window_layered_info_reply set_window_layered_info_reply;
}; };
#define SERVER_PROTOCOL_VERSION 353 #define SERVER_PROTOCOL_VERSION 354
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */ #endif /* __WINE_WINE_SERVER_PROTOCOL_H */
...@@ -1139,7 +1139,7 @@ DECL_HANDLER(read_directory_changes) ...@@ -1139,7 +1139,7 @@ DECL_HANDLER(read_directory_changes)
return; return;
} }
dir = get_dir_obj( current->process, req->handle, 0 ); dir = get_dir_obj( current->process, req->async.handle, 0 );
if (!dir) if (!dir)
return; return;
......
...@@ -2011,7 +2011,7 @@ DECL_HANDLER(get_handle_fd) ...@@ -2011,7 +2011,7 @@ DECL_HANDLER(get_handle_fd)
DECL_HANDLER(ioctl) DECL_HANDLER(ioctl)
{ {
unsigned int access = (req->code >> 14) & (FILE_READ_DATA|FILE_WRITE_DATA); unsigned int access = (req->code >> 14) & (FILE_READ_DATA|FILE_WRITE_DATA);
struct fd *fd = get_handle_fd_obj( current->process, req->handle, access ); struct fd *fd = get_handle_fd_obj( current->process, req->async.handle, access );
if (fd) if (fd)
{ {
...@@ -2041,7 +2041,7 @@ DECL_HANDLER(register_async) ...@@ -2041,7 +2041,7 @@ DECL_HANDLER(register_async)
return; return;
} }
if ((fd = get_handle_fd_obj( current->process, req->handle, access ))) if ((fd = get_handle_fd_obj( current->process, req->async.handle, access )))
{ {
if (get_unix_fd( fd ) != -1) fd->fd_ops->queue_async( fd, &req->async, req->type, req->count ); if (get_unix_fd( fd ) != -1) fd->fd_ops->queue_async( fd, &req->async, req->type, req->count );
release_object( fd ); release_object( fd );
......
...@@ -177,11 +177,12 @@ typedef struct ...@@ -177,11 +177,12 @@ typedef struct
/* structure for parameters of async I/O calls */ /* structure for parameters of async I/O calls */
typedef struct typedef struct
{ {
obj_handle_t handle; /* object to perform I/O on */
obj_handle_t event; /* event to signal when done */
void *callback; /* client-side callback to call upon end of async */ void *callback; /* client-side callback to call upon end of async */
void *iosb; /* I/O status block in client addr space */ void *iosb; /* I/O status block in client addr space */
void *arg; /* opaque user data to pass to callback */ void *arg; /* opaque user data to pass to callback */
void *apc; /* user apc to call */ void *apc; /* user apc to call */
obj_handle_t event; /* event to signal when done */
apc_param_t cvalue; /* completion value to use for completion events */ apc_param_t cvalue; /* completion value to use for completion events */
} async_data_t; } async_data_t;
...@@ -1307,7 +1308,6 @@ enum char_info_mode ...@@ -1307,7 +1308,6 @@ enum char_info_mode
/* enable directory change notifications */ /* enable directory change notifications */
@REQ(read_directory_changes) @REQ(read_directory_changes)
unsigned int filter; /* notification filter */ unsigned int filter; /* notification filter */
obj_handle_t handle; /* handle to the directory */
int subtree; /* watch the subtree? */ int subtree; /* watch the subtree? */
int want_data; /* flag indicating whether change data should be collected */ int want_data; /* flag indicating whether change data should be collected */
async_data_t async; /* async I/O parameters */ async_data_t async; /* async I/O parameters */
...@@ -1976,7 +1976,6 @@ enum message_type ...@@ -1976,7 +1976,6 @@ enum message_type
/* Create an async I/O */ /* Create an async I/O */
@REQ(register_async) @REQ(register_async)
obj_handle_t handle; /* handle to comm port, socket or file */
int type; /* type of queue to look after */ int type; /* type of queue to look after */
int count; /* count - usually # of bytes to be read/written */ int count; /* count - usually # of bytes to be read/written */
async_data_t async; /* async I/O parameters */ async_data_t async; /* async I/O parameters */
...@@ -1994,7 +1993,6 @@ enum message_type ...@@ -1994,7 +1993,6 @@ enum message_type
/* Perform an ioctl on a file */ /* Perform an ioctl on a file */
@REQ(ioctl) @REQ(ioctl)
obj_handle_t handle; /* handle to the device */
ioctl_code_t code; /* ioctl code */ ioctl_code_t code; /* ioctl code */
async_data_t async; /* async I/O parameters */ async_data_t async; /* async I/O parameters */
VARARG(in_data,bytes); /* ioctl input data */ VARARG(in_data,bytes); /* ioctl input data */
......
...@@ -265,8 +265,9 @@ static void dump_apc_result( const apc_result_t *result ) ...@@ -265,8 +265,9 @@ static void dump_apc_result( const apc_result_t *result )
static void dump_async_data( const async_data_t *data ) static void dump_async_data( const async_data_t *data )
{ {
fprintf( stderr, "{callback=%p,iosb=%p,arg=%p,apc=%p,event=%04x}", fprintf( stderr, "{handle=%04x,event=%04x,callback=%p,iosb=%p,arg=%p,apc=%p,cvalue=}",
data->callback, data->iosb, data->arg, data->apc, data->event ); data->handle, data->event, data->callback, data->iosb, data->arg, data->apc );
dump_uint64( &data->cvalue );
} }
static void dump_luid( const luid_t *luid ) static void dump_luid( const luid_t *luid )
...@@ -1732,7 +1733,6 @@ static void dump_send_console_signal_request( const struct send_console_signal_r ...@@ -1732,7 +1733,6 @@ static void dump_send_console_signal_request( const struct send_console_signal_r
static void dump_read_directory_changes_request( const struct read_directory_changes_request *req ) static void dump_read_directory_changes_request( const struct read_directory_changes_request *req )
{ {
fprintf( stderr, " filter=%08x,", req->filter ); fprintf( stderr, " filter=%08x,", req->filter );
fprintf( stderr, " handle=%04x,", req->handle );
fprintf( stderr, " subtree=%d,", req->subtree ); fprintf( stderr, " subtree=%d,", req->subtree );
fprintf( stderr, " want_data=%d,", req->want_data ); fprintf( stderr, " want_data=%d,", req->want_data );
fprintf( stderr, " async=" ); fprintf( stderr, " async=" );
...@@ -2508,7 +2508,6 @@ static void dump_set_serial_info_request( const struct set_serial_info_request * ...@@ -2508,7 +2508,6 @@ static void dump_set_serial_info_request( const struct set_serial_info_request *
static void dump_register_async_request( const struct register_async_request *req ) static void dump_register_async_request( const struct register_async_request *req )
{ {
fprintf( stderr, " handle=%04x,", req->handle );
fprintf( stderr, " type=%d,", req->type ); fprintf( stderr, " type=%d,", req->type );
fprintf( stderr, " count=%d,", req->count ); fprintf( stderr, " count=%d,", req->count );
fprintf( stderr, " async=" ); fprintf( stderr, " async=" );
...@@ -2522,7 +2521,6 @@ static void dump_cancel_async_request( const struct cancel_async_request *req ) ...@@ -2522,7 +2521,6 @@ static void dump_cancel_async_request( const struct cancel_async_request *req )
static void dump_ioctl_request( const struct ioctl_request *req ) static void dump_ioctl_request( const struct ioctl_request *req )
{ {
fprintf( stderr, " handle=%04x,", req->handle );
fprintf( stderr, " code=" ); fprintf( stderr, " code=" );
dump_ioctl_code( &req->code ); dump_ioctl_code( &req->code );
fprintf( stderr, "," ); fprintf( stderr, "," );
......
...@@ -45,7 +45,7 @@ my %formats = ...@@ -45,7 +45,7 @@ my %formats =
"char_info_t" => [ 4, 2, "&dump_char_info" ], "char_info_t" => [ 4, 2, "&dump_char_info" ],
"apc_call_t" => [ 40, 8, "&dump_apc_call" ], "apc_call_t" => [ 40, 8, "&dump_apc_call" ],
"apc_result_t" => [ 40, 8, "&dump_apc_result" ], "apc_result_t" => [ 40, 8, "&dump_apc_result" ],
"async_data_t" => [ 28, 8, "&dump_async_data" ], "async_data_t" => [ 32, 8, "&dump_async_data" ],
"luid_t" => [ 8, 4, "&dump_luid" ], "luid_t" => [ 8, 4, "&dump_luid" ],
"ioctl_code_t" => [ 4, 4, "&dump_ioctl_code" ], "ioctl_code_t" => [ 4, 4, "&dump_ioctl_code" ],
); );
......
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