ReactOS 0.4.16-dev-2104-gb84fa49
cxx.h File Reference
#include "windef.h"
#include "winternl.h"
#include "rtlsupportapi.h"
#include "wine/asm.h"
Include dependency graph for cxx.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __exception
 
struct  __type_info
 
struct  this_ptr_offsets
 
struct  rtti_base_descriptor
 
struct  rtti_base_array
 
struct  rtti_object_hierarchy
 
struct  rtti_object_locator
 
struct  cxx_type_info
 
struct  cxx_type_info_table
 
struct  cxx_exception_type
 

Macros

#define RTTI_USE_RVA   1
 
#define VTABLE_ADD_FUNC(name)   "\t.long " THISCALL_NAME(name) "\n"
 
#define __ASM_VTABLE(name, funcs)
 
#define __DEFINE_RTTI_BASE(name, base_classes_no, mangled_name)
 
#define DEFINE_RTTI_BASE(name, base_classes_no, mangled_name)
 
#define DEFINE_RTTI_DATA(name, off, base_classes_no, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name)
 
#define DEFINE_CXX_TYPE_INFO(type)
 
#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, cl3, cl4, dtor)
 
#define DEFINE_RTTI_DATA0(name, off, mangled_name)    DEFINE_RTTI_DATA(name, off, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)
 
#define DEFINE_RTTI_DATA1(name, off, cl1, mangled_name)    DEFINE_RTTI_DATA(name, off, 1, cl1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)
 
#define DEFINE_RTTI_DATA2(name, off, cl1, cl2, mangled_name)    DEFINE_RTTI_DATA(name, off, 2, cl1, cl2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)
 
#define DEFINE_RTTI_DATA3(name, off, cl1, cl2, cl3, mangled_name)    DEFINE_RTTI_DATA(name, off, 3, cl1, cl2, cl3, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)
 
#define DEFINE_RTTI_DATA4(name, off, cl1, cl2, cl3, cl4, mangled_name)    DEFINE_RTTI_DATA(name, off, 4, cl1, cl2, cl3, cl4, NULL, NULL, NULL, NULL, NULL, mangled_name)
 
#define DEFINE_RTTI_DATA5(name, off, cl1, cl2, cl3, cl4, cl5, mangled_name)    DEFINE_RTTI_DATA(name, off, 5, cl1, cl2, cl3, cl4, cl5, NULL, NULL, NULL, NULL, mangled_name)
 
#define DEFINE_RTTI_DATA8(name, off, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, mangled_name)    DEFINE_RTTI_DATA(name, off, 8, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, NULL, mangled_name)
 
#define DEFINE_RTTI_DATA9(name, off, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name)    DEFINE_RTTI_DATA(name, off, 9, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name)
 
#define DEFINE_CXX_DATA0(name, dtor)    DEFINE_CXX_DATA(name, 0, NULL, NULL, NULL, NULL, dtor)
 
#define DEFINE_CXX_DATA1(name, cl1, dtor)    DEFINE_CXX_DATA(name, 1, cl1, NULL, NULL, NULL, dtor)
 
#define DEFINE_CXX_DATA2(name, cl1, cl2, dtor)    DEFINE_CXX_DATA(name, 2, cl1, cl2, NULL, NULL, dtor)
 
#define DEFINE_CXX_DATA3(name, cl1, cl2, cl3, dtor)    DEFINE_CXX_DATA(name, 3, cl1, cl2, cl3, NULL, dtor)
 
#define DEFINE_CXX_DATA4(name, cl1, cl2, cl3, cl4, dtor)    DEFINE_CXX_DATA(name, 4, cl1, cl2, cl3, cl4, dtor)
 
#define CALL_VTBL_FUNC(this, off, ret, type, args)   ((ret (__thiscall***)type)this)[0][off/4]args
 
#define CREATE_TYPE_INFO_VTABLE
 

Typedefs

typedef void(* vtable_ptr) (void)
 
typedef struct __exception exception
 
typedef struct __type_info type_info
 

Functions

static uintptr_t rtti_rva_base (const void *ptr)
 
static voidrtti_rva (unsigned int rva, uintptr_t base)
 

Variables

const vtable_ptr type_info_vtable
 

Macro Definition Documentation

◆ __ASM_VTABLE

