2 * msvcrt C++ exception handling
4 * Copyright 2011 Alexandre Julliard
5 * Copyright 2013 André Hentschel
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #define WIN32_NO_STATUS
35 #include "wine/debug.h"
37 #include "cppexcept.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(seh
);
42 extern void *call_exc_handler( void *handler
, ULONG_PTR frame
, UINT flags
, BYTE
*nonvol_regs
);
43 __ASM_GLOBAL_FUNC( call_exc_handler
,
44 "push {r1,r4-r11,lr}\n\t"
45 ".seh_save_regs_w {r1,r4-r11,lr}\n\t"
46 ".seh_endprologue\n\t"
47 "ldm r3, {r4-r11}\n\t"
52 /*******************************************************************
55 void *call_catch_handler( EXCEPTION_RECORD
*rec
)
57 ULONG_PTR frame
= rec
->ExceptionInformation
[1];
58 void *handler
= (void *)rec
->ExceptionInformation
[5];
59 BYTE
*nonvol_regs
= (BYTE
*)rec
->ExceptionInformation
[10];
61 TRACE( "calling %p frame %Ix\n", handler
, frame
);
62 return call_exc_handler( handler
, frame
, 0x100, nonvol_regs
);
66 /*******************************************************************
69 void *call_unwind_handler( void *handler
, ULONG_PTR frame
, DISPATCHER_CONTEXT
*dispatch
)
71 TRACE( "calling %p frame %Ix\n", handler
, frame
);
72 return call_exc_handler( handler
, frame
, 0x100, dispatch
->NonVolatileRegisters
);
76 /*******************************************************************
79 ULONG_PTR
get_exception_pc( DISPATCHER_CONTEXT
*dispatch
)
81 ULONG_PTR pc
= dispatch
->ControlPc
;
82 if (dispatch
->ControlPcIsUnwound
) pc
-= 2;
87 /*********************************************************************
90 int handle_fpieee_flt( __msvcrt_ulong exception_code
, EXCEPTION_POINTERS
*ep
,
91 int (__cdecl
*handler
)(_FPIEEE_RECORD
*) )
93 FIXME("(%lx %p %p)\n", exception_code
, ep
, handler
);
94 return EXCEPTION_CONTINUE_SEARCH
;