From: Alex Henrie alexhenrie24@gmail.com
--- dlls/scrrun/tests/filesystem.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c index e53bd092ce9..17872c78c55 100644 --- a/dlls/scrrun/tests/filesystem.c +++ b/dlls/scrrun/tests/filesystem.c @@ -28,6 +28,7 @@ #include "oleauto.h" #include "dispex.h" #include "shlwapi.h" +#include "atlconv.h"
#include "wine/test.h"
@@ -890,14 +891,6 @@ static void test_CopyFolder(void) SysFreeString(bsrc); }
-static BSTR bstr_from_str(const char *str) -{ - int len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); - BSTR ret = SysAllocStringLen(NULL, len - 1); /* NUL character added automatically */ - MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); - return ret; -} - struct buildpath_test { const char *path; @@ -938,7 +931,7 @@ static void test_BuildPath(void) SysFreeString(ret);
ret = (BSTR)0xdeadbeef; - path = bstr_from_str("path"); + path = A2BSTR("path"); hr = IFileSystem3_BuildPath(fs3, path, NULL, &ret); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(ret, path), "got %s\n", wine_dbgstr_w(ret)); @@ -946,7 +939,7 @@ static void test_BuildPath(void) SysFreeString(path);
ret = (BSTR)0xdeadbeef; - path = bstr_from_str("path"); + path = A2BSTR("path"); hr = IFileSystem3_BuildPath(fs3, NULL, path, &ret); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(ret, path), "got %s\n", wine_dbgstr_w(ret)); @@ -958,9 +951,9 @@ static void test_BuildPath(void) BSTR name, result;
ret = NULL; - path = bstr_from_str(ptr->path); - name = bstr_from_str(ptr->name); - result = bstr_from_str(ptr->result); + path = A2BSTR(ptr->path); + name = A2BSTR(ptr->name); + result = A2BSTR(ptr->result); hr = IFileSystem3_BuildPath(fs3, path, name, &ret); ok(hr == S_OK, "%d: Unexpected hr %#lx.\n", i, hr); if (hr == S_OK)