YongHao Hu : msvcp110: Add tr2_sys__Current_set_wchar implementation and test.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 17 09:01:13 CDT 2015


Module: wine
Branch: master
Commit: e55149f8ae6cec76bf910e9e3e37b0457357394a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e55149f8ae6cec76bf910e9e3e37b0457357394a

Author: YongHao Hu <christopherwuy at gmail.com>
Date:   Mon Aug 10 14:45:28 2015 +0800

msvcp110: Add tr2_sys__Current_set_wchar implementation and test.

---

 dlls/msvcp110/msvcp110.spec         | 4 ++--
 dlls/msvcp120/msvcp120.spec         | 4 ++--
 dlls/msvcp120/tests/msvcp120.c      | 8 +++++++-
 dlls/msvcp120_app/msvcp120_app.spec | 4 ++--
 dlls/msvcp90/ios.c                  | 8 ++++++++
 5 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec
index 02d80f9..ff513b3 100644
--- a/dlls/msvcp110/msvcp110.spec
+++ b/dlls/msvcp110/msvcp110.spec
@@ -1173,8 +1173,8 @@
 @ cdecl -arch=win64 ?_Current_get at sys@tr2 at std@@YAPEA_WPEA_W at Z(ptr) tr2_sys__Current_get_wchar
 @ cdecl -arch=win32 ?_Current_set at sys@tr2 at std@@YA_NPBD at Z(str) tr2_sys__Current_set
 @ cdecl -arch=win64 ?_Current_set at sys@tr2 at std@@YA_NPEBD at Z(str) tr2_sys__Current_set
-@ stub -arch=win32 ?_Current_set at sys@tr2 at std@@YA_NPB_W at Z
-@ stub -arch=win64 ?_Current_set at sys@tr2 at std@@YA_NPEB_W at Z
+@ cdecl -arch=win32 ?_Current_set at sys@tr2 at std@@YA_NPB_W at Z(wstr) tr2_sys__Current_set_wchar
+@ cdecl -arch=win64 ?_Current_set at sys@tr2 at std@@YA_NPEB_W at Z(wstr) tr2_sys__Current_set_wchar
 @ cdecl -arch=arm ?_Decref at facet@locale at std@@UAAPAV_Facet_base at 3@XZ(ptr) locale_facet__Decref
 @ thiscall -arch=i386 ?_Decref at facet@locale at std@@UAEPAV_Facet_base at 3@XZ(ptr) locale_facet__Decref
 @ cdecl -arch=win64 ?_Decref at facet@locale at std@@UEAAPEAV_Facet_base at 3@XZ(ptr) locale_facet__Decref
diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec
index d431268..8348a3f 100644
--- a/dlls/msvcp120/msvcp120.spec
+++ b/dlls/msvcp120/msvcp120.spec
@@ -1138,8 +1138,8 @@
 @ cdecl -arch=win64 ?_Current_get at sys@tr2 at std@@YAPEA_WAEAY0BAE at _W@Z(ptr) tr2_sys__Current_get_wchar
 @ cdecl -arch=win32 ?_Current_set at sys@tr2 at std@@YA_NPBD at Z(str) tr2_sys__Current_set
 @ cdecl -arch=win64 ?_Current_set at sys@tr2 at std@@YA_NPEBD at Z(str) tr2_sys__Current_set
-@ stub -arch=win32 ?_Current_set at sys@tr2 at std@@YA_NPB_W at Z
-@ stub -arch=win64 ?_Current_set at sys@tr2 at std@@YA_NPEB_W at Z
+@ cdecl -arch=win32 ?_Current_set at sys@tr2 at std@@YA_NPB_W at Z(wstr) tr2_sys__Current_set_wchar
+@ cdecl -arch=win64 ?_Current_set at sys@tr2 at std@@YA_NPEB_W at Z(wstr) tr2_sys__Current_set_wchar
 @ cdecl -arch=arm ?_Decref at facet@locale at std@@UAAPAV_Facet_base at 3@XZ(ptr) locale_facet__Decref
 @ thiscall -arch=i386 ?_Decref at facet@locale at std@@UAEPAV_Facet_base at 3@XZ(ptr) locale_facet__Decref
 @ cdecl -arch=win64 ?_Decref at facet@locale at std@@UEAAPEAV_Facet_base at 3@XZ(ptr) locale_facet__Decref
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index a81c928..07277b3 100644
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -79,6 +79,7 @@ static int (__cdecl *p_tr2_sys__Equivalent_wchar)(WCHAR const*, WCHAR const*);
 static char* (__cdecl *p_tr2_sys__Current_get)(char *);
 static WCHAR* (__cdecl *p_tr2_sys__Current_get_wchar)(WCHAR *);
 static MSVCP_bool (__cdecl *p_tr2_sys__Current_set)(char const*);
+static MSVCP_bool (__cdecl *p_tr2_sys__Current_set_wchar)(WCHAR const*);
 static int (__cdecl *p_tr2_sys__Make_dir)(char const*);
 static MSVCP_bool (__cdecl *p_tr2_sys__Remove_dir)(char const*);
 static int (__cdecl *p_tr2_sys__Copy_file)(char const*, char const*, MSVCP_bool);
