Added current context to the exception debug event sent to the server.
diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c
index c06e27c..ba94e19 100644
--- a/dlls/ntdll/exception.c
+++ b/dlls/ntdll/exception.c
@@ -122,7 +122,7 @@
static void EXC_DefaultHandling( EXCEPTION_RECORD *rec, CONTEXT *context )
{
if ((PROCESS_Current()->flags & PDB32_DEBUGGED) &&
- (DEBUG_SendExceptionEvent( rec, FALSE ) == DBG_CONTINUE))
+ (DEBUG_SendExceptionEvent( rec, FALSE, context ) == DBG_CONTINUE))
return; /* continue execution */
if (debug_hook( rec, context, FALSE ) == DBG_CONTINUE)
@@ -152,7 +152,7 @@
TRACE( "code=%lx flags=%lx\n", rec->ExceptionCode, rec->ExceptionFlags );
if ((PROCESS_Current()->flags & PDB32_DEBUGGED) &&
- (DEBUG_SendExceptionEvent( rec, TRUE ) == DBG_CONTINUE))
+ (DEBUG_SendExceptionEvent( rec, TRUE, context ) == DBG_CONTINUE))
return; /* continue execution */
if (debug_hook( rec, context, TRUE ) == DBG_CONTINUE)
diff --git a/include/process.h b/include/process.h
index 05ce076..9e37020 100644
--- a/include/process.h
+++ b/include/process.h
@@ -166,7 +166,7 @@
extern void PROCESS_WalkProcess( void );
/* scheduler/debugger.c */
-extern DWORD DEBUG_SendExceptionEvent( EXCEPTION_RECORD *rec, BOOL first_chance );
+extern DWORD DEBUG_SendExceptionEvent( EXCEPTION_RECORD *rec, BOOL first_chance, CONTEXT *ctx );
extern DWORD DEBUG_SendCreateProcessEvent( HFILE file, HMODULE module, void *entry );
extern DWORD DEBUG_SendCreateThreadEvent( void *entry );
extern DWORD DEBUG_SendLoadDLLEvent( HFILE file, HMODULE module, LPSTR *name );
diff --git a/include/server.h b/include/server.h
index f187ae5..7860e06 100644
--- a/include/server.h
+++ b/include/server.h
@@ -9,7 +9,7 @@
#include <stdlib.h>
#include <time.h>
-#include "windef.h"
+#include "winbase.h"
/* Request structures */
@@ -734,6 +734,7 @@
int nb_params; /* exceptions parameters */
int params[15];
int first_chance; /* first chance to handle it? */
+ CONTEXT context; /* thread context */
};
struct debug_event_create_thread
{
diff --git a/scheduler/debugger.c b/scheduler/debugger.c
index 5b39818..ab5091d 100644
--- a/scheduler/debugger.c
+++ b/scheduler/debugger.c
@@ -34,19 +34,28 @@
*
* Send an EXCEPTION_DEBUG_EVENT event to the current process debugger.
*/
-DWORD DEBUG_SendExceptionEvent( EXCEPTION_RECORD *rec, BOOL first_chance )
+DWORD DEBUG_SendExceptionEvent( EXCEPTION_RECORD *rec, BOOL first_chance, CONTEXT *context )
{
- struct debug_event_exception event;
int i;
+ DWORD ret = 0;
+ struct send_debug_event_request *req = get_req_buffer();
+ struct debug_event_exception *event = (struct debug_event_exception *)(req + 1);
- event.code = rec->ExceptionCode;
- event.flags = rec->ExceptionFlags;
- event.record = rec->ExceptionRecord;
- event.addr = rec->ExceptionAddress;
- event.nb_params = rec->NumberParameters;
- for (i = 0; i < event.nb_params; i++) event.params[i] = rec->ExceptionInformation[i];
- event.first_chance = first_chance;
- return DEBUG_SendEvent( EXCEPTION_DEBUG_EVENT, &event, sizeof(event) );
+ req->code = EXCEPTION_DEBUG_EVENT;
+ event->code = rec->ExceptionCode;
+ event->flags = rec->ExceptionFlags;
+ event->record = rec->ExceptionRecord;
+ event->addr = rec->ExceptionAddress;
+ event->nb_params = rec->NumberParameters;
+ for (i = 0; i < event->nb_params; i++) event->params[i] = rec->ExceptionInformation[i];
+ event->first_chance = first_chance;
+ event->context = *context;
+ if (!server_call( REQ_SEND_DEBUG_EVENT ))
+ {
+ ret = req->status;
+ *context = event->context;
+ }
+ return ret;
}