YongHao Hu : msvcp110: Add tr2_sys__Current_get_wchar implementation and test.
Module: wine Branch: master Commit: ee77fc3b4ec9152698fbb6c0e4784c6e28dddea7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ee77fc3b4ec9152698fbb6c0e4... Author: YongHao Hu <christopherwuy(a)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(a)sys@tr2(a)std@@YAHPEB_W0_N(a)Z @ cdecl -arch=win32 ?_Current_get(a)sys@tr2(a)std@@YAPADPAD(a)Z(ptr) tr2_sys__Current_get @ cdecl -arch=win64 ?_Current_get(a)sys@tr2(a)std@@YAPEADPEAD(a)Z(ptr) tr2_sys__Current_get -@ stub -arch=win32 ?_Current_get(a)sys@tr2(a)std@@YAPA_WPA_W(a)Z -@ stub -arch=win64 ?_Current_get(a)sys@tr2(a)std@@YAPEA_WPEA_W(a)Z +@ cdecl -arch=win32 ?_Current_get(a)sys@tr2(a)std@@YAPA_WPA_W(a)Z(ptr) tr2_sys__Current_get_wchar +@ cdecl -arch=win64 ?_Current_get(a)sys@tr2(a)std@@YAPEA_WPEA_W(a)Z(ptr) tr2_sys__Current_get_wchar @ cdecl -arch=win32 ?_Current_set(a)sys@tr2(a)std@@YA_NPBD(a)Z(str) tr2_sys__Current_set @ cdecl -arch=win64 ?_Current_set(a)sys@tr2(a)std@@YA_NPEBD(a)Z(str) tr2_sys__Current_set @ stub -arch=win32 ?_Current_set(a)sys@tr2(a)std@@YA_NPB_W(a)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(a)sys@tr2(a)std@@YAHPEB_W0_N(a)Z @ cdecl -arch=win32 ?_Current_get(a)sys@tr2(a)std@@YAPADAAY0BAE(a)D@Z(ptr) tr2_sys__Current_get @ cdecl -arch=win64 ?_Current_get(a)sys@tr2(a)std@@YAPEADAEAY0BAE(a)D@Z(ptr) tr2_sys__Current_get -@ stub -arch=win32 ?_Current_get(a)sys@tr2(a)std@@YAPA_WAAY0BAE(a)_W@Z -@ stub -arch=win64 ?_Current_get(a)sys@tr2(a)std@@YAPEA_WAEAY0BAE(a)_W@Z +@ cdecl -arch=win32 ?_Current_get(a)sys@tr2(a)std@@YAPA_WAAY0BAE(a)_W@Z(ptr) tr2_sys__Current_get_wchar +@ cdecl -arch=win64 ?_Current_get(a)sys@tr2(a)std@@YAPEA_WAEAY0BAE(a)_W@Z(ptr) tr2_sys__Current_get_wchar @ cdecl -arch=win32 ?_Current_set(a)sys@tr2(a)std@@YA_NPBD(a)Z(str) tr2_sys__Current_set @ cdecl -arch=win64 ?_Current_set(a)sys@tr2(a)std@@YA_NPEBD(a)Z(str) tr2_sys__Current_set @ stub -arch=win32 ?_Current_set(a)sys@tr2(a)std@@YA_NPB_W(a)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(a)sys@tr2(a)std@@YAHPEB_W0(a)Z"); SET(p_tr2_sys__Current_get, "?_Current_get(a)sys@tr2(a)std@@YAPEADAEAY0BAE(a)D@Z"); + SET(p_tr2_sys__Current_get_wchar, + "?_Current_get(a)sys@tr2(a)std@@YAPEA_WAEAY0BAE(a)_W@Z"); SET(p_tr2_sys__Current_set, "?_Current_set(a)sys@tr2(a)std@@YA_NPEBD(a)Z"); SET(p_tr2_sys__Make_dir, @@ -150,6 +153,8 @@ static BOOL init(void) "?_Equivalent(a)sys@tr2(a)std@@YAHPB_W0(a)Z"); SET(p_tr2_sys__Current_get, "?_Current_get(a)sys@tr2(a)std@@YAPADAAY0BAE(a)D@Z"); + SET(p_tr2_sys__Current_get_wchar, + "?_Current_get(a)sys@tr2(a)std@@YAPA_WAAY0BAE(a)_W@Z"); SET(p_tr2_sys__Current_set, "?_Current_set(a)sys@tr2(a)std@@YA_NPBD(a)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(a)sys@tr2(a)std@@YAHPEB_W0_N(a)Z @ cdecl -arch=win32 ?_Current_get(a)sys@tr2(a)std@@YAPADAAY0BAE(a)D@Z(ptr) msvcp120.?_Current_get(a)sys@tr2(a)std@@YAPADAAY0BAE(a)D@Z @ cdecl -arch=win64 ?_Current_get(a)sys@tr2(a)std@@YAPEADAEAY0BAE(a)D@Z(ptr) msvcp120.?_Current_get(a)sys@tr2(a)std@@YAPEADAEAY0BAE(a)D@Z -@ stub -arch=win32 ?_Current_get(a)sys@tr2(a)std@@YAPA_WAAY0BAE(a)_W@Z -@ stub -arch=win64 ?_Current_get(a)sys@tr2(a)std@@YAPEA_WAEAY0BAE(a)_W@Z +@ cdecl -arch=win32 ?_Current_get(a)sys@tr2(a)std@@YAPA_WAAY0BAE(a)_W@Z(ptr) msvcp120.?_Current_get(a)sys@tr2(a)std@@YAPA_WAAY0BAE(a)_W@Z +@ cdecl -arch=win64 ?_Current_get(a)sys@tr2(a)std@@YAPEA_WAEAY0BAE(a)_W@Z(ptr) msvcp120.?_Current_get(a)sys@tr2(a)std@@YAPEA_WAEAY0BAE(a)_W@Z @ cdecl -arch=win32 ?_Current_set(a)sys@tr2(a)std@@YA_NPBD(a)Z(str) msvcp120.?_Current_set(a)sys@tr2(a)std@@YA_NPBD(a)Z @ cdecl -arch=win64 ?_Current_set(a)sys@tr2(a)std@@YA_NPEBD(a)Z(str) msvcp120.?_Current_set(a)sys@tr2(a)std@@YA_NPEBD(a)Z @ stub -arch=win32 ?_Current_set(a)sys@tr2(a)std@@YA_NPB_W(a)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(a)sys@tr2(a)std@@YAPA_WAAY0BAE(a)_W@Z */ +/* ?_Current_get(a)sys@tr2(a)std@@YAPEA_WAEAY0BAE(a)_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(a)std@@QAE(a)XZ */ /* ??1_Winit(a)std@@QAE(a)XZ */ DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
participants (1)
-
Alexandre Julliard