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:
Piotr Caban 2018-09-26 14:52:22 +02:00 committed by Alexandre Julliard
parent 0e29ac0581
commit 058110369d
1 changed files with 4 additions and 8 deletions

View File

@ -508,13 +508,11 @@ static void test_get_clipboard(void)
ok(hr == DV_E_FORMATETC || broken(hr == S_OK),
"IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr);
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.cfFormat = CF_RIFF;
InitFormatEtc(fmtetc, CF_RIFF, TYMED_HGLOBAL);
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);
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.tymed = TYMED_FILE;
InitFormatEtc(fmtetc, CF_TEXT, TYMED_FILE);
hr = IDataObject_QueryGetData(data_obj, &fmtetc);
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);
}
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.cfFormat = CF_RIFF;
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);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.tymed = TYMED_FILE;
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);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);