msxml3: AddRef() typeinfo pointers only when we have to.

This commit is contained in:
Nikolay Sivov 2012-11-19 13:50:04 -05:00 committed by Alexandre Julliard
parent f6d22b06c6
commit 6e566ce6c2
7 changed files with 48 additions and 84 deletions

View File

@ -200,8 +200,6 @@ HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo)
} }
*typeinfo = typeinfos[tid]; *typeinfo = typeinfos[tid];
ITypeInfo_AddRef(typeinfos[tid]);
return S_OK; return S_OK;
} }
@ -300,7 +298,6 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
ITypeInfo_ReleaseFuncDesc(ti, funcdesc); ITypeInfo_ReleaseFuncDesc(ti, funcdesc);
} }
ITypeInfo_Release(ti);
tid++; tid++;
} }
@ -322,7 +319,6 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
data->name_table = NULL; data->name_table = NULL;
} }
ITypeInfo_Release(dti);
return data; return data;
} }
@ -383,13 +379,16 @@ static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pcti
} }
static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo) LCID lcid, ITypeInfo **ti)
{ {
DispatchEx *This = impl_from_IDispatchEx(iface); DispatchEx *This = impl_from_IDispatchEx(iface);
HRESULT hr;
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ti);
return get_typeinfo(This->data->disp_tid, ppTInfo); hr = get_typeinfo(This->data->disp_tid, ti);
ITypeInfo_AddRef(*ti);
return hr;
} }
static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid,
@ -603,7 +602,6 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
hres = ITypeInfo_Invoke(ti, unk, id, wFlags, pdp, pvarRes, pei, &argerr); hres = ITypeInfo_Invoke(ti, unk, id, wFlags, pdp, pvarRes, pei, &argerr);
ITypeInfo_Release(ti);
IUnknown_Release(unk); IUnknown_Release(unk);
return hres; return hres;
} }

View File

