diff --git a/dlls/kernel/except.c b/dlls/kernel/except.c index dd82550d914..9e40eb6138f 100644 --- a/dlls/kernel/except.c +++ b/dlls/kernel/except.c @@ -196,19 +196,15 @@ static NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTE SERVER_END_REQ; if (ret) return ret; - /* No need to wait on the handle since the process gets suspended - * once the event is passed to the debugger, so when we get back - * here the event has been continued already. - */ + WaitForSingleObject( handle, INFINITE ); + SERVER_START_REQ( get_exception_status ) { req->handle = handle; wine_server_set_reply( req, context, sizeof(*context) ); - wine_server_call( req ); - ret = reply->status; + ret = wine_server_call( req ); } SERVER_END_REQ; - NtClose( handle ); return ret; } diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 20024d58b9b..8265bf3bc32 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -164,19 +164,15 @@ static int send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *c SERVER_END_REQ; if (!handle) return 0; - /* No need to wait on the handle since the process gets suspended - * once the event is passed to the debugger, so when we get back - * here the event has been continued already. - */ + NTDLL_wait_for_multiple_objects( 1, &handle, 0, NULL, 0 ); + SERVER_START_REQ( get_exception_status ) { req->handle = handle; wine_server_set_reply( req, context, sizeof(*context) ); - wine_server_call( req ); - ret = reply->status; + ret = wine_server_call( req ); } SERVER_END_REQ; - NtClose( handle ); return ret; } diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 3676e3c2a7f..b4a34c91090 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4207,6 +4207,6 @@ union generic_reply struct set_mailslot_info_reply set_mailslot_info_reply; }; -#define SERVER_PROTOCOL_VERSION 195 +#define SERVER_PROTOCOL_VERSION 196 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/debugger.c b/server/debugger.c index 28781ad0761..8940c0bdb5c 100644 --- a/server/debugger.c +++ b/server/debugger.c @@ -661,19 +661,19 @@ DECL_HANDLER(get_exception_status) { struct debug_event *event; - reply->status = 0; if ((event = (struct debug_event *)get_handle_obj( current->process, req->handle, 0, &debug_event_ops ))) { + close_handle( current->process, req->handle, NULL ); if (event->state == EVENT_CONTINUED) { - reply->status = event->status; if (current->context == &event->context) { size_t size = min( sizeof(CONTEXT), get_reply_max_size() ); set_reply_data( &event->context, size ); current->context = NULL; } + set_error( event->status ); } else set_error( STATUS_PENDING ); release_object( event ); diff --git a/server/protocol.def b/server/protocol.def index f0490cbd3dc..135e2bbeff3 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1162,7 +1162,6 @@ enum char_info_mode @REQ(get_exception_status) obj_handle_t handle; /* handle to the queued event */ @REPLY - int status; /* event continuation status */ VARARG(context,context); /* modified thread context */ @END diff --git a/server/thread.c b/server/thread.c index bddabb0833d..6b83fe099a5 100644 --- a/server/thread.c +++ b/server/thread.c @@ -315,6 +315,7 @@ static void set_thread_info( struct thread *thread, /* stop a thread (at the Unix level) */ void stop_thread( struct thread *thread ) { + if (thread->context) return; /* already inside a debug event, no need for a signal */ /* can't stop a thread while initialisation is in progress */ if (is_process_init_done(thread->process)) send_thread_signal( thread, SIGUSR1 ); }