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

oldstable
Misha Koshelev 2007-07-27 23:51:47 -05:00 committed by Alexandre Julliard
parent ed4f1e8ec7
commit 03d19b5782
3 changed files with 12 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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 )