Module: wine Branch: master Commit: 2b19569958f5b00fe3e60ccf29dfce88dc28033a URL: http://source.winehq.org/git/wine.git/?a=commit;h=2b19569958f5b00fe3e60ccf29...
Author: YongHao Hu christopherwuy@gmail.com Date: Mon Aug 10 14:45:57 2015 +0800
msvcp110: Add tr2_sys__Make_dir_wchar implementation and test.
---
dlls/msvcp110/msvcp110.spec | 4 ++-- dlls/msvcp120/msvcp120.spec | 4 ++-- dlls/msvcp120/tests/msvcp120.c | 11 ++++++++++- dlls/msvcp120_app/msvcp120_app.spec | 4 ++-- dlls/msvcp90/ios.c | 16 ++++++++++++++++ 5 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index ff513b3..c1c6212 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -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 diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec index 8348a3f..e990eaf 100644 --- a/dlls/msvcp120/msvcp120.spec +++ b/dlls/msvcp120/msvcp120.spec @@ -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 diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c index 07277b3..85e9354 100644 --- a/dlls/msvcp120/tests/msvcp120.c +++ b/dlls/msvcp120/tests/msvcp120.c @@ -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) diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec index 697c83c..b20d507 100644 --- a/dlls/msvcp120_app/msvcp120_app.spec +++ b/dlls/msvcp120_app/msvcp120_app.spec @@ -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 diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c index 458e6de..c01d187 100644 --- a/dlls/msvcp90/ios.c +++ b/dlls/msvcp90/ios.c @@ -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)