1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

shell32: Do not interpret the direction in IDataObject::EnumFormatEtc().

This commit is contained in:
Zebediah Figura 2024-03-04 23:44:45 -06:00 committed by Alexandre Julliard
parent b6128bbb51
commit 0344f3aa85
2 changed files with 7 additions and 16 deletions

View file

@ -368,21 +368,15 @@ static HRESULT WINAPI IDataObject_fnSetData(IDataObject *iface, LPFORMATETC pfor
return E_NOTIMPL;
}
static HRESULT WINAPI IDataObject_fnEnumFormatEtc(IDataObject *iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
static HRESULT WINAPI IDataObject_fnEnumFormatEtc(IDataObject *iface, DWORD direction, IEnumFORMATETC **out)
{
IDataObjectImpl *This = impl_from_IDataObject(iface);
IDataObjectImpl *obj = impl_from_IDataObject(iface);
TRACE("(%p)->()\n", This);
*ppenumFormatEtc=NULL;
TRACE("iface %p, direction %#lx, out %p.\n", iface, direction, out);
/* only get data */
if (DATADIR_GET == dwDirection)
{
*ppenumFormatEtc = IEnumFORMATETC_Constructor(MAX_FORMATS, This->pFormatEtc);
return (*ppenumFormatEtc) ? S_OK : E_FAIL;
}
return E_NOTIMPL;
if (!(*out = IEnumFORMATETC_Constructor(MAX_FORMATS, obj->pFormatEtc)))
return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI IDataObject_fnDAdvise(IDataObject *iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)

View file

@ -5478,10 +5478,7 @@ static void test_DataObject(void)
for (unsigned int i = 0; i < ARRAY_SIZE(enum_directions); ++i)
{
hr = IDataObject_EnumFormatEtc(data_obj, enum_directions[i], &enum_format);
todo_wine_if (enum_directions[i] == DATADIR_SET)
ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (hr != S_OK)
continue;
ok(hr == S_OK, "Got hr %#lx.\n", hr);
memset(&fmt, 0xcc, sizeof(fmt));
hr = IEnumFORMATETC_Next(enum_format, 1, &fmt, NULL);