Commit fc78f552 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ole32: AddRef does not return an HRESULT. Have the constructor create the object…

ole32: AddRef does not return an HRESULT. Have the constructor create the object with one reference.
parent 25f1b058
......@@ -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
......
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