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));
|
||||
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 )
|
||||
|
|
Loading…
Reference in New Issue