21#ifndef __MSVCRT_CPPEXCEPT_H
22#define __MSVCRT_CPPEXCEPT_H
31#define CXX_FRAME_MAGIC_VC6 0x19930520
32#define CXX_FRAME_MAGIC_VC7 0x19930521
33#define CXX_FRAME_MAGIC_VC8 0x19930522
34#define CXX_EXCEPTION 0xe06d7363
44#define CXX_EXCEPTION_PARAMS 3
52 void * (*handler)(
void);
61 unsigned int catchblock_count;
69 void * (*handler)(
void);
83 const void *expect_list;
89#define CXX_EXCEPTION_PARAMS 4
134#define FUNC_DESCR_SYNCHRONOUS 1
135#define FUNC_DESCR_NOEXCEPT 4
137#define CLASS_IS_SIMPLE_TYPE 1
138#define CLASS_HAS_VIRTUAL_BASE_CLASS 4
140#define TYPE_FLAG_CONST 1
141#define TYPE_FLAG_VOLATILE 2
142#define TYPE_FLAG_REFERENCE 8
171 if (!
info)
return "{}";
179 if (!
object)
return NULL;
188 offset_ptr = (
int *)(*(
char **)
object + off->
vbase_offset);
189 object = (
char *)
object + *offset_ptr;
196#ifdef __ASM_USE_THISCALL_WRAPPER
220 for (
i = 0;
i < type_info_table->
count;
i++)
225 if (!catch_ti)
return type;
265#define TRACE_EXCEPTION_TYPE(type,base) do { \
266 const cxx_type_info_table *table = rtti_rva( type->type_info_table, base ); \
268 TRACE( "flags %x destr %p handler %p type info %p\n", \
269 type->flags, rtti_rva( type->destructor, base ), \
270 type->custom_handler ? rtti_rva( type->custom_handler, base ) : NULL, table ); \
271 for (i = 0; i < table->count; i++) \
273 const cxx_type_info *type = rtti_rva( table->info[i], base ); \
274 const type_info *info = rtti_rva( type->type_info, base ); \
275 TRACE( " %d: flags %x type %p %s offsets %d,%d,%d size %d copy ctor %p\n", \
276 i, type->flags, info, dbgstr_type_info( info ), \
277 type->offsets.this_offset, type->offsets.vbase_descr, type->offsets.vbase_offset, \
278 type->size, rtti_rva( type->copy_ctor, base )); \
295#define EXCEPTION_MANGLED_NAME ".?AVexception@std@@"
297#define EXCEPTION_MANGLED_NAME ".?AVexception@@"
300#define CREATE_EXCEPTION_OBJECT(exception_name) \
301static exception* __exception_ctor(exception *this, const char *str, const vtable_ptr *vtbl) \
305 unsigned int len = strlen(str) + 1; \
306 this->name = malloc(len); \
307 memcpy(this->name, str, len); \
308 this->do_free = TRUE; \
313 this->do_free = FALSE; \
315 this->vtable = vtbl; \
319static exception* __exception_copy_ctor(exception *this, const exception *rhs, const vtable_ptr *vtbl) \
323 __exception_ctor(this, rhs->name, vtbl); \
328 this->vtable = vtbl; \
332extern const vtable_ptr exception_name ## _vtable; \
333DEFINE_THISCALL_WRAPPER(exception_name ## _copy_ctor,8) \
334exception* __thiscall exception_name ## _copy_ctor(exception *this, const exception *rhs) \
336 return __exception_copy_ctor(this, rhs, & exception_name ## _vtable); \
339DEFINE_THISCALL_WRAPPER(exception_name ## _dtor,4) \
340void __thiscall exception_name ## _dtor(exception *this) \
342 if (this->do_free) free(this->name); \
345DEFINE_THISCALL_WRAPPER(exception_name ## _vector_dtor,8) \
346void* __thiscall exception_name ## _vector_dtor(exception *this, unsigned int flags) \
350 INT_PTR i, *ptr = (INT_PTR *)this - 1; \
352 for (i = *ptr - 1; i >= 0; i--) exception_name ## _dtor(this + i); \
353 operator_delete(ptr); \
357 exception_name ## _dtor(this); \
358 if (flags & 1) operator_delete(this); \
363DEFINE_THISCALL_WRAPPER(exception_name ## _what,4) \
364const char* __thiscall exception_name ## _what(exception *this) \
366 return this->name ? this->name : "Unknown exception"; \
369__ASM_BLOCK_BEGIN(exception_name ## _vtables) \
370__ASM_VTABLE(exception_name, \
371 VTABLE_ADD_FUNC(exception_name ## _vector_dtor) \
372 VTABLE_ADD_FUNC(exception_name ## _what)); \
375DEFINE_RTTI_DATA0(exception_name, 0, EXCEPTION_MANGLED_NAME)
void dispatch(HANDLE hStopEvent)
const char * wine_dbg_sprintf(const char *format,...)
UINT(* handler)(MSIPACKAGE *)
DECLSPEC_NORETURN void WINAPI _CxxThrowException(void *, const cxx_exception_type *)
static const char * dbgstr_type_info(const type_info *info)
static const cxx_type_info * find_caught_type(cxx_exception_type *exc_type, uintptr_t base, const type_info *catch_ti, UINT catch_flags)
void __cdecl __ExceptionPtrCreate(exception_ptr *)
#define CLASS_IS_SIMPLE_TYPE
void throw_exception(const char *)
static void call_dtor(void *func, void *this)
#define CXX_FRAME_MAGIC_VC6
#define CLASS_HAS_VIRTUAL_BASE_CLASS
static void call_copy_ctor(void *func, void *this, void *src, int has_vbase)
#define CXX_FRAME_MAGIC_VC8
void exception_ptr_from_record(exception_ptr *, EXCEPTION_RECORD *)
static BOOL is_cxx_exception(EXCEPTION_RECORD *rec)
void dump_function_descr(const cxx_function_descr *descr, uintptr_t base)
BOOL __cdecl __uncaught_exception(void)
static void copy_exception(void *object, void **dest, UINT catch_flags, const cxx_type_info *type, uintptr_t base)
void * call_unwind_handler(void *func, uintptr_t frame, DISPATCHER_CONTEXT *dispatch)
int handle_fpieee_flt(__msvcrt_ulong exception_code, EXCEPTION_POINTERS *ep, int(__cdecl *handler)(_FPIEEE_RECORD *))
void __cdecl __ExceptionPtrDestroy(exception_ptr *)
void __cdecl __ExceptionPtrRethrow(const exception_ptr *)
void * call_catch_handler(EXCEPTION_RECORD *rec)
#define CXX_EXCEPTION_PARAMS
#define TYPE_FLAG_VOLATILE
ULONG_PTR get_exception_pc(DISPATCHER_CONTEXT *dispatch)
void * find_catch_handler(void *object, uintptr_t frame, uintptr_t exc_base, const tryblock_info *tryblock, cxx_exception_type *exc_type, uintptr_t image_base)
static void * get_this_pointer(const this_ptr_offsets *off, void *object)
#define TYPE_FLAG_REFERENCE
struct __type_info type_info
static void * rtti_rva(unsigned int rva, uintptr_t base)
#define DECLSPEC_NORETURN
unsigned long __msvcrt_ulong
_ACRTIMP int __cdecl strcmp(const char *, const char *)
static void * image_base(void)
GLuint GLuint GLsizei GLenum type
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memmove(s1, s2, n)
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
unsigned int type_info_table