YongHao Hu : msvcp110: Add tr2_sys__Current_get_wchar implementation and test.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 17 09:01:13 CDT 2015
Module: wine
Branch: master
Commit: ee77fc3b4ec9152698fbb6c0e4784c6e28dddea7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ee77fc3b4ec9152698fbb6c0e4784c6e28dddea7
Author: YongHao Hu <christopherwuy at gmail.com>
Date: Mon Aug 10 14:44:53 2015 +0800
msvcp110: Add tr2_sys__Current_get_wchar implementation and test.
---
dlls/msvcp110/msvcp110.spec | 4 ++--
dlls/msvcp120/msvcp120.spec | 4 ++--
dlls/msvcp120/tests/msvcp120.c | 15 +++++++++++++++
dlls/msvcp120_app/msvcp120_app.spec | 4 ++--
dlls/msvcp90/ios.c | 11 +++++++++++
5 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec
index a245681..02d80f9 100644
--- a/dlls/msvcp110/msvcp110.spec
+++ b/dlls/msvcp110/msvcp110.spec
@@ -1169,8 +1169,8 @@
@ stub -arch=win64 ?_Copy_file at sys@tr2 at std@@YAHPEB_W0_N at Z
@ cdecl -arch=win32 ?_Current_get at sys@tr2 at std@@YAPADPAD at Z(ptr) tr2_sys__Current_get
@ cdecl -arch=win64 ?_Current_get at sys@tr2 at std@@YAPEADPEAD at Z(ptr) tr2_sys__Current_get
-@ stub -arch=win32 ?_Current_get at sys@tr2 at std@@YAPA_WPA_W at Z
-@ stub -arch=win64 ?_Current_get at sys@tr2 at std@@YAPEA_WPEA_W at Z
+@ cdecl -arch=win32 ?_Current_get at sys@tr2 at std@@YAPA_WPA_W at Z(ptr) tr2_sys__Current_get_wchar
+@ 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
diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec
index a0357de..d431268 100644
--- a/dlls/msvcp120/msvcp120.spec
+++ b/dlls/msvcp120/msvcp120.spec
@@ -1134,8 +1134,8 @@
@ stub -arch=win64 ?_Copy_file at sys@tr2 at std@@YAHPEB_W0_N at Z
@ cdecl -arch=win32 ?_Current_get at sys@tr2 at std@@YAPADAAY0BAE at D@Z(ptr) tr2_sys__Current_get
@ cdecl -arch=win64 ?_Current_get at sys@tr2 at std@@YAPEADAEAY0BAE at D@Z(ptr) tr2_sys__Current_get
-@ stub -arch=win32 ?_Current_get at sys@tr2 at std@@YAPA_WAAY0BAE at _W@Z
-@ stub -arch=win64 ?_Current_get at sys@tr2 at std@@YAPEA_WAEAY0BAE at _W@Z
+@ cdecl -arch=win32 ?_Current_get at sys@tr2 at std@@YAPA_WAAY0BAE at _W@Z(ptr) tr2_sys__Current_get_wchar
+@ 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
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index 9fca0c2..a81c928 100644
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -77,6 +77,7 @@ static ULONGLONG(__cdecl *p_tr2_sys__File_size_wchar)(WCHAR const*);
static int (__cdecl *p_tr2_sys__Equivalent)(char const*, char const*);
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 int (__cdecl *p_tr2_sys__Make_dir)(char const*);
static MSVCP_bool (__cdecl *p_tr2_sys__Remove_dir)(char const*);
@@ -123,6 +124,8 @@ static BOOL init(void)
"?_Equivalent at sys@tr2 at std@@YAHPEB_W0 at Z");
SET(p_tr2_sys__Current_get,
"?_Current_get at sys@tr2 at std@@YAPEADAEAY0BAE at D@Z");
+ SET(p_tr2_sys__Current_get_wchar,
+ "?_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__Make_dir,
@@ -150,6 +153,8 @@ static BOOL init(void)
"?_Equivalent at sys@tr2 at std@@YAHPB_W0 at Z");
SET(p_tr2_sys__Current_get,
"?_Current_get at sys@tr2 at std@@YAPADAAY0BAE at D@Z");
+ SET(p_tr2_sys__Current_get_wchar,
+ "?_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__Make_dir,
@@ -478,6 +483,8 @@ static void test_tr2_sys__Current_get(void)
{
char temp_path[MAX_PATH], current_path[MAX_PATH], origin_path[MAX_PATH];
char *temp;
+ WCHAR temp_path_wchar[MAX_PATH], current_path_wchar[MAX_PATH];
+ WCHAR *temp_wchar;
memset(origin_path, 0, MAX_PATH);
GetCurrentDirectoryA(MAX_PATH, origin_path);
memset(temp_path, 0, MAX_PATH);
@@ -490,6 +497,14 @@ static void test_tr2_sys__Current_get(void)
temp[strlen(temp)] = '\\';
ok(!strcmp(temp_path, current_path), "test_tr2_sys__Current_get(): expect: %s, got %s\n", temp_path, current_path);
+ GetTempPathW(MAX_PATH, temp_path_wchar);
+ ok(SetCurrentDirectoryW(temp_path_wchar), "SetCurrentDirectoryW to temp_path_wchar failed\n");
+ memset(current_path_wchar, 0, MAX_PATH);
+ temp_wchar = p_tr2_sys__Current_get_wchar(current_path_wchar);
+ ok(temp_wchar == current_path_wchar, "p_tr2_sys__Current_get_wchar returned different buffer\n");
+ temp_wchar[wcslen(temp_wchar)] = '\\';
+ ok(!wcscmp(temp_path_wchar, current_path_wchar), "test_tr2_sys__Current_get(): expect: %s, got %s\n", wine_dbgstr_w(temp_path_wchar), wine_dbgstr_w(current_path_wchar));
+
ok(SetCurrentDirectoryA(origin_path), "SetCurrentDirectoryA to origin_path failed\n");
memset(current_path, 0, MAX_PATH);
temp = p_tr2_sys__Current_get(current_path);
diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec
index 515ca2b..286b978 100644
--- a/dlls/msvcp120_app/msvcp120_app.spec
+++ b/dlls/msvcp120_app/msvcp120_app.spec
@@ -1134,8 +1134,8 @@
@ stub -arch=win64 ?_Copy_file at sys@tr2 at std@@YAHPEB_W0_N at Z
@ cdecl -arch=win32 ?_Current_get at sys@tr2 at std@@YAPADAAY0BAE at D@Z(ptr) msvcp120.?_Current_get at sys@tr2 at std@@YAPADAAY0BAE at D@Z
@ cdecl -arch=win64 ?_Current_get at sys@tr2 at std@@YAPEADAEAY0BAE at D@Z(ptr) msvcp120.?_Current_get at sys@tr2 at std@@YAPEADAEAY0BAE at D@Z
-@ stub -arch=win32 ?_Current_get at sys@tr2 at std@@YAPA_WAAY0BAE at _W@Z
-@ stub -arch=win64 ?_Current_get at sys@tr2 at std@@YAPEA_WAEAY0BAE at _W@Z
+@ cdecl -arch=win32 ?_Current_get at sys@tr2 at std@@YAPA_WAAY0BAE at _W@Z(ptr) msvcp120.?_Current_get at sys@tr2 at std@@YAPA_WAAY0BAE at _W@Z
+@ 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
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index af3f569..9056972 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -14790,6 +14790,17 @@ int __cdecl tr2_sys__Equivalent_wchar(WCHAR const* path1, WCHAR const* path2)
);
}
+/* ?_Current_get at sys@tr2 at std@@YAPA_WAAY0BAE at _W@Z */
+/* ?_Current_get at sys@tr2 at std@@YAPEA_WAEAY0BAE at _W@Z */
+WCHAR* __cdecl tr2_sys__Current_get_wchar(WCHAR *current_path)
+{
+ TRACE("(%s)\n", debugstr_w(current_path));
+
+ if(!GetCurrentDirectoryW(MAX_PATH, current_path))
+ return NULL;
+ return current_path;
+}
+
/* ??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