msvcrt: Clear end-of-file flag on fseek.
[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* (*poperator_new)(unsigned int);
59 static void  (*poperator_delete)(void*);
60 static void* (*pmalloc)(unsigned int);
61 static void  (*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* (*p__RTtypeid)(void*);
117 static void* (*p__RTCastToVoid)(void*);
118 static void* (*p__RTDynamicCast)(void*,int,void*,void*,int);
119
120 /*Demangle*/
121 static char* (*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;
161   __asm__ __volatile__ ("call *%1"
162                         : "=a" (ret)
163                         : "g" (func), "c" (_this)
164                         : "memory" );
165   return ret;
166 }
167 static void* do_call_func2(void *func, void *_this, const void* arg)
168 {
169   void* ret;
170   __asm__ __volatile__ ("pushl %2\n\tcall *%1"
171                         : "=a" (ret)
172                         : "r" (func), "g" (arg), "c" (_this)
173                         : "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) SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y)
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     SETNOFAIL(poperator_new, "??_U@YAPAXI@Z");
194     SETNOFAIL(poperator_delete, "??_V@YAXPAX@Z");
195     SET(pmalloc, "malloc");
196     SET(pfree, "free");
197
198     if (!poperator_new)
199       poperator_new = pmalloc;
200     if (!poperator_delete)
201       poperator_delete = pfree;
202
203     SET(pexception_ctor, "??0exception@@QAE@ABQBD@Z");
204     SET(pexception_copy_ctor, "??0exception@@QAE@ABV0@@Z");
205     SET(pexception_default_ctor, "??0exception@@QAE@XZ");
206     SET(pexception_dtor, "??1exception@@UAE@XZ");
207     SET(pexception_opequals, "??4exception@@QAEAAV0@ABV0@@Z");
208     SET(pexception_what, "?what@exception@@UBEPBDXZ");
209     SET(pexception_vtable, "??_7exception@@6B@");
210     SET(pexception_vector_dtor, "??_Eexception@@UAEPAXI@Z");
211     SET(pexception_scalar_dtor, "??_Gexception@@UAEPAXI@Z");
212
213     SET(pbad_typeid_ctor, "??0bad_typeid@@QAE@PBD@Z");
214     SETNOFAIL(pbad_typeid_ctor_closure, "??_Fbad_typeid@@QAEXXZ");
215     SET(pbad_typeid_copy_ctor, "??0bad_typeid@@QAE@ABV0@@Z");
216     SET(pbad_typeid_dtor, "??1bad_typeid@@UAE@XZ");
217     SET(pbad_typeid_opequals, "??4bad_typeid@@QAEAAV0@ABV0@@Z");
218     SET(pbad_typeid_what, "?what@exception@@UBEPBDXZ");
219     SET(pbad_typeid_vtable, "??_7bad_typeid@@6B@");
220     SET(pbad_typeid_vector_dtor, "??_Ebad_typeid@@UAEPAXI@Z");
221     SET(pbad_typeid_scalar_dtor, "??_Gbad_typeid@@UAEPAXI@Z");
222
223     SETNOFAIL(pbad_cast_ctor, "??0bad_cast@@QAE@ABQBD@Z");
224     if (!pbad_cast_ctor)
225       SET(pbad_cast_ctor, "??0bad_cast@@AAE@PBQBD@Z");
226     SETNOFAIL(pbad_cast_ctor2, "??0bad_cast@@QAE@PBD@Z");
227     SETNOFAIL(pbad_cast_ctor_closure, "??_Fbad_cast@@QAEXXZ");
228     SET(pbad_cast_copy_ctor, "??0bad_cast@@QAE@ABV0@@Z");
229     SET(pbad_cast_dtor, "??1bad_cast@@UAE@XZ");
230     SET(pbad_cast_opequals, "??4bad_cast@@QAEAAV0@ABV0@@Z");
231     SET(pbad_cast_what, "?what@exception@@UBEPBDXZ");
232     SET(pbad_cast_vtable, "??_7bad_cast@@6B@");
233     SET(pbad_cast_vector_dtor, "??_Ebad_cast@@UAEPAXI@Z");
234     SET(pbad_cast_scalar_dtor, "??_Gbad_cast@@UAEPAXI@Z");
235
236     SET(p__non_rtti_object_ctor, "??0__non_rtti_object@@QAE@PBD@Z");
237     SET(p__non_rtti_object_copy_ctor, "??0__non_rtti_object@@QAE@ABV0@@Z");
238     SET(p__non_rtti_object_dtor, "??1__non_rtti_object@@UAE@XZ");
239     SET(p__non_rtti_object_opequals, "??4__non_rtti_object@@QAEAAV0@ABV0@@Z");
240     SET(p__non_rtti_object_what, "?what@exception@@UBEPBDXZ");
241     SET(p__non_rtti_object_vtable, "??_7__non_rtti_object@@6B@");
242     SET(p__non_rtti_object_vector_dtor, "??_E__non_rtti_object@@UAEPAXI@Z");
243     SET(p__non_rtti_object_scalar_dtor, "??_G__non_rtti_object@@UAEPAXI@Z");
244
245     SET(ptype_info_dtor, "??1type_info@@UAE@XZ");
246     SET(ptype_info_raw_name, "?raw_name@type_info@@QBEPBDXZ");
247     SET(ptype_info_name, "?name@type_info@@QBEPBDXZ");
248     SET(ptype_info_before, "?before@type_info@@QBEHABV1@@Z");
249     SET(ptype_info_opequals_equals, "??8type_info@@QBEHABV0@@Z");
250     SET(ptype_info_opnot_equals, "??9type_info@@QBEHABV0@@Z");
251
252     SET(p__RTtypeid, "__RTtypeid");
253     SET(p__RTCastToVoid, "__RTCastToVoid");
254     SET(p__RTDynamicCast, "__RTDynamicCast");
255
256     SET(p__unDName,"__unDName");
257
258     /* Extremely early versions export logic_error, and crash in RTTI */
259     SETNOFAIL(bAncientVersion, "??0logic_error@@QAE@ABQBD@Z");
260   }
261 }
262
263 static void test_exception(void)
264 {
265   static const char* e_name = "An exception name";
266   char* name;
267   exception e, e2, e3, *pe;
268
269   if (!poperator_new || !poperator_delete ||
270       !pexception_ctor || !pexception_copy_ctor || !pexception_default_ctor ||
271       !pexception_dtor || !pexception_opequals || !pexception_what ||
272       !pexception_vtable || !pexception_vector_dtor || !pexception_scalar_dtor)
273     return;
274
275   /* 'const char*&' ctor */
276   memset(&e, 0, sizeof(e));
277   call_func2(pexception_ctor, &e, &e_name);
278   ok(e.vtable != NULL, "Null exception vtable for e\n");
279   ok(e.name && e.name != e_name && !strcmp(e.name, "An exception name"), "Bad name '%s' for e\n", e.name);
280   ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
281
282   /* Copy ctor */
283   memset(&e2, 0, sizeof(e2));
284   call_func2(pexception_copy_ctor, &e2, &e);
285   ok(e2.vtable != NULL, "Null exception vtable for e2\n");
286   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "An exception name"), "Bad exception name for e2\n");
287   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
288
289   /* Default ctor */
290   memset(&e3, 1, sizeof(e3));
291   call_func1(pexception_default_ctor, &e3);
292   ok(e3.vtable != NULL, "Null exception vtable for e3\n");
293   ok(e3.name == NULL, "Bad exception name for e3\n");
294   ok(e3.do_free == 0, "do_free set to %d for e3\n", e3.do_free);
295
296   ok(e.vtable == e2.vtable && e.vtable == e3.vtable, "exception vtables differ!\n");
297
298   /* Test calling the dtors */
299   call_func1(pexception_dtor, &e2);
300   call_func1(pexception_dtor, &e3);
301
302   /* Operator equals */
303   memset(&e2, 0, sizeof(e2));
304   pe = call_func2(pexception_opequals, &e2, &e);
305   ok(e2.vtable != NULL, "Null exception vtable for e2\n");
306   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "An exception name"), "Bad exception name for e2\n");
307   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
308   ok(pe == &e2, "opequals didn't return e2\n");
309
310   /* what() */
311   name = call_func1(pexception_what, &e2);
312   ok(e2.name == name, "Bad exception name from e2::what()\n");
313
314   /* vtable ptr */
315   ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
316   call_func1(pexception_dtor, &e2);
317
318   /* new() */
319   pe = poperator_new(sizeof(exception));
320   ok(pe != NULL, "new() failed\n");
321   if (pe)
322   {
323     call_func2(pexception_ctor, pe, &e_name);
324     /* scalar dtor */
325     call_func2(pexception_scalar_dtor, pe, 0); /* Shouldn't delete pe */
326     pe->name = NULL;
327     pe->do_free = 0;
328     call_func2(pexception_scalar_dtor, pe, 1); /* Should delete pe */
329   }
330
331   pe = poperator_new(sizeof(exception));
332   ok(pe != NULL, "new() failed\n");
333   if (pe)
334   {
335     /* vector dtor, single element */
336     call_func2(pexception_ctor, pe, &e_name);
337     call_func2(pexception_vector_dtor, pe, 1); /* Should delete pe as single element*/
338   }
339
340   pe = poperator_new(sizeof(exception) * 4 + sizeof(int));
341   ok(pe != NULL, "new() failed\n");
342   if (pe)
343   {
344     /* vector dtor, multiple elements */
345     char name[] = "a constant";
346     *((int*)pe) = 3;
347     pe = (exception*)((int*)pe + 1);
348     call_func2(pexception_ctor, &pe[0], &e_name);
349     call_func2(pexception_ctor, &pe[1], &e_name);
350     call_func2(pexception_ctor, &pe[2], &e_name);
351     pe[3].name = name;
352     pe[3].do_free = 1; /* Crash if we try to free this */
353     call_func2(pexception_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
354   }
355
356   /* test our exported vtable is kosher */
357   pe = (void*)pexception_vtable; /* Use the exception struct to get vtable ptrs */
358   pexception_vector_dtor = (void*)pe->vtable;
359   pexception_what = (void*)pe->name;
360
361   name = call_func1(pexception_what, &e);
362   ok(e.name == name, "Bad exception name from vtable e::what()\n");
363
364   if (p__RTtypeid && !bAncientVersion)
365   {
366     /* Check the rtti */
367     type_info *ti = p__RTtypeid(&e);
368     ok (ti && ti->mangled &&
369         !strcmp(ti->mangled, ".?AVexception@@"), "bad rtti for e\n");
370
371     if (ti)
372     {
373       /* Check the returned type_info has rtti too */
374       type_info *ti2 = p__RTtypeid(ti);
375       ok (ti2 != NULL && !strcmp(ti2->mangled, ".?AVtype_info@@"), "bad rtti for e's type_info\n");
376     }
377   }
378
379   call_func2(pexception_vector_dtor, &e, 0); /* Should delete e.name, but not e */
380 }
381
382 /* This test is basically a cut 'n' paste of the exception test. but it verifies that
383  * bad_typeid works the exact same way... */
384 static void test_bad_typeid(void)
385 {
386   static const char* e_name = "A bad_typeid name";
387   char* name;
388   exception e, e2, e3, *pe;
389
390   if (!poperator_new || !poperator_delete ||
391       !pbad_typeid_ctor || !pbad_typeid_copy_ctor ||
392       !pbad_typeid_dtor || !pbad_typeid_opequals || !pbad_typeid_what ||
393       !pbad_typeid_vtable || !pbad_typeid_vector_dtor || !pbad_typeid_scalar_dtor)
394     return;
395
396   /* 'const char*' ctor */
397   memset(&e, 0, sizeof(e));
398   call_func2(pbad_typeid_ctor, &e, e_name);
399   ok(e.vtable != NULL, "Null bad_typeid vtable for e\n");
400   ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_typeid name"), "Bad name '%s' for e\n", e.name);
401   ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
402
403   /* Copy ctor */
404   memset(&e2, 0, sizeof(e2));
405   call_func2(pbad_typeid_copy_ctor, &e2, &e);
406   ok(e2.vtable != NULL, "Null bad_typeid vtable for e2\n");
407   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_typeid name"), "Bad name '%s' for e2\n", e2.name);
408   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
409
410   /* Ctor closure */
411   if (pbad_typeid_ctor_closure)
412   {
413     memset(&e3, 1, sizeof(e3));
414     call_func1(pbad_typeid_ctor_closure, &e3);
415     ok(e3.vtable != NULL, "Null bad_typeid vtable for e3\n");
416     ok(e3.name && !strcmp(e3.name, "bad typeid"), "Bad bad_typeid name for e3\n");
417     ok(e3.do_free == 1, "do_free set to %d for e3\n", e3.do_free);
418     ok(e.vtable == e3.vtable, "bad_typeid closure vtables differ!\n");
419     call_func1(pbad_typeid_dtor, &e3);
420   }
421   ok(e.vtable == e2.vtable, "bad_typeid vtables differ!\n");
422
423   /* Test calling the dtors */
424   call_func1(pbad_typeid_dtor, &e2);
425
426   /* Operator equals */
427   memset(&e2, 1, sizeof(e2));
428   pe = call_func2(pbad_typeid_opequals, &e2, &e);
429   ok(e2.vtable != NULL, "Null bad_typeid vtable for e2\n");
430   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_typeid name"), "Bad bad_typeid name for e2\n");
431   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
432   ok(pe == &e2, "opequals didn't return e2\n");
433
434   /* what() */
435   name = call_func1(pbad_typeid_what, &e2);
436   ok(e2.name == name, "Bad bad_typeid name from e2::what()\n");
437
438   /* vtable ptr */
439   ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
440   call_func1(pbad_typeid_dtor, &e2);
441
442   /* new() */
443   pe = poperator_new(sizeof(exception));
444   ok(pe != NULL, "new() failed\n");
445   if (pe)
446   {
447     call_func2(pbad_typeid_ctor, pe, e_name);
448     /* scalar dtor */
449     call_func2(pbad_typeid_scalar_dtor, pe, 0); /* Shouldn't delete pe */
450     pe->name = NULL;
451     pe->do_free = 0;
452     call_func2(pbad_typeid_scalar_dtor, pe, 1); /* Should delete pe */
453   }
454
455   pe = poperator_new(sizeof(exception));
456   ok(pe != NULL, "new() failed\n");
457   if (pe)
458   {
459     /* vector dtor, single element */
460     call_func2(pbad_typeid_ctor, pe, e_name);
461     call_func2(pbad_typeid_vector_dtor, pe, 1); /* Should delete pe as single element*/
462   }
463
464   pe = poperator_new(sizeof(exception) * 4 + sizeof(int));
465   ok(pe != NULL, "new() failed\n");
466   if (pe)
467   {
468     /* vector dtor, multiple elements */
469     *((int*)pe) = 3;
470     pe = (exception*)((int*)pe + 1);
471     call_func2(pbad_typeid_ctor, &pe[0], e_name);
472     call_func2(pbad_typeid_ctor, &pe[1], e_name);
473     call_func2(pbad_typeid_ctor, &pe[2], e_name);
474     pe[3].name = 0;
475     pe[3].do_free = 1; /* Crash if we try to free this element */
476     call_func2(pbad_typeid_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
477   }
478
479   /* test our exported vtable is kosher */
480   pe = (void*)pbad_typeid_vtable; /* Use the exception struct to get vtable ptrs */
481   pbad_typeid_vector_dtor = (void*)pe->vtable;
482   pbad_typeid_what = (void*)pe->name;
483
484   name = call_func1(pbad_typeid_what, &e);
485   ok(e.name == name, "Bad bad_typeid name from vtable e::what()\n");
486
487   if (p__RTtypeid && !bAncientVersion)
488   {
489     /* Check the rtti */
490     type_info *ti = p__RTtypeid(&e);
491     ok (ti != NULL && !strcmp(ti->mangled, ".?AVbad_typeid@@"), "bad rtti for e (%s)\n",
492         !ti ? "null" : ti->mangled);
493   }
494
495   call_func2(pbad_typeid_vector_dtor, &e, 0); /* Should delete e.name, but not e */
496 }
497
498
499 /* Ditto for this test... */
500 static void test_bad_cast(void)
501 {
502   static const char* e_name = "A bad_cast name";
503   char* name;
504   exception e, e2, e3, *pe;
505
506   if (!poperator_new || !poperator_delete ||
507       !pbad_cast_ctor || !pbad_cast_copy_ctor ||
508       !pbad_cast_dtor || !pbad_cast_opequals || !pbad_cast_what ||
509       !pbad_cast_vtable || !pbad_cast_vector_dtor || !pbad_cast_scalar_dtor)
510     return;
511
512   if (pbad_cast_ctor2)
513   {
514     /* 'const char*' ctor */
515     memset(&e, 0, sizeof(e));
516     call_func2(pbad_cast_ctor2, &e, e_name);
517     ok(e.vtable != NULL, "Null bad_cast vtable for e\n");
518     ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_cast name"), "Bad name '%s' for e\n", e.name);
519     ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
520     call_func1(pbad_cast_dtor, &e);
521   }
522
523   /* 'const char*&' ctor */
524   memset(&e, 0, sizeof(e));
525   call_func2(pbad_cast_ctor, &e, &e_name);
526   ok(e.vtable != NULL, "Null bad_cast vtable for e\n");
527   ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_cast name"), "Bad name '%s' for e\n", e.name);
528   ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
529
530   /* Copy ctor */
531   memset(&e2, 0, sizeof(e2));
532   call_func2(pbad_cast_copy_ctor, &e2, &e);
533   ok(e2.vtable != NULL, "Null bad_cast vtable for e2\n");
534   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_cast name"), "Bad name '%s' for e2\n", e2.name);
535   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
536
537   /* Ctor closure */
538   if (pbad_cast_ctor_closure)
539   {
540     memset(&e3, 1, sizeof(e3));
541     call_func1(pbad_cast_ctor_closure, &e3);
542     ok(e3.vtable != NULL, "Null bad_cast vtable for e3\n");
543     ok(e3.name && !strcmp(e3.name, "bad cast"), "Bad bad_cast name for e3\n");
544     ok(e3.do_free == 1, "do_free set to %d for e3\n", e3.do_free);
545     ok(e.vtable == e3.vtable, "bad_cast closure vtables differ!\n");
546     call_func1(pbad_cast_dtor, &e3);
547   }
548   ok(e.vtable == e2.vtable, "bad_cast vtables differ!\n");
549
550   /* Test calling the dtors */
551   call_func1(pbad_cast_dtor, &e2);
552
553   /* Operator equals */
554   memset(&e2, 1, sizeof(e2));
555   pe = call_func2(pbad_cast_opequals, &e2, &e);
556   ok(e2.vtable != NULL, "Null bad_cast vtable for e2\n");
557   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_cast name"), "Bad bad_cast name for e2\n");
558   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
559   ok(pe == &e2, "opequals didn't return e2\n");
560
561   /* what() */
562   name = call_func1(pbad_cast_what, &e2);
563   ok(e2.name == name, "Bad bad_cast name from e2::what()\n");
564
565   /* vtable ptr */
566   ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
567   call_func1(pbad_cast_dtor, &e2);
568
569   /* new() */
570   pe = poperator_new(sizeof(exception));
571   ok(pe != NULL, "new() failed\n");
572   if (pe)
573   {
574     call_func2(pbad_cast_ctor, pe, &e_name);
575     /* scalar dtor */
576     call_func2(pbad_cast_scalar_dtor, pe, 0); /* Shouldn't delete pe */
577     pe->name = NULL;
578     pe->do_free = 0;
579     call_func2(pbad_cast_scalar_dtor, pe, 1); /* Should delete pe */
580   }
581
582   pe = poperator_new(sizeof(exception));
583   ok(pe != NULL, "new() failed\n");
584   if (pe)
585   {
586     /* vector dtor, single element */
587     call_func2(pbad_cast_ctor, pe, &e_name);
588     call_func2(pbad_cast_vector_dtor, pe, 1); /* Should delete pe as single element*/
589   }
590
591   pe = poperator_new(sizeof(exception) * 4 + sizeof(int));
592   ok(pe != NULL, "new() failed\n");
593   if (pe)
594   {
595     /* vector dtor, multiple elements */
596     *((int*)pe) = 3;
597     pe = (exception*)((int*)pe + 1);
598     call_func2(pbad_cast_ctor, &pe[0], &e_name);
599     call_func2(pbad_cast_ctor, &pe[1], &e_name);
600     call_func2(pbad_cast_ctor, &pe[2], &e_name);
601     pe[3].name = 0;
602     pe[3].do_free = 1; /* Crash if we try to free this element */
603     call_func2(pbad_cast_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
604   }
605
606   /* test our exported vtable is kosher */
607   pe = (void*)pbad_cast_vtable; /* Use the exception struct to get vtable ptrs */
608   pbad_cast_vector_dtor = (void*)pe->vtable;
609   pbad_cast_what = (void*)pe->name;
610
611   name = call_func1(pbad_cast_what, &e);
612   ok(e.name == name, "Bad bad_cast name from vtable e::what()\n");
613
614   if (p__RTtypeid && !bAncientVersion)
615   {
616     /* Check the rtti */
617     type_info *ti = p__RTtypeid(&e);
618     ok (ti != NULL && !strcmp(ti->mangled, ".?AVbad_cast@@"), "bad rtti for e\n");
619   }
620   call_func2(pbad_cast_vector_dtor, &e, 0); /* Should delete e.name, but not e */
621 }
622
623 /* ... and this one */
624 static void test___non_rtti_object(void)
625 {
626   static const char* e_name = "A __non_rtti_object name";
627   char* name;
628   exception e, e2, *pe;
629
630   if (!poperator_new || !poperator_delete ||
631       !p__non_rtti_object_ctor || !p__non_rtti_object_copy_ctor ||
632       !p__non_rtti_object_dtor || !p__non_rtti_object_opequals || !p__non_rtti_object_what ||
633       !p__non_rtti_object_vtable || !p__non_rtti_object_vector_dtor || !p__non_rtti_object_scalar_dtor)
634     return;
635
636   /* 'const char*' ctor */
637   memset(&e, 0, sizeof(e));
638   call_func2(p__non_rtti_object_ctor, &e, e_name);
639   ok(e.vtable != NULL, "Null __non_rtti_object vtable for e\n");
640   ok(e.name && e.name != e_name && !strcmp(e.name, "A __non_rtti_object name"), "Bad name '%s' for e\n", e.name);
641   ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
642
643   /* Copy ctor */
644   memset(&e2, 0, sizeof(e2));
645   call_func2(p__non_rtti_object_copy_ctor, &e2, &e);
646   ok(e2.vtable != NULL, "Null __non_rtti_object vtable for e2\n");
647   ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A __non_rtti_object name"), "Bad name '%s' for e2\n", e2.name);
648   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
649   ok(e.vtable == e2.vtable, "__non_rtti_object vtables differ!\n");
650
651   /* Test calling the dtors */
652   call_func1(p__non_rtti_object_dtor, &e2);
653
654   /* Operator equals */
655   memset(&e2, 1, sizeof(e2));
656   pe = call_func2(p__non_rtti_object_opequals, &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 __non_rtti_object name for e2\n");
659   ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
660   ok(pe == &e2, "opequals didn't return e2\n");
661
662   /* what() */
663   name = call_func1(p__non_rtti_object_what, &e2);
664   ok(e2.name == name, "Bad __non_rtti_object name from e2::what()\n");
665
666   /* vtable ptr */
667   ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
668   call_func1(p__non_rtti_object_dtor, &e2);
669
670   /* new() */
671   pe = poperator_new(sizeof(exception));
672   ok(pe != NULL, "new() failed\n");
673   if (pe)
674   {
675     call_func2(p__non_rtti_object_ctor, pe, e_name);
676     /* scalar dtor */
677     call_func2(p__non_rtti_object_scalar_dtor, pe, 0); /* Shouldn't delete pe */
678     pe->name = NULL;
679     pe->do_free = 0;
680     call_func2(p__non_rtti_object_scalar_dtor, pe, 1); /* Should delete pe */
681   }
682
683   pe = poperator_new(sizeof(exception));
684   ok(pe != NULL, "new() failed\n");
685   if (pe)
686   {
687     /* vector dtor, single element */
688     call_func2(p__non_rtti_object_ctor, pe, e_name);
689     call_func2(p__non_rtti_object_vector_dtor, pe, 1); /* Should delete pe as single element*/
690   }
691
692   pe = poperator_new(sizeof(exception) * 4 + sizeof(int));
693   ok(pe != NULL, "new() failed\n");
694   if (pe)
695   {
696     /* vector dtor, multiple elements */
697     *((int*)pe) = 3;
698     pe = (exception*)((int*)pe + 1);
699     call_func2(p__non_rtti_object_ctor, &pe[0], e_name);
700     call_func2(p__non_rtti_object_ctor, &pe[1], e_name);
701     call_func2(p__non_rtti_object_ctor, &pe[2], e_name);
702     pe[3].name = 0;
703     pe[3].do_free = 1; /* Crash if we try to free this element */
704     call_func2(p__non_rtti_object_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
705   }
706
707   /* test our exported vtable is kosher */
708   pe = (void*)p__non_rtti_object_vtable; /* Use the exception struct to get vtable ptrs */
709   p__non_rtti_object_vector_dtor = (void*)pe->vtable;
710   p__non_rtti_object_what = (void*)pe->name;
711
712   name = call_func1(p__non_rtti_object_what, &e);
713   ok(e.name == name, "Bad __non_rtti_object name from vtable e::what()\n");
714
715   if (p__RTtypeid && !bAncientVersion)
716   {
717     /* Check the rtti */
718     type_info *ti = p__RTtypeid(&e);
719     ok (ti != NULL && !strcmp(ti->mangled, ".?AV__non_rtti_object@@"), "bad rtti for e\n");
720   }
721   call_func2(p__non_rtti_object_vector_dtor, &e, 0); /* Should delete e.name, but not e */
722 }
723
724
725 static void test_type_info(void)
726 {
727   static type_info t1 = { NULL, NULL,{'.','?','A','V','t','e','s','t','1','@','@',0,0,0,0,0 } };
728   static type_info t1_1 = { NULL, NULL,{'?','?','A','V','t','e','s','t','1','@','@',0,0,0,0,0 } };
729   static type_info t2 = { NULL, NULL, {'.','?','A','V','t','e','s','t','2','@','@',0,0,0,0,0 } };
730   char* name;
731   int res;
732
733   if (!pmalloc || !pfree || !ptype_info_dtor || !ptype_info_raw_name ||
734       !ptype_info_name || !ptype_info_before ||
735       !ptype_info_opequals_equals || !ptype_info_opnot_equals)
736     return;
737
738   /* Test calling the dtors */
739   call_func1(ptype_info_dtor, &t1); /* No effect, since name is NULL */
740   t1.name = pmalloc(64);
741   strcpy(t1.name, "foo");
742   call_func1(ptype_info_dtor, &t1); /* Frees t1.name using 'free' */
743
744   /* raw_name */
745   t1.name = NULL;
746   name = call_func1(ptype_info_raw_name, &t1);
747
748   /* FIXME: This fails on native; it shouldn't though - native bug?
749    * ok(name && !strcmp(name, t1.mangled), "bad raw_name '%s' for t1 (expected '%s')\n", name, t1.mangled);
750    */
751   ok(t1.name == NULL, "raw_name() set name for t1\n");
752
753   /* name */
754   t1.name = NULL;
755   name = call_func1(ptype_info_name, &t1);
756   ok(name && t1.name && !strcmp(name, t1.name), "bad name '%s' for t1\n", name);
757
758   ok(t1.name && !strcmp(t1.name, "class test1"), "demangled to '%s' for t1\n", t1.name);
759   call_func1(ptype_info_dtor, &t1);
760
761   /* before */
762   t1.name = NULL;
763   res = (int)call_func2(ptype_info_before, &t1, &t1);
764   ok(res == 0, "expected 0, got %d\n", res);
765   res = (int)call_func2(ptype_info_before, &t2, &t1);
766   ok(res == 0, "expected 0, got %d\n", res);
767   res = (int)call_func2(ptype_info_before, &t1, &t2);
768   ok(res == 1, "expected 1, got %d\n", res);
769   /* Doesn't check first char */
770   res = (int)call_func2(ptype_info_before, &t1, &t1_1);
771   ok(res == 0, "expected 0, got %d\n", res);
772
773   /* opequals_equals */
774   t1.name = NULL;
775   res = (int)call_func2(ptype_info_opequals_equals, &t1, &t1);
776   ok(res == 1, "expected 1, got %d\n", res);
777   res = (int)call_func2(ptype_info_opequals_equals, &t1, &t2);
778   ok(res == 0, "expected 0, got %d\n", res);
779   res = (int)call_func2(ptype_info_opequals_equals, &t2, &t1);
780   ok(res == 0, "expected 0, got %d\n", res);
781
782   /* opnot_equals */
783   t1.name = NULL;
784   res = (int)call_func2(ptype_info_opnot_equals, &t1, &t1);
785   ok(res == 0, "expected 0, got %d\n", res);
786   res = (int)call_func2(ptype_info_opnot_equals, &t1, &t2);
787   ok(res == 1, "expected 1, got %d\n", res);
788   res = (int)call_func2(ptype_info_opnot_equals, &t2, &t1);
789   ok(res == 1, "expected 1, got %d\n", res);
790 }
791
792 /* Test RTTI functions */
793 static void test_rtti(void)
794 {
795   static const char* e_name = "name";
796   type_info *ti,*bti;
797   exception e,b;
798   void *casted;
799
800   if (bAncientVersion ||
801       !p__RTCastToVoid || !p__RTtypeid || !pexception_ctor || !pbad_typeid_ctor || !p__RTDynamicCast)
802     return;
803
804   call_func2(pexception_ctor, &e, &e_name);
805   call_func2(pbad_typeid_ctor, &b, e_name);
806
807   /* dynamic_cast to void* */
808   casted = p__RTCastToVoid(&e);
809   ok (casted == (void*)&e, "failed cast to void\n");
810
811   /* dynamic_cast up */
812   ti = p__RTtypeid(&e);
813   bti = p__RTtypeid(&b);
814
815   casted = p__RTDynamicCast(&b, 0, NULL, ti, 0);
816   ok (casted == (void*)&b, "failed cast from bad_cast to exception\n");
817
818   /* dynamic_cast down */
819   casted = p__RTDynamicCast(&e, 0, NULL, bti, 0);
820   ok (casted == NULL, "Cast succeeded\n");
821 }
822
823 struct _demangle {
824     LPCSTR mangled;
825     LPCSTR result;
826     BOOL test_in_wine;
827 };
828
829 static void test_demangle_datatype(void)
830 {
831     char * name;
832     struct _demangle demangle[]={
833 /*      { "BlaBla"," ?? ::Bla", FALSE}, */
834         { "ABVVec4@ref2@dice@@","class dice::ref2::Vec4 const &",TRUE},
835         { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0H@@@", "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,7>", TRUE},
836         { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HO@@@", "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,126>",TRUE},
837         { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HOA@@@", "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,2016>",TRUE},
838         { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HOAA@@@", "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,32256>",TRUE},
839         { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$01@@@", "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$01@@@", FALSE},
840 /*      { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$011@@@", "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$011@@@",FALSE}, */
841     };
842     int i, num_test = (sizeof(demangle)/sizeof(struct _demangle));
843     
844     for (i = 0; i < num_test; i++)
845     {
846         name = p__unDName(0, demangle[i].mangled, 0, pmalloc, pfree, 0x2800);
847         if (demangle[i].test_in_wine)
848             ok(name != NULL && !strcmp(name,demangle[i].result), "Got name \"%s\" for %d\n", name, i);
849         else
850             todo_wine ok(name != NULL && !strcmp(name,demangle[i].result), "Got name %s for %d\n", name, i);
851               
852     }
853 }
854
855 /* Compare two strings treating multiple spaces (' ', ascii 0x20) in s2 
856    as single space. Needed for test_demangle as __unDName() returns sometimes
857    two spaces instead of one in some older native msvcrt dlls. */
858 static int strcmp_space(const char *s1, const char *s2)
859 {
860     const char* s2start = s2;
861     do {
862         while (*s1 == *s2 && *s1) {
863             s1++;
864             s2++;
865         }
866         if (*s2 == ' ' && s2 > s2start && *(s2 - 1) == ' ')
867             s2++;
868         else
869             break;
870     } while (*s1 && *s2);
871     return *s1 - *s2;
872 }
873
874 static void test_demangle(void)
875 {
876     static struct {const char* in; const char* out; unsigned int flags;} test[] = {
877 {"??0bad_alloc@std@@QAE@ABV01@@Z", "public: __thiscall std::bad_alloc::bad_alloc(class std::bad_alloc const &)"},
878 {"??0bad_alloc@std@@QAE@PBD@Z", "public: __thiscall std::bad_alloc::bad_alloc(char const *)"},
879 {"??0bad_cast@@AAE@PBQBD@Z", "private: __thiscall bad_cast::bad_cast(char const * const *)"},
880 {"??0bad_cast@@QAE@ABQBD@Z", "public: __thiscall bad_cast::bad_cast(char const * const &)"},
881 {"??0bad_cast@@QAE@ABV0@@Z", "public: __thiscall bad_cast::bad_cast(class bad_cast const &)"},
882 {"??0bad_exception@std@@QAE@ABV01@@Z", "public: __thiscall std::bad_exception::bad_exception(class std::bad_exception const &)"},
883 {"??0bad_exception@std@@QAE@PBD@Z", "public: __thiscall std::bad_exception::bad_exception(char const *)"},
884 {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z", "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 &)"},
885 {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z", "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(struct _iobuf *)"},
886 {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z", "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(enum std::_Uninitialized)"},
887 {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z", "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 &)"},
888 {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z", "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 *)"},
889 {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z", "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)"},
890 {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z", "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 &)"},
891 {"??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", "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)"},
892 {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z", "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)"},
893 {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV01@@Z", "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 &)"},
894 {"??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", "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)"},
895 {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z", "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)"},
896 {"??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z", "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)"},
897 {"??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z", "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)"},
898 {"??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@ABV_Locinfo@1@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> > >(class std::_Locinfo const &,unsigned int)"},
899 {"??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)"},
900 {"??0streambuf@@QAE@ABV0@@Z", "public: __thiscall streambuf::streambuf(class streambuf const &)"},
901 {"??0strstreambuf@@QAE@ABV0@@Z", "public: __thiscall strstreambuf::strstreambuf(class strstreambuf const &)"},
902 {"??0strstreambuf@@QAE@H@Z", "public: __thiscall strstreambuf::strstreambuf(int)"},
903 {"??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z", "public: __thiscall strstreambuf::strstreambuf(void * (__cdecl*)(long),void (__cdecl*)(void *))"},
904 {"??0strstreambuf@@QAE@PADH0@Z", "public: __thiscall strstreambuf::strstreambuf(char *,int,char *)"},
905 {"??0strstreambuf@@QAE@PAEH0@Z", "public: __thiscall strstreambuf::strstreambuf(unsigned char *,int,unsigned char *)"},
906 {"??0strstreambuf@@QAE@XZ", "public: __thiscall strstreambuf::strstreambuf(void)"},
907 {"??1__non_rtti_object@std@@UAE@XZ", "public: virtual __thiscall std::__non_rtti_object::~__non_rtti_object(void)"},
908 {"??1__non_rtti_object@@UAE@XZ", "public: virtual __thiscall __non_rtti_object::~__non_rtti_object(void)"},
909 {"??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)"},
910 {"??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)"},
911 {"??4istream_withassign@@QAEAAV0@ABV0@@Z", "public: class istream_withassign & __thiscall istream_withassign::operator=(class istream_withassign const &)"},
912 {"??4istream_withassign@@QAEAAVistream@@ABV1@@Z", "public: class istream & __thiscall istream_withassign::operator=(class istream const &)"},
913 {"??4istream_withassign@@QAEAAVistream@@PAVstreambuf@@@Z", "public: class istream & __thiscall istream_withassign::operator=(class streambuf *)"},
914 {"??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 &)"},
915 {"??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 &)"},
916 {"??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 &)"},
917 {"??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 &))"},
918 {"??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> > *)"},
919 {"??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 *)"},
920 {"??_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> >'}"},
921 {"??_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> >'}"},
922 {"??_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> >'}"},
923 {"??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 &)"},
924 {"??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 &)"},
925 {"??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)"},
926 {"??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 "},
927 {"??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)"},
928 {"??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 "},
929 {"?abs@std@@YAMABV?$complex@M@1@@Z", "float __cdecl std::abs(class std::complex<float> const &)"},
930 {"?abs@std@@YANABV?$complex@N@1@@Z", "double __cdecl std::abs(class std::complex<double> const &)"},
931 {"?abs@std@@YAOABV?$complex@O@1@@Z", "long double __cdecl std::abs(class std::complex<long double> const &)"},
932 {"?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A", "class std::basic_istream<char,struct std::char_traits<char> > std::cin"},
933 {"?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 "},
934 {"?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 "},
935 {"?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 "},
936 {"?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 "},
937 {"?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 "},
938 {"?_query_new_handler@@YAP6AHI@ZXZ", "int (__cdecl*__cdecl _query_new_handler(void))(unsigned int)"},
939 {"?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)"},
940 {"?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)"},
941 {"?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>)"},
942 {"?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)"},
943 {"?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>)"},
944 {"?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)"},
945 {"?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)"},
946 {"?set_new_handler@@YAP6AXXZP6AXXZ@Z", "void (__cdecl*__cdecl set_new_handler(void (__cdecl*)(void)))(void)"},
947 {"?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 &)"},
948 {"?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 "},
949 {"?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 &)"},
950 {"?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 "},
951 {"?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 &)"},
952 {"?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 "},
953 {"?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 &)"},
954 {"?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 "},
955 {"?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 &)"},
956 {"?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 "},
957 {"?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 &)"},
958 {"?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 "},
959 {"?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 &)"},
960 {"?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 "},
961 {"?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 &)"},
962 {"?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 "},
963 {"?_Sync@ios_base@std@@0_NA", "private: static bool std::ios_base::_Sync"},
964 {"??_U@YAPAXI@Z", "void * __cdecl operator new[](unsigned int)"},
965 {"??_V@YAXPAX@Z", "void __cdecl operator delete[](void *)"},
966 {"??X?$_Complex_base@M@std@@QAEAAV01@ABM@Z", "public: class std::_Complex_base<float> & __thiscall std::_Complex_base<float>::operator*=(float const &)"},
967 {"??Xstd@@YAAAV?$complex@M@0@AAV10@ABV10@@Z", "class std::complex<float> & __cdecl std::operator*=(class std::complex<float> &,class std::complex<float> const &)"},
968 {"?aaa@@YAHAAUbbb@@@Z", "int __cdecl aaa(struct bbb &)"},
969 {"?aaa@@YAHBAUbbb@@@Z", "int __cdecl aaa(struct bbb & volatile)"},
970 {"?aaa@@YAHPAUbbb@@@Z", "int __cdecl aaa(struct bbb *)"},
971 {"?aaa@@YAHQAUbbb@@@Z", "int __cdecl aaa(struct bbb * const)"},
972 {"?aaa@@YAHRAUbbb@@@Z", "int __cdecl aaa(struct bbb * volatile)"},
973 {"?aaa@@YAHSAUbbb@@@Z", "int __cdecl aaa(struct bbb * const volatile)"},
974 {"??0aa.a@@QAE@XZ", "??0aa.a@@QAE@XZ"},
975 {"??0aa$_3a@@QAE@XZ", "public: __thiscall aa$_3a::aa$_3a(void)"},
976 {"??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)"},
977 {"?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 *))"},
978 {"?$_aaa@Vbbb@@", "_aaa<class bbb>"},
979 {"?$aaa@Vbbb@ccc@@Vddd@2@", "aaa<class ccc::bbb,class ccc::ddd>"},
980 { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "public: __thiscall Foo<int (__stdcall*)(void *,void *)>::Foo<int (__stdcall*)(void *,void *)>(char *)"},
981 { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "__thiscall Foo<int (__stdcall*)(void *,void *)>::Foo<int (__stdcall*)(void *,void *)>(char *)", 0x880},
982 { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "private: static int (__cdecl** Bar::Qux)(class Bar *,int &,int &,int *)" },
983 { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "Bar::Qux", 0x1800},
984 {"?$AAA@$DBAB@", "AAA<`template-parameter257'>"},
985 {"?$AAA@$D?4@", "AAA<`template-parameter-5'>"},
986 {"?$AAA@PAUBBB@@", "AAA<struct BBB *>"},
987 {"??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z", "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa **,class ee *)"},
988     };
989     int i, num_test = (sizeof(test)/sizeof(test[0]));
990     char* name;
991
992     for (i = 0; i < num_test; i++)
993     {
994         name = p__unDName(0, test[i].in, 0, pmalloc, pfree, test[i].flags);
995         ok(name != NULL && !strcmp_space(test[i].out, name),
996            "Got name \"%s\" for %d\n", name, i );
997         ok(name != NULL && !strcmp_space(test[i].out, name),
998            "Expected \"%s\"\n", test[i].out );
999         pfree(name);
1000     }
1001 }
1002
1003 START_TEST(cpp)
1004 {
1005   InitFunctionPtrs();
1006
1007   test_exception();
1008   test_bad_typeid();
1009   test_bad_cast();
1010   test___non_rtti_object();
1011   test_type_info();
1012   test_rtti();
1013   test_demangle_datatype();
1014   test_demangle();
1015 }
1016 #endif /* __i386__ */