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