[PATCH 4/5] msvcp: Implement the WCHAR version of _Link.

Stefan Dösinger stefan at codeweavers.com
Tue Oct 10 10:09:45 CDT 2017


Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
---
 dlls/msvcp120/msvcp120.spec |  4 ++--
 dlls/msvcp140/msvcp140.spec |  2 +-
 dlls/msvcp90/ios.c          | 14 ++++++++++++++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec
index 3b29e739c9..ae1ac5792d 100644
--- a/dlls/msvcp120/msvcp120.spec
+++ b/dlls/msvcp120/msvcp120.spec
@@ -1533,8 +1533,8 @@
 @ cdecl -arch=win64 ?_Launch at _Pad@std@@QEAAXPEAU_Thrd_imp_t@@@Z(ptr ptr) _Pad__Launch
 @ cdecl -arch=win32 ?_Link at sys@tr2 at std@@YAHPBD0 at Z(str str) tr2_sys__Link
 @ cdecl -arch=win64 ?_Link at sys@tr2 at std@@YAHPEBD0 at Z(str str) tr2_sys__Link
-@ stub -arch=win32 ?_Link at sys@tr2 at std@@YAHPB_W0 at Z
-@ stub -arch=win64 ?_Link at sys@tr2 at std@@YAHPEB_W0 at Z
+@ cdecl -arch=win32 ?_Link at sys@tr2 at std@@YAHPB_W0 at Z(wstr wstr) tr2_sys__Link_wchar
+@ cdecl -arch=win64 ?_Link at sys@tr2 at std@@YAHPEB_W0 at Z(wstr wstr) tr2_sys__Link_wchar
 @ cdecl -arch=win32 ?_Locimp_Addfac at _Locimp@locale at std@@CAXPAV123 at PAVfacet@23 at I@Z(ptr ptr long) locale__Locimp__Locimp_Addfac
 @ cdecl -arch=win64 ?_Locimp_Addfac at _Locimp@locale at std@@CAXPEAV123 at PEAVfacet@23 at _K@Z(ptr ptr long) locale__Locimp__Locimp_Addfac
 @ cdecl -arch=win32 ?_Locimp_ctor at _Locimp@locale at std@@CAXPAV123 at ABV123@@Z(ptr ptr) locale__Locimp__Locimp_ctor
diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec
index 54098534b4..08f1ff479f 100644
--- a/dlls/msvcp140/msvcp140.spec
+++ b/dlls/msvcp140/msvcp140.spec
@@ -3667,7 +3667,7 @@
 @ stub _LSinh
 @ extern _LSnan _LSnan
 @ stub _Last_write_time
-@ stub _Link
+@ cdecl _Link(wstr wstr) tr2_sys__Link_wchar
 @ cdecl _Lock_shared_ptr_spin_lock()
 @ cdecl _Lstat(wstr ptr)
 @ cdecl _Make_dir(wstr) tr2_sys__Make_dir_wchar
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index c6f06ff92e..5d2f0ca9c6 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -15036,6 +15036,20 @@ int __cdecl tr2_sys__Link(char const* existing_path, char const* new_path)
     return GetLastError();
 }
 
+/* ?_Link at sys@tr2 at std@@YAHPB_W0 at Z */
+/* ?_Link at sys@tr2 at std@@YAHPEB_W0 at Z */
+/* _Link */
+int __cdecl tr2_sys__Link_wchar(WCHAR const* existing_path, WCHAR const* new_path)
+{
+    TRACE("(%s %s)\n", debugstr_w(existing_path), debugstr_w(new_path));
+    if(!existing_path || !new_path)
+        return ERROR_INVALID_PARAMETER;
+
+    if(CreateHardLinkW(new_path, existing_path, NULL))
+        return ERROR_SUCCESS;
+    return GetLastError();
+}
+
 /* ?_Symlink at sys@tr2 at std@@YAHPBD0 at Z */
 /* ?_Symlink at sys@tr2 at std@@YAHPEBD0 at Z */
 int __cdecl tr2_sys__Symlink(char const* existing_file_name, char const* file_name)
-- 
2.13.6




More information about the wine-patches mailing list