ole32: Initialize more FORMATETC fields using InitFormatEtc helper.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0e29ac0581
commit
058110369d
|
@ -508,13 +508,11 @@ static void test_get_clipboard(void)
|
||||||
ok(hr == DV_E_FORMATETC || broken(hr == S_OK),
|
ok(hr == DV_E_FORMATETC || broken(hr == S_OK),
|
||||||
"IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr);
|
"IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr);
|
||||||
|
|
||||||
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
|
InitFormatEtc(fmtetc, CF_RIFF, TYMED_HGLOBAL);
|
||||||
fmtetc.cfFormat = CF_RIFF;
|
|
||||||
hr = IDataObject_QueryGetData(data_obj, &fmtetc);
|
hr = IDataObject_QueryGetData(data_obj, &fmtetc);
|
||||||
ok(hr == DV_E_CLIPFORMAT, "IDataObject_QueryGetData should have failed with DV_E_CLIPFORMAT instead of 0x%08x\n", hr);
|
ok(hr == DV_E_CLIPFORMAT, "IDataObject_QueryGetData should have failed with DV_E_CLIPFORMAT instead of 0x%08x\n", hr);
|
||||||
|
|
||||||
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
|
InitFormatEtc(fmtetc, CF_TEXT, TYMED_FILE);
|
||||||
fmtetc.tymed = TYMED_FILE;
|
|
||||||
hr = IDataObject_QueryGetData(data_obj, &fmtetc);
|
hr = IDataObject_QueryGetData(data_obj, &fmtetc);
|
||||||
ok(hr == S_OK, "IDataObject_QueryGetData failed with error 0x%08x\n", hr);
|
ok(hr == S_OK, "IDataObject_QueryGetData failed with error 0x%08x\n", hr);
|
||||||
|
|
||||||
|
@ -552,14 +550,12 @@ static void test_get_clipboard(void)
|
||||||
ReleaseStgMedium(&stgmedium);
|
ReleaseStgMedium(&stgmedium);
|
||||||
}
|
}
|
||||||
|
|
||||||
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
|
InitFormatEtc(fmtetc, CF_RIFF, TYMED_HGLOBAL);
|
||||||
fmtetc.cfFormat = CF_RIFF;
|
|
||||||
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
|
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);
|
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);
|
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
|
||||||
|
|
||||||
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
|
InitFormatEtc(fmtetc, CF_TEXT, TYMED_FILE);
|
||||||
fmtetc.tymed = TYMED_FILE;
|
|
||||||
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
|
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);
|
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);
|
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
|
||||||
|
|
Loading…
Reference in New Issue