#define __ASM_VTABLE (   name,
  funcs 
)
Value:
__asm__(".data\n" \
"\t.balign 4\n" \
"\t.long " __ASM_NAME(#name "_rtti") "\n" \
"\t.globl " __ASM_NAME(#name "_vtable") "\n" \
__ASM_NAME(#name "_vtable") ":\n" \
funcs "\n\t.text")
#define __ASM_NAME(name)
Definition: config.h:934
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
static struct __wine_debug_functions funcs
Definition: debug.c:48
Definition: name.c:39

Definition at line 49 of file cxx.h.

◆ __DEFINE_RTTI_BASE

#define __DEFINE_RTTI_BASE (   name,
  base_classes_no,
  mangled_name 
)
Value:
static type_info name ## _type_info = { \
NULL, \
mangled_name \
}; \
\
0xdeadbeef, \
base_classes_no, \
{ 0, -1, 0}, \
64 \
};
#define NULL
Definition: types.h:112
const vtable_ptr type_info_vtable

Definition at line 141 of file cxx.h.

◆ CALL_VTBL_FUNC

#define CALL_VTBL_FUNC (   this,
  off,
  ret,
  type,
  args 
)    ((ret (__thiscall***)type)this)[0][off/4]args

Definition at line 317 of file cxx.h.

◆ CREATE_TYPE_INFO_VTABLE

#define CREATE_TYPE_INFO_VTABLE
Value:
void * __thiscall type_info_vector_dtor(type_info * _this, unsigned int flags) \
{ \
if (flags & 2) \
{ \
/* we have an array, with the number of elements stored before the first object */ \
INT_PTR i, *ptr = (INT_PTR *)_this - 1; \
\
for (i = *ptr - 1; i >= 0; i--) free(_this[i].name); \
free(ptr); \
} \
else \
{ \
free(_this->name); \
if (flags & 1) free(_this); \
} \
return _this; \
} \
\
DEFINE_RTTI_DATA0( type_info, 0, ".?AVtype_info@@" ) \
\
__ASM_BLOCK_BEGIN(type_info_vtables) \
__ASM_VTABLE(type_info, \
#define free
Definition: debug_ros.c:5
#define VTABLE_ADD_FUNC(name)
Definition: cxx.h:47
GLbitfield flags
Definition: glext.h:7161
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
Definition: glfuncs.h:248
static PVOID ptr
Definition: dispmode.c:27
#define __thiscall
Definition: cpp.c:43
#define DEFINE_THISCALL_WRAPPER(func, args)
Definition: msvc-thiscall.c:2
int32_t INT_PTR
Definition: typedefs.h:64
#define __ASM_BLOCK_END
Definition: asm.h:60
void *__thiscall type_info_vector_dtor(type_info *_this, unsigned int flags)

Definition at line 492 of file cxx.h.

◆ DEFINE_CXX_DATA

#define DEFINE_CXX_DATA (   type,
  base_no,
  cl1,
  cl2,
  cl3,
  cl4,
  dtor 
)

Definition at line 231 of file cxx.h.

◆ DEFINE_CXX_DATA0

#define DEFINE_CXX_DATA0 (   name,
  dtor 
)     DEFINE_CXX_DATA(name, 0, NULL, NULL, NULL, NULL, dtor)

Definition at line 284 of file cxx.h.

◆ DEFINE_CXX_DATA1

#define DEFINE_CXX_DATA1 (   name,
  cl1,
  dtor 
)     DEFINE_CXX_DATA(name, 1, cl1, NULL, NULL, NULL, dtor)

Definition at line 286 of file cxx.h.

◆ DEFINE_CXX_DATA2

#define DEFINE_CXX_DATA2 (   name,
  cl1,
  cl2,
  dtor 
)     DEFINE_CXX_DATA(name, 2, cl1, cl2, NULL, NULL, dtor)

Definition at line 288 of file cxx.h.

◆ DEFINE_CXX_DATA3

#define DEFINE_CXX_DATA3 (   name,
  cl1,
  cl2,
  cl3,
  dtor 
)     DEFINE_CXX_DATA(name, 3, cl1, cl2, cl3, NULL, dtor)

Definition at line 290 of file cxx.h.

◆ DEFINE_CXX_DATA4

#define DEFINE_CXX_DATA4 (   name,
  cl1,
  cl2,
  cl3,
  cl4,
  dtor 
)     DEFINE_CXX_DATA(name, 4, cl1, cl2, cl3, cl4, dtor)

Definition at line 292 of file cxx.h.

◆ DEFINE_CXX_TYPE_INFO

#define DEFINE_CXX_TYPE_INFO (   type)
Value:
static cxx_type_info type ## _cxx_type_info = { \
0, \
0xdeadbeef, \
{ 0, -1, 0 }, \
sizeof(type), \
0xdeadbeef \
}; \
\
static void init_ ## type ## _cxx_type_info(char *base) \
{ \
type ## _cxx_type_info.type_info = (char *)&type ## _type_info - base; \
type ## _cxx_type_info.copy_ctor = (char *)type ## _copy_ctor - base; \
}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
unsigned int type_info
Definition: cxx.h:437

Definition at line 216 of file cxx.h.

◆ DEFINE_RTTI_BASE

#define DEFINE_RTTI_BASE (   name,
  base_classes_no,
  mangled_name 
)
Value:
__DEFINE_RTTI_BASE(name, base_classes_no, mangled_name) \
\
static void init_ ## name ## _rtti(char *base) \
{ \
}
#define __DEFINE_RTTI_BASE(name, base_classes_no, mangled_name)
Definition: cxx.h:141
const type_info * type_descriptor
Definition: cxx.h:198

Definition at line 155 of file cxx.h.

◆ DEFINE_RTTI_DATA

#define DEFINE_RTTI_DATA (   name,
  off,
  base_classes_no,
  cl1,
  cl2,
  cl3,
  cl4,
  cl5,
  cl6,
  cl7,
  cl8,
  cl9,
  mangled_name 
)

Definition at line 163 of file cxx.h.

◆ DEFINE_RTTI_DATA0

#define DEFINE_RTTI_DATA0 (   name,
  off,
  mangled_name 
)     DEFINE_RTTI_DATA(name, off, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)

Definition at line 267 of file cxx.h.

◆ DEFINE_RTTI_DATA1

#define DEFINE_RTTI_DATA1 (   name,
  off,
  cl1,
  mangled_name 
)     DEFINE_RTTI_DATA(name, off, 1, cl1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)

Definition at line 269 of file cxx.h.

◆ DEFINE_RTTI_DATA2

#define DEFINE_RTTI_DATA2 (   name,
  off,
  cl1,
  cl2,
  mangled_name 
)     DEFINE_RTTI_DATA(name, off, 2, cl1, cl2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)

Definition at line 271 of file cxx.h.

◆ DEFINE_RTTI_DATA3

#define DEFINE_RTTI_DATA3 (   name,
  off,
  cl1,
  cl2,
  cl3,
  mangled_name 
)     DEFINE_RTTI_DATA(name, off, 3, cl1, cl2, cl3, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)

Definition at line 273 of file cxx.h.

◆ DEFINE_RTTI_DATA4

#define DEFINE_RTTI_DATA4 (   name,
  off,
  cl1,
  cl2,
  cl3,
  cl4,
  mangled_name 
)     DEFINE_RTTI_DATA(name, off, 4, cl1, cl2, cl3, cl4, NULL, NULL, NULL, NULL, NULL, mangled_name)

Definition at line 275 of file cxx.h.

◆ DEFINE_RTTI_DATA5

#define DEFINE_RTTI_DATA5 (   name,
  off,
  cl1,
  cl2,
  cl3,
  cl4,
  cl5,
  mangled_name 
)     DEFINE_RTTI_DATA(name, off, 5, cl1, cl2, cl3, cl4, cl5, NULL, NULL, NULL, NULL, mangled_name)

Definition at line 277 of file cxx.h.

◆ DEFINE_RTTI_DATA8

#define DEFINE_RTTI_DATA8 (   name,
  off,
  cl1,
  cl2,
  cl3,
  cl4,
  cl5,
  cl6,
  cl7,
  cl8,
  mangled_name 
)     DEFINE_RTTI_DATA(name, off, 8, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, NULL, mangled_name)

Definition at line 279 of file cxx.h.

◆ DEFINE_RTTI_DATA9

#define DEFINE_RTTI_DATA9 (   name,
  off,
  cl1,
  cl2,
  cl3,
  cl4,
  cl5,
  cl6,
  cl7,
  cl8,
  cl9,
  mangled_name 
)     DEFINE_RTTI_DATA(name, off, 9, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name)

Definition at line 281 of file cxx.h.

◆ RTTI_USE_RVA

#define RTTI_USE_RVA   1

Definition at line 27 of file cxx.h.

◆ VTABLE_ADD_FUNC

#define VTABLE_ADD_FUNC (   name)    "\t.long " THISCALL_NAME(name) "\n"

Definition at line 47 of file cxx.h.

Typedef Documentation

◆ exception

◆ type_info

◆ vtable_ptr

typedef void(* vtable_ptr) (void)

Definition at line 322 of file cxx.h.

Function Documentation

◆ rtti_rva()

◆ rtti_rva_base()

static uintptr_t rtti_rva_base ( const void ptr)
inlinestatic

Definition at line 463 of file cxx.h.

464{
465 void *base;
466 return (uintptr_t)RtlPcToFileHeader( (void *)ptr, &base );
467}
PVOID NTAPI RtlPcToFileHeader(IN PVOID PcValue, PVOID *BaseOfImage)
Definition: libsupp.c:658
unsigned int uintptr_t
Definition: corecrt.h:185

Referenced by _CxxThrowException(), and get_obj_locator_base().

Variable Documentation

◆ type_info_vtable

const vtable_ptr type_info_vtable
extern