Commit 55658d06 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Fix return value for IDataObject_GetData.

parent 0b3b6e67
......@@ -1246,7 +1246,8 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData(
}
if ( pformatetcIn->lindex != -1 )
return DV_E_LINDEX;
return DV_E_FORMATETC;
if ( (pformatetcIn->tymed & TYMED_HGLOBAL) != TYMED_HGLOBAL )
return DV_E_TYMED;
/*
......
......@@ -200,7 +200,7 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor
DataObjectImpl_GetData_calls++;
if(pformatetc->lindex != -1)
return DV_E_LINDEX;
return DV_E_FORMATETC;
if(!(pformatetc->tymed & TYMED_HGLOBAL))
return DV_E_TYMED;
......@@ -400,7 +400,6 @@ static void test_get_clipboard(void)
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.lindex = 256;
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
todo_wine
ok(hr == DV_E_FORMATETC || broken(hr == S_OK), "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr);
if (hr == S_OK)
{
......
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