Piotr Caban : msvcp60: Added basic_fstream constructors implementation.

Alexandre Julliard julliard at winehq.org
Mon Oct 8 13:39:56 CDT 2012


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Fri Oct  5 14:56:10 2012 +0200

msvcp60: Added basic_fstream constructors implementation.

---

 dlls/msvcp60/ios.c        |  112 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/msvcp60/msvcp60.spec |   16 +++---
 2 files changed, 120 insertions(+), 8 deletions(-)

diff --git a/dlls/msvcp60/ios.c b/dlls/msvcp60/ios.c
index cb355ec..4d753c5 100644
--- a/dlls/msvcp60/ios.c
+++ b/dlls/msvcp60/ios.c
@@ -10178,6 +10178,57 @@ basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this,
     return this;
 }
 
+/* ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QAE at PAU_iobuf@@@Z */
+/* ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QEAA at PEAU_iobuf@@@Z */
+static basic_fstream_char* basic_fstream_char_ctor_file(basic_fstream_char *this,
+        FILE *file, MSVCP_bool virt_init)
+{
+    basic_ios_char *basic_ios;
+
+    TRACE("(%p %p %d)\n", this, file, virt_init);
+
+    if(virt_init) {
+        this->base.base1.vbtable = basic_fstream_char_vbtable1;
+        this->base.base2.vbtable = basic_fstream_char_vbtable2;
+        basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
+        basic_ios_char_ctor(basic_ios);
+    }else {
+        basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
+    }
+
+    basic_filebuf_char_ctor_file(&this->filebuf, file);
+    basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
+    basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
+    return this;
+}
+
+/* ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QAE at ABV01@@Z */
+/* ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QEAA at AEBV01@@Z */
+DEFINE_THISCALL_WRAPPER(basic_fstream_char_copy_ctor, 12)
+basic_fstream_char* __thiscall basic_fstream_char_copy_ctor(basic_fstream_char *this,
+        basic_fstream_char *copy, MSVCP_bool virt_init)
+{
+    TRACE("(%p %p %d)\n", this, copy, virt_init);
+    return basic_fstream_char_ctor_file(this, copy->filebuf.file, virt_init);
+}
+
+/* ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QAE at PBDH@Z */
+/* ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QEAA at PEBDH@Z */
+DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 16)
+basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
+        const char *name, int mode, MSVCP_bool virt_init)
+{
+    TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
+
+    basic_fstream_char_ctor(this, virt_init);
+
+    if(!basic_filebuf_char_open(&this->filebuf, name, mode, _SH_DENYNO)) {
+        basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
+        basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
+    }
+    return this;
+}
+
 /* ??1?$basic_fstream at DU?$char_traits at D@std@@@std@@UAE at XZ */
 /* ??1?$basic_fstream at DU?$char_traits at D@std@@@std@@UEAA at XZ */
 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
@@ -10322,6 +10373,67 @@ basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *th
     return this;
 }
 
+/* ??0?$basic_fstream at _WU?$char_traits at _W@std@@@std@@QAE at PAU_iobuf@@@Z */
+/* ??0?$basic_fstream at _WU?$char_traits at _W@std@@@std@@QEAA at PEAU_iobuf@@@Z */
+static basic_fstream_wchar* basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
+        FILE *file, MSVCP_bool virt_init)
+{
+    basic_ios_wchar *basic_ios;
+
+    TRACE("(%p %p %d)\n", this, file, virt_init);
+
+    if(virt_init) {
+        this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
+        this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
+        basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
+        basic_ios_wchar_ctor(basic_ios);
+    }else {
+        basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
+    }
+
+    basic_filebuf_wchar_ctor_file(&this->filebuf, file);
+    basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
+    basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
+    return this;
+}
+
+/* ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QAE at PAU_iobuf@@@Z */
+/* ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QEAA at PEAU_iobuf@@@Z */
+static basic_fstream_wchar* basic_fstream_short_ctor_file(basic_fstream_wchar *this,
+        FILE *file, MSVCP_bool virt_init)
+{
+    basic_fstream_wchar_ctor_file(this, file, virt_init);
+    basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
+    return this;
+}
+
+/* ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QAE at ABV01@@Z */
+/* ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QEAA at AEBV01@@Z */
+DEFINE_THISCALL_WRAPPER(basic_fstream_short_copy_ctor, 12)
+basic_fstream_wchar* __thiscall basic_fstream_short_copy_ctor(basic_fstream_wchar *this,
+        basic_fstream_wchar *copy, MSVCP_bool virt_init)
+{
+    TRACE("(%p %p %d)\n", this, copy, virt_init);
+    return basic_fstream_short_ctor_file(this, copy->filebuf.file, virt_init);
+}
+
+/* ??0?$basic_fstream at _WU?$char_traits at _W@std@@@std@@QAE at PB_WHH@Z */
+/* ??0?$basic_fstream at _WU?$char_traits at _W@std@@@std@@QEAA at PEB_WHH@Z */
+DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 16)
+basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
+        const char *name, int mode, MSVCP_bool virt_init)
+{
+    TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
+
+    basic_fstream_short_ctor(this, virt_init);
+
+    if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, _SH_DENYNO)) {
+        basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
+        basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
+    }
+    return this;
+}
+
 /* ??1?$basic_fstream at _WU?$char_traits at _W@std@@@std@@UAE at XZ */
 /* ??1?$basic_fstream at _WU?$char_traits at _W@std@@@std@@UEAA at XZ */
 /* ??1?$basic_fstream at GU?$char_traits at G@std@@@std@@UAE at XZ */
