Commit 2b195699 authored by YongHao Hu's avatar YongHao Hu Committed by Alexandre Julliard

msvcp110: Add tr2_sys__Make_dir_wchar implementation and test.

parent e55149f8
......@@ -1619,8 +1619,8 @@
@ stub -arch=win64 ?_MP_Rem@std@@YAXQEA_K_K@Z
@ cdecl -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPBD@Z(str) tr2_sys__Make_dir
@ cdecl -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEBD@Z(str) tr2_sys__Make_dir
@ stub -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPB_W@Z
@ stub -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z
@ cdecl -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPB_W@Z(wstr) tr2_sys__Make_dir_wchar
@ cdecl -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z(wstr) tr2_sys__Make_dir_wchar
@ cdecl -arch=win32 ?_Makeloc@_Locimp@locale@std@@CAPAV123@ABV_Locinfo@3@HPAV123@PBV23@@Z(ptr long ptr ptr) locale__Locimp__Makeloc
@ cdecl -arch=win64 ?_Makeloc@_Locimp@locale@std@@CAPEAV123@AEBV_Locinfo@3@HPEAV123@PEBV23@@Z(ptr long ptr ptr) locale__Locimp__Makeloc
@ cdecl -arch=win32 ?_Makeushloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z(ptr long ptr ptr) locale__Locimp__Makeushloc
......
......@@ -1580,8 +1580,8 @@
@ stub -arch=win64 ?_MP_Rem@std@@YAXQEA_K_K@Z
@ cdecl -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPBD@Z(str) tr2_sys__Make_dir
@ cdecl -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEBD@Z(str) tr2_sys__Make_dir
@ stub -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPB_W@Z
@ stub -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z
@ cdecl -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPB_W@Z(wstr) tr2_sys__Make_dir_wchar
@ cdecl -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z(wstr) tr2_sys__Make_dir_wchar
@ cdecl -arch=win32 ?_Makeloc@_Locimp@locale@std@@CAPAV123@ABV_Locinfo@3@HPAV123@PBV23@@Z(ptr long ptr ptr) locale__Locimp__Makeloc
@ cdecl -arch=win64 ?_Makeloc@_Locimp@locale@std@@CAPEAV123@AEBV_Locinfo@3@HPEAV123@PEBV23@@Z(ptr long ptr ptr) locale__Locimp__Makeloc
@ cdecl -arch=win32 ?_Makeushloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z(ptr long ptr ptr) locale__Locimp__Makeushloc
......
......@@ -81,6 +81,7 @@ 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 int (__cdecl *p_tr2_sys__Make_dir_wchar)(WCHAR 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);
static int (__cdecl *p_tr2_sys__Rename)(char const*, char const*);
......@@ -133,6 +134,8 @@ static BOOL init(void)
"?_Current_set@sys@tr2@std@@YA_NPEB_W@Z");
SET(p_tr2_sys__Make_dir,
"?_Make_dir@sys@tr2@std@@YAHPEBD@Z");
SET(p_tr2_sys__Make_dir_wchar,
"?_Make_dir@sys@tr2@std@@YAHPEB_W@Z");
SET(p_tr2_sys__Remove_dir,
"?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z");
SET(p_tr2_sys__Copy_file,
......@@ -164,6 +167,8 @@ static BOOL init(void)
"?_Current_set@sys@tr2@std@@YA_NPB_W@Z");
SET(p_tr2_sys__Make_dir,
"?_Make_dir@sys@tr2@std@@YAHPBD@Z");
SET(p_tr2_sys__Make_dir_wchar,
"?_Make_dir@sys@tr2@std@@YAHPB_W@Z");
SET(p_tr2_sys__Remove_dir,
"?_Remove_dir@sys@tr2@std@@YA_NPBD@Z");
SET(p_tr2_sys__Copy_file,
......@@ -561,6 +566,7 @@ static void test_tr2_sys__Current_set(void)
static void test_tr2_sys__Make_dir(void)
{
int ret, i;
WCHAR testW[] = {'w','d',0};
struct {
char const *path;
int val;
......@@ -577,8 +583,11 @@ static void test_tr2_sys__Make_dir(void)
ok(ret == tests[i].val, "tr2_sys__Make_dir(): test %d expect: %d, got %d\n", i+1, tests[i].val, ret);
ok(errno == 0xdeadbeef, "tr2_sys__Make_dir(): test %d errno expect 0xdeadbeef, got %d\n", i+1, errno);
}
ret = p_tr2_sys__Make_dir_wchar(testW);
ok(ret == 1, "tr2_sys__Make_dir(): expect: 1, got %d\n", ret);
ok(RemoveDirectoryA("tr2_test_dir"), "Expected tr2_test_dir to exist\n");
ok(RemoveDirectoryA("tr2_test_dir"), "expect tr2_test_dir to exist\n");
ok(RemoveDirectoryW(testW), "expect wd to exist\n");
}
static void test_tr2_sys__Remove_dir(void)
......
......@@ -1580,8 +1580,8 @@
@ stub -arch=win64 ?_MP_Rem@std@@YAXQEA_K_K@Z
@ cdecl -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPBD@Z(str) msvcp120.?_Make_dir@sys@tr2@std@@YAHPBD@Z
@ cdecl -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEBD@Z(str) msvcp120.?_Make_dir@sys@tr2@std@@YAHPEBD@Z
@ stub -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPB_W@Z
@ stub -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z
@ cdecl -arch=win32 ?_Make_dir@sys@tr2@std@@YAHPB_W@Z(wstr) msvcp120.?_Make_dir@sys@tr2@std@@YAHPB_W@Z
@ cdecl -arch=win64 ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z(wstr) msvcp120.?_Make_dir@sys@tr2@std@@YAHPEB_W@Z
@ cdecl -arch=win32 ?_Makeloc@_Locimp@locale@std@@CAPAV123@ABV_Locinfo@3@HPAV123@PBV23@@Z(ptr long ptr ptr) msvcp120.?_Makeloc@_Locimp@locale@std@@CAPAV123@ABV_Locinfo@3@HPAV123@PBV23@@Z
@ cdecl -arch=win64 ?_Makeloc@_Locimp@locale@std@@CAPEAV123@AEBV_Locinfo@3@HPEAV123@PEBV23@@Z(ptr long ptr ptr) msvcp120.?_Makeloc@_Locimp@locale@std@@CAPEAV123@AEBV_Locinfo@3@HPEAV123@PEBV23@@Z
@ cdecl -arch=win32 ?_Makeushloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z(ptr long ptr ptr) msvcp120.?_Makeushloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z
......
......@@ -14809,6 +14809,22 @@ MSVCP_bool __cdecl tr2_sys__Current_set_wchar(WCHAR const* path)
return SetCurrentDirectoryW(path) != 0;
}
/* ?_Make_dir@sys@tr2@std@@YAHPB_W@Z */
/* ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z */
int __cdecl tr2_sys__Make_dir_wchar(WCHAR const* path)
{
TRACE("(%s)\n", debugstr_w(path));
if(!CreateDirectoryW(path, NULL)) {
if(GetLastError() == ERROR_ALREADY_EXISTS)
return 0;
else
return -1;
}
return 1;
}
/* ??1_Winit@std@@QAE@XZ */
/* ??1_Winit@std@@QAE@XZ */
DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment