Piotr Caban : msvcp90: Added ctype_base class implementation.

Alexandre Julliard julliard at winehq.org
Fri Dec 16 11:22:52 CST 2011


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Fri Dec 16 11:31:45 2011 +0100

msvcp90: Added ctype_base class implementation.

---

 dlls/msvcp90/locale.c     |  101 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/msvcp90/msvcp90.spec |   16 ++++----
 2 files changed, 109 insertions(+), 8 deletions(-)

diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index 03b325d..a3c54dc 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -86,6 +86,10 @@ typedef struct {
     _Collvec coll;
 } collate;
 
+typedef struct {
+    locale_facet facet;
+} ctype_base;
+
 /* ?_Id_cnt at id@locale at std@@0HA */
 int locale_id__Id_cnt = 0;
 
@@ -628,6 +632,65 @@ basic_string_wchar __thiscall collate_wchar_transform(const collate *this,
     return ret;
 }
 
+/* ??_7ctype_base at std@@6B@ */
+extern const vtable_ptr MSVCP_ctype_base_vtable;
+
+/* ??0ctype_base at std@@QAE at I@Z */
+/* ??0ctype_base at std@@QEAA at _K@Z */
+DEFINE_THISCALL_WRAPPER(ctype_base_ctor_refs, 8)
+ctype_base* __thiscall ctype_base_ctor_refs(ctype_base *this, MSVCP_size_t refs)
+{
+    TRACE("(%p %lu)\n", this, refs);
+    locale_facet_ctor_refs(&this->facet, refs);
+    this->facet.vtable = &MSVCP_ctype_base_vtable;
+    return this;
+}
+
+/* ??_Fctype_base at std@@QAEXXZ */
+/* ??_Fctype_base at std@@QEAAXXZ */
+DEFINE_THISCALL_WRAPPER(ctype_base_ctor, 4)
+ctype_base* __thiscall ctype_base_ctor(ctype_base *this)
+{
+    TRACE("(%p)\n", this);
+    locale_facet_ctor_refs(&this->facet, 0);
+    this->facet.vtable = &MSVCP_ctype_base_vtable;
+    return this;
+}
+
+/* ??1ctype_base at std@@UAE at XZ */
+/* ??1ctype_base at std@@UEAA at XZ */
+DEFINE_THISCALL_WRAPPER(ctype_base_dtor, 4)
+void __thiscall ctype_base_dtor(ctype_base *this)
+{
+    TRACE("(%p)\n", this);
+}
+
+DEFINE_THISCALL_WRAPPER(MSVCP_ctype_base_vector_dtor, 8)
+ctype_base* __thiscall MSVCP_ctype_base_vector_dtor(ctype_base *this, unsigned int flags)
+{
+    TRACE("(%p %x)\n", this, flags);
+    if(flags & 2) {
+        /* we have an array, with the number of elements stored before the first object */
+        int i, *ptr = (int *)this-1;
+
+        for(i=*ptr-1; i>=0; i--)
+            ctype_base_dtor(this+i);
+        MSVCRT_operator_delete(ptr);
+    } else {
+        ctype_base_dtor(this);
+        if(flags & 1)
+            MSVCRT_operator_delete(this);
+    }
+
+    return this;
+}
+
+/* ?_Xran at ctype_base@std@@KAXXZ */
+void __cdecl ctype_base__Xran(void)
+{
+    throw_exception(EXCEPTION_OUT_OF_RANGE, "out of range in ctype<T>");
+}
+
 /* ??0_Locimp at locale@std@@AAE at _N@Z */
 /* ??0_Locimp at locale@std@@AEAA at _N@Z */
 DEFINE_THISCALL_WRAPPER(locale__Locimp_ctor_transparent, 8)
@@ -1525,6 +1588,43 @@ const rtti_object_locator collate_short_rtti = {
     &collate_short_hierarchy
 };
 
+static const type_info ctype_base_type_info = {
+    &MSVCP_ctype_base_vtable,
+    NULL,
+    ".?AUctype_base at std@@"
+};
+
+static const rtti_base_descriptor ctype_base_rtti_base_descriptor = {
+    &ctype_base_type_info,
+    1,
+    { 0, -1, 0},
+    64
+};
+
+static const rtti_base_array ctype_base_rtti_base_array = {
+    {
+        &ctype_base_rtti_base_descriptor,
+        &locale_facet_rtti_base_descriptor,
+        NULL,
+        NULL
+    }
+};
+
+static const rtti_object_hierarchy ctype_base_hierarchy = {
+    0,
+    0,
+    2,
+    &ctype_base_rtti_base_array
+};
+
+const rtti_object_locator ctype_base_rtti = {
+    0,
+    0,
+    0,
+    &ctype_base_type_info,
+    &ctype_base_hierarchy
+};
+
 #ifndef __GNUC__
 void __asm_dummy_vtables(void) {
 #endif
@@ -1540,6 +1640,7 @@ void __asm_dummy_vtables(void) {
             VTABLE_ADD_FUNC(collate_wchar_do_compare)
             VTABLE_ADD_FUNC(collate_wchar_do_transform)
             VTABLE_ADD_FUNC(collate_wchar_do_hash));
+    __ASM_VTABLE(ctype_base, "");
 #ifndef __GNUC__
 }
 #endif
diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec
index 0608d9a..64d2e94 100644
--- a/dlls/msvcp90/msvcp90.spec
+++ b/dlls/msvcp90/msvcp90.spec
@@ -1094,8 +1094,8 @@
 @ stub -arch=win64 ??0_Winit at std@@QEAA at XZ
 @ stub -arch=win32 ??0codecvt_base at std@@QAE at I@Z
 @ stub -arch=win64 ??0codecvt_base at std@@QEAA at _K@Z
-@ stub -arch=win32 ??0ctype_base at std@@QAE at I@Z
-@ stub -arch=win64 ??0ctype_base at std@@QEAA at _K@Z
+@ thiscall -arch=win32 ??0ctype_base at std@@QAE at I@Z(ptr long) ctype_base_ctor_refs
+@ cdecl -arch=win64 ??0ctype_base at std@@QEAA at _K@Z(ptr long) ctype_base_ctor_refs
 @ thiscall -arch=win32 ??0facet at locale@std@@IAE at I@Z(ptr long) locale_facet_ctor_refs
 @ cdecl -arch=win64 ??0facet at locale@std@@IEAA at _K@Z(ptr long) locale_facet_ctor_refs
 @ thiscall -arch=win32 ??0id at locale@std@@QAE at I@Z(ptr long) locale_id_ctor_id
@@ -1328,8 +1328,8 @@
 @ stub -arch=win64 ??1_Winit at std@@QEAA at XZ
 @ stub -arch=win32 ??1codecvt_base at std@@UAE at XZ
 @ stub -arch=win64 ??1codecvt_base at std@@UEAA at XZ
-@ stub -arch=win32 ??1ctype_base at std@@UAE at XZ
-@ stub -arch=win64 ??1ctype_base at std@@UEAA at XZ
+@ thiscall -arch=win32 ??1ctype_base at std@@UAE at XZ(ptr) ctype_base_dtor
+@ cdecl -arch=win64 ??1ctype_base at std@@UEAA at XZ(ptr) ctype_base_dtor
 @ thiscall -arch=win32 ??1facet at locale@std@@UAE at XZ(ptr) locale_facet_dtor
 @ cdecl -arch=win64 ??1facet at locale@std@@UEAA at XZ(ptr) locale_facet_dtor
 @ thiscall -arch=win32 ??1ios_base at std@@UAE at XZ(ptr) ios_base_dtor
@@ -1859,7 +1859,7 @@
 # extern ??_7?$time_put at _WV?$ostreambuf_iterator at _WU?$char_traits at _W@std@@@std@@@std@@6B@
 @ extern ??_7_Locimp at locale@std@@6B@ MSVCP_locale__Locimp_vtable
 # extern ??_7codecvt_base at std@@6B@
-# extern ??_7ctype_base at std@@6B@
+@ extern ??_7ctype_base at std@@6B@ MSVCP_ctype_base_vtable
 @ extern ??_7ios_base at std@@6B@ MSVCP_ios_base_vtable
 # extern ??_7messages_base at std@@6B@
 # extern ??_7money_base at std@@6B@
@@ -2083,8 +2083,8 @@
 @ cdecl -arch=win64 ??_F_Timevec at std@@QEAAXXZ(ptr) _Timevec_ctor
 @ stub -arch=win32 ??_Fcodecvt_base at std@@QAEXXZ
 @ stub -arch=win64 ??_Fcodecvt_base at std@@QEAAXXZ
-@ stub -arch=win32 ??_Fctype_base at std@@QAEXXZ
-@ stub -arch=win64 ??_Fctype_base at std@@QEAAXXZ
+@ thiscall -arch=win32 ??_Fctype_base at std@@QAEXXZ(ptr) ctype_base_ctor
+@ cdecl -arch=win64 ??_Fctype_base at std@@QEAAXXZ(ptr) ctype_base_ctor
 @ thiscall -arch=win32 ??_Ffacet at locale@std@@QAEXXZ(ptr) locale_facet_ctor
 @ cdecl -arch=win64 ??_Ffacet at locale@std@@QEAAXXZ(ptr) locale_facet_ctor
 @ thiscall -arch=win32 ??_Fid at locale@std@@QAEXXZ(ptr) locale_id_ctor
@@ -2882,7 +2882,7 @@
 @ stub ?_Xmem at tr1@std@@YAXXZ
 @ stub ?_Xoutrange at tr1@std@@YAXXZ
 @ cdecl ?_Xran at _String_base@std@@SAXXZ() MSVCP__String_base_Xran
-@ stub ?_Xran at ctype_base@std@@KAXXZ
+@ cdecl ?_Xran at ctype_base@std@@KAXXZ() ctype_base__Xran
 @ thiscall -arch=win32 ?_Xsgetn_s@?$basic_streambuf at DU?$char_traits at D@std@@@std@@MAEHPADIH at Z(ptr ptr long long) basic_streambuf_char__Xsgetn_s
 @ cdecl -arch=win64 ?_Xsgetn_s@?$basic_streambuf at DU?$char_traits at D@std@@@std@@MEAA_JPEAD_K_J at Z(ptr ptr long long) basic_streambuf_char__Xsgetn_s
 @ stub -arch=win32 ?_Xsgetn_s@?$basic_streambuf at GU?$char_traits at G@std@@@std@@MAEHPAGIH at Z




More information about the wine-cvs mailing list