Based on a patch by Yeshun Ye.
From: Piotr Caban piotr@codeweavers.com
Based on a patch by Yeshun Ye. --- dlls/msvcp60/ios.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcp60/ios.c b/dlls/msvcp60/ios.c index 1fef80f8a43..3da714375f4 100644 --- a/dlls/msvcp60/ios.c +++ b/dlls/msvcp60/ios.c @@ -26,6 +26,7 @@ #include "msvcp.h" #include "windef.h" #include "winbase.h" +#include "windows.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
@@ -2128,7 +2129,7 @@ FILE* __cdecl ___Fiopen(const char *name, int mode)
TRACE("(%p %d)\n", name, mode);
- if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0) + if(!MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, FILENAME_MAX-1)) return NULL; return _Fiopen_wchar(nameW, mode, _SH_DENYNO); }
From: Piotr Caban piotr@codeweavers.com
Based on a patch by Yeshun Ye. --- dlls/msvcp90/ios.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c index ef2c122f17f..a8014a3dfcf 100644 --- a/dlls/msvcp90/ios.c +++ b/dlls/msvcp90/ios.c @@ -3262,8 +3262,13 @@ FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
TRACE("(%s %d %d)\n", name, mode, prot);
+#if _MSVCP_VER >= 71 && _MSVCP_VER <= 90 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0) return NULL; +#else + if(!MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, FILENAME_MAX-1)) + return NULL; +#endif return _Fiopen_wchar(nameW, mode, prot); }