Fixed bug that could cause SendMessage to return too early in certain

cases.
This commit is contained in:
Alexandre Julliard 2003-03-19 00:12:17 +00:00
parent 6da4c275ca
commit b1095da50c
5 changed files with 10 additions and 5 deletions

View File

@ -1026,6 +1026,7 @@ static void reply_message( struct received_message_info *info, LRESULT result, B
SERVER_START_REQ( reply_message )
{
req->type = info->type;
req->result = result;
req->remove = remove;
for (i = 0; i < data.count; i++) wine_server_add_data( req, data.data[i], data.size[i] );
@ -1407,6 +1408,7 @@ static BOOL process_hardware_message( MSG *msg, ULONG_PTR extra_info, HWND hwnd,
*/
SERVER_START_REQ( reply_message )
{
req->type = MSG_HARDWARE;
req->result = 0;
req->remove = remove || !ret;
wine_server_call( req );

View File

@ -2237,6 +2237,7 @@ struct get_message_reply
struct reply_message_request
{
struct request_header __header;
int type;
unsigned int result;
int remove;
/* VARARG(data,bytes); */
@ -3555,6 +3556,6 @@ union generic_reply
struct get_next_hook_reply get_next_hook_reply;
};
#define SERVER_PROTOCOL_VERSION 100
#define SERVER_PROTOCOL_VERSION 101
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -1589,6 +1589,7 @@ enum message_type
/* Reply to a sent message */
@REQ(reply_message)
int type; /* type of original message */
unsigned int result; /* message result */
int remove; /* should we remove the message? */
VARARG(data,bytes); /* message data for sent messages */

View File

@ -1380,15 +1380,15 @@ DECL_HANDLER(reply_message)
set_error( STATUS_ACCESS_DENIED );
return;
}
if (current->queue->recv_result)
reply_message( current->queue, req->result, 0, req->remove,
get_req_data(), get_req_data_size() );
else
if (req->type == MSG_HARDWARE)
{
struct thread_input *input = current->queue->input;
if (input->msg_thread == current) release_hardware_message( current, req->remove );
else set_error( STATUS_ACCESS_DENIED );
}
else if (current->queue->recv_result)
reply_message( current->queue, req->result, 0, req->remove,
get_req_data(), get_req_data_size() );
}

View File

@ -1835,6 +1835,7 @@ static void dump_get_message_reply( const struct get_message_reply *req )
static void dump_reply_message_request( const struct reply_message_request *req )
{
fprintf( stderr, " type=%d,", req->type );
fprintf( stderr, " result=%08x,", req->result );
fprintf( stderr, " remove=%d,", req->remove );
fprintf( stderr, " data=" );