mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 02:13:38 +00:00
server: Store the async handle inside the async_data_t structure.
This commit is contained in:
parent
cb08534a3d
commit
a7b3efde0e
|
@ -2396,10 +2396,10 @@ NtNotifyChangeDirectoryFile( HANDLE FileHandle, HANDLE Event,
|
|||
|
||||
SERVER_START_REQ( read_directory_changes )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( FileHandle );
|
||||
req->filter = CompletionFilter;
|
||||
req->want_data = (Buffer != NULL);
|
||||
req->subtree = WatchTree;
|
||||
req->async.handle = wine_server_obj_handle( FileHandle );
|
||||
req->async.callback = read_changes_apc;
|
||||
req->async.iosb = IoStatusBlock;
|
||||
req->async.arg = info;
|
||||
|
|
|
@ -652,14 +652,14 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
|
|||
|
||||
SERVER_START_REQ( register_async )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( hFile );
|
||||
req->type = ASYNC_TYPE_READ;
|
||||
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.iosb = io_status;
|
||||
req->async.arg = fileio;
|
||||
req->async.apc = fileio_apc;
|
||||
req->async.event = wine_server_obj_handle( hEvent );
|
||||
req->async.cvalue = cvalue;
|
||||
status = wine_server_call( req );
|
||||
}
|
||||
|
@ -976,14 +976,14 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
|
|||
|
||||
SERVER_START_REQ( register_async )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( hFile );
|
||||
req->type = ASYNC_TYPE_WRITE;
|
||||
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.iosb = io_status;
|
||||
req->async.arg = fileio;
|
||||
req->async.apc = fileio_apc;
|
||||
req->async.event = wine_server_obj_handle( hEvent );
|
||||
req->async.cvalue = cvalue;
|
||||
status = wine_server_call( req );
|
||||
}
|
||||
|
@ -1197,8 +1197,8 @@ static NTSTATUS server_ioctl_file( HANDLE handle, HANDLE event,
|
|||
|
||||
SERVER_START_REQ( ioctl )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( handle );
|
||||
req->code = code;
|
||||
req->async.handle = wine_server_obj_handle( handle );
|
||||
req->async.callback = ioctl_completion;
|
||||
req->async.iosb = io;
|
||||
req->async.arg = async;
|
||||
|
|
|
@ -1327,8 +1327,8 @@ static int WS2_register_async_shutdown( SOCKET s, int type )
|
|||
|
||||
SERVER_START_REQ( register_async )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( wsa->hSocket );
|
||||
req->type = type;
|
||||
req->async.handle = wine_server_obj_handle( wsa->hSocket );
|
||||
req->async.callback = WS2_async_shutdown;
|
||||
req->async.iosb = &wsa->local_iosb;
|
||||
req->async.arg = wsa;
|
||||
|
@ -2780,8 +2780,8 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
|
|||
|
||||
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.iosb = iosb;
|
||||
req->async.arg = wsa;
|
||||
|
@ -4306,8 +4306,8 @@ INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
|
|||
|
||||
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.iosb = iosb;
|
||||
req->async.arg = wsa;
|
||||
|
|
|
@ -161,11 +161,12 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
obj_handle_t handle;
|
||||
obj_handle_t event;
|
||||
void *callback;
|
||||
void *iosb;
|
||||
void *arg;
|
||||
void *apc;
|
||||
obj_handle_t event;
|
||||
apc_param_t cvalue;
|
||||
} async_data_t;
|
||||
|
||||
|
@ -1651,7 +1652,6 @@ struct read_directory_changes_request
|
|||
{
|
||||
struct request_header __header;
|
||||
unsigned int filter;
|
||||
obj_handle_t handle;
|
||||
int subtree;
|
||||
int want_data;
|
||||
async_data_t async;
|
||||
|
@ -2671,7 +2671,6 @@ struct set_serial_info_reply
|
|||
struct register_async_request
|
||||
{
|
||||
struct request_header __header;
|
||||
obj_handle_t handle;
|
||||
int type;
|
||||
int count;
|
||||
async_data_t async;
|
||||
|
@ -2701,7 +2700,6 @@ struct cancel_async_reply
|
|||
struct ioctl_request
|
||||
{
|
||||
struct request_header __header;
|
||||
obj_handle_t handle;
|
||||
ioctl_code_t code;
|
||||
async_data_t async;
|
||||
/* VARARG(in_data,bytes); */
|
||||
|
@ -5053,6 +5051,6 @@ union generic_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 */
|
||||
|
|
|
@ -1139,7 +1139,7 @@ DECL_HANDLER(read_directory_changes)
|
|||
return;
|
||||
}
|
||||
|
||||
dir = get_dir_obj( current->process, req->handle, 0 );
|
||||
dir = get_dir_obj( current->process, req->async.handle, 0 );
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
|
|
|
@ -2011,7 +2011,7 @@ DECL_HANDLER(get_handle_fd)
|
|||
DECL_HANDLER(ioctl)
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
@ -2041,7 +2041,7 @@ DECL_HANDLER(register_async)
|
|||
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 );
|
||||
release_object( fd );
|
||||
|
|
|
@ -177,11 +177,12 @@ typedef struct
|
|||
/* structure for parameters of async I/O calls */
|
||||
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 *iosb; /* I/O status block in client addr space */
|
||||
void *arg; /* opaque user data to pass to callback */
|
||||
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 */
|
||||
} async_data_t;
|
||||
|
||||
|
@ -1307,7 +1308,6 @@ enum char_info_mode
|
|||
/* enable directory change notifications */
|
||||
@REQ(read_directory_changes)
|
||||
unsigned int filter; /* notification filter */
|
||||
obj_handle_t handle; /* handle to the directory */
|
||||
int subtree; /* watch the subtree? */
|
||||
int want_data; /* flag indicating whether change data should be collected */
|
||||
async_data_t async; /* async I/O parameters */
|
||||
|
@ -1976,7 +1976,6 @@ enum message_type
|
|||
|
||||
/* Create an async I/O */
|
||||
@REQ(register_async)
|
||||
obj_handle_t handle; /* handle to comm port, socket or file */
|
||||
int type; /* type of queue to look after */
|
||||
int count; /* count - usually # of bytes to be read/written */
|
||||
async_data_t async; /* async I/O parameters */
|
||||
|
@ -1994,7 +1993,6 @@ enum message_type
|
|||
|
||||
/* Perform an ioctl on a file */
|
||||
@REQ(ioctl)
|
||||
obj_handle_t handle; /* handle to the device */
|
||||
ioctl_code_t code; /* ioctl code */
|
||||
async_data_t async; /* async I/O parameters */
|
||||
VARARG(in_data,bytes); /* ioctl input data */
|
||||
|
|
|
@ -265,8 +265,9 @@ static void dump_apc_result( const apc_result_t *result )
|
|||
|
||||
static void dump_async_data( const async_data_t *data )
|
||||
{
|
||||
fprintf( stderr, "{callback=%p,iosb=%p,arg=%p,apc=%p,event=%04x}",
|
||||
data->callback, data->iosb, data->arg, data->apc, data->event );
|
||||
fprintf( stderr, "{handle=%04x,event=%04x,callback=%p,iosb=%p,arg=%p,apc=%p,cvalue=}",
|
||||
data->handle, data->event, data->callback, data->iosb, data->arg, data->apc );
|
||||
dump_uint64( &data->cvalue );
|
||||
}
|
||||
|
||||
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
|
|||
static void dump_read_directory_changes_request( const struct read_directory_changes_request *req )
|
||||
{
|
||||
fprintf( stderr, " filter=%08x,", req->filter );
|
||||
fprintf( stderr, " handle=%04x,", req->handle );
|
||||
fprintf( stderr, " subtree=%d,", req->subtree );
|
||||
fprintf( stderr, " want_data=%d,", req->want_data );
|
||||
fprintf( stderr, " async=" );
|
||||
|
@ -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 )
|
||||
{
|
||||
fprintf( stderr, " handle=%04x,", req->handle );
|
||||
fprintf( stderr, " type=%d,", req->type );
|
||||
fprintf( stderr, " count=%d,", req->count );
|
||||
fprintf( stderr, " async=" );
|
||||
|
@ -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 )
|
||||
{
|
||||
fprintf( stderr, " handle=%04x,", req->handle );
|
||||
fprintf( stderr, " code=" );
|
||||
dump_ioctl_code( &req->code );
|
||||
fprintf( stderr, "," );
|
||||
|
|
|
@ -45,7 +45,7 @@ my %formats =
|
|||
"char_info_t" => [ 4, 2, "&dump_char_info" ],
|
||||
"apc_call_t" => [ 40, 8, "&dump_apc_call" ],
|
||||
"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" ],
|
||||
"ioctl_code_t" => [ 4, 4, "&dump_ioctl_code" ],
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue