From: Alex Henrie alexhenrie24@gmail.com
--- programs/wscript/tests/run.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/programs/wscript/tests/run.c b/programs/wscript/tests/run.c index 7bccf097f87..b996daa6254 100644 --- a/programs/wscript/tests/run.c +++ b/programs/wscript/tests/run.c @@ -26,6 +26,7 @@ #include <windows.h> #include <psapi.h> #include <oaidl.h> +#include <atlconv.h>
#include "wine/test.h"
@@ -74,18 +75,6 @@ static const GUID CLSID_TestObj = static const char *script_name; static HANDLE wscript_process;
-static BSTR a2bstr(const char *str) -{ - BSTR ret; - int len; - - len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); - ret = SysAllocStringLen(NULL, len-1); - MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); - - return ret; -} - static HRESULT WINAPI Dispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv) { if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDispatch)) { @@ -239,7 +228,7 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REF res = GetFullPathNameA(script_name, sizeof(fullPath), fullPath, &pos); if(!res || res > sizeof(fullPath)) return E_FAIL; - if(!(V_BSTR(pVarResult) = a2bstr(pos))) + if(!(V_BSTR(pVarResult) = A2BSTR(pos))) return E_OUTOFMEMORY; break; } @@ -255,7 +244,7 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REF res = GetFullPathNameA(script_name, sizeof(fullPath), fullPath, NULL); if(!res || res > sizeof(fullPath)) return E_FAIL; - if(!(V_BSTR(pVarResult) = a2bstr(fullPath))) + if(!(V_BSTR(pVarResult) = A2BSTR(fullPath))) return E_OUTOFMEMORY; break; }