Mike McCormack : ole32: This cannot be NULL, so don't check it.
Module: wine Branch: master Commit: a5b3479774ff29276ef26ed3c64362f3eff8dc3d URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=a5b3479774ff29276ef26ed3... Author: Mike McCormack <mike(a)codeweavers.com> Date: Wed Jul 12 13:03:22 2006 +0900 ole32: This cannot be NULL, so don't check it. --- dlls/ole32/stg_prop.c | 29 +++++++++++------------------ 1 files changed, 11 insertions(+), 18 deletions(-) diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index c7a7b6e..1773224 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -307,8 +307,7 @@ static HRESULT WINAPI IPropertyStorage_f ULONG i; TRACE("(%p, %ld, %p, %p)\n", iface, cpspec, rgpspec, rgpropvar); - if (!This) - return E_INVALIDARG; + if (cpspec && (!rgpspec || !rgpropvar)) return E_INVALIDARG; EnterCriticalSection(&This->cs); @@ -562,8 +561,7 @@ static HRESULT WINAPI IPropertyStorage_f ULONG i; TRACE("(%p, %ld, %p, %p)\n", iface, cpspec, rgpspec, rgpropvar); - if (!This) - return E_INVALIDARG; + if (cpspec && (!rgpspec || !rgpropvar)) return E_INVALIDARG; if (!(This->grfMode & STGM_READWRITE)) @@ -662,8 +660,7 @@ static HRESULT WINAPI IPropertyStorage_f HRESULT hr; TRACE("(%p, %ld, %p)\n", iface, cpspec, rgpspec); - if (!This) - return E_INVALIDARG; + if (cpspec && !rgpspec) return E_INVALIDARG; if (!(This->grfMode & STGM_READWRITE)) @@ -711,8 +708,7 @@ static HRESULT WINAPI IPropertyStorage_f HRESULT hr = S_FALSE; TRACE("(%p, %ld, %p, %p)\n", iface, cpropid, rgpropid, rglpwstrName); - if (!This) - return E_INVALIDARG; + if (cpropid && (!rgpropid || !rglpwstrName)) return E_INVALIDARG; EnterCriticalSection(&This->cs); @@ -752,8 +748,7 @@ static HRESULT WINAPI IPropertyStorage_f HRESULT hr; TRACE("(%p, %ld, %p, %p)\n", iface, cpropid, rgpropid, rglpwstrName); - if (!This) - return E_INVALIDARG; + if (cpropid && (!rgpropid || !rglpwstrName)) return E_INVALIDARG; if (!(This->grfMode & STGM_READWRITE)) @@ -786,8 +781,7 @@ static HRESULT WINAPI IPropertyStorage_f HRESULT hr; TRACE("(%p, %ld, %p)\n", iface, cpropid, rgpropid); - if (!This) - return E_INVALIDARG; + if (cpropid && !rgpropid) return E_INVALIDARG; if (!(This->grfMode & STGM_READWRITE)) @@ -823,8 +817,7 @@ static HRESULT WINAPI IPropertyStorage_f HRESULT hr; TRACE("(%p, 0x%08lx)\n", iface, grfCommitFlags); - if (!This) - return E_INVALIDARG; + if (!(This->grfMode & STGM_READWRITE)) return STG_E_ACCESSDENIED; EnterCriticalSection(&This->cs); @@ -846,8 +839,6 @@ static HRESULT WINAPI IPropertyStorage_f PropertyStorage_impl *This = (PropertyStorage_impl *)iface; TRACE("%p\n", iface); - if (!This) - return E_INVALIDARG; EnterCriticalSection(&This->cs); if (This->dirty) @@ -897,7 +888,8 @@ static HRESULT WINAPI IPropertyStorage_f PropertyStorage_impl *This = (PropertyStorage_impl *)iface; TRACE("%p, %s\n", iface, debugstr_guid(clsid)); - if (!This || !clsid) + + if (!clsid) return E_INVALIDARG; if (!(This->grfMode & STGM_READWRITE)) return STG_E_ACCESSDENIED; @@ -920,7 +912,8 @@ static HRESULT WINAPI IPropertyStorage_f HRESULT hr; TRACE("%p, %p\n", iface, statpsstg); - if (!This || !statpsstg) + + if (!statpsstg) return E_INVALIDARG; hr = IStream_Stat(This->stm, &stat, STATFLAG_NONAME);
participants (1)
-
Alexandre Julliard