ReactOS 0.4.16-dev-527-gdad3a09
except_arm.c
Go to the documentation of this file.
1/*
2 * msvcrt C++ exception handling
3 *
4 * Copyright 2011 Alexandre Julliard
5 * Copyright 2013 André Hentschel
6 *
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.
11 *
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.
16 *
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
20 */
21
22#ifdef __arm__
23
24#include <setjmp.h>
25#include <stdarg.h>
26#include <fpieee.h>
27
28#include "ntstatus.h"
29#define WIN32_NO_STATUS
30#include "windef.h"
31#include "winbase.h"
32#include "winternl.h"
33#include "msvcrt.h"
34#include "wine/exception.h"
35#include "excpt.h"
36#include "wine/debug.h"
37
38#include "cppexcept.h"
39
41
42
43/*********************************************************************
44 * __CxxExceptionFilter (MSVCRT.@)
45 */
46int CDECL __CxxExceptionFilter( PEXCEPTION_POINTERS ptrs,
47 const type_info *ti, int flags, void **copy )
48{
49 FIXME( "%p %p %x %p: not implemented\n", ptrs, ti, flags, copy );
51}
52
53/*********************************************************************
54 * __CxxFrameHandler (MSVCRT.@)
55 */
56EXCEPTION_DISPOSITION CDECL __CxxFrameHandler(EXCEPTION_RECORD *rec, DWORD frame, CONTEXT *context,
58{
59 FIXME("%p %x %p %p: not implemented\n", rec, frame, context, dispatch);
61}
62
63
64/*********************************************************************
65 * __CppXcptFilter (MSVCRT.@)
66 */
68{
69 /* only filter c++ exceptions */
71 return _XcptFilter(ex, ptr);
72}
73
74
75/*********************************************************************
76 * __CxxDetectRethrow (MSVCRT.@)
77 */
78BOOL CDECL __CxxDetectRethrow(PEXCEPTION_POINTERS ptrs)
79{
81
82 if (!ptrs)
83 return FALSE;
84
85 rec = ptrs->ExceptionRecord;
86
87 if (rec->ExceptionCode == CXX_EXCEPTION &&
88 rec->NumberParameters == 3 &&
91 {
92 ptrs->ExceptionRecord = msvcrt_get_thread_data()->exc_record;
93 return TRUE;
94 }
95 return (msvcrt_get_thread_data()->exc_record == rec);
96}
97
98
99/*********************************************************************
100 * __CxxQueryExceptionSize (MSVCRT.@)
101 */
102unsigned int CDECL __CxxQueryExceptionSize(void)
103{
104 return sizeof(cxx_exception_type);
105}
106
107
108/*******************************************************************
109 * _setjmp (MSVCRT.@)
110 */
111__ASM_GLOBAL_FUNC(MSVCRT__setjmp,
112 "b " __ASM_NAME("__wine_setjmpex"));
113
114/*******************************************************************
115 * longjmp (MSVCRT.@)
116 */
117void __cdecl MSVCRT_longjmp(_JUMP_BUFFER *jmp, int retval)
118{
120
121 if (!retval) retval = 1;
122 if (jmp->Frame)
123 {
125 rec.ExceptionFlags = 0;
126 rec.ExceptionRecord = NULL;
128 rec.NumberParameters = 1;
129 rec.ExceptionInformation[0] = (DWORD_PTR)jmp;
130 RtlUnwind((void *)jmp->Frame, (void *)jmp->Pc, &rec, IntToPtr(retval));
131 }
132 __wine_longjmp( (__wine_jmp_buf *)jmp, retval );
133}
134
135/*********************************************************************
136 * _fpieee_flt (MSVCRT.@)
137 */
140{
141 FIXME("(%lx %p %p)\n", exception_code, ep, handler);
143}
144
145#endif /* __arm__ */
#define __cdecl
Definition: accygwin.h:79
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
LONG NTSTATUS
Definition: precomp.h:26
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:70
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define IntToPtr(i)
Definition: basetsd.h:89
_CRTIMP int __cdecl _fpieee_flt(unsigned long _ExceptionCode, struct _EXCEPTION_POINTERS *_PtExceptionPtr, int(__cdecl *_Handler)(_FPIEEE_RECORD *))
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CDECL
Definition: compat.h:29
@ ExceptionContinueSearch
Definition: compat.h:91
enum _EXCEPTION_DISPOSITION EXCEPTION_DISPOSITION
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
int CDECL _XcptFilter(NTSTATUS, PEXCEPTION_POINTERS)
Definition: except.c:278
#define CXX_EXCEPTION
Definition: cppexcept.h:27
#define CXX_FRAME_MAGIC_VC6
Definition: cppexcept.h:24
struct __cxx_exception_type cxx_exception_type
int CDECL __CppXcptFilter(NTSTATUS, PEXCEPTION_POINTERS)
#define exception_code
Definition: excpt.h:84
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:91
static PVOID ptr
Definition: dispmode.c:27
thread_data_t * msvcrt_get_thread_data(void)
Definition: tls.c:31
#define __ASM_NAME(name)
Definition: config.h:934
#define __ASM_GLOBAL_FUNC(name, code)
Definition: port.h:201
NTSYSAPI VOID NTAPI RtlUnwind(_In_opt_ PVOID TargetFrame, _In_opt_ PVOID TargetIp, _In_opt_ PEXCEPTION_RECORD ExceptionRecord, _In_ PVOID ReturnValue)
Definition: unwind.c:918
#define STATUS_LONGJUMP
Definition: ntstatus.h:217
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:200
struct _EXCEPTION_RECORD * ExceptionRecord
Definition: compat.h:210
DWORD ExceptionCode
Definition: compat.h:208
DWORD NumberParameters
Definition: compat.h:212
DWORD ExceptionFlags
Definition: compat.h:209
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
Definition: compat.h:213
PVOID ExceptionAddress
Definition: compat.h:211
Definition: http.c:7252
Definition: comerr.c:44
#define DWORD_PTR
Definition: treelist.c:76
int retval
Definition: wcstombs.cpp:91