Skip to content

Commit

Permalink
ole32: Change DataObjectImpl_GetData return value to show more implem…
Browse files Browse the repository at this point in the history
…entation problems.

Signed-off-by: Piotr Caban <[email protected]>
Signed-off-by: Huw Davies <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>
  • Loading branch information
PiotrCW authored and julliard committed Sep 27, 2018
1 parent b8c7b33 commit 0196eee
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions dlls/ole32/tests/clipboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor
{
DataObjectImpl *This = impl_from_IDataObject(iface);
UINT i;
BOOL foundFormat = FALSE;

trace("getdata: %s\n", dump_fmtetc(pformatetc));

Expand All @@ -284,7 +283,6 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor
{
if(This->fmtetc[i].cfFormat == pformatetc->cfFormat)
{
foundFormat = TRUE;
if(This->fmtetc[i].tymed & pformatetc->tymed)
{
pmedium->pUnkForRelease = (LPUNKNOWN)iface;
Expand Down Expand Up @@ -317,7 +315,7 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor
}
}

return foundFormat ? DV_E_TYMED : DV_E_FORMATETC;
return E_FAIL;
}

static HRESULT WINAPI DataObjectImpl_GetDataHere(IDataObject* iface, FORMATETC *pformatetc, STGMEDIUM *pmedium)
Expand Down Expand Up @@ -588,12 +586,12 @@ static void test_get_clipboard(void)

InitFormatEtc(fmtetc, CF_RIFF, TYMED_HGLOBAL);
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == DV_E_FORMATETC, "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr);
todo_wine ok(hr == DV_E_FORMATETC, "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);

InitFormatEtc(fmtetc, CF_TEXT, TYMED_FILE);
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == DV_E_TYMED, "IDataObject_GetData should have failed with DV_E_TYMED instead of 0x%08x\n", hr);
todo_wine ok(hr == DV_E_TYMED, "IDataObject_GetData should have failed with DV_E_TYMED instead of 0x%08x\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);

ok(DataObjectImpl_GetData_calls == 6, "DataObjectImpl_GetData should have been called 6 times instead of %d times\n", DataObjectImpl_GetData_calls);
Expand Down Expand Up @@ -880,7 +878,7 @@ static void test_complex_get_clipboard(void)

InitFormatEtc(fmtetc, CF_METAFILEPICT, TYMED_HGLOBAL);
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr);
todo_wine ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);

InitFormatEtc(fmtetc, CF_ENHMETAFILE, TYMED_HGLOBAL);
Expand Down

0 comments on commit 0196eee

Please sign in to comment.