From: Daniel Lehman dlehman25@gmail.com
--- dlls/msvcp140/tests/msvcp140.c | 15 ++++++--------- dlls/msvcp90/ios.c | 6 ++++++ 2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index 413d157de70..37c340fdce6 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -1709,14 +1709,13 @@ static void test__Fiopen(void) const char *loc; UINT cp; const WCHAR *path; - int is_todo; } tests[] = { - { "German.utf8", 0, L"t\x00e4\x00cf\x00f6\x00df.txt", TRUE }, - { "Polish.utf8", 0, L"t\x0119\x015b\x0107.txt", TRUE }, - { "Turkish.utf8", 0, L"t\x00c7\x011e\x0131\x0130\x015e.txt", TRUE }, - { "Arabic.utf8", 0, L"t\x062a\x0686.txt", TRUE }, - { "Japanese.utf8", 0, L"t\x30af\x30e4.txt", TRUE }, - { "Chinese.utf8", 0, L"t\x4e02\x9f6b.txt", TRUE }, + { "German.utf8", 0, L"t\x00e4\x00cf\x00f6\x00df.txt" }, + { "Polish.utf8", 0, L"t\x0119\x015b\x0107.txt" }, + { "Turkish.utf8", 0, L"t\x00c7\x011e\x0131\x0130\x015e.txt" }, + { "Arabic.utf8", 0, L"t\x062a\x0686.txt" }, + { "Japanese.utf8", 0, L"t\x30af\x30e4.txt" }, + { "Chinese.utf8", 0, L"t\x4e02\x9f6b.txt" },
{ "German.1252", 1252, L"t\x00e4\x00cf\x00f6\x00df.txt" }, { "Polish.1250", 1250, L"t\x0119\x015b\x0107.txt" }, @@ -1768,7 +1767,6 @@ static void test__Fiopen(void) p_fclose(f);
f = p__Fiopen(apath, OPENMODE_in, SH_DENYNO); - todo_wine_if(tests[i].is_todo) ok(!!f, "failed to read %s with locale %s\n", apath, tests[i].loc); if(f) p_fclose(f);
@@ -1797,7 +1795,6 @@ static void test__Fiopen(void) p_fclose(f);
f = p__Fiopen_wchar(wpath, OPENMODE_in, SH_DENYNO); - todo_wine_if(tests[i].is_todo) ok(!!f, "failed to read %s with locale %s\n", wine_dbgstr_w(wpath), tests_a[i].loc); if(f) p_fclose(f);
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c index 5b791cd4345..e2839cf395f 100644 --- a/dlls/msvcp90/ios.c +++ b/dlls/msvcp90/ios.c @@ -28,6 +28,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
+unsigned int __cdecl ___lc_codepage_func(void); + #define SECSPERDAY 86400 /* 1601 to 1970 is 369 years plus 89 leap days */ #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY) @@ -3275,6 +3277,10 @@ FILE* __cdecl _Fiopen(const char *name, int mode, int prot) #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0) return NULL; +#elif _MSVCP_VER >= 140 + if(!MultiByteToWideChar(___lc_codepage_func() == CP_UTF8 ? CP_UTF8 : CP_ACP, + 0, name, -1, nameW, FILENAME_MAX-1)) + return NULL; #else if(!MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, FILENAME_MAX-1)) return NULL;