diff --git a/dlls/msvcp60/msvcp60.spec b/dlls/msvcp60/msvcp60.spec
index ee9fa34..25ee5db 100644
--- a/dlls/msvcp60/msvcp60.spec
+++ b/dlls/msvcp60/msvcp60.spec
@@ -529,16 +529,16 @@
 @ cdecl -arch=win64 ??0?$basic_filebuf at GU?$char_traits at G@std@@@std@@QEAA at PEAU_iobuf@@@Z(ptr ptr) basic_filebuf_short_ctor_file
 @ thiscall -arch=win32 ??0?$basic_filebuf at GU?$char_traits at G@std@@@std@@QAE at W4_Uninitialized@1@@Z(ptr long) basic_filebuf_short_ctor_uninitialized
 @ cdecl -arch=win64 ??0?$basic_filebuf at GU?$char_traits at G@std@@@std@@QEAA at W4_Uninitialized@1@@Z(ptr long) basic_filebuf_short_ctor_uninitialized
-@ stub -arch=win32 ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QAE at ABV01@@Z
-@ stub -arch=win64 ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QEAA at AEBV01@@Z
-@ stub -arch=win32 ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QAE at PBDH@Z
-@ stub -arch=win64 ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QEAA at PEBDH@Z
+@ thiscall -arch=win32 ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QAE at ABV01@@Z(ptr ptr long) basic_fstream_char_copy_ctor
+@ cdecl -arch=win64 ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QEAA at AEBV01@@Z(ptr ptr long) basic_fstream_char_copy_ctor
+@ thiscall -arch=win32 ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QAE at PBDH@Z(ptr str long long) basic_fstream_char_ctor_name
+@ cdecl -arch=win64 ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QEAA at PEBDH@Z(ptr str long long) basic_fstream_char_ctor_name
 @ thiscall -arch=win32 ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QAE at XZ(ptr long) basic_fstream_char_ctor
 @ cdecl -arch=win64 ??0?$basic_fstream at DU?$char_traits at D@std@@@std@@QEAA at XZ(ptr long) basic_fstream_char_ctor
-@ stub -arch=win32 ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QAE at ABV01@@Z
-@ stub -arch=win64 ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QEAA at AEBV01@@Z
-@ stub -arch=win32 ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QAE at PBDH@Z
-@ stub -arch=win64 ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QEAA at PEBDH@Z
+@ thiscall -arch=win32 ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QAE at ABV01@@Z(ptr ptr long) basic_fstream_short_copy_ctor
+@ cdecl -arch=win64 ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QEAA at AEBV01@@Z(ptr ptr long) basic_fstream_short_copy_ctor
+@ thiscall -arch=win32 ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QAE at PBDH@Z(ptr str long long) basic_fstream_short_ctor_name
+@ cdecl -arch=win64 ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QEAA at PEBDH@Z(ptr str long long) basic_fstream_short_ctor_name
 @ thiscall -arch=win32 ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QAE at XZ(ptr long) basic_fstream_short_ctor
 @ cdecl -arch=win64 ??0?$basic_fstream at GU?$char_traits at G@std@@@std@@QEAA at XZ(ptr long) basic_fstream_short_ctor
 @ thiscall -arch=win32 ??0?$basic_ifstream at DU?$char_traits at D@std@@@std@@QAE at ABV01@@Z(ptr ptr long) basic_ifstream_char_copy_ctor




More information about the wine-cvs mailing list