@ -1233,13 +1233,16 @@ static HRESULT WINAPI XMLHTTPRequest_GetTypeInfoCount(IXMLHTTPRequest *iface, UI
} }
static HRESULT WINAPI XMLHTTPRequest_GetTypeInfo(IXMLHTTPRequest *iface, UINT iTInfo, static HRESULT WINAPI XMLHTTPRequest_GetTypeInfo(IXMLHTTPRequest *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo) LCID lcid, ITypeInfo **ti)
{ {
httprequest *This = impl_from_IXMLHTTPRequest( iface ); httprequest *This = impl_from_IXMLHTTPRequest( iface );
HRESULT hr;
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ti);
return get_typeinfo(IXMLHTTPRequest_tid, ppTInfo); hr = get_typeinfo(IXMLHTTPRequest_tid, ti);
ITypeInfo_AddRef(*ti);
return hr;
} }
static HRESULT WINAPI XMLHTTPRequest_GetIDsOfNames(IXMLHTTPRequest *iface, REFIID riid, static HRESULT WINAPI XMLHTTPRequest_GetIDsOfNames(IXMLHTTPRequest *iface, REFIID riid,
@ -1257,10 +1260,7 @@ static HRESULT WINAPI XMLHTTPRequest_GetIDsOfNames(IXMLHTTPRequest *iface, REFII
hr = get_typeinfo(IXMLHTTPRequest_tid, &typeinfo); hr = get_typeinfo(IXMLHTTPRequest_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }
@ -1278,11 +1278,8 @@ static HRESULT WINAPI XMLHTTPRequest_Invoke(IXMLHTTPRequest *iface, DISPID dispI
hr = get_typeinfo(IXMLHTTPRequest_tid, &typeinfo); hr = get_typeinfo(IXMLHTTPRequest_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_Invoke(typeinfo, &This->IXMLHTTPRequest_iface, dispIdMember, wFlags, hr = ITypeInfo_Invoke(typeinfo, &This->IXMLHTTPRequest_iface, dispIdMember, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr); pDispParams, pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }
@ -1606,13 +1603,16 @@ static HRESULT WINAPI ServerXMLHTTPRequest_GetTypeInfoCount(IServerXMLHTTPReques
} }
static HRESULT WINAPI ServerXMLHTTPRequest_GetTypeInfo(IServerXMLHTTPRequest *iface, UINT iTInfo, static HRESULT WINAPI ServerXMLHTTPRequest_GetTypeInfo(IServerXMLHTTPRequest *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo) LCID lcid, ITypeInfo **ti)
{ {
serverhttp *This = impl_from_IServerXMLHTTPRequest( iface ); serverhttp *This = impl_from_IServerXMLHTTPRequest( iface );
HRESULT hr;
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ti);
return get_typeinfo(IServerXMLHTTPRequest_tid, ppTInfo); hr = get_typeinfo(IServerXMLHTTPRequest_tid, ti);
ITypeInfo_AddRef(*ti);
return hr;
} }
static HRESULT WINAPI ServerXMLHTTPRequest_GetIDsOfNames(IServerXMLHTTPRequest *iface, REFIID riid, static HRESULT WINAPI ServerXMLHTTPRequest_GetIDsOfNames(IServerXMLHTTPRequest *iface, REFIID riid,
@ -1630,10 +1630,7 @@ static HRESULT WINAPI ServerXMLHTTPRequest_GetIDsOfNames(IServerXMLHTTPRequest *
hr = get_typeinfo(IServerXMLHTTPRequest_tid, &typeinfo); hr = get_typeinfo(IServerXMLHTTPRequest_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }
@ -1651,11 +1648,8 @@ static HRESULT WINAPI ServerXMLHTTPRequest_Invoke(IServerXMLHTTPRequest *iface,
hr = get_typeinfo(IServerXMLHTTPRequest_tid, &typeinfo); hr = get_typeinfo(IServerXMLHTTPRequest_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_Invoke(typeinfo, &This->IServerXMLHTTPRequest_iface, dispIdMember, wFlags, hr = ITypeInfo_Invoke(typeinfo, &This->IServerXMLHTTPRequest_iface, dispIdMember, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr); pDispParams, pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }

View File

@ -2180,11 +2180,16 @@ static HRESULT WINAPI VBSAXAttributes_GetTypeInfoCount( IVBSAXAttributes *iface,
static HRESULT WINAPI VBSAXAttributes_GetTypeInfo( static HRESULT WINAPI VBSAXAttributes_GetTypeInfo(
IVBSAXAttributes *iface, IVBSAXAttributes *iface,
UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo ) UINT iTInfo, LCID lcid, ITypeInfo** ti )
{ {
mxattributes *This = impl_from_IVBSAXAttributes( iface ); mxattributes *This = impl_from_IVBSAXAttributes( iface );
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); HRESULT hr;
return get_typeinfo(IVBSAXAttributes_tid, ppTInfo);
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ti);
hr = get_typeinfo(IVBSAXAttributes_tid, ti);
ITypeInfo_AddRef(*ti);
return hr;
} }
static HRESULT WINAPI VBSAXAttributes_GetIDsOfNames( static HRESULT WINAPI VBSAXAttributes_GetIDsOfNames(
@ -2207,10 +2212,7 @@ static HRESULT WINAPI VBSAXAttributes_GetIDsOfNames(
hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo); hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }
@ -2235,11 +2237,8 @@ static HRESULT WINAPI VBSAXAttributes_Invoke(
hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo); hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXAttributes_iface, dispIdMember, wFlags, hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXAttributes_iface, dispIdMember, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr); pDispParams, pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }

View File

@ -1113,15 +1113,15 @@ static HRESULT WINAPI unknode_GetTypeInfo(
IXMLDOMNode *iface, IXMLDOMNode *iface,
UINT iTInfo, UINT iTInfo,
LCID lcid, LCID lcid,
ITypeInfo** ppTInfo ) ITypeInfo** ti )
{ {
unknode *This = unknode_from_IXMLDOMNode( iface ); unknode *This = unknode_from_IXMLDOMNode( iface );
HRESULT hr; HRESULT hr;
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ti);
hr = get_typeinfo(IXMLDOMNode_tid, ppTInfo);
hr = get_typeinfo(IXMLDOMNode_tid, ti);
ITypeInfo_AddRef(*ti);
return hr; return hr;
} }
@ -1146,10 +1146,7 @@ static HRESULT WINAPI unknode_GetIDsOfNames(
hr = get_typeinfo(IXMLDOMNode_tid, &typeinfo); hr = get_typeinfo(IXMLDOMNode_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }
@ -1174,11 +1171,8 @@ static HRESULT WINAPI unknode_Invoke(
hr = get_typeinfo(IXMLDOMNode_tid, &typeinfo); hr = get_typeinfo(IXMLDOMNode_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMNode_iface, dispIdMember, wFlags, pDispParams, hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMNode_iface, dispIdMember, wFlags, pDispParams,
pVarResult, pExcepInfo, puArgErr); pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }

View File

@ -727,15 +727,15 @@ static HRESULT WINAPI ivbsaxattributes_GetTypeInfoCount( IVBSAXAttributes *iface
static HRESULT WINAPI ivbsaxattributes_GetTypeInfo( static HRESULT WINAPI ivbsaxattributes_GetTypeInfo(
IVBSAXAttributes *iface, IVBSAXAttributes *iface,
UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo ) UINT iTInfo, LCID lcid, ITypeInfo** ti )
{ {
saxlocator *This = impl_from_IVBSAXAttributes( iface ); saxlocator *This = impl_from_IVBSAXAttributes( iface );
HRESULT hr; HRESULT hr;
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ti);
hr = get_typeinfo(IVBSAXAttributes_tid, ppTInfo);
hr = get_typeinfo(IVBSAXAttributes_tid, ti);
ITypeInfo_AddRef(*ti);
return hr; return hr;
} }
@ -759,10 +759,7 @@ static HRESULT WINAPI ivbsaxattributes_GetIDsOfNames(
hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo); hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }
@ -787,11 +784,8 @@ static HRESULT WINAPI ivbsaxattributes_Invoke(
hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo); hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXAttributes_iface, dispIdMember, wFlags, hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXAttributes_iface, dispIdMember, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr); pDispParams, pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }
@ -1916,15 +1910,15 @@ static HRESULT WINAPI ivbsaxlocator_GetTypeInfoCount( IVBSAXLocator *iface, UINT
static HRESULT WINAPI ivbsaxlocator_GetTypeInfo( static HRESULT WINAPI ivbsaxlocator_GetTypeInfo(
IVBSAXLocator *iface, IVBSAXLocator *iface,
UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo ) UINT iTInfo, LCID lcid, ITypeInfo** ti )
{ {
saxlocator *This = impl_from_IVBSAXLocator( iface ); saxlocator *This = impl_from_IVBSAXLocator( iface );
HRESULT hr; HRESULT hr;
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ti);
hr = get_typeinfo(IVBSAXLocator_tid, ppTInfo);
hr = get_typeinfo(IVBSAXLocator_tid, ti);
ITypeInfo_AddRef(*ti);
return hr; return hr;
} }
@ -1948,10 +1942,7 @@ static HRESULT WINAPI ivbsaxlocator_GetIDsOfNames(
hr = get_typeinfo(IVBSAXLocator_tid, &typeinfo); hr = get_typeinfo(IVBSAXLocator_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }
@ -1976,11 +1967,8 @@ static HRESULT WINAPI ivbsaxlocator_Invoke(
hr = get_typeinfo(IVBSAXLocator_tid, &typeinfo); hr = get_typeinfo(IVBSAXLocator_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXLocator_iface, dispIdMember, wFlags, hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXLocator_iface, dispIdMember, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr); pDispParams, pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }

View File

@ -141,13 +141,16 @@ static HRESULT WINAPI xmldoc_GetTypeInfoCount(IXMLDocument *iface, UINT* pctinfo
} }
static HRESULT WINAPI xmldoc_GetTypeInfo(IXMLDocument *iface, UINT iTInfo, static HRESULT WINAPI xmldoc_GetTypeInfo(IXMLDocument *iface, UINT iTInfo,
LCID lcid, ITypeInfo** ppTInfo) LCID lcid, ITypeInfo** ti)
{ {
xmldoc *This = impl_from_IXMLDocument(iface); xmldoc *This = impl_from_IXMLDocument(iface);
HRESULT hr;
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ti);
return get_typeinfo(IXMLDocument_tid, ppTInfo); hr = get_typeinfo(IXMLDocument_tid, ti);
ITypeInfo_AddRef(*ti);
return hr;
} }
static HRESULT WINAPI xmldoc_GetIDsOfNames(IXMLDocument *iface, REFIID riid, static HRESULT WINAPI xmldoc_GetIDsOfNames(IXMLDocument *iface, REFIID riid,
@ -166,10 +169,7 @@ static HRESULT WINAPI xmldoc_GetIDsOfNames(IXMLDocument *iface, REFIID riid,
hr = get_typeinfo(IXMLDocument_tid, &typeinfo); hr = get_typeinfo(IXMLDocument_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }
@ -188,11 +188,8 @@ static HRESULT WINAPI xmldoc_Invoke(IXMLDocument *iface, DISPID dispIdMember,
hr = get_typeinfo(IXMLDocument_tid, &typeinfo); hr = get_typeinfo(IXMLDocument_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDocument_iface, dispIdMember, wFlags, hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDocument_iface, dispIdMember, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr); pDispParams, pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }

View File

@ -121,15 +121,15 @@ static HRESULT WINAPI xmlelem_GetTypeInfoCount(IXMLElement *iface, UINT* pctinfo
} }
static HRESULT WINAPI xmlelem_GetTypeInfo(IXMLElement *iface, UINT iTInfo, static HRESULT WINAPI xmlelem_GetTypeInfo(IXMLElement *iface, UINT iTInfo,
LCID lcid, ITypeInfo** ppTInfo) LCID lcid, ITypeInfo** ti)
{ {
xmlelem *This = impl_from_IXMLElement(iface); xmlelem *This = impl_from_IXMLElement(iface);
HRESULT hr; HRESULT hr;
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ti);
hr = get_typeinfo(IXMLElement_tid, ppTInfo);
hr = get_typeinfo(IXMLElement_tid, ti);
ITypeInfo_AddRef(*ti);
return hr; return hr;
} }
@ -149,10 +149,7 @@ static HRESULT WINAPI xmlelem_GetIDsOfNames(IXMLElement *iface, REFIID riid,
hr = get_typeinfo(IXMLElement_tid, &typeinfo); hr = get_typeinfo(IXMLElement_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }
@ -171,11 +168,8 @@ static HRESULT WINAPI xmlelem_Invoke(IXMLElement *iface, DISPID dispIdMember,
hr = get_typeinfo(IXMLElement_tid, &typeinfo); hr = get_typeinfo(IXMLElement_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{
hr = ITypeInfo_Invoke(typeinfo, &This->IXMLElement_iface, dispIdMember, wFlags, pDispParams, hr = ITypeInfo_Invoke(typeinfo, &This->IXMLElement_iface, dispIdMember, wFlags, pDispParams,
pVarResult, pExcepInfo, puArgErr); pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo);
}
return hr; return hr;
} }