[PATCH 1/4] msvcp: Implement the WCHAR version of _Unlink.

Stefan Dösinger stefan at codeweavers.com
Tue Oct 10 10:02:35 CDT 2017


Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>

---

I'm not making the ascii version call WCHAR because converting the path
needs more code than what the function itself does.
---
 dlls/msvcp120/msvcp120.spec |  4 ++--
 dlls/msvcp140/msvcp140.spec |  2 +-
 dlls/msvcp90/ios.c          | 12 ++++++++++++
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec
index b3f2223af0..4d46be44bd 100644
--- a/dlls/msvcp120/msvcp120.spec
+++ b/dlls/msvcp120/msvcp120.spec
@@ -1768,8 +1768,8 @@
 @ cdecl -arch=win64 ?_Tidy at ios_base@std@@AEAAXXZ(ptr) ios_base_Tidy
 @ cdecl -arch=win32 ?_Unlink at sys@tr2 at std@@YAHPBD at Z(str) tr2_sys__Unlink
 @ cdecl -arch=win64 ?_Unlink at sys@tr2 at std@@YAHPEBD at Z(str) tr2_sys__Unlink
-@ stub -arch=win32 ?_Unlink at sys@tr2 at std@@YAHPB_W at Z
-@ stub -arch=win64 ?_Unlink at sys@tr2 at std@@YAHPEB_W at Z
+@ cdecl -arch=win32 ?_Unlink at sys@tr2 at std@@YAHPB_W at Z(wstr) tr2_sys__Unlink_wchar
+@ cdecl -arch=win64 ?_Unlink at sys@tr2 at std@@YAHPEB_W at Z(wstr) tr2_sys__Unlink_wchar
 @ cdecl -arch=arm ?_Unlock@?$basic_streambuf at DU?$char_traits at D@std@@@std@@UAAXXZ(ptr) basic_streambuf_char__Unlock
 @ thiscall -arch=i386 ?_Unlock@?$basic_streambuf at DU?$char_traits at D@std@@@std@@UAEXXZ(ptr) basic_streambuf_char__Unlock
 @ cdecl -arch=win64 ?_Unlock@?$basic_streambuf at DU?$char_traits at D@std@@@std@@UEAAXXZ(ptr) basic_streambuf_char__Unlock
diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec
index 80840db459..74ff305166 100644
--- a/dlls/msvcp140/msvcp140.spec
+++ b/dlls/msvcp140/msvcp140.spec
@@ -3737,7 +3737,7 @@
 @ cdecl _Toupper(long ptr) _Toupper
 @ cdecl _Towlower(long ptr) _Towlower
 @ cdecl _Towupper(long ptr) _Towupper
-@ stub _Unlink
+@ cdecl _Unlink(wstr) tr2_sys__Unlink_wchar
 @ cdecl _Unlock_shared_ptr_spin_lock()
 @ stub _WStod
 @ stub _WStodx
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index 28deae081d..36e5067e1f 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -15060,6 +15060,18 @@ int __cdecl tr2_sys__Unlink(char const* path)
     return GetLastError();
 }
 
+/* ?_Unlink at sys@tr2 at std@@YAHPB_W at Z */
+/* ?_Unlink at sys@tr2 at std@@YAHPEB_W at Z */
+/* _Unlink */
+int __cdecl tr2_sys__Unlink_wchar(WCHAR const* path)
+{
+    TRACE("(%s)\n", debugstr_w(path));
+
+    if(DeleteFileW(path))
+        return ERROR_SUCCESS;
+    return GetLastError();
+}
+
 /* ??0strstream at std@@QAE at PADHH@Z */
 /* ??0strstream at std@@QEAA at PEAD_JH@Z */
 #if STREAMSIZE_BITS == 64
-- 
2.13.6




More information about the wine-patches mailing list