ReactOS 0.4.16-dev-976-g18fc5a1
cpp.c
Go to the documentation of this file.
1/* Unit test suite for msvcrt C++ objects
2 *
3 * Copyright 2003 Jon Griffiths
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19#include "wine/test.h"
20#include "winbase.h"
21#include "winnt.h"
22
23typedef void (*vtable_ptr)(void);
24
25typedef struct __exception
26{
28 char *name;
31
32typedef struct __type_info
33{
35 char *name;
36 char mangled[16];
38
39#undef __thiscall
40#ifdef __i386__
41#define __thiscall __stdcall
42#else
43#define __thiscall __cdecl
44#endif
45
46/* Function pointers. We need to use these to call these funcs as __thiscall */
47static void* (__cdecl *poperator_new)(size_t);
48static void (__cdecl *poperator_delete)(void*);
49
50/* exception */
51static void (__thiscall *pexception_ctor)(exception*,LPCSTR*);
52static void (__thiscall *pexception_copy_ctor)(exception*,exception*);
53static void (__thiscall *pexception_default_ctor)(exception*);
54static void (__thiscall *pexception_dtor)(exception*);
58static void (__thiscall *pexception_vector_dtor)(exception*,unsigned int);
59static void (__thiscall *pexception_scalar_dtor)(exception*,unsigned int);
60
61/* bad_typeid */
62static void (__thiscall *pbad_typeid_ctor)(exception*,LPCSTR);
63static void (__thiscall *pbad_typeid_ctor_closure)(exception*);
64static void (__thiscall *pbad_typeid_copy_ctor)(exception*,exception*);
65static void (__thiscall *pbad_typeid_dtor)(exception*);
69static void (__thiscall *pbad_typeid_vector_dtor)(exception*,unsigned int);
70static void (__thiscall *pbad_typeid_scalar_dtor)(exception*,unsigned int);
71
72/* bad_cast */
73static void (__thiscall *pbad_cast_ctor)(exception*,LPCSTR*);
74static void (__thiscall *pbad_cast_ctor2)(exception*,LPCSTR);
75static void (__thiscall *pbad_cast_ctor_closure)(exception*);
76static void (__thiscall *pbad_cast_copy_ctor)(exception*,exception*);
77static void (__thiscall *pbad_cast_dtor)(exception*);
81static void (__thiscall *pbad_cast_vector_dtor)(exception*,unsigned int);
82static void (__thiscall *pbad_cast_scalar_dtor)(exception*,unsigned int);
83
84/* __non_rtti_object */
85static void (__thiscall *p__non_rtti_object_ctor)(exception*,LPCSTR);
86static void (__thiscall *p__non_rtti_object_copy_ctor)(exception*,exception*);
87static void (__thiscall *p__non_rtti_object_dtor)(exception*);
91static void (__thiscall *p__non_rtti_object_vector_dtor)(exception*,unsigned int);
92static void (__thiscall *p__non_rtti_object_scalar_dtor)(exception*,unsigned int);
93
94/* type_info */
95static void (__thiscall *ptype_info_dtor)(type_info*);
98static int (__thiscall *ptype_info_before)(type_info*,type_info*);
99static int (__thiscall *ptype_info_opequals_equals)(type_info*,type_info*);
100static int (__thiscall *ptype_info_opnot_equals)(type_info*,type_info*);
101
102/* RTTI */
103static type_info* (__cdecl *p__RTtypeid)(void*);
104static void* (__cdecl *p__RTCastToVoid)(void*);
105static void* (__cdecl *p__RTDynamicCast)(void*,int,void*,void*,int);
106
107/*Demangle*/
108static char* (__cdecl *p__unDName)(char*,const char*,int,void*,void*,unsigned short int);
109
110
111/* Emulate a __thiscall */
112#ifdef __i386__
113
114#include "pshpack1.h"
115struct thiscall_thunk
116{
117 BYTE pop_eax; /* popl %eax (ret addr) */
118 BYTE pop_edx; /* popl %edx (func) */
119 BYTE pop_ecx; /* popl %ecx (this) */
120 BYTE push_eax; /* pushl %eax */
121 WORD jmp_edx; /* jmp *%edx */
122};
123#include "poppack.h"
124
125static void * (WINAPI *call_thiscall_func1)( void *func, void *this );
126static void * (WINAPI *call_thiscall_func2)( void *func, void *this, const void *a );
127
128static void init_thiscall_thunk(void)
129{
130 struct thiscall_thunk *thunk = VirtualAlloc( NULL, sizeof(*thunk),
132 thunk->pop_eax = 0x58; /* popl %eax */
133 thunk->pop_edx = 0x5a; /* popl %edx */
134 thunk->pop_ecx = 0x59; /* popl %ecx */
135 thunk->push_eax = 0x50; /* pushl %eax */
136 thunk->jmp_edx = 0xe2ff; /* jmp *%edx */
137 call_thiscall_func1 = (void *)thunk;
138 call_thiscall_func2 = (void *)thunk;
139}
140
141#define call_func1(func,_this) call_thiscall_func1(func,_this)
142#define call_func2(func,_this,a) call_thiscall_func2(func,_this,(const void*)(a))
143
144#else
145
146#define init_thiscall_thunk() do { } while(0)
147#define call_func1(func,_this) func(_this)
148#define call_func2(func,_this,a) func(_this,a)
149
150#endif /* __i386__ */
151
152/* Some exports are only available in later versions */
153#define SETNOFAIL(x,y) x = (void*)GetProcAddress(hmsvcrt,y)
154#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
155
157{
158 HMODULE hmsvcrt = GetModuleHandleA("msvcrt.dll");
159
160 SET(pexception_vtable, "??_7exception@@6B@");
161 SET(pbad_typeid_vtable, "??_7bad_typeid@@6B@");
162 SET(pbad_cast_vtable, "??_7bad_cast@@6B@");
163 SET(p__non_rtti_object_vtable, "??_7__non_rtti_object@@6B@");
164
165 SET(p__RTtypeid, "__RTtypeid");
166 SET(p__RTCastToVoid, "__RTCastToVoid");
167 SET(p__RTDynamicCast, "__RTDynamicCast");
168
169 SET(p__unDName,"__unDName");
170
171 /* Extremely early versions export logic_error, and crash in RTTI */
172 if (sizeof(void *) > sizeof(int)) /* 64-bit initialization */
173 {
174 SETNOFAIL(poperator_new, "??_U@YAPEAX_K@Z");
175 SETNOFAIL(poperator_delete, "??_V@YAXPEAX@Z");
176
177 SET(pexception_ctor, "??0exception@@QEAA@AEBQEBD@Z");
178 SET(pexception_copy_ctor, "??0exception@@QEAA@AEBV0@@Z");
179 SET(pexception_default_ctor, "??0exception@@QEAA@XZ");
180 SET(pexception_dtor, "??1exception@@UEAA@XZ");
181 SET(pexception_opequals, "??4exception@@QEAAAEAV0@AEBV0@@Z");
182 SET(pexception_what, "?what@exception@@UEBAPEBDXZ");
183 pexception_vector_dtor = (void*)pexception_vtable[0];
184 pexception_scalar_dtor = (void*)pexception_vtable[0];
185
186 SET(pbad_typeid_ctor, "??0bad_typeid@@QEAA@PEBD@Z");
187 SETNOFAIL(pbad_typeid_ctor_closure, "??_Fbad_typeid@@QEAAXXZ");
188 SET(pbad_typeid_copy_ctor, "??0bad_typeid@@QEAA@AEBV0@@Z");
189 SET(pbad_typeid_dtor, "??1bad_typeid@@UEAA@XZ");
190 SET(pbad_typeid_opequals, "??4bad_typeid@@QEAAAEAV0@AEBV0@@Z");
191 SET(pbad_typeid_what, "?what@exception@@UEBAPEBDXZ");
192 pbad_typeid_vector_dtor = (void*)pbad_typeid_vtable[0];
193 pbad_typeid_scalar_dtor = (void*)pbad_typeid_vtable[0];
194
195 SET(pbad_cast_ctor, "??0bad_cast@@QEAA@AEBQEBD@Z");
196 SET(pbad_cast_ctor2, "??0bad_cast@@QEAA@PEBD@Z");
197 SET(pbad_cast_ctor_closure, "??_Fbad_cast@@QEAAXXZ");
198 SET(pbad_cast_copy_ctor, "??0bad_cast@@QEAA@AEBV0@@Z");
199 SET(pbad_cast_dtor, "??1bad_cast@@UEAA@XZ");
200 SET(pbad_cast_opequals, "??4bad_cast@@QEAAAEAV0@AEBV0@@Z");
201 SET(pbad_cast_what, "?what@exception@@UEBAPEBDXZ");
202 pbad_cast_vector_dtor = (void*)pbad_cast_vtable[0];
203 pbad_cast_scalar_dtor = (void*)pbad_cast_vtable[0];
204
205 SET(p__non_rtti_object_ctor, "??0__non_rtti_object@@QEAA@PEBD@Z");
206 SET(p__non_rtti_object_copy_ctor, "??0__non_rtti_object@@QEAA@AEBV0@@Z");
207 SET(p__non_rtti_object_dtor, "??1__non_rtti_object@@UEAA@XZ");
208 SET(p__non_rtti_object_opequals, "??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z");
209 SET(p__non_rtti_object_what, "?what@exception@@UEBAPEBDXZ");
210 p__non_rtti_object_vector_dtor = (void*)p__non_rtti_object_vtable[0];
211 p__non_rtti_object_scalar_dtor = (void*)p__non_rtti_object_vtable[0];
212
213 SET(ptype_info_dtor, "??1type_info@@UEAA@XZ");
214 SET(ptype_info_raw_name, "?raw_name@type_info@@QEBAPEBDXZ");
215 SET(ptype_info_name, "?name@type_info@@QEBAPEBDXZ");
216 SET(ptype_info_before, "?before@type_info@@QEBAHAEBV1@@Z");
217 SET(ptype_info_opequals_equals, "??8type_info@@QEBAHAEBV0@@Z");
218 SET(ptype_info_opnot_equals, "??9type_info@@QEBAHAEBV0@@Z");
219 }
220 else
221 {
222#ifdef __arm__
223 SETNOFAIL(poperator_new, "??_U@YAPAXI@Z");
224 SETNOFAIL(poperator_delete, "??_V@YAXPAX@Z");
225
226 SET(pexception_ctor, "??0exception@@QAA@ABQBD@Z");
227 SET(pexception_copy_ctor, "??0exception@@QAA@ABV0@@Z");
228 SET(pexception_default_ctor, "??0exception@@QAA@XZ");
229 SET(pexception_dtor, "??1exception@@UAA@XZ");
230 SET(pexception_opequals, "??4exception@@QAAAAV0@ABV0@@Z");
231 SET(pexception_what, "?what@exception@@UBAPBDXZ");
232 pexception_vector_dtor = (void*)pexception_vtable[0];
233 pexception_scalar_dtor = (void*)pexception_vtable[0];
234
235 SET(pbad_typeid_ctor, "??0bad_typeid@@QAA@PBD@Z");
236 SETNOFAIL(pbad_typeid_ctor_closure, "??_Fbad_typeid@@QAAXXZ");
237 SET(pbad_typeid_copy_ctor, "??0bad_typeid@@QAA@ABV0@@Z");
238 SET(pbad_typeid_dtor, "??1bad_typeid@@UAA@XZ");
239 SET(pbad_typeid_opequals, "??4bad_typeid@@QAAAAV0@ABV0@@Z");
240 SET(pbad_typeid_what, "?what@exception@@UBAPBDXZ");
241 pbad_typeid_vector_dtor = (void*)pbad_typeid_vtable[0];
242 pbad_typeid_scalar_dtor = (void*)pbad_typeid_vtable[0];
243
244 SETNOFAIL(pbad_cast_ctor, "??0bad_cast@@QAE@ABQBD@Z");
245 if (!pbad_cast_ctor)
246 SET(pbad_cast_ctor, "??0bad_cast@@AAA@PBQBD@Z");
247 SETNOFAIL(pbad_cast_ctor2, "??0bad_cast@@QAA@PBD@Z");
248 SETNOFAIL(pbad_cast_ctor_closure, "??_Fbad_cast@@QAAXXZ");
249 SET(pbad_cast_copy_ctor, "??0bad_cast@@QAA@ABV0@@Z");
250 SET(pbad_cast_dtor, "??1bad_cast@@UAA@XZ");
251 SET(pbad_cast_opequals, "??4bad_cast@@QAAAAV0@ABV0@@Z");
252 SET(pbad_cast_what, "?what@exception@@UBAPBDXZ");
253 pbad_cast_vector_dtor = (void*)pbad_cast_vtable[0];
254 pbad_cast_scalar_dtor = (void*)pbad_cast_vtable[0];
255
256 SET(p__non_rtti_object_ctor, "??0__non_rtti_object@@QAA@PBD@Z");
257 SET(p__non_rtti_object_copy_ctor, "??0__non_rtti_object@@QAA@ABV0@@Z");
258 SET(p__non_rtti_object_dtor, "??1__non_rtti_object@@UAA@XZ");
259 SET(p__non_rtti_object_opequals, "??4__non_rtti_object@@QAAAAV0@ABV0@@Z");
260 SET(p__non_rtti_object_what, "?what@exception@@UBAPBDXZ");
261 p__non_rtti_object_vector_dtor = (void*)p__non_rtti_object_vtable[0];
262 p__non_rtti_object_scalar_dtor = (void*)p__non_rtti_object_vtable[0];
263
264 SET(ptype_info_dtor, "??1type_info@@UAA@XZ");
265 SET(ptype_info_raw_name, "?raw_name@type_info@@QBAPBDXZ");
266 SET(ptype_info_name, "?name@type_info@@QBAPBDXZ");
267 SET(ptype_info_before, "?before@type_info@@QBAHABV1@@Z");
268 SET(ptype_info_opequals_equals, "??8type_info@@QBAHABV0@@Z");
269 SET(ptype_info_opnot_equals, "??9type_info@@QBAHABV0@@Z");
270#else
271 SETNOFAIL(poperator_new, "??_U@YAPAXI@Z");
272 SETNOFAIL(poperator_delete, "??_V@YAXPAX@Z");
273
274 SET(pexception_ctor, "??0exception@@QAE@ABQBD@Z");
275 SET(pexception_copy_ctor, "??0exception@@QAE@ABV0@@Z");
276 SET(pexception_default_ctor, "??0exception@@QAE@XZ");
277 SET(pexception_dtor, "??1exception@@UAE@XZ");
278 SET(pexception_opequals, "??4exception@@QAEAAV0@ABV0@@Z");
279 SET(pexception_what, "?what@exception@@UBEPBDXZ");
280 SET(pexception_vector_dtor, "??_Eexception@@UAEPAXI@Z");
281 SET(pexception_scalar_dtor, "??_Gexception@@UAEPAXI@Z");
282
283 SET(pbad_typeid_ctor, "??0bad_typeid@@QAE@PBD@Z");
284 SETNOFAIL(pbad_typeid_ctor_closure, "??_Fbad_typeid@@QAEXXZ");
285 SET(pbad_typeid_copy_ctor, "??0bad_typeid@@QAE@ABV0@@Z");
286 SET(pbad_typeid_dtor, "??1bad_typeid@@UAE@XZ");
287 SET(pbad_typeid_opequals, "??4bad_typeid@@QAEAAV0@ABV0@@Z");
288 SET(pbad_typeid_what, "?what@exception@@UBEPBDXZ");
289 SET(pbad_typeid_vector_dtor, "??_Ebad_typeid@@UAEPAXI@Z");
290 SET(pbad_typeid_scalar_dtor, "??_Gbad_typeid@@UAEPAXI@Z");
291
292 SETNOFAIL(pbad_cast_ctor, "??0bad_cast@@QAE@ABQBD@Z");
293 if (!pbad_cast_ctor)
294 SET(pbad_cast_ctor, "??0bad_cast@@AAE@PBQBD@Z");
295 SETNOFAIL(pbad_cast_ctor2, "??0bad_cast@@QAE@PBD@Z");
296 SETNOFAIL(pbad_cast_ctor_closure, "??_Fbad_cast@@QAEXXZ");
297 SET(pbad_cast_copy_ctor, "??0bad_cast@@QAE@ABV0@@Z");
298 SET(pbad_cast_dtor, "??1bad_cast@@UAE@XZ");
299 SET(pbad_cast_opequals, "??4bad_cast@@QAEAAV0@ABV0@@Z");
300 SET(pbad_cast_what, "?what@exception@@UBEPBDXZ");
301 SET(pbad_cast_vector_dtor, "??_Ebad_cast@@UAEPAXI@Z");
302 SET(pbad_cast_scalar_dtor, "??_Gbad_cast@@UAEPAXI@Z");
303
304 SET(p__non_rtti_object_ctor, "??0__non_rtti_object@@QAE@PBD@Z");
305 SET(p__non_rtti_object_copy_ctor, "??0__non_rtti_object@@QAE@ABV0@@Z");
306 SET(p__non_rtti_object_dtor, "??1__non_rtti_object@@UAE@XZ");
307 SET(p__non_rtti_object_opequals, "??4__non_rtti_object@@QAEAAV0@ABV0@@Z");
308 SET(p__non_rtti_object_what, "?what@exception@@UBEPBDXZ");
309 SET(p__non_rtti_object_vector_dtor, "??_E__non_rtti_object@@UAEPAXI@Z");
310 SET(p__non_rtti_object_scalar_dtor, "??_G__non_rtti_object@@UAEPAXI@Z");
311
312 SET(ptype_info_dtor, "??1type_info@@UAE@XZ");
313 SET(ptype_info_raw_name, "?raw_name@type_info@@QBEPBDXZ");
314 SET(ptype_info_name, "?name@type_info@@QBEPBDXZ");
315 SET(ptype_info_before, "?before@type_info@@QBEHABV1@@Z");
316 SET(ptype_info_opequals_equals, "??8type_info@@QBEHABV0@@Z");
317 SET(ptype_info_opnot_equals, "??9type_info@@QBEHABV0@@Z");
318#endif /* __arm__ */
319 }
320
321 if (!poperator_new)
323 if (!poperator_delete)
324 poperator_delete = free;
325
327 return TRUE;
328}
329
330static void test_exception(void)
331{
332 static const char* e_name = "An exception name";
333 char* name;
334 exception e, e2, e3, *pe;
335
336 if (!poperator_new || !poperator_delete ||
337 !pexception_ctor || !pexception_copy_ctor || !pexception_default_ctor ||
338 !pexception_dtor || !pexception_opequals || !pexception_what ||
339 !pexception_vtable || !pexception_vector_dtor || !pexception_scalar_dtor)
340 return;
341
342 /* 'const char*&' ctor */
343 memset(&e, 0, sizeof(e));
344 call_func2(pexception_ctor, &e, &e_name);
345 ok(e.vtable != NULL, "Null exception vtable for e\n");
346 ok(e.name && e.name != e_name && !strcmp(e.name, "An exception name"), "Bad name '%s' for e\n", e.name);
347 ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
348
349 /* Copy ctor */
350 memset(&e2, 0, sizeof(e2));
351 call_func2(pexception_copy_ctor, &e2, &e);
352 ok(e2.vtable != NULL, "Null exception vtable for e2\n");
353 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "An exception name"), "Bad exception name for e2\n");
354 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
355
356 /* Default ctor */
357 memset(&e3, 1, sizeof(e3));
358 call_func1(pexception_default_ctor, &e3);
359 ok(e3.vtable != NULL, "Null exception vtable for e3\n");
360 ok(e3.name == NULL, "Bad exception name for e3\n");
361 ok(e3.do_free == 0, "do_free set to %d for e3\n", e3.do_free);
362
363 ok(e.vtable == e2.vtable && e.vtable == e3.vtable, "exception vtables differ!\n");
364
365 /* Test calling the dtors */
366 call_func1(pexception_dtor, &e2);
367 call_func1(pexception_dtor, &e3);
368
369 /* Operator equals */
370 memset(&e2, 0, sizeof(e2));
371 call_func1(pexception_default_ctor, &e2);
372 pe = call_func2(pexception_opequals, &e2, &e);
373 ok(e2.vtable != NULL, "Null exception vtable for e2\n");
374 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "An exception name"), "Bad exception name for e2\n");
375 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
376 ok(pe == &e2, "opequals didn't return e2\n");
377
378 /* what() */
380 ok(e2.name == name, "Bad exception name from e2::what()\n");
381
382 /* vtable ptr */
383 ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
384 call_func1(pexception_dtor, &e2);
385
386 /* new() */
387 pe = poperator_new(sizeof(exception));
388 ok(pe != NULL, "new() failed\n");
389 if (pe)
390 {
391 call_func2(pexception_ctor, pe, &e_name);
392 /* scalar dtor */
393 call_func2(pexception_scalar_dtor, pe, 0); /* Shouldn't delete pe */
394 pe->name = NULL;
395 pe->do_free = 0;
396 call_func2(pexception_scalar_dtor, pe, 1); /* Should delete pe */
397 }
398
399 pe = poperator_new(sizeof(exception));
400 ok(pe != NULL, "new() failed\n");
401 if (pe)
402 {
403 /* vector dtor, single element */
404 call_func2(pexception_ctor, pe, &e_name);
405 call_func2(pexception_vector_dtor, pe, 1); /* Should delete pe as single element*/
406 }
407
408 pe = poperator_new(sizeof(exception) * 4 + sizeof(size_t));
409 ok(pe != NULL, "new() failed\n");
410 if (pe)
411 {
412 /* vector dtor, multiple elements */
413 char name[] = "a constant";
414 *((size_t*)pe) = 3;
415 pe = (exception*)((size_t*)pe + 1);
416 call_func2(pexception_ctor, &pe[0], &e_name);
417 call_func2(pexception_ctor, &pe[1], &e_name);
418 call_func2(pexception_ctor, &pe[2], &e_name);
419 pe[3].name = name;
420 pe[3].do_free = 1; /* Crash if we try to free this */
421 call_func2(pexception_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
422 }
423
424 /* test our exported vtable is kosher */
425 pe = (void*)pexception_vtable; /* Use the exception struct to get vtable ptrs */
426 pexception_vector_dtor = (void*)pe->vtable;
427 pexception_what = (void*)pe->name;
428
430 ok(e.name == name, "Bad exception name from vtable e::what()\n");
431
432 if (p__RTtypeid)
433 {
434 /* Check the rtti */
435 type_info *ti = p__RTtypeid(&e);
436 ok (ti && !strcmp(ti->mangled, ".?AVexception@@"), "bad rtti for e\n");
437
438 if (ti)
439 {
440 /* Check the returned type_info has rtti too */
441 type_info *ti2 = p__RTtypeid(ti);
442 ok (ti2 != NULL && !strcmp(ti2->mangled, ".?AVtype_info@@"), "bad rtti for e's type_info\n");
443 }
444 }
445
446 call_func2(pexception_vector_dtor, &e, 0); /* Should delete e.name, but not e */
447}
448
449/* This test is basically a cut 'n' paste of the exception test. but it verifies that
450 * bad_typeid works the exact same way... */
451static void test_bad_typeid(void)
452{
453 static const char* e_name = "A bad_typeid name";
454 char* name;
455 exception e, e2, e3, *pe;
456
457 if (!poperator_new || !poperator_delete ||
458 !pbad_typeid_ctor || !pbad_typeid_copy_ctor ||
459 !pbad_typeid_dtor || !pbad_typeid_opequals || !pbad_typeid_what ||
460 !pbad_typeid_vtable || !pbad_typeid_vector_dtor || !pbad_typeid_scalar_dtor)
461 return;
462
463 /* 'const char*' ctor */
464 memset(&e, 0, sizeof(e));
465 call_func2(pbad_typeid_ctor, &e, e_name);
466 ok(e.vtable != NULL, "Null bad_typeid vtable for e\n");
467 ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_typeid name"), "Bad name '%s' for e\n", e.name);
468 ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
469
470 /* Copy ctor */
471 memset(&e2, 0, sizeof(e2));
472 call_func2(pbad_typeid_copy_ctor, &e2, &e);
473 ok(e2.vtable != NULL, "Null bad_typeid vtable for e2\n");
474 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_typeid name"), "Bad name '%s' for e2\n", e2.name);
475 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
476
477 /* Ctor closure */
478 if (pbad_typeid_ctor_closure)
479 {
480 memset(&e3, 1, sizeof(e3));
481 call_func1(pbad_typeid_ctor_closure, &e3);
482 ok(e3.vtable != NULL, "Null bad_typeid vtable for e3\n");
483 ok(e3.name && !strcmp(e3.name, "bad typeid"), "Bad bad_typeid name for e3\n");
484 ok(e3.do_free == 1, "do_free set to %d for e3\n", e3.do_free);
485 ok(e.vtable == e3.vtable, "bad_typeid closure vtables differ!\n");
486 call_func1(pbad_typeid_dtor, &e3);
487 }
488 ok(e.vtable == e2.vtable, "bad_typeid vtables differ!\n");
489
490 /* Test calling the dtors */
491 call_func1(pbad_typeid_dtor, &e2);
492
493 /* Operator equals */
494 memset(&e2, 1, sizeof(e2));
495 call_func1(pexception_default_ctor, &e2);
496 pe = call_func2(pbad_typeid_opequals, &e2, &e);
497 ok(e2.vtable != NULL, "Null bad_typeid vtable for e2\n");
498 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_typeid name"), "Bad bad_typeid name for e2\n");
499 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
500 ok(pe == &e2, "opequals didn't return e2\n");
501
502 /* what() */
504 ok(e2.name == name, "Bad bad_typeid name from e2::what()\n");
505
506 /* vtable ptr */
507 ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
508 call_func1(pbad_typeid_dtor, &e2);
509
510 /* new() */
511 pe = poperator_new(sizeof(exception));
512 ok(pe != NULL, "new() failed\n");
513 if (pe)
514 {
515 call_func2(pbad_typeid_ctor, pe, e_name);
516 /* scalar dtor */
517 call_func2(pbad_typeid_scalar_dtor, pe, 0); /* Shouldn't delete pe */
518 pe->name = NULL;
519 pe->do_free = 0;
520 call_func2(pbad_typeid_scalar_dtor, pe, 1); /* Should delete pe */
521 }
522
523 pe = poperator_new(sizeof(exception));
524 ok(pe != NULL, "new() failed\n");
525 if (pe)
526 {
527 /* vector dtor, single element */
528 call_func2(pbad_typeid_ctor, pe, e_name);
529 call_func2(pbad_typeid_vector_dtor, pe, 1); /* Should delete pe as single element*/
530 }
531
532 pe = poperator_new(sizeof(exception) * 4 + sizeof(size_t));
533 ok(pe != NULL, "new() failed\n");
534 if (pe)
535 {
536 /* vector dtor, multiple elements */
537 *((size_t*)pe) = 3;
538 pe = (exception*)((size_t*)pe + 1);
539 call_func2(pbad_typeid_ctor, &pe[0], e_name);
540 call_func2(pbad_typeid_ctor, &pe[1], e_name);
541 call_func2(pbad_typeid_ctor, &pe[2], e_name);
542 pe[3].name = 0;
543 pe[3].do_free = 1; /* Crash if we try to free this element */
544 call_func2(pbad_typeid_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
545 }
546
547 /* test our exported vtable is kosher */
548 pe = (void*)pbad_typeid_vtable; /* Use the exception struct to get vtable ptrs */
549 pbad_typeid_vector_dtor = (void*)pe->vtable;
550 pbad_typeid_what = (void*)pe->name;
551
553 ok(e.name == name, "Bad bad_typeid name from vtable e::what()\n");
554
555 if (p__RTtypeid)
556 {
557 /* Check the rtti */
558 type_info *ti = p__RTtypeid(&e);
559 ok (ti != NULL && !strcmp(ti->mangled, ".?AVbad_typeid@@"), "bad rtti for e (%s)\n",
560 !ti ? "null" : ti->mangled);
561 }
562
563 call_func2(pbad_typeid_vector_dtor, &e, 0); /* Should delete e.name, but not e */
564}
565
566
567/* Ditto for this test... */
568static void test_bad_cast(void)
569{
570 static const char* e_name = "A bad_cast name";
571 char* name;
572 exception e, e2, e3, *pe;
573
574 if (!poperator_new || !poperator_delete ||
575 !pbad_cast_ctor || !pbad_cast_copy_ctor ||
576 !pbad_cast_dtor || !pbad_cast_opequals || !pbad_cast_what ||
577 !pbad_cast_vtable || !pbad_cast_vector_dtor || !pbad_cast_scalar_dtor)
578 return;
579
580 if (pbad_cast_ctor2)
581 {
582 /* 'const char*' ctor */
583 memset(&e, 0, sizeof(e));
584 call_func2(pbad_cast_ctor2, &e, e_name);
585 ok(e.vtable != NULL, "Null bad_cast vtable for e\n");
586 ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_cast name"), "Bad name '%s' for e\n", e.name);
587 ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
588 call_func1(pbad_cast_dtor, &e);
589 }
590
591 /* 'const char*&' ctor */
592 memset(&e, 0, sizeof(e));
593 call_func2(pbad_cast_ctor, &e, &e_name);
594 ok(e.vtable != NULL, "Null bad_cast vtable for e\n");
595 ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_cast name"), "Bad name '%s' for e\n", e.name);
596 ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
597
598 /* Copy ctor */
599 memset(&e2, 0, sizeof(e2));
600 call_func2(pbad_cast_copy_ctor, &e2, &e);
601 ok(e2.vtable != NULL, "Null bad_cast vtable for e2\n");
602 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_cast name"), "Bad name '%s' for e2\n", e2.name);
603 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
604
605 /* Ctor closure */
606 if (pbad_cast_ctor_closure)
607 {
608 memset(&e3, 1, sizeof(e3));
609 call_func1(pbad_cast_ctor_closure, &e3);
610 ok(e3.vtable != NULL, "Null bad_cast vtable for e3\n");
611 ok(e3.name && !strcmp(e3.name, "bad cast"), "Bad bad_cast name for e3\n");
612 ok(e3.do_free == 1, "do_free set to %d for e3\n", e3.do_free);
613 ok(e.vtable == e3.vtable, "bad_cast closure vtables differ!\n");
614 call_func1(pbad_cast_dtor, &e3);
615 }
616 ok(e.vtable == e2.vtable, "bad_cast vtables differ!\n");
617
618 /* Test calling the dtors */
619 call_func1(pbad_cast_dtor, &e2);
620
621 /* Operator equals */
622 memset(&e2, 1, sizeof(e2));
623 call_func1(pexception_default_ctor, &e2);
624 pe = call_func2(pbad_cast_opequals, &e2, &e);
625 ok(e2.vtable != NULL, "Null bad_cast vtable for e2\n");
626 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_cast name"), "Bad bad_cast name for e2\n");
627 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
628 ok(pe == &e2, "opequals didn't return e2\n");
629
630 /* what() */
632 ok(e2.name == name, "Bad bad_cast name from e2::what()\n");
633
634 /* vtable ptr */
635 ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
636 call_func1(pbad_cast_dtor, &e2);
637
638 /* new() */
639 pe = poperator_new(sizeof(exception));
640 ok(pe != NULL, "new() failed\n");
641 if (pe)
642 {
643 call_func2(pbad_cast_ctor, pe, &e_name);
644 /* scalar dtor */
645 call_func2(pbad_cast_scalar_dtor, pe, 0); /* Shouldn't delete pe */
646 pe->name = NULL;
647 pe->do_free = 0;
648 call_func2(pbad_cast_scalar_dtor, pe, 1); /* Should delete pe */
649 }
650
651 pe = poperator_new(sizeof(exception));
652 ok(pe != NULL, "new() failed\n");
653 if (pe)
654 {
655 /* vector dtor, single element */
656 call_func2(pbad_cast_ctor, pe, &e_name);
657 call_func2(pbad_cast_vector_dtor, pe, 1); /* Should delete pe as single element*/
658 }
659
660 pe = poperator_new(sizeof(exception) * 4 + sizeof(size_t));
661 ok(pe != NULL, "new() failed\n");
662 if (pe)
663 {
664 /* vector dtor, multiple elements */
665 *((size_t*)pe) = 3;
666 pe = (exception*)((size_t*)pe + 1);
667 call_func2(pbad_cast_ctor, &pe[0], &e_name);
668 call_func2(pbad_cast_ctor, &pe[1], &e_name);
669 call_func2(pbad_cast_ctor, &pe[2], &e_name);
670 pe[3].name = 0;
671 pe[3].do_free = 1; /* Crash if we try to free this element */
672 call_func2(pbad_cast_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
673 }
674
675 /* test our exported vtable is kosher */
676 pe = (void*)pbad_cast_vtable; /* Use the exception struct to get vtable ptrs */
677 pbad_cast_vector_dtor = (void*)pe->vtable;
678 pbad_cast_what = (void*)pe->name;
679
681 ok(e.name == name, "Bad bad_cast name from vtable e::what()\n");
682
683 if (p__RTtypeid)
684 {
685 /* Check the rtti */
686 type_info *ti = p__RTtypeid(&e);
687 ok (ti != NULL && !strcmp(ti->mangled, ".?AVbad_cast@@"), "bad rtti for e\n");
688 }
689 call_func2(pbad_cast_vector_dtor, &e, 0); /* Should delete e.name, but not e */
690}
691
692/* ... and this one */
693static void test___non_rtti_object(void)
694{
695 static const char* e_name = "A __non_rtti_object name";
696 char* name;
697 exception e, e2, *pe;
698
699 if (!poperator_new || !poperator_delete ||
700 !p__non_rtti_object_ctor || !p__non_rtti_object_copy_ctor ||
701 !p__non_rtti_object_dtor || !p__non_rtti_object_opequals || !p__non_rtti_object_what ||
702 !p__non_rtti_object_vtable || !p__non_rtti_object_vector_dtor || !p__non_rtti_object_scalar_dtor)
703 return;
704
705 /* 'const char*' ctor */
706 memset(&e, 0, sizeof(e));
707 call_func2(p__non_rtti_object_ctor, &e, e_name);
708 ok(e.vtable != NULL, "Null __non_rtti_object vtable for e\n");
709 ok(e.name && e.name != e_name && !strcmp(e.name, "A __non_rtti_object name"), "Bad name '%s' for e\n", e.name);
710 ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
711
712 /* Copy ctor */
713 memset(&e2, 0, sizeof(e2));
714 call_func2(p__non_rtti_object_copy_ctor, &e2, &e);
715 ok(e2.vtable != NULL, "Null __non_rtti_object vtable for e2\n");
716 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A __non_rtti_object name"), "Bad name '%s' for e2\n", e2.name);
717 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
718 ok(e.vtable == e2.vtable, "__non_rtti_object vtables differ!\n");
719
720 /* Test calling the dtors */
721 call_func1(p__non_rtti_object_dtor, &e2);
722
723 /* Operator equals */
724 memset(&e2, 1, sizeof(e2));
725 call_func1(pexception_default_ctor, &e2);
727 ok(e2.vtable != NULL, "Null __non_rtti_object vtable for e2\n");
728 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A __non_rtti_object name"), "Bad __non_rtti_object name for e2\n");
729 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
730 ok(pe == &e2, "opequals didn't return e2\n");
731
732 /* what() */
734 ok(e2.name == name, "Bad __non_rtti_object name from e2::what()\n");
735
736 /* vtable ptr */
737 ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
738 call_func1(p__non_rtti_object_dtor, &e2);
739
740 /* new() */
741 pe = poperator_new(sizeof(exception));
742 ok(pe != NULL, "new() failed\n");
743 if (pe)
744 {
745 call_func2(p__non_rtti_object_ctor, pe, e_name);
746 /* scalar dtor */
747 call_func2(p__non_rtti_object_scalar_dtor, pe, 0); /* Shouldn't delete pe */
748 pe->name = NULL;
749 pe->do_free = 0;
750 call_func2(p__non_rtti_object_scalar_dtor, pe, 1); /* Should delete pe */
751 }
752
753 pe = poperator_new(sizeof(exception));
754 ok(pe != NULL, "new() failed\n");
755 if (pe)
756 {
757 /* vector dtor, single element */
758 call_func2(p__non_rtti_object_ctor, pe, e_name);
759 call_func2(p__non_rtti_object_vector_dtor, pe, 1); /* Should delete pe as single element*/
760 }
761
762 pe = poperator_new(sizeof(exception) * 4 + sizeof(size_t));
763 ok(pe != NULL, "new() failed\n");
764 if (pe)
765 {
766 /* vector dtor, multiple elements */
767 *((size_t*)pe) = 3;
768 pe = (exception*)((size_t*)pe + 1);
769 call_func2(p__non_rtti_object_ctor, &pe[0], e_name);
770 call_func2(p__non_rtti_object_ctor, &pe[1], e_name);
771 call_func2(p__non_rtti_object_ctor, &pe[2], e_name);
772 pe[3].name = 0;
773 pe[3].do_free = 1; /* Crash if we try to free this element */
774 call_func2(p__non_rtti_object_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
775 }
776
777 /* test our exported vtable is kosher */
778 pe = (void*)p__non_rtti_object_vtable; /* Use the exception struct to get vtable ptrs */
779 p__non_rtti_object_vector_dtor = (void*)pe->vtable;
780 p__non_rtti_object_what = (void*)pe->name;
781
783 ok(e.name == name, "Bad __non_rtti_object name from vtable e::what()\n");
784
785 if (p__RTtypeid)
786 {
787 /* Check the rtti */
788 type_info *ti = p__RTtypeid(&e);
789 ok (ti != NULL && !strcmp(ti->mangled, ".?AV__non_rtti_object@@"), "bad rtti for e\n");
790 }
791 call_func2(p__non_rtti_object_vector_dtor, &e, 0); /* Should delete e.name, but not e */
792}
793
794static void test_type_info(void)
795{
796 static type_info t1 = { NULL, NULL,{'.','?','A','V','t','e','s','t','1','@','@',0,0,0,0,0 } };
797 static type_info t1_1 = { NULL, NULL,{'?','?','A','V','t','e','s','t','1','@','@',0,0,0,0,0 } };
798 static type_info t2 = { NULL, NULL, {'.','?','A','V','t','e','s','t','2','@','@',0,0,0,0,0 } };
799 char* name;
800 int res;
801
802 if (!ptype_info_dtor || !ptype_info_raw_name ||
803 !ptype_info_name || !ptype_info_before ||
804 !ptype_info_opequals_equals || !ptype_info_opnot_equals)
805 return;
806
807 /* Test calling the dtors */
808 call_func1(ptype_info_dtor, &t1); /* No effect, since name is NULL */
809 t1.name = malloc(64);
810 strcpy(t1.name, "foo");
811 call_func1(ptype_info_dtor, &t1); /* Frees t1.name using 'free' */
812
813 /* raw_name */
814 t1.name = NULL;
816
817 /* FIXME: This fails on native; it shouldn't though - native bug?
818 * ok(name && !strcmp(name, t1.mangled), "bad raw_name '%s' for t1 (expected '%s')\n", name, t1.mangled);
819 */
820 ok(t1.name == NULL, "raw_name() set name for t1\n");
821
822 /* name */
823 t1.name = NULL;
825 ok(name && t1.name && !strcmp(name, t1.name), "bad name '%s' for t1\n", name);
826
827 ok(t1.name && !strcmp(t1.name, "class test1"), "demangled to '%s' for t1\n", t1.name);
828 call_func1(ptype_info_dtor, &t1);
829
830 /* before */
831 t1.name = NULL;
832 res = (int)call_func2(ptype_info_before, &t1, &t1);
833 ok(res == 0, "expected 0, got %d\n", res);
834 res = (int)call_func2(ptype_info_before, &t2, &t1);
835 ok(res == 0, "expected 0, got %d\n", res);
836 res = (int)call_func2(ptype_info_before, &t1, &t2);
837 ok(res == 1, "expected 1, got %d\n", res);
838 /* Doesn't check first char */
839 res = (int)call_func2(ptype_info_before, &t1, &t1_1);
840 ok(res == 0, "expected 0, got %d\n", res);
841
842 /* opequals_equals */
843 t1.name = NULL;
844 res = (int)call_func2(ptype_info_opequals_equals, &t1, &t1);
845 ok(res == 1, "expected 1, got %d\n", res);
846 res = (int)call_func2(ptype_info_opequals_equals, &t1, &t2);
847 ok(res == 0, "expected 0, got %d\n", res);
848 res = (int)call_func2(ptype_info_opequals_equals, &t2, &t1);
849 ok(res == 0, "expected 0, got %d\n", res);
850
851 /* opnot_equals */
852 t1.name = NULL;
853 res = (int)call_func2(ptype_info_opnot_equals, &t1, &t1);
854 ok(res == 0, "expected 0, got %d\n", res);
855 res = (int)call_func2(ptype_info_opnot_equals, &t1, &t2);
856 ok(res == 1, "expected 1, got %d\n", res);
857 res = (int)call_func2(ptype_info_opnot_equals, &t2, &t1);
858 ok(res == 1, "expected 1, got %d\n", res);
859}
860
861static inline vtable_ptr *get_vtable( void *obj )
862{
863 return *(vtable_ptr **)obj;
864}
865
866static inline void/*rtti_object_locator*/ *get_obj_locator( void *cppobj )
867{
868 const vtable_ptr *vtable = get_vtable( cppobj );
869 return (void *)vtable[-1];
870}
871
872#ifdef __i386__
873#define DEFINE_RTTI_REF(type, name) type *name
874#define RTTI_REF(instance, name) &instance.name
875#define RTTI_REF_SIG0(instance, name, base) RTTI_REF(instance, name)
876#else
877#define DEFINE_RTTI_REF(type, name) unsigned name
878#define RTTI_REF(instance, name) FIELD_OFFSET(struct rtti_data, name)
879#define RTTI_REF_SIG0(instance, name, base) ((char*)&instance.name-base)
880#endif
881/* Test RTTI functions */
882static void test_rtti(void)
883{
884 struct _object_locator
885 {
886 unsigned int signature;
887 int base_class_offset;
888 unsigned int flags;
889 DEFINE_RTTI_REF(type_info, type_descriptor);
890 DEFINE_RTTI_REF(struct _rtti_object_hierarchy, type_hierarchy);
891 DEFINE_RTTI_REF(void, object_locator);
892 } *obj_locator;
893
895 {
898 struct {
899 int this_offset;
900 int vbase_descr;
901 int vbase_offset;
903 unsigned int attributes;
904 };
905
906 struct _rtti_base_array {
908 };
909
911 unsigned int signature;
912 unsigned int attributes;
913 int array_len;
915 };
916
917 struct rtti_data
918 {
920
921 struct _rtti_base_descriptor base_descriptor[4];
922 struct _rtti_base_array base_array;
923 struct _rtti_object_hierarchy object_hierarchy;
924 struct _object_locator object_locator;
925 } simple_class_rtti = {
926 { {NULL, NULL, "simple_class"} },
927 { {RTTI_REF(simple_class_rtti, type_info[0]), 0, {0, 0, 0}, 0} },
928 { {RTTI_REF(simple_class_rtti, base_descriptor[0])} },
929 {0, 0, 1, RTTI_REF(simple_class_rtti, base_array)},
930 {1, 0, 0, RTTI_REF(simple_class_rtti, type_info[0]), RTTI_REF(simple_class_rtti, object_hierarchy), RTTI_REF(simple_class_rtti, object_locator)}
931 }, child_class_rtti = {
932 { {NULL, NULL, "simple_class"}, {NULL, NULL, "child_class"} },
933 { {RTTI_REF(child_class_rtti, type_info[1]), 0, {4, -1, 0}, 0}, {RTTI_REF(child_class_rtti, type_info[0]), 0, {8, -1, 0}, 0} },
934 { {RTTI_REF(child_class_rtti, base_descriptor[0]), RTTI_REF(child_class_rtti, base_descriptor[1])} },
935 {0, 0, 2, RTTI_REF(child_class_rtti, base_array)},
936 {1, 0, 0, RTTI_REF(child_class_rtti, type_info[1]), RTTI_REF(child_class_rtti, object_hierarchy), RTTI_REF(child_class_rtti, object_locator)}
937 }, virtual_base_class_rtti = {
938 { {NULL, NULL, "simple_class"}, {NULL, NULL, "child_class"} },
939 { {RTTI_REF(virtual_base_class_rtti, type_info[1]), 0, {0x10, sizeof(void*), sizeof(int)}, 0}, {RTTI_REF(virtual_base_class_rtti, type_info[0]), 0, {8, -1, 0}, 0} },
940 { {RTTI_REF(virtual_base_class_rtti, base_descriptor[0]), RTTI_REF(virtual_base_class_rtti, base_descriptor[1])} },
941 {0, 0, 2, RTTI_REF(virtual_base_class_rtti, base_array)},
942 {1, 0, 0, RTTI_REF(virtual_base_class_rtti, type_info[1]), RTTI_REF(virtual_base_class_rtti, object_hierarchy), RTTI_REF(virtual_base_class_rtti, object_locator)}
943 };
944 static struct rtti_data simple_class_sig0_rtti, child_class_sig0_rtti;
945
946 void *simple_class_vtbl[2] = {&simple_class_rtti.object_locator};
947 void *simple_class = &simple_class_vtbl[1];
948 void *child_class_vtbl[2] = {&child_class_rtti.object_locator};
949 struct {
950 void *vtbl;
951 char data[4];
952 } child_class = { &child_class_vtbl[1] };
953 void *simple_class_sig0_vtbl[2] = {&simple_class_sig0_rtti.object_locator};
954 void *simple_class_sig0 = &simple_class_sig0_vtbl[1];
955 void *child_class_sig0_vtbl[2] = {&child_class_sig0_rtti.object_locator};
956 struct {
957 void *vtbl;
958 char data[4];
959 } child_class_sig0 = { &child_class_sig0_vtbl[1] };
960 void *virtual_base_class_vtbl[2] = {&virtual_base_class_rtti.object_locator};
961 int virtual_base_class_vbtbl[2] = {0, 0x100};
962 struct {
963 void *virtual_base[2];
964 char data[0x110-sizeof(void*)];
965 void *vbthis;
966 } virtual_base_class = { {&virtual_base_class_vtbl[1], virtual_base_class_vbtbl} };
967
968 static const char* e_name = "name";
969 type_info *ti,*bti;
970 exception e,b;
971 void *casted;
972 BOOL old_signature;
973#ifndef __i386__
974 char *base = (char*)GetModuleHandleW(NULL);
975#endif
976
977 if (!p__RTCastToVoid || !p__RTtypeid || !pexception_ctor || !pbad_typeid_ctor
978 || !p__RTDynamicCast || !pexception_dtor || !pbad_typeid_dtor)
979 return;
980
981 call_func2(pexception_ctor, &e, &e_name);
982 call_func2(pbad_typeid_ctor, &b, e_name);
983
984 obj_locator = get_obj_locator(&e);
985 if(obj_locator->signature!=1 && sizeof(void*)>sizeof(int))
986 old_signature = TRUE;
987 else
988 old_signature = FALSE;
989
990 /* dynamic_cast to void* */
991 casted = p__RTCastToVoid(&e);
992 ok (casted == (void*)&e, "failed cast to void\n");
993
994 /* dynamic_cast up */
995 ti = p__RTtypeid(&e);
996 bti = p__RTtypeid(&b);
997
998 casted = p__RTDynamicCast(&b, 0, NULL, ti, 0);
999 if (casted)
1000 {
1001 /* New versions do not allow this conversion due to compiler changes */
1002 ok (casted == (void*)&b, "failed cast from bad_typeid to exception\n");
1003 }
1004
1005 /* dynamic_cast down */
1006 casted = p__RTDynamicCast(&e, 0, NULL, bti, 0);
1007 ok (casted == NULL, "Cast succeeded\n");
1008
1009 call_func1(pexception_dtor, &e);
1010 call_func1(pbad_typeid_dtor, &b);
1011
1012 simple_class_sig0_rtti = simple_class_rtti;
1013 simple_class_sig0_rtti.object_locator.signature = 0;
1014 simple_class_sig0_rtti.base_descriptor[0].type_descriptor = RTTI_REF_SIG0(simple_class_sig0_rtti, type_info[0], base);
1015 simple_class_sig0_rtti.base_array.bases[0] = RTTI_REF_SIG0(simple_class_sig0_rtti, base_descriptor[0], base);
1016 simple_class_sig0_rtti.object_hierarchy.base_classes = RTTI_REF_SIG0(simple_class_sig0_rtti, base_array, base);
1017 simple_class_sig0_rtti.object_locator.type_descriptor = RTTI_REF_SIG0(simple_class_sig0_rtti, type_info[0], base);
1018 simple_class_sig0_rtti.object_locator.type_hierarchy = RTTI_REF_SIG0(simple_class_sig0_rtti, object_hierarchy, base);
1019
1020 child_class_sig0_rtti = child_class_rtti;
1021 child_class_sig0_rtti.object_locator.signature = 0;
1022 child_class_sig0_rtti.base_descriptor[0].type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[1], base);
1023 child_class_sig0_rtti.base_descriptor[1].type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[0], base);
1024 child_class_sig0_rtti.base_array.bases[0] = RTTI_REF_SIG0(child_class_sig0_rtti, base_descriptor[0], base);
1025 child_class_sig0_rtti.base_array.bases[1] = RTTI_REF_SIG0(child_class_sig0_rtti, base_descriptor[1], base);
1026 child_class_sig0_rtti.object_hierarchy.base_classes = RTTI_REF_SIG0(child_class_sig0_rtti, base_array, base);
1027 child_class_sig0_rtti.object_locator.type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[1], base);
1028 child_class_sig0_rtti.object_locator.type_hierarchy = RTTI_REF_SIG0(child_class_sig0_rtti, object_hierarchy, base);
1029
1030 ti = p__RTtypeid(&simple_class_sig0);
1031 ok (ti && !strcmp(ti->mangled, "simple_class"), "incorrect rtti data\n");
1032
1033 casted = p__RTCastToVoid(&simple_class_sig0);
1034 ok (casted == (void*)&simple_class_sig0, "failed cast to void\n");
1035
1036 ti = p__RTtypeid(&child_class_sig0);
1037 ok (ti && !strcmp(ti->mangled, "child_class"), "incorrect rtti data\n");
1038
1039 casted = p__RTCastToVoid(&child_class_sig0);
1040 ok (casted == (void*)&child_class_sig0, "failed cast to void\n");
1041
1042 casted = p__RTDynamicCast(&child_class_sig0, 0, NULL, simple_class_sig0_rtti.type_info, 0);
1043 if(casted)
1044 {
1045 ok (casted == (char*)&child_class_sig0+8, "failed cast to simple_class (%p %p)\n", casted, &child_class_sig0);
1046 }
1047
1048 casted = p__RTDynamicCast(&child_class_sig0, 0, &child_class_sig0_rtti.type_info[0], &child_class_sig0_rtti.type_info[1], 0);
1049 ok(casted == (char*)&child_class_sig0+4, "failed cast to child class (%p %p)\n", casted, &child_class_sig0);
1050
1051 if(old_signature) {
1052 skip("signature==1 is not supported\n");
1053 return;
1054 }
1055
1056 ti = p__RTtypeid(&simple_class);
1057 ok (ti && !strcmp(ti->mangled, "simple_class"), "incorrect rtti data\n");
1058
1059 casted = p__RTCastToVoid(&simple_class);
1060 ok (casted == (void*)&simple_class, "failed cast to void\n");
1061
1062 ti = p__RTtypeid(&child_class);
1063 ok (ti && !strcmp(ti->mangled, "child_class"), "incorrect rtti data\n");
1064
1065 casted = p__RTCastToVoid(&child_class);
1066 ok (casted == (void*)&child_class, "failed cast to void\n");
1067
1068 casted = p__RTDynamicCast(&child_class, 0, NULL, simple_class_rtti.type_info, 0);
1069 if(casted)
1070 {
1071 ok (casted == (char*)&child_class+8, "failed cast to simple_class (%p %p)\n", casted, &child_class);
1072 }
1073
1074 casted = p__RTDynamicCast(&child_class, 0, &child_class_rtti.type_info[0], &child_class_rtti.type_info[1], 0);
1075 ok(casted == (char*)&child_class+4, "failed cast to child class (%p %p)\n", casted, &child_class);
1076
1077 casted = p__RTDynamicCast(&virtual_base_class, 0, &virtual_base_class_rtti.type_info[0], &virtual_base_class_rtti.type_info[1], 0);
1078 ok(casted == &virtual_base_class.vbthis, "failed cast to child class (%p %p)\n", casted, &virtual_base_class);
1079}
1080
1085};
1086
1087static void test_demangle_datatype(void)
1088{
1089 char * name;
1090 struct _demangle demangle[]={
1091 { "BlaBla"," ?? ::Bla", FALSE},
1092 { "ABVVec4@ref2@dice@@", "class dice::ref2::Vec4 const &", TRUE},
1093 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0H@@@",
1094 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,7>", TRUE},
1095 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HO@@@",
1096 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,126>",TRUE},
1097 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HOA@@@",
1098 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,2016>",TRUE},
1099 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HOAA@@@",
1100 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,32256>",TRUE},
1101 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$01@@@",
1102 "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$01@@@", FALSE},
1103 { "P8test@@AACXZ", "signed char (__cdecl test::*)(void)", TRUE},
1104 { "P8test@@BACXZ", "signed char (__cdecl test::*)(void)const ", TRUE},
1105 };
1106 int i, num_test = ARRAY_SIZE(demangle);
1107
1108 for (i = 0; i < num_test; i++)
1109 {
1110 name = p__unDName(0, demangle[i].mangled, 0, malloc, free, 0x2800);
1111 todo_wine_if (!demangle[i].test_in_wine)
1112 ok(name != NULL && !strcmp(name,demangle[i].result), "Got name \"%s\" for %d\n", name, i);
1113 free(name);
1114 }
1115}
1116
1117static void test_demangle(void)
1118{
1119 static struct {const char* in; const char* out; const char *broken; unsigned int flags;} test[] = {
1120/* 0 */ {"??0bad_alloc@std@@QAE@ABV01@@Z",
1121 "public: __thiscall std::bad_alloc::bad_alloc(class std::bad_alloc const &)",
1122 "public: __thiscall std::bad_alloc::bad_alloc(class bad_alloc::bad_alloc const &)"},
1123/* 1 */ {"??0bad_alloc@std@@QAE@PBD@Z",
1124 "public: __thiscall std::bad_alloc::bad_alloc(char const *)"},
1125/* 2 */ {"??0bad_cast@@AAE@PBQBD@Z",
1126 "private: __thiscall bad_cast::bad_cast(char const * const *)"},
1127/* 3 */ {"??0bad_cast@@QAE@ABQBD@Z",
1128 "public: __thiscall bad_cast::bad_cast(char const * const &)"},
1129/* 4 */ {"??0bad_cast@@QAE@ABV0@@Z",
1130 "public: __thiscall bad_cast::bad_cast(class bad_cast const &)"},
1131/* 5 */ {"??0bad_exception@std@@QAE@ABV01@@Z",
1132 "public: __thiscall std::bad_exception::bad_exception(class std::bad_exception const &)",
1133 "public: __thiscall std::bad_exception::bad_exception(class bad_exception::bad_exception const &)"},
1134/* 6 */ {"??0bad_exception@std@@QAE@PBD@Z",
1135 "public: __thiscall std::bad_exception::bad_exception(char const *)"},
1136/* 7 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z",
1137 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(class std::basic_filebuf<char,struct std::char_traits<char> > const &)",
1138 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(class basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> > const &)"},
1139/* 8 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z",
1140 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(struct _iobuf *)"},
1141/* 9 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z",
1142 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(enum std::_Uninitialized)",
1143 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(enum basic_filebuf<char,struct std::char_traits<char> >::_Uninitialized)"},
1144/* 10 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z",
1145 "public: __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >(class std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> > const &)",
1146 "public: __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >(class basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> > const &)"},
1147/* 11 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z",
1148 "public: __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >(struct _iobuf *)"},
1149/* 12 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z",
1150 "public: __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >(enum std::_Uninitialized)",
1151 "public: __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >(enum basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::_Uninitialized)"},
1152/* 13 */ {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z",
1153 "public: __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> > const &)",
1154 "public: __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(class basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1155/* 14 */ {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@H@Z",
1156 "public: __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)",
1157 "public: __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(class basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)"},
1158/* 15 */ {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z",
1159 "public: __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(int)"},
1160/* 16 */ {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV01@@Z",
1161 "public: __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)",
1162 "public: __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1163/* 17 */ {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@1@H@Z",
1164 "public: __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,int)",
1165 "public: __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,int)"},
1166/* 18 */ {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z",
1167 "public: __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(int)"},
1168/* 19 */ {"??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z",
1169 "public: __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >(class std::_Locinfo const &,unsigned int)",
1170 "public: __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >(class num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::_Locinfo const &,unsigned int)"},
1171/* 20 */ {"??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z",
1172 "public: __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >(unsigned int)"},
1173/* 21 */ {"??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z",
1174 "public: __thiscall std::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >(class std::_Locinfo const &,unsigned int)",
1175 "public: __thiscall std::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >(class num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::_Locinfo const &,unsigned int)"},
1176/* 22 */ {"??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@I@Z", "public: __thiscall std::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >(unsigned int)"},
1177/* 23 */ {"??0streambuf@@QAE@ABV0@@Z", "public: __thiscall streambuf::streambuf(class streambuf const &)"},
1178/* 24 */ {"??0strstreambuf@@QAE@ABV0@@Z", "public: __thiscall strstreambuf::strstreambuf(class strstreambuf const &)"},
1179/* 25 */ {"??0strstreambuf@@QAE@H@Z", "public: __thiscall strstreambuf::strstreambuf(int)"},
1180/* 26 */ {"??0strstreambuf@@QAE@Q6APAXJ@ZS6AXPAX@Z@Z", "public: __thiscall strstreambuf::strstreambuf(void * (__cdecl*const)(long),void (__cdecl*const volatile)(void *))"},
1181/* 27 */ {"??0strstreambuf@@QAE@PADH0@Z", "public: __thiscall strstreambuf::strstreambuf(char *,int,char *)"},
1182/* 28 */ {"??0strstreambuf@@QAE@PAEH0@Z", "public: __thiscall strstreambuf::strstreambuf(unsigned char *,int,unsigned char *)"},
1183/* 29 */ {"??0strstreambuf@@QAE@XZ", "public: __thiscall strstreambuf::strstreambuf(void)"},
1184/* 30 */ {"??1__non_rtti_object@std@@UAE@XZ", "public: virtual __thiscall std::__non_rtti_object::~__non_rtti_object(void)"},
1185/* 31 */ {"??1__non_rtti_object@@UAE@XZ", "public: virtual __thiscall __non_rtti_object::~__non_rtti_object(void)"},
1186/* 32 */ {"??1?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@UAE@XZ", "public: virtual __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::~num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >(void)"},
1187/* 33 */ {"??1?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@UAE@XZ", "public: virtual __thiscall std::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::~num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >(void)"},
1188/* 34 */ {"??4istream_withassign@@QAEAAV0@ABV0@@Z", "public: class istream_withassign & __thiscall istream_withassign::operator=(class istream_withassign const &)"},
1189/* 35 */ {"??4istream_withassign@@QAEAAVistream@@ABV1@@Z", "public: class istream & __thiscall istream_withassign::operator=(class istream const &)"},
1190/* 36 */ {"??4istream_withassign@@QAEAAVistream@@PAVstreambuf@@@Z", "public: class istream & __thiscall istream_withassign::operator=(class streambuf *)"},
1191/* 37 */ {"??5std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z", "class std::basic_istream<char,struct std::char_traits<char> > & __cdecl std::operator>>(class std::basic_istream<char,struct std::char_traits<char> > &,signed char &)"},
1192/* 38 */ {"??5std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z", "class std::basic_istream<char,struct std::char_traits<char> > & __cdecl std::operator>>(class std::basic_istream<char,struct std::char_traits<char> > &,char &)"},
1193/* 39 */ {"??5std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z", "class std::basic_istream<char,struct std::char_traits<char> > & __cdecl std::operator>>(class std::basic_istream<char,struct std::char_traits<char> > &,unsigned char &)"},
1194/* 40 */ {"??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z", "public: class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > & __thiscall std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> >::operator<<(class std::ios_base & (__cdecl*)(class std::ios_base &))"},
1195/* 41 */ {"??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z", "public: class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > & __thiscall std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> >::operator<<(class std::basic_streambuf<unsigned short,struct std::char_traits<unsigned short> > *)"},
1196/* 42 */ {"??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z", "public: class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > & __thiscall std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> >::operator<<(void const *)"},
1197/* 43 */ {"??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@", "const std::basic_fstream<char,struct std::char_traits<char> >::`vbtable'{for `std::basic_ostream<char,struct std::char_traits<char> >'}"},
1198/* 44 */ {"??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@", "const std::basic_fstream<unsigned short,struct std::char_traits<unsigned short> >::`vbtable'{for `std::basic_istream<unsigned short,struct std::char_traits<unsigned short> >'}"},
1199/* 45 */ {"??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@", "const std::basic_fstream<unsigned short,struct std::char_traits<unsigned short> >::`vbtable'{for `std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> >'}"},
1200/* 46 */ {"??9std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z", "bool __cdecl std::operator!=(char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1201/* 47 */ {"??9std@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z", "bool __cdecl std::operator!=(unsigned short const *,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1202/* 48 */ {"??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z", "public: char & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator[](unsigned int)"},
1203/* 49 */ {"??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z", "public: char const & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator[](unsigned int)const "},
1204/* 50 */ {"??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAGI@Z", "public: unsigned short & __thiscall std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::operator[](unsigned int)"},
1205/* 51 */ {"??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEABGI@Z", "public: unsigned short const & __thiscall std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::operator[](unsigned int)const "},
1206/* 52 */ {"?abs@std@@YAMABV?$complex@M@1@@Z", "float __cdecl std::abs(class std::complex<float> const &)"},
1207/* 53 */ {"?abs@std@@YANABV?$complex@N@1@@Z", "double __cdecl std::abs(class std::complex<double> const &)"},
1208/* 54 */ {"?abs@std@@YAOABV?$complex@O@1@@Z", "long double __cdecl std::abs(class std::complex<long double> const &)"},
1209/* 55 */ {"?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A", "class std::basic_istream<char,struct std::char_traits<char> > std::cin"},
1210/* 56 */ {"?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAG@Z", "protected: virtual class std::istreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::do_get(class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,int &,unsigned short &)const "},
1211/* 57 */ {"?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAI@Z", "protected: virtual class std::istreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::do_get(class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,int &,unsigned int &)const "},
1212/* 58 */ {"?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAJ@Z", "protected: virtual class std::istreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::do_get(class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,int &,long &)const "},
1213/* 59 */ {"?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAK@Z", "protected: virtual class std::istreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::do_get(class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,int &,unsigned long &)const "},
1214/* 60 */ {"?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAM@Z", "protected: virtual class std::istreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::do_get(class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,int &,float &)const "},
1215/* 61 */ {"?_query_new_handler@@YAR6AHI@ZXZ", "int (__cdecl*__cdecl _query_new_handler(void))(unsigned int)"},
1216/* 62 */ {"?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z", "public: void __thiscall std::ios_base::register_callback(void (__cdecl*)(enum std::ios_base::event,class std::ios_base &,int),int)"},
1217/* 63 */ {"?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z", "public: class std::basic_istream<char,struct std::char_traits<char> > & __thiscall std::basic_istream<char,struct std::char_traits<char> >::seekg(long,enum std::ios_base::seekdir)"},
1218/* 64 */ {"?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z", "public: class std::basic_istream<char,struct std::char_traits<char> > & __thiscall std::basic_istream<char,struct std::char_traits<char> >::seekg(class std::fpos<int>)"},
1219/* 65 */ {"?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z", "public: class std::basic_istream<unsigned short,struct std::char_traits<unsigned short> > & __thiscall std::basic_istream<unsigned short,struct std::char_traits<unsigned short> >::seekg(long,enum std::ios_base::seekdir)"},
1220/* 66 */ {"?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z", "public: class std::basic_istream<unsigned short,struct std::char_traits<unsigned short> > & __thiscall std::basic_istream<unsigned short,struct std::char_traits<unsigned short> >::seekg(class std::fpos<int>)"},
1221/* 67 */ {"?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z", "protected: virtual class std::fpos<int> __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::seekoff(long,enum std::ios_base::seekdir,int)"},
1222/* 68 */ {"?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z", "protected: virtual class std::fpos<int> __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::seekoff(long,enum std::ios_base::seekdir,int)"},
1223/* 69 */ {"?set_new_handler@@YAP6AXXZP6AXXZ@Z", "void (__cdecl*__cdecl set_new_handler(void (__cdecl*)(void)))(void)"},
1224/* 70 */ {"?str@?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z", "public: void __thiscall std::basic_istringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1225/* 71 */ {"?str@?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ", "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_istringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const "},
1226/* 72 */ {"?str@?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z", "public: void __thiscall std::basic_istringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1227/* 73 */ {"?str@?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ", "public: class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __thiscall std::basic_istringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(void)const "},
1228/* 74 */ {"?str@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z", "public: void __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1229/* 75 */ {"?str@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ", "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const "},
1230/* 76 */ {"?str@?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z", "public: void __thiscall std::basic_ostringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1231/* 77 */ {"?str@?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ", "public: class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __thiscall std::basic_ostringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(void)const "},
1232/* 78 */ {"?str@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z", "public: void __thiscall std::basic_stringbuf<char,struct std::char_traits<char>,class std::allocator<char> >::str(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1233/* 79 */ {"?str@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ", "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_stringbuf<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const "},
1234/* 80 */ {"?str@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z", "public: void __thiscall std::basic_stringbuf<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1235/* 81 */ {"?str@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ", "public: class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __thiscall std::basic_stringbuf<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(void)const "},
1236/* 82 */ {"?str@?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z", "public: void __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1237/* 83 */ {"?str@?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ", "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const "},
1238/* 84 */ {"?str@?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z", "public: void __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1239/* 85 */ {"?str@?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ", "public: class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(void)const "},
1240/* 86 */ {"?_Sync@ios_base@std@@0_NA", "private: static bool std::ios_base::_Sync"},
1241/* 87 */ {"??_U@YAPAXI@Z", "void * __cdecl operator new[](unsigned int)"},
1242/* 88 */ {"??_V@YAXPAX@Z", "void __cdecl operator delete[](void *)"},
1243/* 89 */ {"??X?$_Complex_base@M@std@@QAEAAV01@ABM@Z", "public: class std::_Complex_base<float> & __thiscall std::_Complex_base<float>::operator*=(float const &)"},
1244/* 90 */ {"??Xstd@@YAAAV?$complex@M@0@AAV10@ABV10@@Z", "class std::complex<float> & __cdecl std::operator*=(class std::complex<float> &,class std::complex<float> const &)"},
1245/* 91 */ {"?aaa@@YAHAAUbbb@@@Z", "int __cdecl aaa(struct bbb &)"},
1246/* 92 */ {"?aaa@@YAHBAUbbb@@@Z", "int __cdecl aaa(struct bbb & volatile)"},
1247/* 93 */ {"?aaa@@YAHPAUbbb@@@Z", "int __cdecl aaa(struct bbb *)"},
1248/* 94 */ {"?aaa@@YAHQAUbbb@@@Z", "int __cdecl aaa(struct bbb * const)"},
1249/* 95 */ {"?aaa@@YAHRAUbbb@@@Z", "int __cdecl aaa(struct bbb * volatile)"},
1250/* 96 */ {"?aaa@@YAHSAUbbb@@@Z", "int __cdecl aaa(struct bbb * const volatile)"},
1251/* 97 */ {"??0aa.a@@QAE@XZ", "??0aa.a@@QAE@XZ"},
1252/* 98 */ {"??0aa$_3a@@QAE@XZ", "public: __thiscall aa$_3a::aa$_3a(void)"},
1253/* 99 */ {"??2?$aaa@AAUbbb@@AAUccc@@AAU2@@ddd@1eee@2@QAEHXZ", "public: int __thiscall eee::eee::ddd::ddd::aaa<struct bbb &,struct ccc &,struct ccc &>::operator new(void)"},
1254/* 100 */ {"?pSW@@3P6GHKPAX0PAU_tagSTACKFRAME@@0P6GH0K0KPAK@ZP6GPAX0K@ZP6GK0K@ZP6GK00PAU_tagADDRESS@@@Z@ZA", "int (__stdcall* pSW)(unsigned long,void *,void *,struct _tagSTACKFRAME *,void *,int (__stdcall*)(void *,unsigned long,void *,unsigned long,unsigned long *),void * (__stdcall*)(void *,unsigned long),unsigned long (__stdcall*)(void *,unsigned long),unsigned long (__stdcall*)(void *,void *,struct _tagADDRESS *))"},
1255/* 101 */ {"?$_aaa@Vbbb@@", "_aaa<class bbb>"},
1256/* 102 */ {"?$aaa@Vbbb@ccc@@Vddd@2@", "aaa<class ccc::bbb,class ccc::ddd>"},
1257/* 103 */ { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "public: __thiscall Foo<int (__stdcall*)(void *,void *)>::Foo<int (__stdcall*)(void *,void *)>(char *)"},
1258/* 104 */ { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "__thiscall Foo<int (__stdcall*)(void *,void *)>::Foo<int (__stdcall*)(void *,void *)>(char *)", NULL, 0x880},
1259/* 105 */ { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "private: static int (__cdecl** Bar::Qux)(class Bar *,int &,int &,int *)" },
1260/* 106 */ { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "Bar::Qux", NULL, 0x1800},
1261/* 107 */ {"?$AAA@$DBAB@", "AAA<`template-parameter257'>"},
1262/* 108 */ {"?$AAA@?C@", "AAA<`template-parameter-2'>"},
1263/* 109 */ {"?$AAA@PAUBBB@@", "AAA<struct BBB *>"},
1264/* 110 */ {"??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z",
1265 "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa * *,class ee *)",
1266 "??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z"},
1267/* 111 */ {"?f@T@@QAEHQCY1BE@BO@D@Z", "public: int __thiscall T::f(char (volatile * const)[20][30])"},
1268/* 112 */ {"?f@T@@QAEHQAY2BE@BO@CI@D@Z", "public: int __thiscall T::f(char (* const)[20][30][40])"},
1269/* 113 */ {"?f@T@@QAEHQAY1BE@BO@$$CBD@Z", "public: int __thiscall T::f(char const (* const)[20][30])"},
1270/* 114 */ {"??0?$Foo@U?$vector_c@H$00$01$0?1$0A@$0A@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@@mpl@boost@@@@QAE@XZ",
1271 "public: __thiscall Foo<struct boost::mpl::vector_c<int,1,2,-2,0,0,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647> >::Foo<struct boost::mpl::vector_c<int,1,2,-2,0,0,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647> >(void)"},
1272/* 115 */ {"?swprintf@@YAHPAGIPBGZZ", "int __cdecl swprintf(unsigned short *,unsigned int,unsigned short const *,...)"},
1273/* 116 */ {"?vswprintf@@YAHPAGIPBGPAD@Z", "int __cdecl vswprintf(unsigned short *,unsigned int,unsigned short const *,char *)"},
1274/* 117 */ {"?vswprintf@@YAHPA_WIPB_WPAD@Z", "int __cdecl vswprintf(wchar_t *,unsigned int,wchar_t const *,char *)"},
1275/* 118 */ {"?swprintf@@YAHPA_WIPB_WZZ", "int __cdecl swprintf(wchar_t *,unsigned int,wchar_t const *,...)"},
1276/* 119 */ {"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", "class std::complex<float> & __ptr64 __cdecl std::operator*=(class std::complex<float> & __ptr64,class std::complex<float> const & __ptr64)"},
1277/* 120 */ {"?_Doraise@bad_cast@std@@MEBAXXZ", "protected: virtual void __cdecl std::bad_cast::_Doraise(void)const __ptr64"},
1278/* 121 */ {"??$?DM@std@@YA?AV?$complex@M@0@ABMABV10@@Z",
1279 "class std::complex<float> __cdecl std::operator*<float>(float const &,class std::complex<float> const &)",
1280 "??$?DM@std@@YA?AV?$complex@M@0@ABMABV10@@Z"},
1281/* 122 */ {"?_R2@?BN@???$_Fabs@N@std@@YANAEBV?$complex@N@1@PEAH@Z@4NB",
1282 "double const `double __cdecl std::_Fabs<double>(class std::complex<double> const & __ptr64,int * __ptr64)'::`29'::_R2",
1283 "?_R2@?BN@???$_Fabs@N@std@@YANAEBV?$complex@N@1@PEAH@Z@4NB"},
1284/* 123 */ {"?vtordisp_thunk@std@@$4PPPPPPPM@3EAA_NXZ",
1285 "[thunk]:public: virtual bool __cdecl std::vtordisp_thunk`vtordisp{4294967292,4}' (void) __ptr64",
1286 "[thunk]:public: virtual bool __cdecl std::vtordisp_thunk`vtordisp{-4,4}' (void) __ptr64"},
1287/* 124 */ {"??_9CView@@$BBII@AE",
1288 "[thunk]: __thiscall CView::`vcall'{392,{flat}}' }'",
1289 "[thunk]: __thiscall CView::`vcall'{392,{flat}}' "},
1290/* 125 */ {"?_dispatch@_impl_Engine@SalomeApp@@$R4CE@BA@PPPPPPPM@7AE_NAAVomniCallHandle@@@Z",
1291 "[thunk]:public: virtual bool __thiscall SalomeApp::_impl_Engine::_dispatch`vtordispex{36,16,4294967292,8}' (class omniCallHandle &)",
1292 "?_dispatch@_impl_Engine@SalomeApp@@$R4CE@BA@PPPPPPPM@7AE_NAAVomniCallHandle@@@Z"},
1293/* 126 */ {"?_Doraise@bad_cast@std@@MEBAXXZ", "protected: virtual void __cdecl std::bad_cast::_Doraise(void)", NULL, 0x60},
1294/* 127 */ {"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", "class std::complex<float> & ptr64 cdecl std::operator*=(class std::complex<float> & ptr64,class std::complex<float> const & ptr64)", NULL, 1},
1295/* 128 */ {"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z",
1296 "class std::complex<float> & std::operator*=(class std::complex<float> &,class std::complex<float> const &)",
1297 "??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", 2},
1298/* 129 */ {"??$run@XVTask_Render_Preview@@@QtConcurrent@@YA?AV?$QFuture@X@@PEAVTask_Render_Preview@@P82@EAAXXZ@Z",
1299 "class QFuture<void> __cdecl QtConcurrent::run<void,class Task_Render_Preview>(class Task_Render_Preview * __ptr64,void (__cdecl Task_Render_Preview::*)(void) __ptr64)",
1300 "??$run@XVTask_Render_Preview@@@QtConcurrent@@YA?AV?$QFuture@X@@PEAVTask_Render_Preview@@P82@EAAXXZ@Z"},
1301/* 130 */ {"??_E?$TStrArray@$$BY0BAA@D$0BA@@@UAEPAXI@Z",
1302 "public: virtual void * __thiscall TStrArray<char [256],16>::`vector deleting destructor'(unsigned int)"},
1303/* 131 */ {"??_R0?AVCC@DD@@@8", "class DD::CC `RTTI Type Descriptor'"},
1304/* 132 */ {"??$meth@FD@DD@CC@@QAE_NK@Z", "public: bool __thiscall CC::DD::meth<short,char>(unsigned long)"},
1305/* 133 */ {"?func@@YAXPIFAH@Z", "void __cdecl func(int __unaligned * __restrict)"},
1306/* 135 */ {"?x@@3PAY02HA", "int (* x)[3]"},
1307/* 136 */ {"?Qux@Bar@@0PAPAP6AHPAV1@AAH1PAH@ZA",
1308 "private: static int (__cdecl** * Bar::Qux)(class Bar *,int &,int &,int *)"}, /* variation of 105: note white space handling! */
1309/* 137 */ {"?x@@3PAW4myenum@@A", "enum myenum * x"},
1310/* 138 */ {"?pfunc@@3PAY0E@P6AXF@ZA", "void (__cdecl*(* pfunc)[4])(short)"},
1311/* 139 */ {"??$?0AEAVzzz@BB4@AA@@AEAV012@$0A@@?$pair@Vzzz@BB4@AA@@V123@@std@@QEAA@AEAVzzz@BB4@AA@@0@Z",
1312 "public: __cdecl std::pair<class AA::BB4::zzz,class AA::BB4::zzz>::pair<class AA::BB4::zzz,class AA::BB4::zzz><class AA::BB4::zzz & __ptr64,class AA::BB4::zzz & __ptr64,0>(class AA::BB4::zzz & __ptr64,class AA::BB4::zzz & __ptr64) __ptr64"},
1313/* 140 */ {"??$?BH@?$foo@N@@QEAAHXZ", "public: __cdecl foo<double>::operator<int> int(void) __ptr64"},
1314/* 141 */ {"??Bcastop@@QAEHXZ", "public: __thiscall castop::operator int(void)"},
1315/* 142 */ {"??Bcastop@@QAE?BHXZ", "public: __thiscall castop::operator int const (void)"},
1316/* 143 */ {"?pfield@@3PTAA@@DT1@", "char const volatile AA::* const volatile pfield"},
1317/* 144 */ {"?ptititi1@@3PEQtititi@@IEQ1@", "unsigned int tititi::* __ptr64 __ptr64 ptititi1"},
1318/* 145 */ {"?ptititi2@@3PERtititi@@IER1@", "unsigned int const tititi::* __ptr64 const __ptr64 ptititi2"},
1319/* 146 */ {"?ptititi3@@3PEStititi@@IES1@", "unsigned int volatile tititi::* __ptr64 volatile __ptr64 ptititi3"},
1320/* 147 */ {"?ptititi4@@3PETtititi@@IET1@", "unsigned int const volatile tititi::* __ptr64 const volatile __ptr64 ptititi4"},
1321/* 148 */ {"?ptititi4v@@3RETtititi@@IET1@", "unsigned int const volatile tititi::* __ptr64 const volatile __ptr64 ptititi4v"},
1322/* 149 */ {"?meth@AAA@@QFCEXXZ", "public: void __thiscall AAA::meth(void)volatile __unaligned "},
1323/* 150 */ {"?RegisterModuleUninitializer@<CrtImplementationDetails>@@YAXP$AAVEventHandler@System@@@Z",
1324 "void __cdecl <CrtImplementationDetails>::RegisterModuleUninitializer(class System::EventHandler ^)"},
1325/* 151 */ {"?RegisterModuleUninitializer@<CrtImplementationDetails>@@YAXBE$AAVEventHandler@System@@@Z",
1326 "void __cdecl <CrtImplementationDetails>::RegisterModuleUninitializer(class System::EventHandler % __ptr64 volatile)"},
1327/* 152 */ {"??$forward@AEAUFFIValue@?1??call@FFIFunctionBinder@@CAHPEAUlua_State@@@Z@@std@@YAAEAUFFIValue@?1??call@"
1328 "FFIFunctionBinder@@CAHPEAUxlua_State@@@Z@AEAU1?1??23@CAH0@Z@@Z",
1329 "struct `private: static int __cdecl FFIFunctionBinder::call(struct xlua_State * __ptr64)'::`2'::FFIValue & "
1330 "__ptr64 __cdecl std::forward<struct `private: static int __cdecl FFIFunctionBinder::call(struct lua_State "
1331 "* __ptr64)'::`2'::FFIValue & __ptr64>(struct `private: static int __cdecl FFIFunctionBinder::call(struct "
1332 "xlua_State * __ptr64)'::`2'::FFIValue & __ptr64)"},
1333/* 153 */ {"?$AAA@XX", "AAA<void,void>"},
1334/* 154 */ {"?$AAA@", "AAA<>"},
1335 };
1336 int i;
1337 char* name;
1338
1339 for (i = 0; i < ARRAY_SIZE(test); i++)
1340 {
1341 if (((i == 149) || (i == 150)) && (_winver < 0x600))
1342 {
1343 skip("Skipping test with i = %u, because it fails on Windows 2003\n", i);
1344 continue;
1345 }
1346 name = p__unDName(0, test[i].in, 0, malloc, free, test[i].flags);
1347 ok(name != NULL, "%u: unDName failed\n", i);
1348 if (!name) continue;
1349 ok( !strcmp(test[i].out, name) ||
1351 "%u: Got name \"%s\"\n", i, name );
1352 ok( !strcmp(test[i].out, name) ||
1354 "%u: Expected \"%s\"\n", i, test[i].out );
1355 free(name);
1356 }
1357}
1358
1360{
1361 if (!InitFunctionPtrs())
1362 return;
1363
1366 test_bad_cast();
1369 test_rtti();
1371 test_demangle();
1372}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define __cdecl
Definition: accygwin.h:79
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define ARRAY_SIZE(A)
Definition: main.h:20
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned short WORD
Definition: ntddk_ex.h:93
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum func
Definition: glext.h:6028
GLuint res
Definition: glext.h:9613
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLuint in
Definition: glext.h:9616
GLbitfield flags
Definition: glext.h:7161
GLuint64EXT * result
Definition: glext.h:11304
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
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
#define e
Definition: ke_i.h:82
#define b
Definition: ke_i.h:79
#define todo_wine_if(is_todo)
Definition: custom.c:86
#define RTTI_REF_SIG0(instance, name, base)
Definition: cpp.c:879
#define SETNOFAIL(x, y)
Definition: cpp.c:153
static void * get_obj_locator(void *cppobj)
Definition: cpp.c:866
static char *__thiscall * ptype_info_raw_name(type_info *)
struct __type_info type_info
static void test_demangle_datatype(void)
Definition: cpp.c:1087
#define __thiscall
Definition: cpp.c:43
static vtable_ptr * pbad_typeid_vtable
Definition: cpp.c:68
static char *__thiscall * pexception_what(exception *)
static void test_bad_typeid(void)
Definition: cpp.c:451
struct __exception exception
static exception *__thiscall * pexception_opequals(exception *, exception *)
#define SET(x, y)
Definition: cpp.c:154
static char *__thiscall * pbad_typeid_what(exception *)
static exception *__thiscall * pbad_typeid_opequals(exception *, exception *)
#define DEFINE_RTTI_REF(type, name)
Definition: cpp.c:877
static char *__thiscall * pbad_cast_what(exception *)
#define call_func2(func, _this, a)
Definition: cpp.c:148
static void *__cdecl * p__RTCastToVoid(void *)
static void *__cdecl * poperator_new(size_t)
#define call_func1(func, _this)
Definition: cpp.c:147
static char *__cdecl * p__unDName(char *, const char *, int, void *, void *, unsigned short int)
static vtable_ptr * p__non_rtti_object_vtable
Definition: cpp.c:90
static void test_bad_cast(void)
Definition: cpp.c:568
static void test_type_info(void)
Definition: cpp.c:794
static void *__cdecl * p__RTDynamicCast(void *, int, void *, void *, int)
static exception *__thiscall * pbad_cast_opequals(exception *, exception *)
static char *__thiscall * ptype_info_name(type_info *)
static void test_demangle(void)
Definition: cpp.c:1117
#define init_thiscall_thunk()
Definition: cpp.c:146
static vtable_ptr * pbad_cast_vtable
Definition: cpp.c:80
static vtable_ptr * pexception_vtable
Definition: cpp.c:57
static exception *__thiscall * p__non_rtti_object_opequals(exception *, exception *)
static BOOL InitFunctionPtrs(void)
Definition: cpp.c:156
static void test_exception(void)
Definition: cpp.c:330
static LPCSTR
Definition: cpp.c:62
void(* vtable_ptr)(void)
Definition: cpp.c:23
static char *__thiscall * p__non_rtti_object_what(exception *)
static void test_rtti(void)
Definition: cpp.c:882
static unsigned int
Definition: cpp.c:58
static type_info *static type_info *static type_info *static type_info *__cdecl * p__RTtypeid(void *)
#define RTTI_REF(instance, name)
Definition: cpp.c:878
static void test___non_rtti_object(void)
Definition: cpp.c:693
static vtable_ptr * get_vtable(void *obj)
Definition: cpp.c:861
static void * vtable[]
Definition: typelib.c:1231
unsigned int _winver
Definition: environ.c:14
#define MEM_COMMIT
Definition: nt_native.h:1313
#define PAGE_EXECUTE_READWRITE
Definition: nt_native.h:1308
#define test
Definition: rosglue.h:37
strcpy
Definition: string.h:131
#define memset(x, y, z)
Definition: compat.h:39
char * name
Definition: cpp.c:28
vtable_ptr * vtable
Definition: cpp.c:27
int do_free
Definition: cpp.c:29
vtable_ptr * vtable
Definition: cpp.c:34
char mangled[16]
Definition: cpp.c:36
char * name
Definition: cpp.c:35
LPCSTR mangled
Definition: cpp.c:1082
BOOL test_in_wine
Definition: cpp.c:1084
LPCSTR result
Definition: cpp.c:1083
const rtti_base_descriptor * bases[10]
Definition: cxx.h:206
int num_base_classes
Definition: cxx.h:199
const type_info * type_descriptor
Definition: cxx.h:198
unsigned int attributes
Definition: cxx.h:201
unsigned int signature
Definition: cxx.h:211
unsigned int attributes
Definition: cxx.h:212
const rtti_base_array * base_classes
Definition: cxx.h:214
char * name
Definition: compiler.c:66
Definition: name.c:39
Definition: cproxy.c:248
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
Definition: virtmem.c:65
#define WINAPI
Definition: msvc.h:6
void(* vtable_ptr)(void)
Definition: cppexcept.h:34
const char * LPCSTR
Definition: xmlstorage.h:183
unsigned char BYTE
Definition: xxhash.c:193