From a2d24c8a4a07cac3c82392a697f23c54a960cc25 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Mon, 8 Nov 2004 22:11:05 +0000 Subject: [PATCH] Now that name undecoration works, fix the type info. --- dlls/msvcrt/cpp.c | 11 +++++++---- dlls/msvcrt/tests/cpp.c | 6 +----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index 4ec8d99ab6..2cdcdf0dbf 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -565,16 +565,19 @@ const char * __stdcall MSVCRT_type_info_name(type_info * _this) if (!_this->name) { /* Create and set the demangled name */ - char* name = __unDName(0, _this->mangled, 0, - (malloc_func_t)MSVCRT_malloc, - (free_func_t)MSVCRT_free, 0x2800); + /* Nota: mangled name in type_info struct always start with a '.', while + * it isn't valid for mangled name. + * Is this '.' really part of the mangled name, or has it some other meaning ? + */ + char* name = __unDName(0, _this->mangled + 1, 0, + MSVCRT_malloc, MSVCRT_free, 0x2800); if (name) { unsigned int len = strlen(name); /* It seems _unDName may leave blanks at the end of the demangled name */ - if (name[len] == ' ') + while (len && name[--len] == ' ') name[len] = '\0'; _mlock(_EXIT_LOCK2); diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index 808e34de37..15bbcc254b 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -748,11 +748,7 @@ static void test_type_info(void) name = call_func1(ptype_info_name, &t1); ok(name && t1.name && !strcmp(name, t1.name), "bad name '%s' for t1\n", name); - todo_wine - { - /* Demangling doesn't work yet, since __unDName() is a stub */ - ok(t1.name && !strcmp(t1.name, "class test1"), "demangled to '%s' for t1\n", t1.name); - } + ok(t1.name && !strcmp(t1.name, "class test1"), "demangled to '%s' for t1\n", t1.name); call_func1(ptype_info_dtor, &t1); /* before */ -- 2.33.8