From 55658d061c92e401e255474ac2c1d7a5eef8f32e Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sat, 20 Dec 2008 12:43:36 +0300 Subject: [PATCH] ole32: Fix return value for IDataObject_GetData. --- dlls/ole32/clipboard.c | 3 ++- dlls/ole32/tests/clipboard.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 762afc7c3bf..9b290bb314f 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -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; /* diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index 7e3809e620e..8445f8b1c0f 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -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) {