wow64: Add handler for exceptions happening in 32-bit mode.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-12-01 11:47:03 +01:00
parent 47f59be21f
commit 111398c364
1 changed files with 34 additions and 1 deletions

View File

@ -670,6 +670,39 @@ NTSTATUS WINAPI Wow64SystemServiceEx( UINT num, UINT *args )
} }
static void cpu_simulate(void);
/**********************************************************************
* simulate_filter
*/
static LONG CALLBACK simulate_filter( EXCEPTION_POINTERS *ptrs )
{
Wow64PassExceptionToGuest( ptrs );
cpu_simulate(); /* re-enter simulation to run the exception dispatcher */
return EXCEPTION_EXECUTE_HANDLER;
}
/**********************************************************************
* cpu_simulate
*/
static void cpu_simulate(void)
{
for (;;)
{
__TRY
{
pBTCpuSimulate();
}
__EXCEPT( simulate_filter )
{
/* restart simulation loop */
}
__ENDTRY
}
}
/********************************************************************** /**********************************************************************
* Wow64AllocateTemp (wow64.@) * Wow64AllocateTemp (wow64.@)
* *
@ -769,7 +802,7 @@ void WINAPI Wow64LdrpInitialize( CONTEXT *context )
RtlRunOnceExecuteOnce( &init_done, process_init, NULL, NULL ); RtlRunOnceExecuteOnce( &init_done, process_init, NULL, NULL );
thread_init(); thread_init();
pBTCpuSimulate(); cpu_simulate();
} }