@@ -128,6 +129,8 @@ static BOOL init(void)
                 "?_Current_get at sys@tr2 at std@@YAPEA_WAEAY0BAE at _W@Z");
         SET(p_tr2_sys__Current_set,
                 "?_Current_set at sys@tr2 at std@@YA_NPEBD at Z");
+        SET(p_tr2_sys__Current_set_wchar,
+                "?_Current_set at sys@tr2 at std@@YA_NPEB_W at Z");
         SET(p_tr2_sys__Make_dir,
                 "?_Make_dir at sys@tr2 at std@@YAHPEBD at Z");
         SET(p_tr2_sys__Remove_dir,
@@ -157,6 +160,8 @@ static BOOL init(void)
                 "?_Current_get at sys@tr2 at std@@YAPA_WAAY0BAE at _W@Z");
         SET(p_tr2_sys__Current_set,
                 "?_Current_set at sys@tr2 at std@@YA_NPBD at Z");
+        SET(p_tr2_sys__Current_set_wchar,
+                "?_Current_set at sys@tr2 at std@@YA_NPB_W at Z");
         SET(p_tr2_sys__Make_dir,
                 "?_Make_dir at sys@tr2 at std@@YAHPBD at Z");
         SET(p_tr2_sys__Remove_dir,
@@ -516,6 +521,7 @@ static void test_tr2_sys__Current_set(void)
 {
     char temp_path[MAX_PATH], current_path[MAX_PATH], origin_path[MAX_PATH];
     char *temp;
+    WCHAR testW[] = {'.','/',0};
     memset(temp_path, 0, MAX_PATH);
     GetTempPathA(MAX_PATH, temp_path);
     memset(origin_path, 0, MAX_PATH);
@@ -530,7 +536,7 @@ static void test_tr2_sys__Current_set(void)
     temp[strlen(temp)] = '\\';
     ok(!strcmp(temp_path, current_path), "test_tr2_sys__Current_get(): expect: %s, got %s\n", temp_path, current_path);
 
-    ok(p_tr2_sys__Current_set("./"), "p_tr2_sys__Current_set to temp_path failed\n");
+    ok(p_tr2_sys__Current_set_wchar(testW), "p_tr2_sys__Current_set_wchar to temp_path failed\n");
     memset(current_path, 0, MAX_PATH);
     temp = p_tr2_sys__Current_get(current_path);
     ok(temp == current_path, "p_tr2_sys__Current_get returned different buffer\n");
diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec
index 286b978..697c83c 100644
--- a/dlls/msvcp120_app/msvcp120_app.spec
+++ b/dlls/msvcp120_app/msvcp120_app.spec
@@ -1138,8 +1138,8 @@
 @ cdecl -arch=win64 ?_Current_get at sys@tr2 at std@@YAPEA_WAEAY0BAE at _W@Z(ptr) msvcp120.?_Current_get at sys@tr2 at std@@YAPEA_WAEAY0BAE at _W@Z
 @ cdecl -arch=win32 ?_Current_set at sys@tr2 at std@@YA_NPBD at Z(str) msvcp120.?_Current_set at sys@tr2 at std@@YA_NPBD at Z
 @ cdecl -arch=win64 ?_Current_set at sys@tr2 at std@@YA_NPEBD at Z(str) msvcp120.?_Current_set at sys@tr2 at std@@YA_NPEBD at Z
-@ stub -arch=win32 ?_Current_set at sys@tr2 at std@@YA_NPB_W at Z
-@ stub -arch=win64 ?_Current_set at sys@tr2 at std@@YA_NPEB_W at Z
+@ cdecl -arch=win32 ?_Current_set at sys@tr2 at std@@YA_NPB_W at Z(wstr) msvcp120.?_Current_set at sys@tr2 at std@@YA_NPB_W at Z
+@ cdecl -arch=win64 ?_Current_set at sys@tr2 at std@@YA_NPEB_W at Z(wstr) msvcp120.?_Current_set at sys@tr2 at std@@YA_NPEB_W at Z
 @ cdecl -arch=arm ?_Decref at facet@locale at std@@UAAPAV_Facet_base at 3@XZ(ptr) msvcp120.?_Decref at facet@locale at std@@UAAPAV_Facet_base at 3@XZ
 @ thiscall -arch=i386 ?_Decref at facet@locale at std@@UAEPAV_Facet_base at 3@XZ(ptr) msvcp120.?_Decref at facet@locale at std@@UAEPAV_Facet_base at 3@XZ
 @ cdecl -arch=win64 ?_Decref at facet@locale at std@@UEAAPEAV_Facet_base at 3@XZ(ptr) msvcp120.?_Decref at facet@locale at std@@UEAAPEAV_Facet_base at 3@XZ
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index 9056972..458e6de 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -14801,6 +14801,14 @@ WCHAR* __cdecl tr2_sys__Current_get_wchar(WCHAR *current_path)
     return current_path;
 }
 
+/* ?_Current_set at sys@tr2 at std@@YA_NPB_W at Z */
+/* ?_Current_set at sys@tr2 at std@@YA_NPEB_W at Z */
+MSVCP_bool __cdecl tr2_sys__Current_set_wchar(WCHAR const* path)
+{
+    TRACE("(%s)\n", debugstr_w(path));
+    return SetCurrentDirectoryW(path) != 0;
+}
+
 /* ??1_Winit at std@@QAE at XZ */
 /* ??1_Winit at std@@QAE at XZ */
 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)




More information about the wine-cvs mailing list