gdi32: Map all the points at once in PolyPolyline, similarly to what PolyPolygon...
[wine] / dlls / msvcrt / tests / cpp.c
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  * NOTES
20  * This tests is only valid for ix86 platforms, on others it's a no-op.
21  * Some tests cannot be checked with ok(), for example the dtors. We simply
22  * call them to ensure we don't crash ;-)
23  *
24  * If we build this test with VC++ in debug mode, we will fail in _chkstk()
25  * or at program exit malloc() checking if these methods haven't been
26  * implemented correctly (they have).
27  *
28  * Tested with a range of native msvcrt's from v4 -> v7.
29  */
30 #include "wine/test.h"
31 #include "winbase.h"
32 #include "winnt.h"
33
34 #ifndef __i386__
35 /* Skip these tests for non x86 platforms */
36 START_TEST(cpp)
37 {
38 }
39 #else
40
41 typedef struct __exception
42 {
43   void *vtable;
44   char *name;
45   int   do_free;
46 } exception;
47
48 typedef struct __type_info
49 {
50   void *vtable;
51   char *name;
52   char  mangled[16];
53 } type_info;
54
55 /* Function pointers. We need to use these to call these funcs as __thiscall */
56 static HMODULE hMsvcrt;
57
58 static void* (__cdecl *poperator_new)(unsigned int);
59 static void  (__cdecl *poperator_delete)(void*);
60 static void* (__cdecl *pmalloc)(unsigned int);
61 static void  (__cdecl *pfree)(void*);
62
63 /* exception */
64 static void (WINAPI *pexception_ctor)(exception*,LPCSTR*);
65 static void (WINAPI *pexception_copy_ctor)(exception*,exception*);
66 static void (WINAPI *pexception_default_ctor)(exception*);
67 static void (WINAPI *pexception_dtor)(exception*);
68 static exception* (WINAPI *pexception_opequals)(exception*,exception*);
69 static char* (WINAPI *pexception_what)(exception*);
70 static void* (WINAPI *pexception_vtable)(exception*);
71 static void (WINAPI *pexception_vector_dtor)(exception*,unsigned int);
72 static void (WINAPI *pexception_scalar_dtor)(exception*,unsigned int);
73
74 /* bad_typeid */
75 static void (WINAPI *pbad_typeid_ctor)(exception*,LPCSTR);
76 static void (WINAPI *pbad_typeid_ctor_closure)(exception*);
77 static void (WINAPI *pbad_typeid_copy_ctor)(exception*,exception*);
78 static void (WINAPI *pbad_typeid_dtor)(exception*);
79 static exception* (WINAPI *pbad_typeid_opequals)(exception*,exception*);
80 static char* (WINAPI *pbad_typeid_what)(exception*);
81 static void* (WINAPI *pbad_typeid_vtable)(exception*);
82 static void (WINAPI *pbad_typeid_vector_dtor)(exception*,unsigned int);
83 static void (WINAPI *pbad_typeid_scalar_dtor)(exception*,unsigned int);
84
85 /* bad_cast */
86 static void (WINAPI *pbad_cast_ctor)(exception*,LPCSTR*);
87 static void (WINAPI *pbad_cast_ctor2)(exception*,LPCSTR);
88 static void (WINAPI *pbad_cast_ctor_closure)(exception*);
89 static void (WINAPI *pbad_cast_copy_ctor)(exception*,exception*);
90 static void (WINAPI *pbad_cast_dtor)(exception*);
91 static exception* (WINAPI *pbad_cast_opequals)(exception*,exception*);
92 static char* (WINAPI *pbad_cast_what)(exception*);
93 static void* (WINAPI *pbad_cast_vtable)(exception*);
94 static void (WINAPI *pbad_cast_vector_dtor)(exception*,unsigned int);
95 static void (WINAPI *pbad_cast_scalar_dtor)(exception*,unsigned int);
96
97 /* __non_rtti_object */
98 static void (WINAPI *p__non_rtti_object_ctor)(exception*,LPCSTR);
99 static void (WINAPI *p__non_rtti_object_copy_ctor)(exception*,exception*);
100 static void (WINAPI *p__non_rtti_object_dtor)(exception*);
101 static exception* (WINAPI *p__non_rtti_object_opequals)(exception*,exception*);
102 static char* (WINAPI *p__non_rtti_object_what)(exception*);
103 static void* (WINAPI *p__non_rtti_object_vtable)(exception*);
104 static void (WINAPI *p__non_rtti_object_vector_dtor)(exception*,unsigned int);
105 static void (WINAPI *p__non_rtti_object_scalar_dtor)(exception*,unsigned int);
106
107 /* type_info */
108 static void  (WINAPI *ptype_info_dtor)(type_info*);
109 static char* (WINAPI *ptype_info_raw_name)(type_info*);
110 static char* (WINAPI *ptype_info_name)(type_info*);
111 static int   (WINAPI *ptype_info_before)(type_info*,type_info*);
112 static int   (WINAPI *ptype_info_opequals_equals)(type_info*,type_info*);
113 static int   (WINAPI *ptype_info_opnot_equals)(type_info*,type_info*);
114
115 /* RTTI */
116 static type_info* (__cdecl *p__RTtypeid)(void*);
117 static void* (__cdecl *p__RTCastToVoid)(void*);
118 static void* (__cdecl *p__RTDynamicCast)(void*,int,void*,void*,int);
119
120 /*Demangle*/
121 static char* (__cdecl *p__unDName)(char*,const char*,int,void*,void*,unsigned short int);
122
123
124 /* _very_ early native versions have serious RTTI bugs, so we check */
125 static void* bAncientVersion;
126
127 /* Emulate a __thiscall */
128 #ifdef _MSC_VER
129 static inline void* do_call_func1(void *func, void *_this)
130 {
131   volatile void* retval = 0;
132   __asm
133   {
134     push ecx
135     mov ecx, _this
136     call func
137     mov retval, eax
138     pop ecx
139   }
140   return (void*)retval;
141 }
142
143 static inline void* do_call_func2(void *func, void *_this, const void* arg)
144 {
145   volatile void* retval = 0;
146   __asm
147   {
148     push ecx
149     push arg
150     mov ecx, _this
151     call func
152     mov retval, eax
153     pop ecx
154   }
155   return (void*)retval;
156 }
157 #else
158 static void* do_call_func1(void *func, void *_this)
159 {
160   void *ret, *dummy;
161   __asm__ __volatile__ ("call *%2"
162                         : "=a" (ret), "=c" (dummy)
163                         : "g" (func), "1" (_this)
164                         : "edx", "memory" );
165   return ret;
166 }
167 static void* do_call_func2(void *func, void *_this, const void* arg)
168 {
169   void *ret, *dummy;
170   __asm__ __volatile__ ("pushl %3\n\tcall *%2"
171                         : "=a" (ret), "=c" (dummy)
172                         : "r" (func), "r" (arg), "1" (_this)
173                         : "edx", "memory" );
174   return ret;
175 }
176 #endif
177
178 #define call_func1(x,y)   do_call_func1((void*)x,(void*)y)
179 #define call_func2(x,y,z) do_call_func2((void*)x,(void*)y,(const void*)z)
180
181 /* Some exports are only available in later versions */
182 #define SETNOFAIL(x,y) x = (void*)GetProcAddress(hMsvcrt,y)
183 #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
184
185 static void InitFunctionPtrs(void)
186 {
187   hMsvcrt = GetModuleHandleA("msvcrt.dll");
188   if (!hMsvcrt)
189     hMsvcrt = GetModuleHandleA("msvcrtd.dll");
190   ok(hMsvcrt != 0, "GetModuleHandleA failed\n");
191   if (hMsvcrt)
192   {
193     if (sizeof(void *) > sizeof(int))  /* 64-bit has different names */
194     {
195         SETNOFAIL(poperator_new, "??_U@YAPEAX_K@Z");
196         SETNOFAIL(poperator_delete, "??_V@YAXPEAX@Z");
197     }
198     else
199     {
200         SETNOFAIL(poperator_new, "??_U@YAPAXI@Z");
201         SETNOFAIL(poperator_delete, "??_V@YAXPAX@Z");
202     }
203     SET(pmalloc, "malloc");
204     SET(pfree, "free");
205
206     if (!poperator_new)
207       poperator_new = pmalloc;
208     if (!poperator_delete)
209       poperator_delete = pfree;
210
211     SET(pexception_ctor, "??0exception@@QAE@ABQBD@Z");
212     SET(pexception_copy_ctor, "??0exception@@QAE@ABV0@@Z");
213     SET(pexception_default_ctor, "??0exception@@QAE@XZ");
214     SET(pexception_dtor, "??1exception@@UAE@XZ");
215     SET(pexception_opequals, "??4exception@@QAEAAV0@ABV0@@Z");
216     SET(pexception_what, "?what@exception@@UBEPBDXZ");
217     SET(pexception_vtable, "??_7exception@@6B@");
218     SET(pexception_vector_dtor, "??_Eexception@@UAEPAXI@Z");
219     SET(pexception_scalar_dtor, "??_Gexception@@UAEPAXI@Z");
220
221     SET(pbad_typeid_ctor, "??0bad_typeid@@QAE@PBD@Z");
222     SETNOFAIL(pbad_typeid_ctor_closure, "??_Fbad_typeid@@QAEXXZ");
223     SET(pbad_typeid_copy_ctor, "??0bad_typeid@@QAE@ABV0@@Z");
224     SET(pbad_typeid_dtor, "??1bad_typeid@@UAE@XZ");
225     SET(pbad_typeid_opequals, "??4bad_typeid@@QAEAAV0@ABV0@@Z");
226     SET(pbad_typeid_what, "?what@exception@@UBEPBDXZ");
227     SET(pbad_typeid_vtable, "??_7bad_typeid@@6B@");
228     SET(pbad_typeid_vector_dtor, "??_Ebad_typeid@@UAEPAXI@Z");
229     SET(pbad_typeid_scalar_dtor, "??_Gbad_typeid@@UAEPAXI@Z");
230
231     SETNOFAIL(pbad_cast_ctor, "??0bad_cast@@QAE@ABQBD@Z");
232     if (!pbad_cast_ctor)
233       SET(pbad_cast_ctor, "??0bad_cast@@AAE@PBQBD@Z");
234     SETNOFAIL(pbad_cast_ctor2, "??0bad_cast@@QAE@PBD@Z");
235     SETNOFAIL(pbad_cast_ctor_closure, "??_Fbad_cast@@QAEXXZ");
236     SET(pbad_cast_copy_ctor, "??0bad_cast@@QAE@ABV0@@Z");
237     SET(pbad_cast_dtor, "??1bad_cast@@UAE@XZ");
238     SET(pbad_cast_opequals, "??4bad_cast@@QAEAAV0@ABV0@@Z");
239     SET(pbad_cast_what, "?what@exception@@UBEPBDXZ");
240     SET(pbad_cast_vtable, "??_7bad_cast@@6B@");
241     SET(pbad_cast_vector_dtor, "??_Ebad_cast@@UAEPAXI@Z");
242     SET(pbad_cast_scalar_dtor, "??_Gbad_cast@@UAEPAXI@Z");
243
244     SET(p__non_rtti_object_ctor, "??0__non_rtti_object@@QAE@PBD@Z");
245     SET(p__non_rtti_object_copy_ctor, "??0__non_rtti_object@@QAE@ABV0@@Z");
246     SET(p__non_rtti_object_dtor, "??1__non_rtti_object@@UAE@XZ");
247     SET(p__non_rtti_object_opequals, "??4__non_rtti_object@@QAEAAV0@ABV0@@Z");
248     SET(p__non_rtti_object_what, "?what@exception@@UBEPBDXZ");
249     SET(p__non_rtti_object_vtable, "??_7__non_rtti_object@@6B@");
250     SET(p__non_rtti_object_vector_dtor, "??_E__non_rtti_object@@UAEPAXI@Z");
251     SET(p__non_rtti_object_scalar_dtor, "??_G__non_rtti_object@@UAEPAXI@Z");
252
253     SET(ptype_info_dtor, "??1type_info@@UAE@XZ");
254     SET(ptype_info_raw_name, "?raw_name@type_info@@QBEPBDXZ");
255     SET(ptype_info_name, "?name@type_info@@QBEPBDXZ");
256     SET(ptype_info_before, "?before@type_info@@QBEHABV1@@Z");
257     SET(ptype_info_opequals_equals, "??8type_info@@QBEHABV0@@Z");
258     SET(ptype_info_opnot_equals, "??9type_info@@QBEHABV0@@Z");
259
260     SET(p__RTtypeid, "__RTtypeid");
261     SET(p__RTCastToVoid, "__RTCastToVoid");
262     SET(p__RTDynamicCast, "__RTDynamicCast");
263
264     SET(p__unDName,"__unDName");
265
266     /* Extremely early versions export logic_error, and crash in RTTI */
267     SETNOFAIL(bAncientVersion, "??0logic_error@@QAE@ABQBD@Z");
268   }
269 }
270
271 static void test_exception(void)
272 {
273   static const char* e_name = "An exception name";
274   char* name;
275   exception e, e2, e3, *pe;
276
277   if (!poperator_new || !poperator_delete ||
278       !pexception_ctor || !pexception_copy_ctor || !pexception_default_ctor ||
279       !pexception_dtor || !pexception_opequals || !pexception_what ||
280       !pexception_vtable || !pexception_vector_dtor || !pexception_scalar_dtor)
281     return;
282
283   /* 'const char*&' ctor */
284   memset(&e, 0, sizeof(e));
285   call_func2(pexception_ctor, &e, &e_name);
286   ok(e.vtable != NULL, "Null exception vtable for e\n");
287   ok(e.name && e.name != e_name && !strcmp(e.name, "An exception name"), "Bad name '%s' for e\n", e.name);
288   ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
289
290   /* Copy ctor */
291   memset(&e2, 0, sizeof(e2));
292   call_func2(pexception_copy_ctor, &e2, &e);
293   ok(e2.vtable != NULL, "Null exception vtable for e2\n");
294   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "An exception name"), "Bad exception name for e2\n");
295   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
296
297   /* Default ctor */
298   memset(&e3, 1, sizeof(e3));
299   call_func1(pexception_default_ctor, &e3);
300   ok(e3.vtable != NULL, "Null exception vtable for e3\n");
301   ok(e3.name == NULL, "Bad exception name for e3\n");
302   ok(e3.do_free == 0, "do_free set to %d for e3\n", e3.do_free);
303
304   ok(e.vtable == e2.vtable && e.vtable == e3.vtable, "exception vtables differ!\n");
305
306   /* Test calling the dtors */
307   call_func1(pexception_dtor, &e2);
308   call_func1(pexception_dtor, &e3);
309
310   /* Operator equals */
311   memset(&e2, 0, sizeof(e2));
312   call_func1(pexception_default_ctor, &e2);
313   pe = call_func2(pexception_opequals, &e2, &e);
314   ok(e2.vtable != NULL, "Null exception vtable for e2\n");
315   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "An exception name"), "Bad exception name for e2\n");
316   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
317   ok(pe == &e2, "opequals didn't return e2\n");
318
319   /* what() */
320   name = call_func1(pexception_what, &e2);
321   ok(e2.name == name, "Bad exception name from e2::what()\n");
322
323   /* vtable ptr */
324   ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
325   call_func1(pexception_dtor, &e2);
326
327   /* new() */
328   pe = poperator_new(sizeof(exception));
329   ok(pe != NULL, "new() failed\n");
330   if (pe)
331   {
332     call_func2(pexception_ctor, pe, &e_name);
333     /* scalar dtor */
334     call_func2(pexception_scalar_dtor, pe, 0); /* Shouldn't delete pe */
335     pe->name = NULL;
336     pe->do_free = 0;
337     call_func2(pexception_scalar_dtor, pe, 1); /* Should delete pe */
338   }
339
340   pe = poperator_new(sizeof(exception));
341   ok(pe != NULL, "new() failed\n");
342   if (pe)
343   {
344     /* vector dtor, single element */
345     call_func2(pexception_ctor, pe, &e_name);
346     call_func2(pexception_vector_dtor, pe, 1); /* Should delete pe as single element*/
347   }
348
349   pe = poperator_new(sizeof(exception) * 4 + sizeof(int));
350   ok(pe != NULL, "new() failed\n");
351   if (pe)
352   {
353     /* vector dtor, multiple elements */
354     char name[] = "a constant";
355     *((int*)pe) = 3;
356     pe = (exception*)((int*)pe + 1);
357     call_func2(pexception_ctor, &pe[0], &e_name);
358     call_func2(pexception_ctor, &pe[1], &e_name);
359     call_func2(pexception_ctor, &pe[2], &e_name);
360     pe[3].name = name;
361     pe[3].do_free = 1; /* Crash if we try to free this */
362     call_func2(pexception_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
363   }
364
365   /* test our exported vtable is kosher */
366   pe = (void*)pexception_vtable; /* Use the exception struct to get vtable ptrs */
367   pexception_vector_dtor = (void*)pe->vtable;
368   pexception_what = (void*)pe->name;
369
370   name = call_func1(pexception_what, &e);
371   ok(e.name == name, "Bad exception name from vtable e::what()\n");
372
373   if (p__RTtypeid && !bAncientVersion)
374   {
375     /* Check the rtti */
376     type_info *ti = p__RTtypeid(&e);
377     ok (ti && ti->mangled &&
378         !strcmp(ti->mangled, ".?AVexception@@"), "bad rtti for e\n");
379
380     if (ti)
381     {
382       /* Check the returned type_info has rtti too */
383       type_info *ti2 = p__RTtypeid(ti);
384       ok (ti2 != NULL && !strcmp(ti2->mangled, ".?AVtype_info@@"), "bad rtti for e's type_info\n");
385     }
386   }
387
388   call_func2(pexception_vector_dtor, &e, 0); /* Should delete e.name, but not e */
389 }
390
391 /* This test is basically a cut 'n' paste of the exception test. but it verifies that
392  * bad_typeid works the exact same way... */
393 static void test_bad_typeid(void)
394 {
395   static const char* e_name = "A bad_typeid name";
396   char* name;
397   exception e, e2, e3, *pe;
398
399   if (!poperator_new || !poperator_delete ||
400       !pbad_typeid_ctor || !pbad_typeid_copy_ctor ||
401       !pbad_typeid_dtor || !pbad_typeid_opequals || !pbad_typeid_what ||
402       !pbad_typeid_vtable || !pbad_typeid_vector_dtor || !pbad_typeid_scalar_dtor)
403     return;
404
405   /* 'const char*' ctor */
406   memset(&e, 0, sizeof(e));
407   call_func2(pbad_typeid_ctor, &e, e_name);
408   ok(e.vtable != NULL, "Null bad_typeid vtable for e\n");
409   ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_typeid name"), "Bad name '%s' for e\n", e.name);
410   ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
411
412   /* Copy ctor */
413   memset(&e2, 0, sizeof(e2));
414   call_func2(pbad_typeid_copy_ctor, &e2, &e);
415   ok(e2.vtable != NULL, "Null bad_typeid vtable for e2\n");
416   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_typeid name"), "Bad name '%s' for e2\n", e2.name);
417   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
418
419   /* Ctor closure */
420   if (pbad_typeid_ctor_closure)
421   {
422     memset(&e3, 1, sizeof(e3));
423     call_func1(pbad_typeid_ctor_closure, &e3);
424     ok(e3.vtable != NULL, "Null bad_typeid vtable for e3\n");
425     ok(e3.name && !strcmp(e3.name, "bad typeid"), "Bad bad_typeid name for e3\n");
426     ok(e3.do_free == 1, "do_free set to %d for e3\n", e3.do_free);
427     ok(e.vtable == e3.vtable, "bad_typeid closure vtables differ!\n");
428     call_func1(pbad_typeid_dtor, &e3);
429   }
430   ok(e.vtable == e2.vtable, "bad_typeid vtables differ!\n");
431
432   /* Test calling the dtors */
433   call_func1(pbad_typeid_dtor, &e2);
434
435   /* Operator equals */
436   memset(&e2, 1, sizeof(e2));
437   call_func1(pexception_default_ctor, &e2);
438   pe = call_func2(pbad_typeid_opequals, &e2, &e);
439   ok(e2.vtable != NULL, "Null bad_typeid vtable for e2\n");
440   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_typeid name"), "Bad bad_typeid name for e2\n");
441   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
442   ok(pe == &e2, "opequals didn't return e2\n");
443
444   /* what() */
445   name = call_func1(pbad_typeid_what, &e2);
446   ok(e2.name == name, "Bad bad_typeid name from e2::what()\n");
447
448   /* vtable ptr */
449   ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
450   call_func1(pbad_typeid_dtor, &e2);
451
452   /* new() */
453   pe = poperator_new(sizeof(exception));
454   ok(pe != NULL, "new() failed\n");
455   if (pe)
456   {
457     call_func2(pbad_typeid_ctor, pe, e_name);
458     /* scalar dtor */
459     call_func2(pbad_typeid_scalar_dtor, pe, 0); /* Shouldn't delete pe */
460     pe->name = NULL;
461     pe->do_free = 0;
462     call_func2(pbad_typeid_scalar_dtor, pe, 1); /* Should delete pe */
463   }
464
465   pe = poperator_new(sizeof(exception));
466   ok(pe != NULL, "new() failed\n");
467   if (pe)
468   {
469     /* vector dtor, single element */
470     call_func2(pbad_typeid_ctor, pe, e_name);
471     call_func2(pbad_typeid_vector_dtor, pe, 1); /* Should delete pe as single element*/
472   }
473
474   pe = poperator_new(sizeof(exception) * 4 + sizeof(int));
475   ok(pe != NULL, "new() failed\n");
476   if (pe)
477   {
478     /* vector dtor, multiple elements */
479     *((int*)pe) = 3;
480     pe = (exception*)((int*)pe + 1);
481     call_func2(pbad_typeid_ctor, &pe[0], e_name);
482     call_func2(pbad_typeid_ctor, &pe[1], e_name);
483     call_func2(pbad_typeid_ctor, &pe[2], e_name);
484     pe[3].name = 0;
485     pe[3].do_free = 1; /* Crash if we try to free this element */
486     call_func2(pbad_typeid_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
487   }
488
489   /* test our exported vtable is kosher */
490   pe = (void*)pbad_typeid_vtable; /* Use the exception struct to get vtable ptrs */
491   pbad_typeid_vector_dtor = (void*)pe->vtable;
492   pbad_typeid_what = (void*)pe->name;
493
494   name = call_func1(pbad_typeid_what, &e);
495   ok(e.name == name, "Bad bad_typeid name from vtable e::what()\n");
496
497   if (p__RTtypeid && !bAncientVersion)
498   {
499     /* Check the rtti */
500     type_info *ti = p__RTtypeid(&e);
501     ok (ti != NULL && !strcmp(ti->mangled, ".?AVbad_typeid@@"), "bad rtti for e (%s)\n",
502         !ti ? "null" : ti->mangled);
503   }
504
505   call_func2(pbad_typeid_vector_dtor, &e, 0); /* Should delete e.name, but not e */
506 }
507
508
509 /* Ditto for this test... */
510 static void test_bad_cast(void)
511 {
512   static const char* e_name = "A bad_cast name";
513   char* name;
514   exception e, e2, e3, *pe;
515
516   if (!poperator_new || !poperator_delete ||
517       !pbad_cast_ctor || !pbad_cast_copy_ctor ||
518       !pbad_cast_dtor || !pbad_cast_opequals || !pbad_cast_what ||
519       !pbad_cast_vtable || !pbad_cast_vector_dtor || !pbad_cast_scalar_dtor)
520     return;
521
522   if (pbad_cast_ctor2)
523   {
524     /* 'const char*' ctor */
525     memset(&e, 0, sizeof(e));
526     call_func2(pbad_cast_ctor2, &e, e_name);
527     ok(e.vtable != NULL, "Null bad_cast vtable for e\n");
528     ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_cast name"), "Bad name '%s' for e\n", e.name);
529     ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
530     call_func1(pbad_cast_dtor, &e);
531   }
532
533   /* 'const char*&' ctor */
534   memset(&e, 0, sizeof(e));
535   call_func2(pbad_cast_ctor, &e, &e_name);
536   ok(e.vtable != NULL, "Null bad_cast vtable for e\n");
537   ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_cast name"), "Bad name '%s' for e\n", e.name);
538   ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
539
540   /* Copy ctor */
541   memset(&e2, 0, sizeof(e2));
542   call_func2(pbad_cast_copy_ctor, &e2, &e);
543   ok(e2.vtable != NULL, "Null bad_cast vtable for e2\n");
544   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_cast name"), "Bad name '%s' for e2\n", e2.name);
545   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
546
547   /* Ctor closure */
548   if (pbad_cast_ctor_closure)
549   {
550     memset(&e3, 1, sizeof(e3));
551     call_func1(pbad_cast_ctor_closure, &e3);
552     ok(e3.vtable != NULL, "Null bad_cast vtable for e3\n");
553     ok(e3.name && !strcmp(e3.name, "bad cast"), "Bad bad_cast name for e3\n");
554     ok(e3.do_free == 1, "do_free set to %d for e3\n", e3.do_free);
555     ok(e.vtable == e3.vtable, "bad_cast closure vtables differ!\n");
556     call_func1(pbad_cast_dtor, &e3);
557   }
558   ok(e.vtable == e2.vtable, "bad_cast vtables differ!\n");
559
560   /* Test calling the dtors */
561   call_func1(pbad_cast_dtor, &e2);
562
563   /* Operator equals */
564   memset(&e2, 1, sizeof(e2));
565   call_func1(pexception_default_ctor, &e2);
566   pe = call_func2(pbad_cast_opequals, &e2, &e);
567   ok(e2.vtable != NULL, "Null bad_cast vtable for e2\n");
568   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_cast name"), "Bad bad_cast name for e2\n");
569   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
570   ok(pe == &e2, "opequals didn't return e2\n");
571
572   /* what() */
573   name = call_func1(pbad_cast_what, &e2);
574   ok(e2.name == name, "Bad bad_cast name from e2::what()\n");
575
576   /* vtable ptr */
577   ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
578   call_func1(pbad_cast_dtor, &e2);
579
580   /* new() */
581   pe = poperator_new(sizeof(exception));
582   ok(pe != NULL, "new() failed\n");
583   if (pe)
584   {
585     call_func2(pbad_cast_ctor, pe, &e_name);
586     /* scalar dtor */
587     call_func2(pbad_cast_scalar_dtor, pe, 0); /* Shouldn't delete pe */
588     pe->name = NULL;
589     pe->do_free = 0;
590     call_func2(pbad_cast_scalar_dtor, pe, 1); /* Should delete pe */
591   }
592
593   pe = poperator_new(sizeof(exception));
594   ok(pe != NULL, "new() failed\n");
595   if (pe)
596   {
597     /* vector dtor, single element */
598     call_func2(pbad_cast_ctor, pe, &e_name);
599     call_func2(pbad_cast_vector_dtor, pe, 1); /* Should delete pe as single element*/
600   }
601
602   pe = poperator_new(sizeof(exception) * 4 + sizeof(int));
603   ok(pe != NULL, "new() failed\n");
604   if (pe)
605   {
606     /* vector dtor, multiple elements */
607     *((int*)pe) = 3;
608     pe = (exception*)((int*)pe + 1);
609     call_func2(pbad_cast_ctor, &pe[0], &e_name);
610     call_func2(pbad_cast_ctor, &pe[1], &e_name);
611     call_func2(pbad_cast_ctor, &pe[2], &e_name);
612     pe[3].name = 0;
613     pe[3].do_free = 1; /* Crash if we try to free this element */
614     call_func2(pbad_cast_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
615   }
616
617   /* test our exported vtable is kosher */
618   pe = (void*)pbad_cast_vtable; /* Use the exception struct to get vtable ptrs */
619   pbad_cast_vector_dtor = (void*)pe->vtable;
620   pbad_cast_what = (void*)pe->name;
621
622   name = call_func1(pbad_cast_what, &e);
623   ok(e.name == name, "Bad bad_cast name from vtable e::what()\n");
624
625   if (p__RTtypeid && !bAncientVersion)
626   {
627     /* Check the rtti */
628     type_info *ti = p__RTtypeid(&e);
629     ok (ti != NULL && !strcmp(ti->mangled, ".?AVbad_cast@@"), "bad rtti for e\n");
630   }
631   call_func2(pbad_cast_vector_dtor, &e, 0); /* Should delete e.name, but not e */
632 }
633
634 /* ... and this one */
635 static void test___non_rtti_object(void)
636 {
637   static const char* e_name = "A __non_rtti_object name";
638   char* name;
639   exception e, e2, *pe;
640
641   if (!poperator_new || !poperator_delete ||
642       !p__non_rtti_object_ctor || !p__non_rtti_object_copy_ctor ||
643       !p__non_rtti_object_dtor || !p__non_rtti_object_opequals || !p__non_rtti_object_what ||
644       !p__non_rtti_object_vtable || !p__non_rtti_object_vector_dtor || !p__non_rtti_object_scalar_dtor)
645     return;
646
647   /* 'const char*' ctor */
648   memset(&e, 0, sizeof(e));
649   call_func2(p__non_rtti_object_ctor, &e, e_name);
650   ok(e.vtable != NULL, "Null __non_rtti_object vtable for e\n");
651   ok(e.name && e.name != e_name && !strcmp(e.name, "A __non_rtti_object name"), "Bad name '%s' for e\n", e.name);
652   ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
653
654   /* Copy ctor */
655   memset(&e2, 0, sizeof(e2));
656   call_func2(p__non_rtti_object_copy_ctor, &e2, &e);
657   ok(e2.vtable != NULL, "Null __non_rtti_object vtable for e2\n");
658   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A __non_rtti_object name"), "Bad name '%s' for e2\n", e2.name);
659   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
660   ok(e.vtable == e2.vtable, "__non_rtti_object vtables differ!\n");
661
662   /* Test calling the dtors */
663   call_func1(p__non_rtti_object_dtor, &e2);
664
665   /* Operator equals */
666   memset(&e2, 1, sizeof(e2));
667   call_func1(pexception_default_ctor, &e2);
668   pe = call_func2(p__non_rtti_object_opequals, &e2, &e);
669   ok(e2.vtable != NULL, "Null __non_rtti_object vtable for e2\n");
670   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A __non_rtti_object name"), "Bad __non_rtti_object name for e2\n");
671   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
672   ok(pe == &e2, "opequals didn't return e2\n");
673
674   /* what() */
675   name = call_func1(p__non_rtti_object_what, &e2);
676   ok(e2.name == name, "Bad __non_rtti_object name from e2::what()\n");
677
678   /* vtable ptr */
679   ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
680   call_func1(p__non_rtti_object_dtor, &e2);
681
682   /* new() */
683   pe = poperator_new(sizeof(exception));
684   ok(pe != NULL, "new() failed\n");
685   if (pe)
686   {
687     call_func2(p__non_rtti_object_ctor, pe, e_name);
688     /* scalar dtor */
689     call_func2(p__non_rtti_object_scalar_dtor, pe, 0); /* Shouldn't delete pe */
690     pe->name = NULL;
691     pe->do_free = 0;
692     call_func2(p__non_rtti_object_scalar_dtor, pe, 1); /* Should delete pe */
693   }
694
695   pe = poperator_new(sizeof(exception));
696   ok(pe != NULL, "new() failed\n");
697   if (pe)
698   {
699     /* vector dtor, single element */
700     call_func2(p__non_rtti_object_ctor, pe, e_name);
701     call_func2(p__non_rtti_object_vector_dtor, pe, 1); /* Should delete pe as single element*/
702   }
703
704   pe = poperator_new(sizeof(exception) * 4 + sizeof(int));
705   ok(pe != NULL, "new() failed\n");
706   if (pe)
707   {
708     /* vector dtor, multiple elements */
709     *((int*)pe) = 3;
710     pe = (exception*)((int*)pe + 1);
711     call_func2(p__non_rtti_object_ctor, &pe[0], e_name);
712     call_func2(p__non_rtti_object_ctor, &pe[1], e_name);
713     call_func2(p__non_rtti_object_ctor, &pe[2], e_name);
714     pe[3].name = 0;
715     pe[3].do_free = 1; /* Crash if we try to free this element */
716     call_func2(p__non_rtti_object_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
717   }
718
719   /* test our exported vtable is kosher */
720   pe = (void*)p__non_rtti_object_vtable; /* Use the exception struct to get vtable ptrs */
721   p__non_rtti_object_vector_dtor = (void*)pe->vtable;
722   p__non_rtti_object_what = (void*)pe->name;
723
724   name = call_func1(p__non_rtti_object_what, &e);
725   ok(e.name == name, "Bad __non_rtti_object name from vtable e::what()\n");
726
727   if (p__RTtypeid && !bAncientVersion)
728   {
729     /* Check the rtti */
730     type_info *ti = p__RTtypeid(&e);
731     ok (ti != NULL && !strcmp(ti->mangled, ".?AV__non_rtti_object@@"), "bad rtti for e\n");
732   }
733   call_func2(p__non_rtti_object_vector_dtor, &e, 0); /* Should delete e.name, but not e */
734 }
735
736
737 static void test_type_info(void)
738 {
739   static type_info t1 = { NULL, NULL,{'.','?','A','V','t','e','s','t','1','@','@',0,0,0,0,0 } };
740   static type_info t1_1 = { NULL, NULL,{'?','?','A','V','t','e','s','t','1','@','@',0,0,0,0,0 } };
741   static type_info t2 = { NULL, NULL, {'.','?','A','V','t','e','s','t','2','@','@',0,0,0,0,0 } };
742   char* name;
743   int res;
744
745   if (!pmalloc || !pfree || !ptype_info_dtor || !ptype_info_raw_name ||
746       !ptype_info_name || !ptype_info_before ||
747       !ptype_info_opequals_equals || !ptype_info_opnot_equals)
748     return;
749
750   /* Test calling the dtors */
751   call_func1(ptype_info_dtor, &t1); /* No effect, since name is NULL */
752   t1.name = pmalloc(64);
753   strcpy(t1.name, "foo");
754   call_func1(ptype_info_dtor, &t1); /* Frees t1.name using 'free' */
755
756   /* raw_name */
757   t1.name = NULL;
758   name = call_func1(ptype_info_raw_name, &t1);
759
760   /* FIXME: This fails on native; it shouldn't though - native bug?
761    * ok(name && !strcmp(name, t1.mangled), "bad raw_name '%s' for t1 (expected '%s')\n", name, t1.mangled);
762    */
763   ok(t1.name == NULL, "raw_name() set name for t1\n");
764
765   /* name */
766   t1.name = NULL;
767   name = call_func1(ptype_info_name, &t1);
768   ok(name && t1.name && !strcmp(name, t1.name), "bad name '%s' for t1\n", name);
769
770   ok(t1.name && !strcmp(t1.name, "class test1"), "demangled to '%s' for t1\n", t1.name);
771   call_func1(ptype_info_dtor, &t1);
772
773   /* before */
774   t1.name = NULL;
775   res = (int)call_func2(ptype_info_before, &t1, &t1);
776   ok(res == 0, "expected 0, got %d\n", res);
777   res = (int)call_func2(ptype_info_before, &t2, &t1);
778   ok(res == 0, "expected 0, got %d\n", res);
779   res = (int)call_func2(ptype_info_before, &t1, &t2);
780   ok(res == 1, "expected 1, got %d\n", res);
781   /* Doesn't check first char */
782   res = (int)call_func2(ptype_info_before, &t1, &t1_1);
783   ok(res == 0, "expected 0, got %d\n", res);
784
785   /* opequals_equals */
786   t1.name = NULL;
787   res = (int)call_func2(ptype_info_opequals_equals, &t1, &t1);
788   ok(res == 1, "expected 1, got %d\n", res);
789   res = (int)call_func2(ptype_info_opequals_equals, &t1, &t2);
790   ok(res == 0, "expected 0, got %d\n", res);
791   res = (int)call_func2(ptype_info_opequals_equals, &t2, &t1);
792   ok(res == 0, "expected 0, got %d\n", res);
793
794   /* opnot_equals */
795   t1.name = NULL;
796   res = (int)call_func2(ptype_info_opnot_equals, &t1, &t1);
797   ok(res == 0, "expected 0, got %d\n", res);
798   res = (int)call_func2(ptype_info_opnot_equals, &t1, &t2);
799   ok(res == 1, "expected 1, got %d\n", res);
800   res = (int)call_func2(ptype_info_opnot_equals, &t2, &t1);
801   ok(res == 1, "expected 1, got %d\n", res);
802 }
803
804 /* Test RTTI functions */
805 static void test_rtti(void)
806 {
807   static const char* e_name = "name";
808   type_info *ti,*bti;
809   exception e,b;
810   void *casted;
811
812   if (bAncientVersion ||
813       !p__RTCastToVoid || !p__RTtypeid || !pexception_ctor || !pbad_typeid_ctor
814       || !p__RTDynamicCast || !pexception_dtor || !pbad_typeid_dtor)
815     return;
816
817   call_func2(pexception_ctor, &e, &e_name);
818   call_func2(pbad_typeid_ctor, &b, e_name);
819
820   /* dynamic_cast to void* */
821   casted = p__RTCastToVoid(&e);
822   ok (casted == (void*)&e, "failed cast to void\n");
823
824   /* dynamic_cast up */
825   ti = p__RTtypeid(&e);
826   bti = p__RTtypeid(&b);
827
828   casted = p__RTDynamicCast(&b, 0, NULL, ti, 0);
829   if (casted)
830   {
831     /* New versions do not allow this conversion due to compiler changes */
832     ok (casted == (void*)&b, "failed cast from bad_typeid to exception\n");
833   }
834
835   /* dynamic_cast down */
836   casted = p__RTDynamicCast(&e, 0, NULL, bti, 0);
837   ok (casted == NULL, "Cast succeeded\n");
838
839   call_func1(pexception_dtor, &e);
840   call_func1(pbad_typeid_dtor, &b);
841 }
842
843 struct _demangle {
844     LPCSTR mangled;
845     LPCSTR result;
846     BOOL test_in_wine;
847 };
848
849 static void test_demangle_datatype(void)
850 {
851     char * name;
852     struct _demangle demangle[]={
853 /*      { "BlaBla"," ?? ::Bla", FALSE}, */
854         { "ABVVec4@ref2@dice@@","class dice::ref2::Vec4 const &",TRUE},
855         { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0H@@@", "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,7>", TRUE},
856         { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HO@@@", "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,126>",TRUE},
857         { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HOA@@@", "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,2016>",TRUE},
858         { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HOAA@@@", "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,32256>",TRUE},
859         { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$01@@@", "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$01@@@", FALSE},
860 /*      { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$011@@@", "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$011@@@",FALSE}, */
861     };
862     int i, num_test = (sizeof(demangle)/sizeof(struct _demangle));
863     
864     for (i = 0; i < num_test; i++)
865     {
866         name = p__unDName(0, demangle[i].mangled, 0, pmalloc, pfree, 0x2800);
867         if (demangle[i].test_in_wine)
868             ok(name != NULL && !strcmp(name,demangle[i].result), "Got name \"%s\" for %d\n", name, i);
869         else
870             todo_wine ok(name != NULL && !strcmp(name,demangle[i].result), "Got name %s for %d\n", name, i);
871         if(name)
872             pfree(name);
873     }
874 }
875
876 /* Compare two strings treating multiple spaces (' ', ascii 0x20) in s2 
877    as single space. Needed for test_demangle as __unDName() returns sometimes
878    two spaces instead of one in some older native msvcrt dlls. */
879 static int strcmp_space(const char *s1, const char *s2)
880 {
881     const char* s2start = s2;
882     do {
883         while (*s1 == *s2 && *s1) {
884             s1++;
885             s2++;
886         }
887         if (*s2 == ' ' && s2 > s2start && *(s2 - 1) == ' ')
888             s2++;
889         else
890             break;
891     } while (*s1 && *s2);
892     return *s1 - *s2;
893 }
894
895 static void test_demangle(void)
896 {
897     static struct {const char* in; const char* out; const char *broken; unsigned int flags;} test[] = {
898 /* 0 */ {"??0bad_alloc@std@@QAE@ABV01@@Z",
899          "public: __thiscall std::bad_alloc::bad_alloc(class std::bad_alloc const &)",
900          "public: __thiscall std::bad_alloc::bad_alloc(class bad_alloc::bad_alloc const &)"},
901 /* 1 */ {"??0bad_alloc@std@@QAE@PBD@Z",
902          "public: __thiscall std::bad_alloc::bad_alloc(char const *)"},
903 /* 2 */ {"??0bad_cast@@AAE@PBQBD@Z",
904          "private: __thiscall bad_cast::bad_cast(char const * const *)"},
905 /* 3 */ {"??0bad_cast@@QAE@ABQBD@Z",
906          "public: __thiscall bad_cast::bad_cast(char const * const &)"},
907 /* 4 */ {"??0bad_cast@@QAE@ABV0@@Z",
908          "public: __thiscall bad_cast::bad_cast(class bad_cast const &)"},
909 /* 5 */ {"??0bad_exception@std@@QAE@ABV01@@Z",
910          "public: __thiscall std::bad_exception::bad_exception(class std::bad_exception const &)",
911          "public: __thiscall std::bad_exception::bad_exception(class bad_exception::bad_exception const &)"},
912 /* 6 */ {"??0bad_exception@std@@QAE@PBD@Z",
913          "public: __thiscall std::bad_exception::bad_exception(char const *)"},
914 /* 7 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z",
915          "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 &)",
916          "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 &)"},
917 /* 8 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z",
918          "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(struct _iobuf *)"},
919 /* 9 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z",
920          "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(enum std::_Uninitialized)",
921          "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)"},
922 /* 10 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z",
923           "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 &)",
924           "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 &)"},
925 /* 11 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z",
926           "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 *)"},
927 /* 12 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z",
928           "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)",
929           "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)"},
930 /* 13 */ {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z",
931           "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 &)",
932           "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 &)"},
933 /* 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",
934           "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)",
935           "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)"},
936 /* 15 */ {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z",
937           "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)"},
938 /* 16 */ {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV01@@Z",
939           "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 &)",
940           "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 &)"},
941 /* 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",
942           "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)",
943           "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)"},
944 /* 18 */ {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z",
945           "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)"},
946 /* 19 */ {"??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z",
947           "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)",
948           "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)"},
949 /* 20 */ {"??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z",
950           "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)"},
951 /* 21 */ {"??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z",
952           "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)",
953           "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)"},
954 /* 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)"},
955 /* 23 */ {"??0streambuf@@QAE@ABV0@@Z", "public: __thiscall streambuf::streambuf(class streambuf const &)"},
956 /* 24 */ {"??0strstreambuf@@QAE@ABV0@@Z", "public: __thiscall strstreambuf::strstreambuf(class strstreambuf const &)"},
957 /* 25 */ {"??0strstreambuf@@QAE@H@Z", "public: __thiscall strstreambuf::strstreambuf(int)"},
958 /* 26 */ {"??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z", "public: __thiscall strstreambuf::strstreambuf(void * (__cdecl*)(long),void (__cdecl*)(void *))"},
959 /* 27 */ {"??0strstreambuf@@QAE@PADH0@Z", "public: __thiscall strstreambuf::strstreambuf(char *,int,char *)"},
960 /* 28 */ {"??0strstreambuf@@QAE@PAEH0@Z", "public: __thiscall strstreambuf::strstreambuf(unsigned char *,int,unsigned char *)"},
961 /* 29 */ {"??0strstreambuf@@QAE@XZ", "public: __thiscall strstreambuf::strstreambuf(void)"},
962 /* 30 */ {"??1__non_rtti_object@std@@UAE@XZ", "public: virtual __thiscall std::__non_rtti_object::~__non_rtti_object(void)"},
963 /* 31 */ {"??1__non_rtti_object@@UAE@XZ", "public: virtual __thiscall __non_rtti_object::~__non_rtti_object(void)"},
964 /* 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)"},
965 /* 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)"},
966 /* 34 */ {"??4istream_withassign@@QAEAAV0@ABV0@@Z", "public: class istream_withassign & __thiscall istream_withassign::operator=(class istream_withassign const &)"},
967 /* 35 */ {"??4istream_withassign@@QAEAAVistream@@ABV1@@Z", "public: class istream & __thiscall istream_withassign::operator=(class istream const &)"},
968 /* 36 */ {"??4istream_withassign@@QAEAAVistream@@PAVstreambuf@@@Z", "public: class istream & __thiscall istream_withassign::operator=(class streambuf *)"},
969 /* 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 &)"},
970 /* 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 &)"},
971 /* 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 &)"},
972 /* 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 &))"},
973 /* 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> > *)"},
974 /* 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 *)"},
975 /* 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> >'}"},
976 /* 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> >'}"},
977 /* 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> >'}"},
978 /* 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 &)"},
979 /* 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 &)"},
980 /* 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)"},
981 /* 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 "},
982 /* 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)"},
983 /* 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 "},
984 /* 52 */ {"?abs@std@@YAMABV?$complex@M@1@@Z", "float __cdecl std::abs(class std::complex<float> const &)"},
985 /* 53 */ {"?abs@std@@YANABV?$complex@N@1@@Z", "double __cdecl std::abs(class std::complex<double> const &)"},
986 /* 54 */ {"?abs@std@@YAOABV?$complex@O@1@@Z", "long double __cdecl std::abs(class std::complex<long double> const &)"},
987 /* 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"},
988 /* 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 "},
989 /* 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 "},
990 /* 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 "},
991 /* 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 "},
992 /* 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 "},
993 /* 61 */ {"?_query_new_handler@@YAP6AHI@ZXZ", "int (__cdecl*__cdecl _query_new_handler(void))(unsigned int)"},
994 /* 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)"},
995 /* 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)"},
996 /* 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>)"},
997 /* 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)"},
998 /* 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>)"},
999 /* 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)"},
1000 /* 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)"},
1001 /* 69 */ {"?set_new_handler@@YAP6AXXZP6AXXZ@Z", "void (__cdecl*__cdecl set_new_handler(void (__cdecl*)(void)))(void)"},
1002 /* 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 &)"},
1003 /* 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 "},
1004 /* 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 &)"},
1005 /* 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 "},
1006 /* 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 &)"},
1007 /* 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 "},
1008 /* 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 &)"},
1009 /* 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 "},
1010 /* 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 &)"},
1011 /* 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 "},
1012 /* 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 &)"},
1013 /* 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 "},
1014 /* 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 &)"},
1015 /* 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 "},
1016 /* 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 &)"},
1017 /* 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 "},
1018 /* 86 */ {"?_Sync@ios_base@std@@0_NA", "private: static bool std::ios_base::_Sync"},
1019 /* 87 */ {"??_U@YAPAXI@Z", "void * __cdecl operator new[](unsigned int)"},
1020 /* 88 */ {"??_V@YAXPAX@Z", "void __cdecl operator delete[](void *)"},
1021 /* 89 */ {"??X?$_Complex_base@M@std@@QAEAAV01@ABM@Z", "public: class std::_Complex_base<float> & __thiscall std::_Complex_base<float>::operator*=(float const &)"},
1022 /* 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 &)"},
1023 /* 91 */ {"?aaa@@YAHAAUbbb@@@Z", "int __cdecl aaa(struct bbb &)"},
1024 /* 92 */ {"?aaa@@YAHBAUbbb@@@Z", "int __cdecl aaa(struct bbb & volatile)"},
1025 /* 93 */ {"?aaa@@YAHPAUbbb@@@Z", "int __cdecl aaa(struct bbb *)"},
1026 /* 94 */ {"?aaa@@YAHQAUbbb@@@Z", "int __cdecl aaa(struct bbb * const)"},
1027 /* 95 */ {"?aaa@@YAHRAUbbb@@@Z", "int __cdecl aaa(struct bbb * volatile)"},
1028 /* 96 */ {"?aaa@@YAHSAUbbb@@@Z", "int __cdecl aaa(struct bbb * const volatile)"},
1029 /* 97 */ {"??0aa.a@@QAE@XZ", "??0aa.a@@QAE@XZ"},
1030 /* 98 */ {"??0aa$_3a@@QAE@XZ", "public: __thiscall aa$_3a::aa$_3a(void)"},
1031 /* 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)"},
1032 /* 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 *))"},
1033 /* 101 */ {"?$_aaa@Vbbb@@", "_aaa<class bbb>"},
1034 /* 102 */ {"?$aaa@Vbbb@ccc@@Vddd@2@", "aaa<class ccc::bbb,class ccc::ddd>"},
1035 /* 103 */ { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "public: __thiscall Foo<int (__stdcall*)(void *,void *)>::Foo<int (__stdcall*)(void *,void *)>(char *)"},
1036 /* 104 */ { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "__thiscall Foo<int (__stdcall*)(void *,void *)>::Foo<int (__stdcall*)(void *,void *)>(char *)", NULL, 0x880},
1037 /* 105 */ { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "private: static int (__cdecl** Bar::Qux)(class Bar *,int &,int &,int *)" },
1038 /* 106 */ { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "Bar::Qux", NULL, 0x1800},
1039 /* 107 */ {"?$AAA@$DBAB@", "AAA<`template-parameter257'>"},
1040 /* 108 */ {"?$AAA@?C@", "AAA<`template-parameter-2'>"},
1041 /* 109 */ {"?$AAA@PAUBBB@@", "AAA<struct BBB *>"},
1042 /* 110 */ {"??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z",
1043            "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa * *,class ee *)",
1044            "??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z"},
1045 /* 111 */ {"?f@T@@QAEHQCY1BE@BO@D@Z", "public: int __thiscall T::f(char (volatile * const)[20][30])"},
1046 /* 112 */ {"?f@T@@QAEHQAY2BE@BO@CI@D@Z", "public: int __thiscall T::f(char (* const)[20][30][40])"},
1047 /* 113 */ {"?f@T@@QAEHQAY1BE@BO@$$CBD@Z", "public: int __thiscall T::f(char const (* const)[20][30])"},
1048 /* 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",
1049            "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)"},
1050 /* 115 */ {"?swprintf@@YAHPAGIPBGZZ", "int __cdecl swprintf(unsigned short *,unsigned int,unsigned short const *,...)"},
1051 /* 116 */ {"?vswprintf@@YAHPAGIPBGPAD@Z", "int __cdecl vswprintf(unsigned short *,unsigned int,unsigned short const *,char *)"},
1052 /* 117 */ {"?vswprintf@@YAHPA_WIPB_WPAD@Z", "int __cdecl vswprintf(wchar_t *,unsigned int,wchar_t const *,char *)"},
1053 /* 118 */ {"?swprintf@@YAHPA_WIPB_WZZ", "int __cdecl swprintf(wchar_t *,unsigned int,wchar_t const *,...)"},
1054 /* 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)"},
1055 /* 120 */ {"?_Doraise@bad_cast@std@@MEBAXXZ", "protected: virtual void __cdecl std::bad_cast::_Doraise(void)const __ptr64"},
1056 /* 121 */ {"??$?DM@std@@YA?AV?$complex@M@0@ABMABV10@@Z",
1057            "class std::complex<float> __cdecl std::operator*<float>(float const &,class std::complex<float> const &)",
1058            "??$?DM@std@@YA?AV?$complex@M@0@ABMABV10@@Z"},
1059 /* 122 */ {"?_R2@?BN@???$_Fabs@N@std@@YANAEBV?$complex@N@1@PEAH@Z@4NB",
1060            "double const `double __cdecl std::_Fabs<double>(class std::complex<double> const & __ptr64,int * __ptr64)'::`29'::_R2",
1061            "?_R2@?BN@???$_Fabs@N@std@@YANAEBV?$complex@N@1@PEAH@Z@4NB"},
1062
1063     };
1064     int i, num_test = (sizeof(test)/sizeof(test[0]));
1065     char* name;
1066
1067     for (i = 0; i < num_test; i++)
1068     {
1069         name = p__unDName(0, test[i].in, 0, pmalloc, pfree, test[i].flags);
1070         ok(name != NULL, "%u: unDName failed\n", i);
1071         if (!name) continue;
1072         ok( !strcmp_space(test[i].out, name) ||
1073             broken(test[i].broken && !strcmp_space(test[i].broken, name)),
1074            "%u: Got name \"%s\"\n", i, name );
1075         ok( !strcmp_space(test[i].out, name) ||
1076             broken(test[i].broken && !strcmp_space(test[i].broken, name)),
1077            "%u: Expected \"%s\"\n", i, test[i].out );
1078         pfree(name);
1079     }
1080 }
1081
1082 START_TEST(cpp)
1083 {
1084   InitFunctionPtrs();
1085
1086   test_exception();
1087   test_bad_typeid();
1088   test_bad_cast();
1089   test___non_rtti_object();
1090   test_type_info();
1091   test_rtti();
1092   test_demangle_datatype();
1093   test_demangle();
1094 }
1095 #endif /* __i386__ */