#include <stdarg.h>
#include <stdbool.h>
#include "windef.h"
#include "winternl.h"
#include "wine/exception.h"
#include "wine/debug.h"
#include "msvcrt.h"
#include "mtdll.h"
#include "cxx.h"
Go to the source code of this file.
|
| | WINE_DEFAULT_DEBUG_CHANNEL (msvcrt) |
| |
| static const vtable_ptr * | get_vtable (void *obj) |
| |
| static const rtti_object_locator * | get_obj_locator (void *cppobj) |
| |
| static void | dump_obj_locator (const rtti_object_locator *ptr) |
| |
| exception __thiscall | exception_ctor (exception *_this, const char **name) |
| |
| exception __thiscall | exception_ctor_noalloc (exception *_this, char **name, int noalloc) |
| |
| exception __thiscall | exception_default_ctor (exception *_this) |
| |
| exception __thiscall | exception_opequals (exception *_this, const exception *rhs) |
| |
| void *__thiscall | exception_scalar_dtor (exception *_this, unsigned int flags) |
| |
| bad_typeid *__thiscall | bad_typeid_copy_ctor (bad_typeid *_this, const bad_typeid *rhs) |
| |
| bad_typeid *__thiscall | bad_typeid_ctor (bad_typeid *_this, const char *name) |
| |
| bad_typeid *__thiscall | bad_typeid_default_ctor (bad_typeid *_this) |
| |
| void __thiscall | bad_typeid_dtor (bad_typeid *_this) |
| |
| bad_typeid *__thiscall | bad_typeid_opequals (bad_typeid *_this, const bad_typeid *rhs) |
| |
| void *__thiscall | bad_typeid_vector_dtor (bad_typeid *_this, unsigned int flags) |
| |
| void *__thiscall | bad_typeid_scalar_dtor (bad_typeid *_this, unsigned int flags) |
| |
| __non_rtti_object *__thiscall | __non_rtti_object_copy_ctor (__non_rtti_object *_this, const __non_rtti_object *rhs) |
| |
| __non_rtti_object *__thiscall | __non_rtti_object_ctor (__non_rtti_object *_this, const char *name) |
| |
| void __thiscall | __non_rtti_object_dtor (__non_rtti_object *_this) |
| |
| __non_rtti_object *__thiscall | __non_rtti_object_opequals (__non_rtti_object *_this, const __non_rtti_object *rhs) |
| |
| void *__thiscall | __non_rtti_object_vector_dtor (__non_rtti_object *_this, unsigned int flags) |
| |
| void *__thiscall | __non_rtti_object_scalar_dtor (__non_rtti_object *_this, unsigned int flags) |
| |
| bad_cast *__thiscall | bad_cast_ctor (bad_cast *_this, const char **name) |
| |
| bad_cast *__thiscall | bad_cast_copy_ctor (bad_cast *_this, const bad_cast *rhs) |
| |
| bad_cast *__thiscall | bad_cast_ctor_charptr (bad_cast *_this, const char *name) |
| |
| bad_cast *__thiscall | bad_cast_default_ctor (bad_cast *_this) |
| |
| void __thiscall | bad_cast_dtor (bad_cast *_this) |
| |
| bad_cast *__thiscall | bad_cast_opequals (bad_cast *_this, const bad_cast *rhs) |
| |
| void *__thiscall | bad_cast_vector_dtor (bad_cast *_this, unsigned int flags) |
| |
| void *__thiscall | bad_cast_scalar_dtor (bad_cast *_this, unsigned int flags) |
| |
| int __thiscall | type_info_opequals_equals (type_info *_this, const type_info *rhs) |
| |
| int __thiscall | type_info_opnot_equals (type_info *_this, const type_info *rhs) |
| |
| int __thiscall | type_info_before (type_info *_this, const type_info *rhs) |
| |
| void __thiscall | type_info_dtor (type_info *_this) |
| |
| const char *__thiscall | type_info_name (type_info *_this) |
| |
| const char *__thiscall | type_info_raw_name (type_info *_this) |
| |
| | __ASM_VTABLE (bad_typeid, VTABLE_ADD_FUNC(exception_what)) |
| |
| | __ASM_VTABLE (bad_cast, VTABLE_ADD_FUNC(exception_what)) |
| |
| | __ASM_VTABLE (__non_rtti_object, VTABLE_ADD_FUNC(exception_what)) |
| |
| __ASM_BLOCK_END | DEFINE_CXX_DATA2 (__non_rtti_object, &bad_typeid_cxx_type_info, &exception_cxx_type_info, __non_rtti_object_dtor) void msvcrt_init_exception(void *base) |
| |
| terminate_function CDECL | set_terminate (terminate_function func) |
| |
| terminate_function CDECL | _get_terminate (void) |
| |
| unexpected_function CDECL | set_unexpected (unexpected_function func) |
| |
| unexpected_function CDECL | _get_unexpected (void) |
| |
| _se_translator_function CDECL | _set_se_translator (_se_translator_function func) |
| |
| void CDECL | terminate (void) |
| |
| void CDECL | unexpected (void) |
| |
| const type_info *CDECL | __RTtypeid (void *cppobj) |
| |
| void *CDECL | __RTDynamicCast (void *cppobj, int unknown, type_info *src, type_info *dst, int do_throw) |
| |
| void *CDECL | __RTCastToVoid (void *cppobj) |
| |
| void WINAPI | _CxxThrowException (void *object, const cxx_exception_type *type) |
| |
| void __cdecl | __ExceptionPtrRethrow (const exception_ptr *ep) |
| |
◆ __ASM_VTABLE() [1/3]
◆ __ASM_VTABLE() [2/3]
◆ __ASM_VTABLE() [3/3]
◆ __ExceptionPtrRethrow()
Definition at line 1245 of file cpp.c.
1246{
1247 TRACE(
"(%p)\n", ep);
1248
1250 {
1251 static const char *exception_msg = "bad exception";
1253
1256 return;
1257 }
1258
1261}
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
void WINAPI _CxxThrowException(void *object, const cxx_exception_type *type)
exception __thiscall exception_ctor(exception *_this, const char **name)
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
◆ __non_rtti_object_copy_ctor()
Definition at line 276 of file cpp.c.
278{
279 TRACE(
"(%p %p)\n", _this, rhs);
281}
const vtable_ptr __non_rtti_object_vtable
◆ __non_rtti_object_ctor()
◆ __non_rtti_object_dtor()
Definition at line 298 of file cpp.c.
299{
300 TRACE(
"(%p)\n", _this);
302}
void __thiscall bad_typeid_dtor(bad_typeid *_this)
◆ __non_rtti_object_opequals()
Definition at line 308 of file cpp.c.
310{
311 TRACE(
"(%p %p)\n", _this, rhs);
313 return _this;
314}
bad_typeid *__thiscall bad_typeid_opequals(bad_typeid *_this, const bad_typeid *rhs)
◆ __non_rtti_object_scalar_dtor()
Definition at line 343 of file cpp.c.
344{
348 return _this;
349}
void __thiscall __non_rtti_object_dtor(__non_rtti_object *_this)
void CDECL DECLSPEC_HOTPATCH operator_delete(void *mem)
◆ __non_rtti_object_vector_dtor()
Definition at line 320 of file cpp.c.
321{
324 {
325
327
330 }
331 else
332 {
335 }
336 return _this;
337}
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
◆ __RTCastToVoid()
Definition at line 980 of file cpp.c.
981{
983
984 if (!cppobj)
return NULL;
985
987 {
990 }
992 {
996 }
999}
#define __EXCEPT_PAGE_FAULT
__non_rtti_object *__thiscall __non_rtti_object_ctor(__non_rtti_object *_this, const char *name)
static const rtti_object_locator * get_obj_locator(void *cppobj)
#define __non_rtti_object
◆ __RTDynamicCast()
Definition at line 838 of file cpp.c.
841{
843
844 if (!cppobj)
return NULL;
845
846 TRACE(
"obj: %p unknown: %d src: %p %s dst: %p %s do_throw: %d)\n",
848
849
850
851
852
853
854
855
856
858 {
863
865
868 {
870
872 {
873
876 break;
877 }
878 }
879
880
881
882 if (!
ret && do_throw)
883 {
884 const char *
msg =
"Bad dynamic_cast!";
888 }
889 }
891 {
895 }
898}
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
bad_cast *__thiscall bad_cast_ctor(bad_cast *_this, const char **name)
static void dump_obj_locator(const rtti_object_locator *ptr)
static const char * dbgstr_type_info(const type_info *info)
static void * get_this_pointer(const this_ptr_offsets *off, void *object)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
static const FxOffsetAndName offsets[]
unsigned int type_descriptor
unsigned int base_classes
unsigned int type_hierarchy
◆ __RTtypeid()
Definition at line 753 of file cpp.c.
754{
756
757 if (!cppobj)
758 {
762 }
763
765 {
768 }
770 {
774 }
777}
bad_typeid *__thiscall bad_typeid_ctor(bad_typeid *_this, const char *name)
unsigned int type_descriptor
◆ _CxxThrowException()
Definition at line 1006 of file cpp.c.
1007{
1009
1014}
#define CXX_FRAME_MAGIC_VC6
GLuint GLuint GLsizei GLenum type
#define EH_NONCONTINUABLE
◆ _get_terminate()
Definition at line 654 of file cpp.c.
655{
657 TRACE(
"returning %p\n",
data->terminate_handler);
658 return data->terminate_handler;
659}
thread_data_t *CDECL msvcrt_get_thread_data(void)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
◆ _get_unexpected()
Definition at line 684 of file cpp.c.
685{
687 TRACE(
"returning %p\n",
data->unexpected_handler);
688 return data->unexpected_handler;
689}
◆ _set_se_translator()
Definition at line 694 of file cpp.c.
695{
698 TRACE(
"(%p) returning %p\n",
func,previous);
700 return previous;
701}
void(__cdecl * _se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info)
Referenced by test_thread_storage().
◆ bad_cast_copy_ctor()
Definition at line 366 of file cpp.c.
367{
368 TRACE(
"(%p %p)\n", _this, rhs);
370}
const vtable_ptr bad_cast_vtable
◆ bad_cast_ctor()
◆ bad_cast_ctor_charptr()
◆ bad_cast_default_ctor()
Definition at line 386 of file cpp.c.
387{
389}
bad_cast *__thiscall bad_cast_ctor_charptr(bad_cast *_this, const char *name)
◆ bad_cast_dtor()
Definition at line 395 of file cpp.c.
396{
397 TRACE(
"(%p)\n", _this);
399}
void __thiscall exception_dtor(exception *_this)
◆ bad_cast_opequals()
Definition at line 405 of file cpp.c.
406{
407 TRACE(
"(%p %p)\n", _this, rhs);
409 return _this;
410}
exception __thiscall exception_opequals(exception *_this, const exception *rhs)
◆ bad_cast_scalar_dtor()
Definition at line 439 of file cpp.c.
440{
444 return _this;
445}
void __thiscall bad_cast_dtor(bad_cast *_this)
◆ bad_cast_vector_dtor()
Definition at line 416 of file cpp.c.
417{
420 {
421
423
426 }
427 else
428 {
431 }
432 return _this;
433}
◆ bad_typeid_copy_ctor()
Definition at line 191 of file cpp.c.
192{
193 TRACE(
"(%p %p)\n", _this, rhs);
195}
const vtable_ptr bad_typeid_vtable
◆ bad_typeid_ctor()
◆ bad_typeid_default_ctor()
◆ bad_typeid_dtor()
Definition at line 220 of file cpp.c.
221{
222 TRACE(
"(%p)\n", _this);
224}
◆ bad_typeid_opequals()
Definition at line 230 of file cpp.c.
231{
232 TRACE(
"(%p %p)\n", _this, rhs);
234 return _this;
235}
◆ bad_typeid_scalar_dtor()
Definition at line 264 of file cpp.c.
265{
269 return _this;
270}
◆ bad_typeid_vector_dtor()
Definition at line 241 of file cpp.c.
242{
245 {
246
248
251 }
252 else
253 {
256 }
257 return _this;
258}
◆ DEFINE_CXX_DATA2()
Definition at line 593 of file cpp.c.
600{
601#ifdef __x86_64__
602 init_type_info_rtti(
base);
603 init_exception_rtti(
base);
604#if _MSVCR_VER >= 80
605 init_exception_old_rtti(
base);
606 init_bad_alloc_rtti(
base);
607#endif
608 init_bad_typeid_rtti(
base);
609 init_bad_cast_rtti(
base);
610 init___non_rtti_object_rtti(
base);
611
612 init_exception_cxx(
base);
613 init_bad_typeid_cxx(
base);
614 init_bad_cast_cxx(
base);
615 init___non_rtti_object_cxx(
base);
616#if _MSVCR_VER >= 80
617 init_bad_alloc_cxx(
base);
618#endif
619#endif
620}
◆ dump_obj_locator()
Definition at line 66 of file cpp.c.
67{
70
71 TRACE(
"%p: sig=%08x base_offset=%08x flags=%08x type=%p %s hierarchy=%p\n",
74 TRACE(
" hierarchy: sig=%08x attr=%08x len=%d base classes=%p\n",
75 h->signature,
h->attributes,
h->array_len,
h->base_classes );
76 for (
i = 0;
i <
h->array_len;
i++)
77 {
78 TRACE(
" base class %p: num %d off %d,%d,%d attr %08x type %p %s\n",
79 h->base_classes->bases[
i],
80 h->base_classes->bases[
i]->num_base_classes,
81 h->base_classes->bases[
i]->offsets.this_offset,
82 h->base_classes->bases[
i]->offsets.vbase_descr,
83 h->base_classes->bases[
i]->offsets.vbase_offset,
84 h->base_classes->bases[
i]->attributes,
85 h->base_classes->bases[
i]->type_descriptor,
87 }
88}
GLfloat GLfloat GLfloat GLfloat h
◆ exception_ctor()
Definition at line 130 of file cpp.c.
131{
133 return __exception_ctor(_this, *
name, &exception_vtable);
134}
◆ exception_ctor_noalloc()
Definition at line 140 of file cpp.c.
141{
143 _this->
vtable = &exception_vtable;
146 return _this;
147}
const vtable_ptr * vtable
◆ exception_default_ctor()
Definition at line 153 of file cpp.c.
154{
155 TRACE(
"(%p)\n", _this);
156 return __exception_ctor(_this,
NULL, &exception_vtable);
157}
◆ exception_opequals()
Definition at line 163 of file cpp.c.
164{
165 TRACE(
"(%p %p)\n", _this, rhs);
166 if (_this != rhs)
167 {
170 }
172 return _this;
173}
exception *__thiscall exception_copy_ctor(exception *_this, const exception *rhs)
◆ exception_scalar_dtor()
Definition at line 179 of file cpp.c.
180{
184 return _this;
185}
◆ get_obj_locator()
Definition at line 59 of file cpp.c.
60{
63}
static const vtable_ptr * get_vtable(void *obj)
◆ get_vtable()
Definition at line 54 of file cpp.c.
◆ set_terminate()
Definition at line 642 of file cpp.c.
643{
646 TRACE(
"(%p) returning %p\n",
func,previous);
648 return previous;
649}
void(__cdecl * terminate_function)(void)
◆ set_unexpected()
Definition at line 672 of file cpp.c.
673{
676 TRACE(
"(%p) returning %p\n",
func,previous);
678 return previous;
679}
void(__cdecl * unexpected_function)(void)
◆ terminate()
Definition at line 716 of file cpp.c.
717{
719 if (
data->terminate_handler)
data->terminate_handler();
721}
◆ type_info_before()
Definition at line 473 of file cpp.c.
474{
476 TRACE(
"(%p %p) returning %d\n", _this, rhs,
ret);
478}
◆ type_info_dtor()
Definition at line 484 of file cpp.c.
485{
486 TRACE(
"(%p)\n", _this);
488}
◆ type_info_name()
Definition at line 494 of file cpp.c.
495{
497 {
498
499
500
501
502
506 {
508
509
512
514 {
515
517 }
518 }
519 }
520 TRACE(
"(%p) returning %s\n", _this, _this->
name);
522}
#define UNDNAME_32_BIT_DECODE
#define UNDNAME_NO_ARGUMENTS
_ACRTIMP size_t __cdecl strlen(const char *)
char *__cdecl __unDName(char *, const char *, int, malloc_func_t, free_func_t, unsigned short int)
#define InterlockedCompareExchangePointer
◆ type_info_opequals_equals()
Definition at line 451 of file cpp.c.
452{
454 TRACE(
"(%p %p) returning %d\n", _this, rhs,
ret);
456}
◆ type_info_opnot_equals()
Definition at line 462 of file cpp.c.
463{
465 TRACE(
"(%p %p) returning %d\n", _this, rhs,
ret);
467}
◆ type_info_raw_name()
◆ unexpected()
Definition at line 726 of file cpp.c.
727{
729 if (
data->unexpected_handler)
data->unexpected_handler();
731}
void CDECL terminate(void)
◆ WINE_DEFAULT_DEBUG_CHANNEL()
| WINE_DEFAULT_DEBUG_CHANNEL |
( |
msvcrt |
| ) |
|
◆ __non_rtti_object_vtable
◆ bad_cast_vtable
◆ bad_typeid_vtable
◆ type_info_vtable