msvcp110: Add tr2_sys__Current_get_wchar implementation and test.

This commit is contained in:
YongHao Hu 2015-08-10 14:44:53 +08:00 committed by Alexandre Julliard
parent 70ac10affa
commit ee77fc3b4e
5 changed files with 32 additions and 6 deletions

View File

@ -1169,8 +1169,8 @@
@ stub -arch=win64 ?_Copy_file@sys@tr2@std@@YAHPEB_W0_N@Z
@ cdecl -arch=win32 ?_Current_get@sys@tr2@std@@YAPADPAD@Z(ptr) tr2_sys__Current_get
@ cdecl -arch=win64 ?_Current_get@sys@tr2@std@@YAPEADPEAD@Z(ptr) tr2_sys__Current_get
@ stub -arch=win32 ?_Current_get@sys@tr2@std@@YAPA_WPA_W@Z
@ stub -arch=win64 ?_Current_get@sys@tr2@std@@YAPEA_WPEA_W@Z
@ cdecl -arch=win32 ?_Current_get@sys@tr2@std@@YAPA_WPA_W@Z(ptr) tr2_sys__Current_get_wchar
@ cdecl -arch=win64 ?_Current_get@sys@tr2@std@@YAPEA_WPEA_W@Z(ptr) tr2_sys__Current_get_wchar
@ cdecl -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPBD@Z(str) tr2_sys__Current_set
@ cdecl -arch=win64 ?_Current_set@sys@tr2@std@@YA_NPEBD@Z(str) tr2_sys__Current_set
@ stub -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPB_W@Z

View File

@ -1134,8 +1134,8 @@
@ stub -arch=win64 ?_Copy_file@sys@tr2@std@@YAHPEB_W0_N@Z
@ cdecl -arch=win32 ?_Current_get@sys@tr2@std@@YAPADAAY0BAE@D@Z(ptr) tr2_sys__Current_get
@ cdecl -arch=win64 ?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z(ptr) tr2_sys__Current_get
@ stub -arch=win32 ?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z
@ stub -arch=win64 ?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_W@Z
@ cdecl -arch=win32 ?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z(ptr) tr2_sys__Current_get_wchar
@ cdecl -arch=win64 ?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_W@Z(ptr) tr2_sys__Current_get_wchar
@ cdecl -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPBD@Z(str) tr2_sys__Current_set
@ cdecl -arch=win64 ?_Current_set@sys@tr2@std@@YA_NPEBD@Z(str) tr2_sys__Current_set
@ stub -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPB_W@Z

View File

@ -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@sys@tr2@std@@YAHPEB_W0@Z");
SET(p_tr2_sys__Current_get,
"?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z");
SET(p_tr2_sys__Current_get_wchar,
"?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_W@Z");
SET(p_tr2_sys__Current_set,
"?_Current_set@sys@tr2@std@@YA_NPEBD@Z");
SET(p_tr2_sys__Make_dir,
@ -150,6 +153,8 @@ static BOOL init(void)
"?_Equivalent@sys@tr2@std@@YAHPB_W0@Z");
SET(p_tr2_sys__Current_get,
"?_Current_get@sys@tr2@std@@YAPADAAY0BAE@D@Z");
SET(p_tr2_sys__Current_get_wchar,
"?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z");
SET(p_tr2_sys__Current_set,
"?_Current_set@sys@tr2@std@@YA_NPBD@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);

View File

@ -1134,8 +1134,8 @@
@ stub -arch=win64 ?_Copy_file@sys@tr2@std@@YAHPEB_W0_N@Z
@ cdecl -arch=win32 ?_Current_get@sys@tr2@std@@YAPADAAY0BAE@D@Z(ptr) msvcp120.?_Current_get@sys@tr2@std@@YAPADAAY0BAE@D@Z
@ cdecl -arch=win64 ?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z(ptr) msvcp120.?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z
@ stub -arch=win32 ?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z
@ stub -arch=win64 ?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_W@Z
@ cdecl -arch=win32 ?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z(ptr) msvcp120.?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z
@ cdecl -arch=win64 ?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_W@Z(ptr) msvcp120.?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_W@Z
@ cdecl -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPBD@Z(str) msvcp120.?_Current_set@sys@tr2@std@@YA_NPBD@Z
@ cdecl -arch=win64 ?_Current_set@sys@tr2@std@@YA_NPEBD@Z(str) msvcp120.?_Current_set@sys@tr2@std@@YA_NPEBD@Z
@ stub -arch=win32 ?_Current_set@sys@tr2@std@@YA_NPB_W@Z

View File

@ -14790,6 +14790,17 @@ int __cdecl tr2_sys__Equivalent_wchar(WCHAR const* path1, WCHAR const* path2)
);
}
/* ?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z */
/* ?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_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@std@@QAE@XZ */
/* ??1_Winit@std@@QAE@XZ */
DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)