Commit 36309142 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Handle seh exceptions rethrowing in cxx_frame_handler.

parent b5b454c5
......@@ -522,17 +522,21 @@ DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame
}
if (!descr->tryblock_count) return ExceptionContinueSearch;
if(rec->ExceptionCode == CXX_EXCEPTION)
if(rec->ExceptionCode == CXX_EXCEPTION &&
rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0)
{
if (rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0)
{
EXCEPTION_RECORD *exc_record = msvcrt_get_thread_data()->exc_record;
rec->ExceptionInformation[1] = exc_record->ExceptionInformation[1];
rec->ExceptionInformation[2] = exc_record->ExceptionInformation[2];
TRACE("detect rethrow: obj: %lx, type: %lx\n",
rec->ExceptionInformation[1], rec->ExceptionInformation[2]);
*rec = *msvcrt_get_thread_data()->exc_record;
rec->ExceptionFlags &= ~EH_UNWINDING;
if(TRACE_ON(seh)) {
TRACE("detect rethrow: exception code: %x\n", rec->ExceptionCode);
if(rec->ExceptionCode == CXX_EXCEPTION)
TRACE("re-propage: obj: %lx, type: %lx\n",
rec->ExceptionInformation[1], rec->ExceptionInformation[2]);
}
}
if(rec->ExceptionCode == CXX_EXCEPTION)
{
exc_type = (cxx_exception_type *)rec->ExceptionInformation[2];
if (rec->ExceptionInformation[0] > CXX_FRAME_MAGIC_VC8 &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment