31#define __ASM_VTABLE(name,funcs)
35#define VTABLE_ADD_FUNC(name) "\t.quad " THISCALL_NAME(name) "\n"
37#define __ASM_VTABLE(name,funcs) \
40 "\t.quad " __ASM_NAME(#name "_rtti") "\n" \
41 "\t.globl " __ASM_NAME(#name "_vtable") "\n" \
42 __ASM_NAME(#name "_vtable") ":\n" \
47#define VTABLE_ADD_FUNC(name) "\t.long " THISCALL_NAME(name) "\n"
49#define __ASM_VTABLE(name,funcs) \
52 "\t.long " __ASM_NAME(#name "_rtti") "\n" \
53 "\t.globl " __ASM_NAME(#name "_vtable") "\n" \
54 __ASM_NAME(#name "_vtable") ":\n" \
62#define DEFINE_RTTI_BASE(name, base_classes_no, mangled_name) \
63 static type_info name ## _type_info = { \
69static const rtti_base_descriptor name ## _rtti_base_descriptor = { \
76#define DEFINE_RTTI_DATA(name, off, base_classes_no, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
77 DEFINE_RTTI_BASE(name, base_classes_no, mangled_name) \
79static const rtti_base_array name ## _rtti_base_array = { \
81 &name ## _rtti_base_descriptor, \
94static const rtti_object_hierarchy name ## _hierarchy = { \
98 &name ## _rtti_base_array \
101const rtti_object_locator name ## _rtti = { \
105 &name ## _type_info, \
106 &name ## _hierarchy \
109#define DEFINE_CXX_TYPE_INFO(type) \
110static const cxx_type_info type ## _cxx_type_info = { \
112 & type ##_type_info, \
115 THISCALL(type ##_copy_ctor) \
118#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, cl3, cl4, dtor) \
119DEFINE_CXX_TYPE_INFO(type) \
121static const cxx_type_info_table type ## _cxx_type_table = { \
124 & type ## _cxx_type_info, \
132static const cxx_exception_type type ## _exception_type = { \
136 & type ## _cxx_type_table \
141#define __DEFINE_RTTI_BASE(name, base_classes_no, mangled_name) \
142 static type_info name ## _type_info = { \
148static rtti_base_descriptor name ## _rtti_base_descriptor = { \
155#define DEFINE_RTTI_BASE(name, base_classes_no, mangled_name) \
156 __DEFINE_RTTI_BASE(name, base_classes_no, mangled_name) \
158 static void init_ ## name ## _rtti(char *base) \
160 name ## _rtti_base_descriptor.type_descriptor = (char*)&name ## _type_info - base; \
163#define DEFINE_RTTI_DATA(name, off, base_classes_no, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
164 __DEFINE_RTTI_BASE(name, base_classes_no, mangled_name) \
166static rtti_base_array name ## _rtti_base_array = { \
181static rtti_object_hierarchy name ## _hierarchy = { \
188rtti_object_locator name ## _rtti = { \
197static void init_ ## name ## _rtti(char *base) \
199 name ## _rtti_base_descriptor.type_descriptor = (char*)&name ## _type_info - base; \
200 name ## _rtti_base_array.bases[0] = (char*)&name ## _rtti_base_descriptor - base; \
201 name ## _rtti_base_array.bases[1] = (char*)cl1 - base; \
202 name ## _rtti_base_array.bases[2] = (char*)cl2 - base; \
203 name ## _rtti_base_array.bases[3] = (char*)cl3 - base; \
204 name ## _rtti_base_array.bases[4] = (char*)cl4 - base; \
205 name ## _rtti_base_array.bases[5] = (char*)cl5 - base; \
206 name ## _rtti_base_array.bases[6] = (char*)cl6 - base; \
207 name ## _rtti_base_array.bases[7] = (char*)cl7 - base; \
208 name ## _rtti_base_array.bases[8] = (char*)cl8 - base; \
209 name ## _rtti_base_array.bases[9] = (char*)cl9 - base; \
210 name ## _hierarchy.base_classes = (char*)&name ## _rtti_base_array - base; \
211 name ## _rtti.type_descriptor = (char*)&name ## _type_info - base; \
212 name ## _rtti.type_hierarchy = (char*)&name ## _hierarchy - base; \
213 name ## _rtti.object_locator = (char*)&name ## _rtti - base; \
216#define DEFINE_CXX_TYPE_INFO(type) \
217static cxx_type_info type ## _cxx_type_info = { \
225static void init_ ## type ## _cxx_type_info(char *base) \
227 type ## _cxx_type_info.type_info = (char *)&type ## _type_info - base; \
228 type ## _cxx_type_info.copy_ctor = (char *)type ## _copy_ctor - base; \
231#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, cl3, cl4, dtor) \
233DEFINE_CXX_TYPE_INFO(type) \
235static cxx_type_info_table type ## _cxx_type_table = { \
246static cxx_exception_type type ##_exception_type = { \
253static void init_ ## type ## _cxx(char *base) \
255 init_ ## type ## _cxx_type_info(base); \
256 type ## _cxx_type_table.info[0] = (char *)&type ## _cxx_type_info - base; \
257 type ## _cxx_type_table.info[1] = (char *)cl1 - base; \
258 type ## _cxx_type_table.info[2] = (char *)cl2 - base; \
259 type ## _cxx_type_table.info[3] = (char *)cl3 - base; \
260 type ## _cxx_type_table.info[4] = (char *)cl4 - base; \
261 type ## _exception_type.destructor = (char *)dtor - base; \
262 type ## _exception_type.type_info_table = (char *)&type ## _cxx_type_table - base; \
267#define DEFINE_RTTI_DATA0(name, off, mangled_name) \
268 DEFINE_RTTI_DATA(name, off, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)
269#define DEFINE_RTTI_DATA1(name, off, cl1, mangled_name) \
270 DEFINE_RTTI_DATA(name, off, 1, cl1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)
271#define DEFINE_RTTI_DATA2(name, off, cl1, cl2, mangled_name) \
272 DEFINE_RTTI_DATA(name, off, 2, cl1, cl2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)
273#define DEFINE_RTTI_DATA3(name, off, cl1, cl2, cl3, mangled_name) \
274 DEFINE_RTTI_DATA(name, off, 3, cl1, cl2, cl3, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)
275#define DEFINE_RTTI_DATA4(name, off, cl1, cl2, cl3, cl4, mangled_name) \
276 DEFINE_RTTI_DATA(name, off, 4, cl1, cl2, cl3, cl4, NULL, NULL, NULL, NULL, NULL, mangled_name)
277#define DEFINE_RTTI_DATA5(name, off, cl1, cl2, cl3, cl4, cl5, mangled_name) \
278 DEFINE_RTTI_DATA(name, off, 5, cl1, cl2, cl3, cl4, cl5, NULL, NULL, NULL, NULL, mangled_name)
279#define DEFINE_RTTI_DATA8(name, off, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, mangled_name) \
280 DEFINE_RTTI_DATA(name, off, 8, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, NULL, mangled_name)
281#define DEFINE_RTTI_DATA9(name, off, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
282 DEFINE_RTTI_DATA(name, off, 9, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name)
284#define DEFINE_CXX_DATA0(name, dtor) \
285 DEFINE_CXX_DATA(name, 0, NULL, NULL, NULL, NULL, dtor)
286#define DEFINE_CXX_DATA1(name, cl1, dtor) \
287 DEFINE_CXX_DATA(name, 1, cl1, NULL, NULL, NULL, dtor)
288#define DEFINE_CXX_DATA2(name, cl1, cl2, dtor) \
289 DEFINE_CXX_DATA(name, 2, cl1, cl2, NULL, NULL, dtor)
290#define DEFINE_CXX_DATA3(name, cl1, cl2, cl3, dtor) \
291 DEFINE_CXX_DATA(name, 3, cl1, cl2, cl3, NULL, dtor)
292#define DEFINE_CXX_DATA4(name, cl1, cl2, cl3, cl4, dtor) \
293 DEFINE_CXX_DATA(name, 4, cl1, cl2, cl3, cl4, dtor)
295#ifdef __ASM_USE_THISCALL_WRAPPER
297#define CALL_VTBL_FUNC(this, off, ret, type, args) ((ret (WINAPI*)type)&vtbl_wrapper_##off)args
299extern void *vtbl_wrapper_0;
300extern void *vtbl_wrapper_4;
301extern void *vtbl_wrapper_8;
302extern void *vtbl_wrapper_12;
303extern void *vtbl_wrapper_16;
304extern void *vtbl_wrapper_20;
305extern void *vtbl_wrapper_24;
306extern void *vtbl_wrapper_28;
307extern void *vtbl_wrapper_32;
308extern void *vtbl_wrapper_36;
309extern void *vtbl_wrapper_40;
310extern void *vtbl_wrapper_44;
311extern void *vtbl_wrapper_48;
312extern void *vtbl_wrapper_52;
313extern void *vtbl_wrapper_56;
317#define CALL_VTBL_FUNC(this, off, ret, type, args) ((ret (__thiscall***)type)this)[0][off/4]args
397 void *custom_handler;
413 unsigned int bases[10];
471 return (
void *)(
base + rva);
492#define CREATE_TYPE_INFO_VTABLE \
493DEFINE_THISCALL_WRAPPER(type_info_vector_dtor,8) \
494void * __thiscall type_info_vector_dtor(type_info * _this, unsigned int flags) \
499 INT_PTR i, *ptr = (INT_PTR *)_this - 1; \
501 for (i = *ptr - 1; i >= 0; i--) free(_this[i].name); \
507 if (flags & 1) free(_this); \
512DEFINE_RTTI_DATA0( type_info, 0, ".?AVtype_info@@" ) \
514__ASM_BLOCK_BEGIN(type_info_vtables) \
515 __ASM_VTABLE(type_info, \
516 VTABLE_ADD_FUNC(type_info_vector_dtor)); \
PVOID NTAPI RtlPcToFileHeader(IN PVOID PcValue, PVOID *BaseOfImage)
struct __type_info type_info
struct __exception exception
static void * rtti_rva(unsigned int rva, uintptr_t base)
const vtable_ptr type_info_vtable
static uintptr_t rtti_rva_base(const void *ptr)
static const FxOffsetAndName offsets[]
GLuint GLuint GLsizei count
const vtable_ptr * vtable
const vtable_ptr * vtable
const rtti_base_descriptor * bases[10]
const type_info * type_descriptor
const rtti_base_array * base_classes
const type_info * type_descriptor
const rtti_object_hierarchy * type_hierarchy
unsigned int custom_handler
unsigned int type_info_table
unsigned int type_descriptor
unsigned int base_classes
unsigned int object_locator
unsigned int type_hierarchy
unsigned int type_descriptor
void *__thiscall type_info_vector_dtor(type_info *_this, unsigned int flags)