Michael Stefaniuc : msxml3/tests: Get rid of a2bstr().

Alexandre Julliard julliard at winehq.org
Tue Feb 18 16:13:47 CST 2020


Module: wine
Branch: master
Commit: 077224622db0ced84224bf84ea0b9365bf4c2486
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=077224622db0ced84224bf84ea0b9365bf4c2486

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Fri Feb 14 21:24:37 2020 +0100

msxml3/tests: Get rid of a2bstr().

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msxml3/tests/httpreq.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/dlls/msxml3/tests/httpreq.c b/dlls/msxml3/tests/httpreq.c
index ae0a95a2f1..33e6bd6581 100644
--- a/dlls/msxml3/tests/httpreq.c
+++ b/dlls/msxml3/tests/httpreq.c
@@ -130,21 +130,6 @@ static void free_bstrs(void)
     alloced_bstrs_count = 0;
 }
 
-static BSTR a2bstr(const char *str)
-{
-    BSTR ret;
-    int len;
-
-    if(!str)
-        return NULL;
-
-    len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
-    ret = SysAllocStringLen(NULL, len);
-    MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
-
-    return ret;
-}
-
 
 /* test IHTMLElementCollection */
 static HRESULT WINAPI htmlecoll_QueryInterface(IHTMLElementCollection *iface, REFIID riid, void **ppvObject)
@@ -496,7 +481,7 @@ static HRESULT WINAPI htmldoc2_put_URL(IHTMLDocument2 *iface, BSTR v)
 static HRESULT WINAPI htmldoc2_get_URL(IHTMLDocument2 *iface, BSTR *p)
 {
     CHECK_EXPECT2(htmldoc2_get_url);
-    *p = a2bstr("http://test.winehq.org/");
+    *p = SysAllocString(L"http://test.winehq.org/");
     return S_OK;
 }
 
@@ -1747,7 +1732,7 @@ static void test_XMLHTTP(void)
     set_xhr_site(xhr);
 
     test_open(xhr, "GET", "tests/referer.php", S_OK);
-    str1 = a2bstr("http://test.winehq.org/");
+    str1 = SysAllocString(L"http://test.winehq.org/");
 
     V_VT(&varbody) = VT_EMPTY;
     hr = IXMLHttpRequest_send(xhr, varbody);




More information about the wine-cvs mailing list