Piotr Caban : msvcp60: Added basic_filebuf::open implementation.

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


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

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

msvcp60: Added basic_filebuf::open implementation.

---

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

diff --git a/dlls/msvcp60/ios.c b/dlls/msvcp60/ios.c
index cf3620a..8d7381a 100644
--- a/dlls/msvcp60/ios.c
+++ b/dlls/msvcp60/ios.c
@@ -2491,6 +2491,58 @@ FILE* __cdecl ___Fiopen(const char *name, int mode)
     return _Fiopen(name, mode, _SH_DENYNO);
 }
 
+/* ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QAEPAV12 at PB_WHH@Z */
+/* ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QEAAPEAV12 at PEB_WHH@Z */
+/* ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QAEPAV12 at PBGHH@Z */
+/* ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QEAAPEAV12 at PEBGHH@Z */
+static basic_filebuf_char* basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
+{
+    FILE *f = NULL;
+
+    TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
+
+    if(basic_filebuf_char_is_open(this))
+        return NULL;
+
+    if(!(f = _Fiopen_wchar(name, mode, prot)))
+        return NULL;
+
+    basic_filebuf_char__Init(this, f, INITFL_open);
+    basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(this->base.loc));
+    return this;
+}
+
+/* ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QAEPAV12 at PBDHH@Z */
+/* ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QEAAPEAV12 at PEBDHH@Z */
+static basic_filebuf_char* basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
+{
+    wchar_t nameW[FILENAME_MAX];
+
+    TRACE("(%p %s %d %d)\n", this, name, mode, prot);
+
+    if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
+        return NULL;
+    return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
+}
+
+/* ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QAEPAV12 at PBDF@Z */
+/* ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QEAAPEAV12 at PEBDF@Z */
+DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode_old, 12)
+basic_filebuf_char* __thiscall basic_filebuf_char_open_mode_old(basic_filebuf_char *this, const char *name, short mode)
+{
+    TRACE("(%p %p %d)\n", this, name, mode);
+    return basic_filebuf_char_open(this, name, mode, _SH_DENYNO);
+}
+
+/* ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QAEPAV12 at PBDH@Z */
+/* ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QEAAPEAV12 at PEBDH@Z */
+DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
+basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, int mode)
+{
+    TRACE("(%p %p %d)\n", this, name, mode);
+    return basic_filebuf_char_open(this, name, mode, _SH_DENYNO);
+}
+
 /* ?overflow@?$basic_filebuf at DU?$char_traits at D@std@@@std@@MAEHH at Z */
 /* ?overflow@?$basic_filebuf at DU?$char_traits at D@std@@@std@@MEAAHH at Z */
 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
@@ -2955,6 +3007,58 @@ MSVCP_bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *thi
     return this->file != NULL;
 }
 
+/* ?open@?$basic_filebuf at _WU?$char_traits at _W@std@@@std@@QAEPAV12 at PB_WHH@Z */
+/* ?open@?$basic_filebuf at _WU?$char_traits at _W@std@@@std@@QEAAPEAV12 at PEB_WHH@Z */
+/* ?open@?$basic_filebuf at _WU?$char_traits at _W@std@@@std@@QAEPAV12 at PBGHH@Z */
+/* ?open@?$basic_filebuf at _WU?$char_traits at _W@std@@@std@@QEAAPEAV12 at PEBGHH@Z */
+static basic_filebuf_wchar* basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
+{
+    FILE *f = NULL;
+
+    TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
+
+    if(basic_filebuf_wchar_is_open(this))
+        return NULL;
+
+    if(!(f = _Fiopen_wchar(name, mode, prot)))
+        return NULL;
+
+    basic_filebuf_wchar__Init(this, f, INITFL_open);
+    basic_filebuf_wchar__Initcvt(this, codecvt_wchar_use_facet(this->base.loc));
+    return this;
+}
+
+/* ?open@?$basic_filebuf at _WU?$char_traits at _W@std@@@std@@QAEPAV12 at PBDHH@Z */
+/* ?open@?$basic_filebuf at _WU?$char_traits at _W@std@@@std@@QEAAPEAV12 at PEBDHH@Z */
+static basic_filebuf_wchar* basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
+{
+    wchar_t nameW[FILENAME_MAX];
+
+    TRACE("(%p %s %d %d)\n", this, name, mode, prot);
+
+    if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
+        return NULL;
+    return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
+}
+
+/* ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QAEPAV12 at PBDF@Z */
+/* ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QEAAPEAV12 at PEBDF@Z */
+DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode_old, 12)
+basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode_old(basic_filebuf_wchar *this, const char *name, short mode)
+{
+    TRACE("(%p %p %d)\n", this, name, mode);
+    return basic_filebuf_wchar_open(this, name, mode, _SH_DENYNO);
+}
+
+/* ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QAEPAV12 at PBDH@Z */
+/* ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QEAAPEAV12 at PEBDH@Z */
+DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
+basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, int mode)
+{
+    TRACE("(%p %p %d)\n", this, name, mode);
+    return basic_filebuf_wchar_open(this, name, mode, _SH_DENYNO);
+}
+
 /* ?overflow@?$basic_filebuf at _WU?$char_traits at _W@std@@@std@@MAEGG at Z */
 /* ?overflow@?$basic_filebuf at _WU?$char_traits at _W@std@@@std@@MEAAGG at Z */
 /* ?overflow@?$basic_filebuf at GU?$char_traits at G@std@@@std@@MAEGG at Z */
