From: Alex Henrie alexhenrie24@gmail.com
--- dlls/shell32/tests/shelldispatch.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c index 67659f72345..d8078679627 100644 --- a/dlls/shell32/tests/shelldispatch.c +++ b/dlls/shell32/tests/shelldispatch.c @@ -26,6 +26,7 @@ #include "shlobj.h" #include "shlwapi.h" #include "winsvc.h" +#include "atlconv.h"
#include "wine/test.h"
@@ -50,22 +51,10 @@ static HRESULT (WINAPI *pSHGetNameFromIDList)(PCIDLIST_ABSOLUTE,SIGDN,PWSTR*); /* Updated Windows 7 has a new IShellDispatch6 in its typelib */ DEFINE_GUID(IID_IWin7ShellDispatch6, 0x34936ba1, 0x67ad, 0x4c41, 0x99,0xb8, 0x8c,0x12,0xdf,0xf1,0xe9,0x74);
-static BSTR a2bstr(const char *str) -{ - BSTR ret; - int len; - - len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); - ret = SysAllocStringLen(NULL, len); - MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); - - return ret; -} - static void variant_set_string(VARIANT *v, const char *s) { V_VT(v) = VT_BSTR; - V_BSTR(v) = a2bstr(s); + V_BSTR(v) = A2BSTR(s); }
static void init_function_pointers(void) @@ -647,7 +636,7 @@ static void test_items(void) "file_defs[%d]: expected %s, got %s\n", i, wine_dbgstr_w(path), wine_dbgstr_w(bstr)); SysFreeString(bstr);
- bstr = a2bstr(file_defs[i].name); + bstr = A2BSTR(file_defs[i].name); r = FolderItem_get_Name(item, &name); ok(r == S_OK, "Failed to get item name, hr %#lx.\n", r); /* Returned display name does not have to strictly match file name, e.g. extension could be omitted. */