1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

msvcp60: Use 'MultiByteToWideChar' in __Fiopen implementation.

Based on a patch by Yeshun Ye.
This commit is contained in:
Piotr Caban 2022-08-09 19:29:17 +02:00 committed by Alexandre Julliard
parent dc1fa72d1d
commit fb54c4e0a4

View File

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