diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index be5a3423569..84802b2e7cd 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -2482,6 +2482,9 @@ static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL f if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED) return STATUS_SUCCESS; + /* fix up instruction pointer in context for EXCEPTION_BREAKPOINT */ + if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) context->Rip--; + if (call_vectored_handlers( rec, context ) == EXCEPTION_CONTINUE_EXECUTION) return STATUS_SUCCESS; diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 0f07404535b..670c37b0e48 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1911,7 +1911,6 @@ static LONG CALLBACK debug_service_handler(EXCEPTION_POINTERS *ExceptionInfo) "got ExceptionInformation[2] = %lx\n", rec->ExceptionInformation[2]); } #else - todo_wine ok(ExceptionInfo->ContextRecord->Rip == (DWORD_PTR)code_mem + 0x2f, "expected Rip = %lx, got %lx\n", (DWORD_PTR)code_mem + 0x2f, ExceptionInfo->ContextRecord->Rip); ok(rec->NumberParameters == 1, @@ -1978,7 +1977,6 @@ static const BYTE call_debug_service_code[] = { static void test_debug_service(DWORD numexc) { - const BOOL is_win64 = (sizeof(void *) > sizeof(int)); DWORD (CDECL *func)(DWORD_PTR) = code_mem; DWORD expected_exc, expected_ret; void *vectored_handler; @@ -1999,7 +1997,6 @@ static void test_debug_service(DWORD numexc) ok(debug_service_exceptions == expected_exc, "BREAKPOINT_BREAK generated %u exceptions, expected %u\n", debug_service_exceptions, expected_exc); - todo_wine_if(is_win64) ok(ret == expected_ret, "BREAKPOINT_BREAK returned %u, expected %u\n", ret, expected_ret); @@ -2009,7 +2006,6 @@ static void test_debug_service(DWORD numexc) ok(debug_service_exceptions == expected_exc, "BREAKPOINT_PROMPT generated %u exceptions, expected %u\n", debug_service_exceptions, expected_exc); - todo_wine_if(is_win64) ok(ret == expected_ret, "BREAKPOINT_PROMPT returned %u, expected %u\n", ret, expected_ret); @@ -2019,7 +2015,6 @@ static void test_debug_service(DWORD numexc) ok(debug_service_exceptions == expected_exc, "invalid debug service generated %u exceptions, expected %u\n", debug_service_exceptions, expected_exc); - todo_wine_if(is_win64) ok(ret == expected_ret, "invalid debug service returned %u, expected %u\n", ret, expected_ret); @@ -2086,7 +2081,6 @@ static LONG CALLBACK breakpoint_handler(EXCEPTION_POINTERS *ExceptionInfo) "got ExceptionInformation[0] = %lx\n", rec->ExceptionInformation[0]); ExceptionInfo->ContextRecord->Eip = (DWORD)code_mem + 2; #else - todo_wine ok(ExceptionInfo->ContextRecord->Rip == (DWORD_PTR)code_mem + 1, "expected Rip = %lx, got %lx\n", (DWORD_PTR)code_mem + 1, ExceptionInfo->ContextRecord->Rip); todo_wine