diff --git a/dlls/kernel32/debugger.c b/dlls/kernel32/debugger.c index d439475381e..d78b0831785 100644 --- a/dlls/kernel32/debugger.c +++ b/dlls/kernel32/debugger.c @@ -199,6 +199,7 @@ BOOL WINAPI ContinueDebugEvent( */ BOOL WINAPI DebugActiveProcess( DWORD pid ) { + HANDLE process; BOOL ret; SERVER_START_REQ( debug_process ) { @@ -207,6 +208,11 @@ BOOL WINAPI DebugActiveProcess( DWORD pid ) ret = !wine_server_call_err( req ); } SERVER_END_REQ; + if (!ret) return FALSE; + if (!(process = OpenProcess( PROCESS_CREATE_THREAD, FALSE, pid ))) return FALSE; + ret = DebugBreakProcess( process ); + NtClose( process ); + if (!ret) DebugActiveProcessStop( pid ); return ret; } diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c index ff25c21adce..bc12ea8b69c 100644 --- a/dlls/kernel32/tests/debugger.c +++ b/dlls/kernel32/tests/debugger.c @@ -308,7 +308,6 @@ static void process_attach_events(struct debugger_context *ctx) ok(ctx->dll_cnt > 2, "dll_cnt = %d\n", ctx->dll_cnt); /* a new thread is created and it executes DbgBreakPoint, which causes the exception */ - todo_wine ok(ctx->ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx->ev.dwDebugEventCode); if (ctx->ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT) { @@ -320,7 +319,6 @@ static void process_attach_events(struct debugger_context *ctx) ok(ctx->ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx->ev.dwDebugEventCode); ok(ctx->ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %x\n", ctx->ev.u.Exception.ExceptionRecord.ExceptionCode); - todo_wine ok(ctx->ev.u.Exception.ExceptionRecord.ExceptionAddress == pDbgBreakPoint, "ExceptionAddres != DbgBreakPoint\n"); /* flush debug events */ diff --git a/server/debugger.c b/server/debugger.c index 7c64cbbac84..99e50aa4f36 100644 --- a/server/debugger.c +++ b/server/debugger.c @@ -638,7 +638,6 @@ DECL_HANDLER(debug_process) else if (debugger_attach( process, current )) { generate_startup_debug_events( process, 0 ); - break_process( process ); resume_process( process ); } release_object( process );