Piotr Caban : msvcp90: Added _Fiopen functions implementation.

Alexandre Julliard julliard at winehq.org
Wed Jun 27 19:13:59 CDT 2012


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Jun 27 11:16:44 2012 +0200

msvcp90: Added _Fiopen functions implementation.

---

 dlls/msvcp90/ios.c        |   47 +++++++++++++++++++++++++++++++++++---------
 dlls/msvcp90/msvcp90.spec |   12 +++++-----
 2 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index 0950077..ae9e519 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -2036,12 +2036,9 @@ MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
     return this->file != NULL;
 }
 
-/* ?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 */
-DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
-basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
+/* ?_Fiopen at std@@YAPAU_iobuf@@PB_WHH at Z */
+/* ?_Fiopen at std@@YAPEAU_iobuf@@PEB_WHH at Z */
+FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
 {
     static const wchar_t rW[] = {'r',0};
     static const struct {
@@ -2064,10 +2061,7 @@ basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char
     int mode_idx;
     FILE *f = NULL;
 
-    TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
-
-    if(basic_filebuf_char_is_open(this))
-        return NULL;
+    TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
 
     for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
         if(str_mode[mode_idx].mode == real_mode)
@@ -2096,6 +2090,39 @@ basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char
         return NULL;
     }
 
+    return f;
+}
+
+/* ?_Fiopen at std@@YAPAU_iobuf@@PBDHH at Z */
+/* ?_Fiopen at std@@YAPEAU_iobuf@@PEBDHH at Z */
+FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
+{
+    wchar_t nameW[FILENAME_MAX];
+
+    TRACE("(%s %d %d)\n", name, mode, prot);
+
+    if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
+        return NULL;
+    return _Fiopen_wchar(nameW, mode, prot);
+}
+
+/* ?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 */
+DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
+basic_filebuf_char* __thiscall 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;
diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec
index 7126603..ff042d9 100644
--- a/dlls/msvcp90/msvcp90.spec
+++ b/dlls/msvcp90/msvcp90.spec
@@ -2206,12 +2206,12 @@
 @ cdecl -arch=win64 ?_Ffmt@?$num_put at _WV?$ostreambuf_iterator at _WU?$char_traits at _W@std@@@std@@@std@@AEBAPEADPEADDH at Z(ptr ptr long long) num_put_wchar__Ffmt
 @ thiscall -arch=win32 ?_Findarr at ios_base@std@@AAEAAU_Iosarray at 12@H at Z(ptr long) ios_base_Findarr
 @ cdecl -arch=win64 ?_Findarr at ios_base@std@@AEAAAEAU_Iosarray at 12@H at Z(ptr long) ios_base_Findarr
-@ stub -arch=win32 ?_Fiopen at std@@YAPAU_iobuf@@PBDHH at Z
-@ stub -arch=win64 ?_Fiopen at std@@YAPEAU_iobuf@@PEBDHH at Z
-@ stub -arch=win32 ?_Fiopen at std@@YAPAU_iobuf@@PBGHH at Z
-@ stub -arch=win64 ?_Fiopen at std@@YAPEAU_iobuf@@PEBGHH at Z
-@ stub -arch=win32 ?_Fiopen at std@@YAPAU_iobuf@@PB_WHH at Z
-@ stub -arch=win64 ?_Fiopen at std@@YAPEAU_iobuf@@PEB_WHH at Z
+@ cdecl -arch=win32 ?_Fiopen at std@@YAPAU_iobuf@@PBDHH at Z(str long long) _Fiopen
+@ cdecl -arch=win64 ?_Fiopen at std@@YAPEAU_iobuf@@PEBDHH at Z(str long long) _Fiopen
+@ cdecl -arch=win32 ?_Fiopen at std@@YAPAU_iobuf@@PBGHH at Z(wstr long long) _Fiopen_wchar
+@ cdecl -arch=win64 ?_Fiopen at std@@YAPEAU_iobuf@@PEBGHH at Z(wstr long long) _Fiopen_wchar
+@ cdecl -arch=win32 ?_Fiopen at std@@YAPAU_iobuf@@PB_WHH at Z(wstr long long) _Fiopen_wchar
+@ cdecl -arch=win64 ?_Fiopen at std@@YAPEAU_iobuf@@PEB_WHH at Z(wstr long long) _Fiopen_wchar
 @ cdecl -arch=win32 ?_Fput@?$num_put at DV?$ostreambuf_iterator at DU?$char_traits at D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator at DU?$char_traits at D@std@@@2 at V32@AAVios_base at 2@DPBDIIII at Z(ptr ptr long ptr ptr long str long long long long) num_put_char__Fput
 @ cdecl -arch=win64 ?_Fput@?$num_put at DV?$ostreambuf_iterator at DU?$char_traits at D@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator at DU?$char_traits at D@std@@@2 at V32@AEAVios_base at 2@DPEBD_K333 at Z(ptr ptr ptr ptr long str long long long long) num_put_char__Fput
 @ stub -arch=win32 ?_Fput@?$num_put at GV?$ostreambuf_iterator at GU?$char_traits at G@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator at GU?$char_traits at G@std@@@2 at V32@AAVios_base at 2@GPBDIIII at Z




More information about the wine-cvs mailing list