Piotr Caban : msvcp90: Added _Fiopen functions implementation.
Module: wine Branch: master Commit: ccb4c4846641b81baddfd854c63b78f9092bf5a6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ccb4c4846641b81baddfd854c6... Author: Piotr Caban <piotr(a)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(a)DU?$char_traits(a)D@std@@@std@@QAEPAV12(a)PB_WHH@Z */ -/* ?open@?$basic_filebuf(a)DU?$char_traits(a)D@std@@@std@@QEAAPEAV12(a)PEB_WHH@Z */ -/* ?open@?$basic_filebuf(a)DU?$char_traits(a)D@std@@@std@@QAEPAV12(a)PBGHH@Z */ -/* ?open@?$basic_filebuf(a)DU?$char_traits(a)D@std@@@std@@QEAAPEAV12(a)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(a)std@@YAPAU_iobuf@@PB_WHH(a)Z */ +/* ?_Fiopen(a)std@@YAPEAU_iobuf@@PEB_WHH(a)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(a)std@@YAPAU_iobuf@@PBDHH(a)Z */ +/* ?_Fiopen(a)std@@YAPEAU_iobuf@@PEBDHH(a)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(a)DU?$char_traits(a)D@std@@@std@@QAEPAV12(a)PB_WHH@Z */ +/* ?open@?$basic_filebuf(a)DU?$char_traits(a)D@std@@@std@@QEAAPEAV12(a)PEB_WHH@Z */ +/* ?open@?$basic_filebuf(a)DU?$char_traits(a)D@std@@@std@@QAEPAV12(a)PBGHH@Z */ +/* ?open@?$basic_filebuf(a)DU?$char_traits(a)D@std@@@std@@QEAAPEAV12(a)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(a)_WV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@std@@@std@@AEBAPEADPEADDH(a)Z(ptr ptr long long) num_put_wchar__Ffmt @ thiscall -arch=win32 ?_Findarr(a)ios_base@std@@AAEAAU_Iosarray(a)12@H(a)Z(ptr long) ios_base_Findarr @ cdecl -arch=win64 ?_Findarr(a)ios_base@std@@AEAAAEAU_Iosarray(a)12@H(a)Z(ptr long) ios_base_Findarr -@ stub -arch=win32 ?_Fiopen(a)std@@YAPAU_iobuf@@PBDHH(a)Z -@ stub -arch=win64 ?_Fiopen(a)std@@YAPEAU_iobuf@@PEBDHH(a)Z -@ stub -arch=win32 ?_Fiopen(a)std@@YAPAU_iobuf@@PBGHH(a)Z -@ stub -arch=win64 ?_Fiopen(a)std@@YAPEAU_iobuf@@PEBGHH(a)Z -@ stub -arch=win32 ?_Fiopen(a)std@@YAPAU_iobuf@@PB_WHH(a)Z -@ stub -arch=win64 ?_Fiopen(a)std@@YAPEAU_iobuf@@PEB_WHH(a)Z +@ cdecl -arch=win32 ?_Fiopen(a)std@@YAPAU_iobuf@@PBDHH(a)Z(str long long) _Fiopen +@ cdecl -arch=win64 ?_Fiopen(a)std@@YAPEAU_iobuf@@PEBDHH(a)Z(str long long) _Fiopen +@ cdecl -arch=win32 ?_Fiopen(a)std@@YAPAU_iobuf@@PBGHH(a)Z(wstr long long) _Fiopen_wchar +@ cdecl -arch=win64 ?_Fiopen(a)std@@YAPEAU_iobuf@@PEBGHH(a)Z(wstr long long) _Fiopen_wchar +@ cdecl -arch=win32 ?_Fiopen(a)std@@YAPAU_iobuf@@PB_WHH(a)Z(wstr long long) _Fiopen_wchar +@ cdecl -arch=win64 ?_Fiopen(a)std@@YAPEAU_iobuf@@PEB_WHH(a)Z(wstr long long) _Fiopen_wchar @ cdecl -arch=win32 ?_Fput@?$num_put(a)DV?$ostreambuf_iterator(a)DU?$char_traits(a)D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator(a)DU?$char_traits(a)D@std@@@2(a)V32@AAVios_base(a)2@DPBDIIII(a)Z(ptr ptr long ptr ptr long str long long long long) num_put_char__Fput @ cdecl -arch=win64 ?_Fput@?$num_put(a)DV?$ostreambuf_iterator(a)DU?$char_traits(a)D@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator(a)DU?$char_traits(a)D@std@@@2(a)V32@AEAVios_base(a)2@DPEBD_K333(a)Z(ptr ptr ptr ptr long str long long long long) num_put_char__Fput @ stub -arch=win32 ?_Fput@?$num_put(a)GV?$ostreambuf_iterator(a)GU?$char_traits(a)G@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator(a)GU?$char_traits(a)G@std@@@2(a)V32@AAVios_base(a)2@GPBDIIII(a)Z
participants (1)
-
Alexandre Julliard