Piotr Caban : msvcr80: Add type_info::name partial implementation.

Alexandre Julliard julliard at winehq.org
Mon Apr 21 12:36:55 CDT 2014


Module: wine
Branch: master
Commit: 026ea82a2debf32aef53f5caf2f8946f68e18416
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=026ea82a2debf32aef53f5caf2f8946f68e18416

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Apr 21 15:28:09 2014 +0200

msvcr80: Add type_info::name partial implementation.

---

 dlls/msvcr100/msvcr100.spec |    4 ++--
 dlls/msvcr110/msvcr110.spec |    6 +++---
 dlls/msvcr80/msvcr80.spec   |    4 ++--
 dlls/msvcr90/msvcr90.spec   |    4 ++--
 dlls/msvcrt/cpp.c           |   27 +--------------------------
 5 files changed, 10 insertions(+), 35 deletions(-)

diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 6a9461b..9c20f28 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -465,8 +465,8 @@
 @ stub -arch=win64 ?lock at reader_writer_lock@Concurrency@@QEAAXXZ
 @ stub -arch=win32 ?lock_read at reader_writer_lock@Concurrency@@QAEXXZ
 @ stub -arch=win64 ?lock_read at reader_writer_lock@Concurrency@@QEAAXXZ
-@ stub -arch=win32 ?name at type_info@@QBEPBDPAU__type_info_node@@@Z  # public: char const * __thiscall type_info::name(struct __type_info_node *)const
-@ stub -arch=win64 ?name at type_info@@QEBAPEBDPEAU__type_info_node@@@Z  # public: char const * __ptr64 __cdecl type_info::name(struct __type_info_node * __ptr64)const __ptr64
+@ thiscall -arch=win32 ?name at type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method
+@ cdecl -arch=win64 ?name at type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method
 @ stub -arch=win32 ?native_handle at critical_section@Concurrency@@QAEAAV12 at XZ
 @ stub -arch=win64 ?native_handle at critical_section@Concurrency@@QEAAAEAV12 at XZ
 @ cdecl -arch=arm ?raw_name at type_info@@QBAPBDXZ(ptr) MSVCRT_type_info_raw_name
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec
index 68b48b7..0034b2f 100644
--- a/dlls/msvcr110/msvcr110.spec
+++ b/dlls/msvcr110/msvcr110.spec
@@ -755,9 +755,9 @@
 @ stub -arch=arm ?lock_read at reader_writer_lock@Concurrency@@QAAXXZ
 @ stub -arch=i386 ?lock_read at reader_writer_lock@Concurrency@@QAEXXZ
 @ stub -arch=win64 ?lock_read at reader_writer_lock@Concurrency@@QEAAXXZ
-@ stub -arch=arm ?name at type_info@@QBAPBDPAU__type_info_node@@@Z
-@ stub -arch=i386 ?name at type_info@@QBEPBDPAU__type_info_node@@@Z  # public: char const * __thiscall type_info::name(struct __type_info_node *)const
-@ stub -arch=win64 ?name at type_info@@QEBAPEBDPEAU__type_info_node@@@Z  # public: char const * __ptr64 __cdecl type_info::name(struct __type_info_node * __ptr64)const __ptr64
+@ cdecl -arch=arm ?name at type_info@@QBAPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method
+@ thiscall -arch=i386 ?name at type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method
+@ cdecl -arch=win64 ?name at type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method
 @ stub -arch=arm ?native_handle at critical_section@Concurrency@@QAAAAV12 at XZ
 @ stub -arch=i386 ?native_handle at critical_section@Concurrency@@QAEAAV12 at XZ
 @ stub -arch=win64 ?native_handle at critical_section@Concurrency@@QEAAAEAV12 at XZ
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index 105970a..1caa7e0 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -113,8 +113,8 @@
 @ cdecl -arch=win64 ?_wsopen@@YAHPEB_WHHH at Z(wstr long long long) MSVCRT__wsopen
 @ thiscall -arch=i386 ?before at type_info@@QBEHABV1@@Z(ptr ptr) MSVCRT_type_info_before
 @ cdecl -arch=win64 ?before at type_info@@QEBAHAEBV1@@Z(ptr ptr) MSVCRT_type_info_before
-@ stub -arch=win32 ?name at type_info@@QBEPBDPAU__type_info_node@@@Z  # public: char const * __thiscall type_info::name(struct __type_info_node *)const
-@ stub -arch=win64 ?name at type_info@@QEBAPEBDPEAU__type_info_node@@@Z  # public: char const * __ptr64 __cdecl type_info::name(struct __type_info_node * __ptr64)const __ptr64
+@ thiscall -arch=win32 ?name at type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method
+@ cdecl -arch=win64 ?name at type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method
 @ cdecl -arch=arm ?raw_name at type_info@@QBAPBDXZ(ptr) MSVCRT_type_info_raw_name
 @ thiscall -arch=i386 ?raw_name at type_info@@QBEPBDXZ(ptr) MSVCRT_type_info_raw_name
 @ cdecl -arch=win64 ?raw_name at type_info@@QEBAPEBDXZ(ptr) MSVCRT_type_info_raw_name
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index 20260e2..b624bd0 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -113,8 +113,8 @@
 @ cdecl -arch=win64 ?_wsopen@@YAHPEB_WHHH at Z(wstr long long long) MSVCRT__wsopen
 @ thiscall -arch=i386 ?before at type_info@@QBEHABV1@@Z(ptr ptr) MSVCRT_type_info_before
 @ cdecl -arch=win64 ?before at type_info@@QEBAHAEBV1@@Z(ptr ptr) MSVCRT_type_info_before
-@ stub -arch=win32 ?name at type_info@@QBEPBDPAU__type_info_node@@@Z  # public: char const * __thiscall type_info::name(struct __type_info_node *)const
-@ stub -arch=win64 ?name at type_info@@QEBAPEBDPEAU__type_info_node@@@Z  # public: char const * __ptr64 __cdecl type_info::name(struct __type_info_node * __ptr64)const __ptr64
+@ thiscall -arch=win32 ?name at type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method
+@ cdecl -arch=win64 ?name at type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method
 @ cdecl -arch=arm ?raw_name at type_info@@QBAPBDXZ(ptr) MSVCRT_type_info_raw_name
 @ thiscall -arch=i386 ?raw_name at type_info@@QBEPBDXZ(ptr) MSVCRT_type_info_raw_name
 @ cdecl -arch=win64 ?raw_name at type_info@@QEBAPEBDXZ(ptr) MSVCRT_type_info_raw_name
diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c
index cffcdd7..e392208 100644
--- a/dlls/msvcrt/cpp.c
+++ b/dlls/msvcrt/cpp.c
@@ -1191,32 +1191,7 @@ DEFINE_THISCALL_WRAPPER(type_info_name_internal_method,8)
 const char * __thiscall type_info_name_internal_method(type_info * _this, struct __type_info_node *node)
 {
     static int once;
-
     if (node && !once++) FIXME("type_info_node parameter ignored\n");
 
-    if (!_this->name)
-    {
-        /* Create and set the demangled name */
-        /* Note: mangled name in type_info struct always starts 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 */
-            while (len && name[--len] == ' ')
-                name[len] = '\0';
-
-            if (InterlockedCompareExchangePointer((void**)&_this->name, name, NULL))
-            {
-                /* Another thread set this member since we checked above - use it */
-                MSVCRT_free(name);
-            }
-        }
-    }
-    TRACE("(%p) returning %s\n", _this, _this->name);
-    return _this->name;
+    return MSVCRT_type_info_name(_this);
 }




More information about the wine-cvs mailing list