diff --git a/dlls/msvcp60/msvcp60.spec b/dlls/msvcp60/msvcp60.spec
index e6bf596..9301a6f 100644
--- a/dlls/msvcp60/msvcp60.spec
+++ b/dlls/msvcp60/msvcp60.spec
@@ -3498,14 +3498,14 @@
 @ extern -arch=win64 ?npos@?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@2_KB basic_string_char_npos
 @ extern -arch=win32 ?npos@?$basic_string at GU?$char_traits at G@std@@V?$allocator at G@2@@std@@2IB basic_string_wchar_npos
 @ extern -arch=win64 ?npos@?$basic_string at GU?$char_traits at G@std@@V?$allocator at G@2@@std@@2_KB basic_string_wchar_npos
-@ stub -arch=win32 ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QAEPAV12 at PBDF@Z
-@ stub -arch=win64 ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QEAAPEAV12 at PEBDF@Z
-@ stub -arch=win32 ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QAEPAV12 at PBDH@Z
-@ stub -arch=win64 ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QEAAPEAV12 at PEBDH@Z
-@ stub -arch=win32 ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QAEPAV12 at PBDF@Z
-@ stub -arch=win64 ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QEAAPEAV12 at PEBDF@Z
-@ stub -arch=win32 ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QAEPAV12 at PBDH@Z
-@ stub -arch=win64 ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QEAAPEAV12 at PEBDH@Z
+@ thiscall -arch=win32 ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QAEPAV12 at PBDF@Z(ptr str long) basic_filebuf_char_open_mode_old
+@ cdecl -arch=win64 ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QEAAPEAV12 at PEBDF@Z(ptr str long) basic_filebuf_char_open_mode_old
+@ thiscall -arch=win32 ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QAEPAV12 at PBDH@Z(ptr str long) basic_filebuf_char_open_mode
+@ cdecl -arch=win64 ?open@?$basic_filebuf at DU?$char_traits at D@std@@@std@@QEAAPEAV12 at PEBDH@Z(ptr str long) basic_filebuf_char_open_mode
+@ thiscall -arch=win32 ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QAEPAV12 at PBDF@Z(ptr str long) basic_filebuf_wchar_open_mode_old
+@ cdecl -arch=win64 ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QEAAPEAV12 at PEBDF@Z(ptr str long) basic_filebuf_wchar_open_mode_old
+@ thiscall -arch=win32 ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QAEPAV12 at PBDH@Z(ptr str long) basic_filebuf_wchar_open_mode
+@ cdecl -arch=win64 ?open@?$basic_filebuf at GU?$char_traits at G@std@@@std@@QEAAPEAV12 at PEBDH@Z(ptr str long) basic_filebuf_wchar_open_mode
 @ stub -arch=win32 ?open@?$basic_fstream at DU?$char_traits at D@std@@@std@@QAEXPBDF at Z
 @ stub -arch=win64 ?open@?$basic_fstream at DU?$char_traits at D@std@@@std@@QEAAXPEBDF at Z
 @ stub -arch=win32 ?open@?$basic_fstream at DU?$char_traits at D@std@@@std@@QAEXPBDH at Z




More information about the wine-cvs mailing list