ntdll: Set the exception address to the program counter in RtlRaiseException.

This commit is contained in:
Alexandre Julliard 2009-04-10 13:17:12 +02:00
parent f4eee1c731
commit 7f9750550a
5 changed files with 12 additions and 5 deletions

View File

@ -2013,7 +2013,10 @@ void __wine_enter_vm86( CONTEXT *context )
*/
void WINAPI __regs_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
{
NTSTATUS status = raise_exception( rec, context, TRUE );
NTSTATUS status;
rec->ExceptionAddress = (void *)context->Eip;
status = raise_exception( rec, context, TRUE );
if (status != STATUS_SUCCESS) raise_status( status, rec );
}
DEFINE_REGS_ENTRYPOINT( RtlRaiseException, 1 )

View File

@ -1010,6 +1010,7 @@ void WINAPI RtlRaiseException( EXCEPTION_RECORD *rec )
NTSTATUS status;
RtlCaptureContext( &context );
rec->ExceptionAddress = (void *)context.Iar;
status = raise_exception( rec, &context, TRUE );
if (status) raise_status( status, rec );
}

View File

@ -724,6 +724,7 @@ void WINAPI RtlRaiseException( EXCEPTION_RECORD *rec )
NTSTATUS status;
RtlCaptureContext( &context );
rec->ExceptionAddress = (void *)context.pc;
status = raise_exception( rec, &context, TRUE );
if (status) raise_status( status, rec );
}

View File

@ -809,7 +809,10 @@ PVOID WINAPI RtlVirtualUnwind ( ULONG type, ULONG64 base, ULONG64 pc,
*/
void WINAPI __regs_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
{
NTSTATUS status = raise_exception( rec, context, TRUE );
NTSTATUS status;
rec->ExceptionAddress = (void *)context->Rip;
status = raise_exception( rec, context, TRUE );
if (status != STATUS_SUCCESS) raise_status( status, rec );
}
DEFINE_REGS_ENTRYPOINT( RtlRaiseException, 1 )

View File

@ -206,7 +206,6 @@ static LONG CALLBACK rtlraiseexception_vectored_handler(EXCEPTION_POINTERS *Exce
trace("vect. handler %08x addr:%p context.Eip:%x\n", rec->ExceptionCode,
rec->ExceptionAddress, context->Eip);
todo_wine
ok(rec->ExceptionAddress == (char *)code_mem + 0xb, "ExceptionAddress at %p instead of %p\n",
rec->ExceptionAddress, (char *)code_mem + 0xb);
@ -241,10 +240,8 @@ static DWORD rtlraiseexception_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR
trace( "exception: %08x flags:%x addr:%p context: Eip:%x\n",
rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, context->Eip );
todo_wine {
ok(rec->ExceptionAddress == (char *)code_mem + 0xb, "ExceptionAddress at %p instead of %p\n",
rec->ExceptionAddress, (char *)code_mem + 0xb);
}
/* check that context.Eip is fixed up only for EXCEPTION_BREAKPOINT
* even if raised by RtlRaiseException
@ -319,6 +316,8 @@ static void run_rtlraiseexception_test(DWORD exceptioncode)
}
func(pRtlRaiseException, &record);
ok( record.ExceptionAddress == (char *)code_mem + 0x0b,
"address set to %p instead of %p\n", record.ExceptionAddress, (char *)code_mem + 0x0b );
if (have_vectored_api)
pRtlRemoveVectoredExceptionHandler(vectored_handler);