Piotr Caban : msvcp90: Use 'MultiByteToWideChar' in _Fiopen implementation.

Alexandre Julliard julliard at winehq.org
Mon Aug 15 15:22:31 CDT 2022


Module: wine
Branch: master
Commit: 8c46e2a85b588273fc6c6123b3b542e5b25d8d2e
URL:    https://gitlab.winehq.org/wine/wine/-/commit/8c46e2a85b588273fc6c6123b3b542e5b25d8d2e

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Aug  9 19:30:00 2022 +0200

msvcp90: Use 'MultiByteToWideChar' in _Fiopen implementation.

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);
 }
 




More information about the wine-cvs mailing list