From f16bbf32820388c25b31d3217036e223f83dd131 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Sun, 28 Sep 2008 17:41:47 +0100 Subject: [PATCH] ole32: Fix clipboard test failures on some versions of Windows. Some versions of ole32 don't test that the lindex field of the FORMATETC structure passed into functions is valid. --- dlls/ole32/tests/clipboard.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index ee912ce773e..e714064b55d 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -359,7 +359,10 @@ static void test_get_clipboard(void) InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL); fmtetc.lindex = 256; hr = IDataObject_QueryGetData(data_obj, &fmtetc); - ok(hr == DV_E_FORMATETC, "IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr); + ok(hr == DV_E_FORMATETC || broken(hr == S_OK), + "IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr); + if (hr == S_OK) + ReleaseStgMedium(&stgmedium); InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL); fmtetc.cfFormat = CF_RIFF; @@ -398,7 +401,13 @@ static void test_get_clipboard(void) fmtetc.lindex = 256; hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); todo_wine - ok(hr == DV_E_FORMATETC, "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr); + 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) + { + /* undo the unexpected success */ + DataObjectImpl_GetData_calls--; + ReleaseStgMedium(&stgmedium); + } InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL); fmtetc.cfFormat = CF_RIFF;