ole32: AddRef does not return an HRESULT. Have the constructor create the object with one reference.

This commit is contained in:
Huw Davies 2009-03-26 16:41:59 +00:00 committed by Alexandre Julliard
parent 25f1b058a8
commit fc78f552a0
1 changed files with 2 additions and 14 deletions

View File

@ -322,13 +322,8 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Clone
return E_INVALIDARG;
hr = enum_fmtetc_construct(This->countFmt, This->pFmt, ppenum);
if (FAILED(hr)) return hr;
/* FIXME: This is wrong! */
if (FAILED( hr = IEnumFORMATETC_AddRef(*ppenum)))
return ( hr );
return (*ppenum) ? S_OK : E_OUTOFMEMORY;
return hr;
}
static const IEnumFORMATETCVtbl efvt =
@ -347,7 +342,6 @@ static const IEnumFORMATETCVtbl efvt =
*
* Creates an IEnumFORMATETC enumerator from an array of FORMATETC
* Structures.
* NOTE: this does not AddRef the interface.
*/
static HRESULT enum_fmtetc_construct(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **obj)
{
@ -358,7 +352,7 @@ static HRESULT enum_fmtetc_construct(UINT cfmt, const FORMATETC afmt[], IEnumFOR
ef = HeapAlloc(GetProcessHeap(), 0, sizeof(*ef));
if (!ef) return E_OUTOFMEMORY;
ef->ref = 0;
ef->ref = 1;
ef->lpVtbl = &efvt;
ef->pos = 0;
@ -1046,12 +1040,6 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc(
if (FAILED(hr))
HANDLE_ERROR( hr );
/* FIXME: This is wrong! */
if (FAILED( hr = IEnumFORMATETC_AddRef(*ppenumFormatEtc)))
HANDLE_ERROR( hr );
hr = S_OK;
CLEANUP:
/*
* Free the array of FORMATETC's