From: Piotr Caban piotr@codeweavers.com
--- dlls/msvcrt/handler4.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcrt/handler4.c b/dlls/msvcrt/handler4.c index 8ffdbdbf063..e05a9528b24 100644 --- a/dlls/msvcrt/handler4.c +++ b/dlls/msvcrt/handler4.c @@ -400,8 +400,8 @@ static void CALLBACK cxx_catch_cleanup(BOOL normal, void *c)
static void* WINAPI call_catch_block4(EXCEPTION_RECORD *rec) { - EXCEPTION_RECORD *prev_rec = (void*)rec->ExceptionInformation[4]; - EXCEPTION_RECORD *untrans_rec = (void*)rec->ExceptionInformation[6]; + EXCEPTION_RECORD *untrans_rec = (void*)rec->ExceptionInformation[4]; + EXCEPTION_RECORD *prev_rec = (void*)rec->ExceptionInformation[6]; CONTEXT *context = (void*)rec->ExceptionInformation[7]; EXCEPTION_POINTERS ep = { prev_rec, context }; cxx_catch_ctx ctx; @@ -534,9 +534,10 @@ static inline void find_catch_block4(EXCEPTION_RECORD *rec, CONTEXT *context, catch_record.ExceptionInformation[1] = orig_frame; catch_record.ExceptionInformation[2] = tryblock.catch_level; catch_record.ExceptionInformation[3] = tryblock.start_level; - catch_record.ExceptionInformation[4] = (ULONG_PTR)rec; + catch_record.ExceptionInformation[4] = (ULONG_PTR)untrans_rec; catch_record.ExceptionInformation[5] = (ULONG_PTR)rtti_rva(ci.handler, dispatch->ImageBase); - catch_record.ExceptionInformation[6] = (ULONG_PTR)untrans_rec; + /* 3ds Max plugin expect ExceptionInformation[6] to contain exception record */ + catch_record.ExceptionInformation[6] = (ULONG_PTR)rec; catch_record.ExceptionInformation[7] = (ULONG_PTR)context; if (ci.ret_addr[0]) {