Commit cb74cd3e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Remove useless NULL checks.

parent e9debeb6
...@@ -226,13 +226,15 @@ static HRESULT WINAPI StdDispatch_QueryInterface( ...@@ -226,13 +226,15 @@ static HRESULT WINAPI StdDispatch_QueryInterface(
void** ppvObject) void** ppvObject)
{ {
StdDispatch *This = impl_from_IDispatch(iface); StdDispatch *This = impl_from_IDispatch(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppvObject); TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject);
*ppvObject = NULL;
if (IsEqualIID(riid, &IID_IDispatch) || if (IsEqualIID(riid, &IID_IDispatch) ||
IsEqualIID(riid, &IID_IUnknown)) IsEqualIID(riid, &IID_IUnknown))
{ {
*ppvObject = This; *ppvObject = iface;
IUnknown_AddRef((LPUNKNOWN)*ppvObject); IDispatch_AddRef(iface);
return S_OK; return S_OK;
} }
return E_NOINTERFACE; return E_NOINTERFACE;
...@@ -293,10 +295,8 @@ static ULONG WINAPI StdDispatch_Release(LPDISPATCH iface) ...@@ -293,10 +295,8 @@ static ULONG WINAPI StdDispatch_Release(LPDISPATCH iface)
*/ */
static HRESULT WINAPI StdDispatch_GetTypeInfoCount(LPDISPATCH iface, UINT * pctinfo) static HRESULT WINAPI StdDispatch_GetTypeInfoCount(LPDISPATCH iface, UINT * pctinfo)
{ {
StdDispatch *This = impl_from_IDispatch(iface);
TRACE("(%p)\n", pctinfo); TRACE("(%p)\n", pctinfo);
*pctinfo = 1;
*pctinfo = This->pTypeInfo ? 1 : 0;
return S_OK; return S_OK;
} }
...@@ -327,11 +327,9 @@ static HRESULT WINAPI StdDispatch_GetTypeInfo(LPDISPATCH iface, UINT iTInfo, LCI ...@@ -327,11 +327,9 @@ static HRESULT WINAPI StdDispatch_GetTypeInfo(LPDISPATCH iface, UINT iTInfo, LCI
if (iTInfo != 0) if (iTInfo != 0)
return DISP_E_BADINDEX; return DISP_E_BADINDEX;
if (This->pTypeInfo) *ppTInfo = This->pTypeInfo;
{ ITypeInfo_AddRef(*ppTInfo);
*ppTInfo = This->pTypeInfo;
ITypeInfo_AddRef(*ppTInfo);
}
return S_OK; return S_OK;
} }
......
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