Piotr Caban : msvcp60: Use 'MultiByteToWideChar' in __Fiopen implementation.

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


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

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

msvcp60: Use 'MultiByteToWideChar' in __Fiopen implementation.

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




More information about the wine-cvs mailing list