msi: Use SysAllocString/SysFreeString for BSTR members of EXCEPINFO structure.
This commit is contained in:
parent
ed4f1e8ec7
commit
03d19b5782
|
@ -426,8 +426,8 @@ static HRESULT WINAPI AutomationObject_Invoke(
|
||||||
|
|
||||||
memset(pExcepInfo, 0, sizeof(EXCEPINFO));
|
memset(pExcepInfo, 0, sizeof(EXCEPINFO));
|
||||||
pExcepInfo->wCode = 1000;
|
pExcepInfo->wCode = 1000;
|
||||||
pExcepInfo->bstrSource = szExceptionSource;
|
pExcepInfo->bstrSource = SysAllocString(szExceptionSource);
|
||||||
pExcepInfo->bstrDescription = szExceptionDescription;
|
pExcepInfo->bstrDescription = SysAllocString(szExceptionDescription);
|
||||||
hr = DISP_E_EXCEPTION;
|
hr = DISP_E_EXCEPTION;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -336,9 +336,15 @@ static HRESULT WINAPI MsiActiveScriptSite_OnScriptError(IActiveScriptSite* iface
|
||||||
|
|
||||||
TRACE("(%p/%p)->(%p)\n", This, iface, pscripterror);
|
TRACE("(%p/%p)->(%p)\n", This, iface, pscripterror);
|
||||||
|
|
||||||
|
memset(&exception, 0, sizeof(EXCEPINFO));
|
||||||
hr = IActiveScriptError_GetExceptionInfo(pscripterror, &exception);
|
hr = IActiveScriptError_GetExceptionInfo(pscripterror, &exception);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
ERR("script error: %s\n", debugstr_w(exception.bstrDescription));
|
ERR("script error: %s\n", debugstr_w(exception.bstrDescription));
|
||||||
|
SysFreeString(exception.bstrSource);
|
||||||
|
SysFreeString(exception.bstrDescription);
|
||||||
|
SysFreeString(exception.bstrHelpFile);
|
||||||
|
}
|
||||||
|
|
||||||
return S_OK;
|
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"); \
|
ok(excepinfo.bstrDescription != NULL, "Exception description was NULL\n"); \
|
||||||
if (excepinfo.bstrDescription) \
|
if (excepinfo.bstrDescription) \
|
||||||
ok_w2("Exception description was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrDescription, szDescription); \
|
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 )
|
static DISPID get_dispid( IDispatch *disp, const char *name )
|
||||||
|
|
Loading…
Reference in New Issue