diff --git a/patches/msvcp140-_Equivalent/0001-msvcp140-Export-_Equivalent-and-port-tests.patch b/patches/msvcp140-_Equivalent/0001-msvcp140-Export-_Equivalent-and-port-tests.patch new file mode 100644 index 00000000..6cb4f998 --- /dev/null +++ b/patches/msvcp140-_Equivalent/0001-msvcp140-Export-_Equivalent-and-port-tests.patch @@ -0,0 +1,128 @@ +From 9148a362cb4a728762584e1daf47d8c09c24d9ba Mon Sep 17 00:00:00 2001 +From: Gijs Vermeulen +Date: Mon, 14 Jan 2019 18:07:35 +0100 +Subject: [PATCH] msvcp140: Export _Equivalent and port tests. + +Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46465 +Signed-off-by: Gijs Vermeulen +--- + dlls/msvcp140/msvcp140.spec | 2 +- + dlls/msvcp140/tests/msvcp140.c | 69 ++++++++++++++++++++++++++++++++++ + 2 files changed, 70 insertions(+), 1 deletion(-) + +diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec +index 245389e61e..6a4eb14c04 100644 +--- a/dlls/msvcp140/msvcp140.spec ++++ b/dlls/msvcp140/msvcp140.spec +@@ -3638,7 +3638,7 @@ + @ cdecl _Current_set(wstr) tr2_sys__Current_set_wchar + @ extern _Denorm _Denorm + @ cdecl _Dtest(ptr) _Dtest +-@ stub _Equivalent ++@ cdecl _Equivalent(wstr wstr) tr2_sys__Equivalent_wchar + @ cdecl _Exp(ptr double long) _Exp + @ stub _FCosh + @ extern _FDenorm _FDenorm +diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c +index 5705882c88..2ba809dc50 100644 +--- a/dlls/msvcp140/tests/msvcp140.c ++++ b/dlls/msvcp140/tests/msvcp140.c +@@ -176,6 +176,7 @@ static void (__cdecl *p__Release_chore)(_Threadpool_chore*); + static void (__cdecl *p_Close_dir)(void*); + static MSVCP_bool (__cdecl *p_Current_get)(WCHAR *); + static MSVCP_bool (__cdecl *p_Current_set)(WCHAR const *); ++static int (__cdecl *p_Equivalent)(WCHAR const*, WCHAR const*); + static ULONGLONG (__cdecl *p_File_size)(WCHAR const *); + static __int64 (__cdecl *p_Last_write_time)(WCHAR const*); + static void (__cdecl *p_Set_last_write_time)(WCHAR const*, __int64); +@@ -267,6 +268,7 @@ static BOOL init(void) + SET(p_Close_dir, "_Close_dir"); + SET(p_Current_get, "_Current_get"); + SET(p_Current_set, "_Current_set"); ++ SET(p_Equivalent, "_Equivalent"); + SET(p_File_size, "_File_size"); + SET(p_Last_write_time, "_Last_write_time"); + SET(p_Set_last_write_time, "_Set_last_write_time"); +@@ -1360,6 +1362,72 @@ static void test__Winerror_map(void) + } + } + ++static void test_Equivalent(void) ++{ ++ int val, i; ++ HANDLE file; ++ WCHAR temp_path[MAX_PATH], current_path[MAX_PATH]; ++ static const WCHAR wine_test_dirW[] = ++ {'w','i','n','e','_','t','e','s','t','_','d','i','r',0}; ++ static const WCHAR f1W[] = ++ {'w','i','n','e','_','t','e','s','t','_','d','i','r','/','f','1',0}; ++ static const WCHAR f1W_backslash[] = ++ {'w','i','n','e','_','t','e','s','t','_','d','i','r','\\','f','1',0}; ++ static const WCHAR f1W_subdir[] = ++ {'w','i','n','e','_','t','e','s','t','_','d','i','r','/','.','/','f','1',0}; ++ static const WCHAR f1W_long[] = ++ {'w','i','n','e','_','t','e','s','t','_','d','i','r','/','.','.','/','w','i','n','e','_','t','e','s','t','_','d','i','r','/','f','1',0}; ++ static const WCHAR f2W[] = ++ {'w','i','n','e','_','t','e','s','t','_','d','i','r','/','f','2',0}; ++ static const WCHAR not_existW[] = ++ {'n','o','t','_','e','x','i','s','t','s','_','f','i','l','e',0}; ++ static const struct { ++ const WCHAR *path1; ++ const WCHAR *path2; ++ int equivalent; ++ } tests[] = { ++ { NULL, NULL, -1 }, ++ { NULL, f1W, 0 }, ++ { f1W, NULL, 0 }, ++ { f1W, wine_test_dirW, 0 }, ++ { wine_test_dirW, f1W, 0 }, ++ { wine_test_dirW, wine_test_dirW, -1 }, ++ { f1W_subdir, f2W, 0 }, ++ { f1W, f1W, 1 }, ++ { not_existW, f1W, 0 }, ++ { f1W_backslash, f1W_subdir, 1 }, ++ { not_existW, not_existW, -1 }, ++ { f1W, not_existW, 0 }, ++ { f1W_long, f1W, 1 } ++ }; ++ ++ memset(current_path, 0, MAX_PATH); ++ GetCurrentDirectoryW(MAX_PATH, current_path); ++ memset(temp_path, 0, MAX_PATH); ++ GetTempPathW(MAX_PATH, temp_path); ++ ok(SetCurrentDirectoryW(temp_path), "SetCurrentDirectoryW to temp_path failed\n"); ++ CreateDirectoryW(wine_test_dirW, NULL); ++ ++ file = CreateFileW(f1W, 0, 0, NULL, CREATE_ALWAYS, 0, NULL); ++ ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); ++ CloseHandle(file); ++ file = CreateFileW(f2W, 0, 0, NULL, CREATE_ALWAYS, 0, NULL); ++ ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); ++ CloseHandle(file); ++ ++ for(i=0; i -Date: Fri, 18 Jan 2019 11:06:14 +1100 -Subject: [PATCH] msvcp140: Forward _Equivalent to tr2_sys__Equivalent_wchar - -Wine-Bug:https://bugs.winehq.org/show_bug.cgi?id=46465 ---- - dlls/msvcp140/msvcp140.spec | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec -index 245389e..6a4eb14 100644 ---- a/dlls/msvcp140/msvcp140.spec -+++ b/dlls/msvcp140/msvcp140.spec -@@ -3638,7 +3638,7 @@ - @ cdecl _Current_set(wstr) tr2_sys__Current_set_wchar - @ extern _Denorm _Denorm - @ cdecl _Dtest(ptr) _Dtest --@ stub _Equivalent -+@ cdecl _Equivalent(wstr wstr) tr2_sys__Equivalent_wchar - @ cdecl _Exp(ptr double long) _Exp - @ stub _FCosh - @ extern _FDenorm _FDenorm --- -1.9.1 - diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 3b20b470..321c2ee0 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -4228,12 +4228,12 @@ fi # | * [#46465] msvcp140: Forward _Equivalent to tr2_sys__Equivalent_wchar # | # | Modified files: -# | * dlls/msvcp140/msvcp140.spec +# | * dlls/msvcp140/msvcp140.spec, dlls/msvcp140/tests/msvcp140.c # | if test "$enable_msvcp140__Equivalent" -eq 1; then - patch_apply msvcp140-_Equivalent/0001-msvcp140-Forward-_Equivalent-to-tr2_sys__Equivalent_.patch + patch_apply msvcp140-_Equivalent/0001-msvcp140-Export-_Equivalent-and-port-tests.patch ( - printf '%s\n' '+ { "Gijs Vermeulen", "msvcp140: Forward _Equivalent to tr2_sys__Equivalent_wchar.", 1 },'; + printf '%s\n' '+ { "Gijs Vermeulen", "msvcp140: Export _Equivalent and port tests.", 1 },'; ) >> "$patchlist" fi