Commit 03d19b57 authored by Misha Koshelev's avatar Misha Koshelev Committed by Alexandre Julliard

msi: Use SysAllocString/SysFreeString for BSTR members of EXCEPINFO structure.

parent ed4f1e8e
......@@ -426,8 +426,8 @@ static HRESULT WINAPI AutomationObject_Invoke(
memset(pExcepInfo, 0, sizeof(EXCEPINFO));
pExcepInfo->wCode = 1000;
pExcepInfo->bstrSource = szExceptionSource;
pExcepInfo->bstrDescription = szExceptionDescription;
pExcepInfo->bstrSource = SysAllocString(szExceptionSource);
pExcepInfo->bstrDescription = SysAllocString(szExceptionDescription);
hr = DISP_E_EXCEPTION;
}
}
......
......@@ -336,9 +336,15 @@ static HRESULT WINAPI MsiActiveScriptSite_OnScriptError(IActiveScriptSite* iface
TRACE("(%p/%p)->(%p)\n", This, iface, pscripterror);
memset(&exception, 0, sizeof(EXCEPINFO));
hr = IActiveScriptError_GetExceptionInfo(pscripterror, &exception);
if (SUCCEEDED(hr))
{
ERR("script error: %s\n", debugstr_w(exception.bstrDescription));
SysFreeString(exception.bstrSource);
SysFreeString(exception.bstrDescription);
SysFreeString(exception.bstrHelpFile);
}
return S_OK;
}
......
......@@ -433,6 +433,10 @@ static WCHAR szSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0
ok(excepinfo.bstrDescription != NULL, "Exception description was NULL\n"); \
if (excepinfo.bstrDescription) \
ok_w2("Exception description was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrDescription, szDescription); \
\
SysFreeString(excepinfo.bstrSource); \
SysFreeString(excepinfo.bstrDescription); \
SysFreeString(excepinfo.bstrHelpFile); \
}
static DISPID get_dispid( IDispatch *disp, const char *name )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment