Commit a7421744 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

ole32/tests: Enable compilation with long types.

parent 3aa87091
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = ole32.dll
IMPORTS = oleaut32 ole32 user32 uuid gdi32 advapi32
......
......@@ -46,7 +46,7 @@ static inline char *dump_fmtetc(FORMATETC *fmt)
{
static char buf[100];
sprintf(buf, "cf %04x ptd %p aspect %x lindex %d tymed %x",
sprintf(buf, "cf %04x ptd %p aspect %lx lindex %ld tymed %lx",
fmt->cfFormat, fmt->ptd, fmt->dwAspect, fmt->lindex, fmt->tymed);
return buf;
}
......@@ -153,7 +153,7 @@ static HRESULT WINAPI EnumFormatImpl_Next(IEnumFORMATETC *iface, ULONG celt,
ULONG count, i;
if (winetest_debug > 1)
trace("next: count %d cur %d\n", celt, This->cur);
trace("next: count %ld cur %d\n", celt, This->cur);
if(!rgelt)
return E_INVALIDARG;
......@@ -274,7 +274,7 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor
DataObjectImpl_GetData_calls++;
ok(pmedium->tymed == 0, "pmedium->tymed = %u\n", pmedium->tymed);
ok(pmedium->tymed == 0, "pmedium->tymed = %lu\n", pmedium->tymed);
ok(U(*pmedium).hGlobal == NULL, "pmedium->hGlobal = %p\n", U(*pmedium).hGlobal);
ok(pmedium->pUnkForRelease == NULL, "pmedium->pUnkForRelease = %p\n", pmedium->pUnkForRelease);
......@@ -373,7 +373,7 @@ static HRESULT WINAPI DataObjectImpl_EnumFormatEtc(IDataObject* iface, DWORD dwD
DataObjectImpl_EnumFormatEtc_calls++;
if(dwDirection != DATADIR_GET) {
ok(0, "unexpected direction %d\n", dwDirection);
ok(0, "unexpected direction %ld\n", dwDirection);
return E_NOTIMPL;
}
return EnumFormatImpl_Create(This->fmtetc, This->fmtetc_cnt, ppenumFormatEtc);
......@@ -510,18 +510,18 @@ static void test_get_clipboard_uninitialized(void)
pDObj = (IDataObject *)0xdeadbeef;
hr = OleGetClipboard(&pDObj);
ok(hr == S_OK, "OleGetClipboard() got 0x%08x instead of 0x%08x\n", hr, S_OK);
ok(hr == S_OK, "OleGetClipboard() got 0x%08lx instead of 0x%08lx\n", hr, S_OK);
ok(!!pDObj && pDObj != (IDataObject *)0xdeadbeef, "Got unexpected pDObj %p.\n", pDObj);
/* COM is still not initialized. */
hr = CoCreateInstance(rclsid, NULL, 0x17, &IID_IUnknown, (void **)&pUnk);
ok(hr == CO_E_NOTINITIALIZED, "Got unexpected hr %#x.\n", hr);
ok(hr == CO_E_NOTINITIALIZED, "Got unexpected hr %#lx.\n", hr);
hr = OleFlushClipboard();
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = OleIsCurrentClipboard(pDObj);
ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr);
ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
IDataObject_Release(pDObj);
}
......@@ -534,10 +534,10 @@ static void test_get_clipboard(void)
STGMEDIUM stgmedium;
hr = OleGetClipboard(NULL);
ok(hr == E_INVALIDARG, "OleGetClipboard(NULL) should return E_INVALIDARG instead of 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "OleGetClipboard(NULL) should return E_INVALIDARG instead of 0x%08lx\n", hr);
hr = OleGetClipboard(&data_obj);
ok(hr == S_OK, "OleGetClipboard failed with error 0x%08x\n", hr);
ok(hr == S_OK, "OleGetClipboard failed with error 0x%08lx\n", hr);
/* test IDataObject_QueryGetData */
......@@ -546,31 +546,31 @@ static void test_get_clipboard(void)
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
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%08lx\n", hr);
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.dwAspect = 0xdeadbeef;
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, "IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08lx\n", hr);
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.dwAspect = DVASPECT_THUMBNAIL;
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, "IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08lx\n", hr);
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.lindex = 256;
hr = IDataObject_QueryGetData(data_obj, &fmtetc);
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%08lx\n", hr);
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);
ok(hr == DV_E_CLIPFORMAT, "IDataObject_QueryGetData should have failed with DV_E_CLIPFORMAT instead of 0x%08lx\n", hr);
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);
ok(hr == S_OK, "IDataObject_QueryGetData failed with error 0x%08lx\n", hr);
expect_DataObjectImpl_QueryGetData = TRUE;
......@@ -580,25 +580,25 @@ static void test_get_clipboard(void)
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr);
ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.dwAspect = 0xdeadbeef;
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr);
ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.dwAspect = DVASPECT_THUMBNAIL;
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr);
ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL);
fmtetc.lindex = 256;
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == DV_E_FORMATETC || broken(hr == S_OK), "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%08lx\n", hr);
if (hr == S_OK)
{
/* undo the unexpected success */
......@@ -608,15 +608,15 @@ static void test_get_clipboard(void)
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);
ok(hr == DV_E_FORMATETC, "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
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);
ok(hr == DV_E_TYMED, "IDataObject_GetData should have failed with DV_E_TYMED instead of 0x%08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
ok(DataObjectImpl_GetData_calls == 6, "DataObjectImpl_GetData should have been called 6 times instead of %d times\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetData_calls == 6, "DataObjectImpl_GetData should have been called 6 times instead of %ld times\n", DataObjectImpl_GetData_calls);
IDataObject_Release(data_obj);
}
......@@ -630,16 +630,16 @@ static void test_enum_fmtetc(IDataObject *src)
DWORD count = 0;
hr = OleGetClipboard(&data);
ok(hr == S_OK, "OleGetClipboard failed with error 0x%08x\n", hr);
ok(hr == S_OK, "OleGetClipboard failed with error 0x%08lx\n", hr);
hr = IDataObject_EnumFormatEtc(data, DATADIR_SET, &enum_fmt);
ok(hr == E_NOTIMPL ||
broken(hr == E_INVALIDARG), /* win98 (not win98SE) */
"got %08x\n", hr);
"got %08lx\n", hr);
DataObjectImpl_EnumFormatEtc_calls = 0;
hr = IDataObject_EnumFormatEtc(data, DATADIR_GET, &enum_fmt);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(DataObjectImpl_EnumFormatEtc_calls == 0, "EnumFormatEtc was called\n");
if (FAILED(hr))
{
......@@ -653,32 +653,32 @@ static void test_enum_fmtetc(IDataObject *src)
{
ok(src != NULL, "shouldn't be here\n");
hr = IEnumFORMATETC_Next(src_enum, 1, &src_fmt, NULL);
ok(hr == S_OK, "%d: got %08x\n", count, hr);
trace("%d: %s\n", count, dump_fmtetc(&fmt));
ok(fmt.cfFormat == src_fmt.cfFormat, "%d: %04x %04x\n", count, fmt.cfFormat, src_fmt.cfFormat);
ok(fmt.dwAspect == src_fmt.dwAspect, "%d: %08x %08x\n", count, fmt.dwAspect, src_fmt.dwAspect);
ok(fmt.lindex == src_fmt.lindex, "%d: %08x %08x\n", count, fmt.lindex, src_fmt.lindex);
ok(fmt.tymed == src_fmt.tymed, "%d: %08x %08x\n", count, fmt.tymed, src_fmt.tymed);
ok(hr == S_OK, "%ld: got %08lx\n", count, hr);
trace("%ld: %s\n", count, dump_fmtetc(&fmt));
ok(fmt.cfFormat == src_fmt.cfFormat, "%ld: %04x %04x\n", count, fmt.cfFormat, src_fmt.cfFormat);
ok(fmt.dwAspect == src_fmt.dwAspect, "%ld: %08lx %08lx\n", count, fmt.dwAspect, src_fmt.dwAspect);
ok(fmt.lindex == src_fmt.lindex, "%ld: %08lx %08lx\n", count, fmt.lindex, src_fmt.lindex);
ok(fmt.tymed == src_fmt.tymed, "%ld: %08lx %08lx\n", count, fmt.tymed, src_fmt.tymed);
if(fmt.ptd)
{
ok(src_fmt.ptd != NULL, "%d: expected non-NULL\n", count);
ok(src_fmt.ptd != NULL, "%ld: expected non-NULL\n", count);
CoTaskMemFree(fmt.ptd);
CoTaskMemFree(src_fmt.ptd);
}
count++;
}
ok(hr == S_FALSE, "%d: got %08x\n", count, hr);
ok(hr == S_FALSE, "%ld: got %08lx\n", count, hr);
if(src)
{
hr = IEnumFORMATETC_Next(src_enum, 1, &src_fmt, NULL);
ok(hr == S_FALSE, "%d: got %08x\n", count, hr);
ok(hr == S_FALSE, "%ld: got %08lx\n", count, hr);
IEnumFORMATETC_Release(src_enum);
}
hr = IEnumFORMATETC_Reset(enum_fmt);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
if(src) /* Exercise the enumerator a bit */
{
......@@ -686,24 +686,24 @@ static void test_enum_fmtetc(IDataObject *src)
FORMATETC third_fmt;
hr = IEnumFORMATETC_Next(enum_fmt, 1, &third_fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &third_fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &third_fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IEnumFORMATETC_Reset(enum_fmt);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IEnumFORMATETC_Skip(enum_fmt, 2);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IEnumFORMATETC_Clone(enum_fmt, &clone);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(fmt.cfFormat == third_fmt.cfFormat, "formats don't match\n");
hr = IEnumFORMATETC_Next(clone, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(fmt.cfFormat == third_fmt.cfFormat, "formats don't match\n");
IEnumFORMATETC_Release(clone);
}
......@@ -746,7 +746,7 @@ static void test_cf_dataobject(IDataObject *data)
HWND clip_owner = GetClipboardOwner();
found_dataobject = TRUE;
ok(size >= sizeof(*ptr), "size %d\n", size);
ok(size >= sizeof(*ptr), "size %ld\n", size);
if(data)
ok(*ptr == clip_owner, "hwnd %p clip_owner %p\n", *ptr, clip_owner);
else /* ole clipboard flushed */
......@@ -788,7 +788,7 @@ static void test_cf_dataobject(IDataObject *data)
CLIPFORMAT cfs_seen[10];
hr = IDataObject_EnumFormatEtc(data, DATADIR_GET, &enum_fmt);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
fmt_ptr = priv->fmts;
while(IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL) == S_OK)
......@@ -798,11 +798,11 @@ static void test_cf_dataobject(IDataObject *data)
ok(fmt_ptr->fmt.cfFormat == fmt.cfFormat,
"got %08x expected %08x\n", fmt_ptr->fmt.cfFormat, fmt.cfFormat);
ok(fmt_ptr->fmt.dwAspect == fmt.dwAspect, "got %08x expected %08x\n",
ok(fmt_ptr->fmt.dwAspect == fmt.dwAspect, "got %08lx expected %08lx\n",
fmt_ptr->fmt.dwAspect, fmt.dwAspect);
ok(fmt_ptr->fmt.lindex == fmt.lindex, "got %08x expected %08x\n",
ok(fmt_ptr->fmt.lindex == fmt.lindex, "got %08lx expected %08lx\n",
fmt_ptr->fmt.lindex, fmt.lindex);
ok(fmt_ptr->fmt.tymed == fmt.tymed, "got %08x expected %08x\n",
ok(fmt_ptr->fmt.tymed == fmt.tymed, "got %08lx expected %08lx\n",
fmt_ptr->fmt.tymed, fmt.tymed);
for(i = 0; i < count; i++)
if(fmt_ptr->fmt.cfFormat == cfs_seen[i])
......@@ -813,8 +813,8 @@ static void test_cf_dataobject(IDataObject *data)
cfs_seen[count] = fmt.cfFormat;
ok(fmt_ptr->first_use_of_cf != seen_cf, "got %08x expected %08x\n",
fmt_ptr->first_use_of_cf, !seen_cf);
ok(fmt_ptr->res[0] == 0, "got %08x\n", fmt_ptr->res[0]);
ok(fmt_ptr->res[1] == 0, "got %08x\n", fmt_ptr->res[1]);
ok(fmt_ptr->res[0] == 0, "got %08lx\n", fmt_ptr->res[0]);
ok(fmt_ptr->res[1] == 0, "got %08lx\n", fmt_ptr->res[1]);
if(fmt.ptd)
{
DVTARGETDEVICE *target;
......@@ -827,16 +827,16 @@ static void test_cf_dataobject(IDataObject *data)
fmt_ptr++;
count++;
}
ok(priv->res1 == 0, "got %08x\n", priv->res1);
ok(priv->res2 == 1, "got %08x\n", priv->res2);
ok(priv->count == count, "got %08x expected %08x\n", priv->count, count);
ok(priv->res3[0] == 0, "got %08x\n", priv->res3[0]);
ok(priv->res1 == 0, "got %08lx\n", priv->res1);
ok(priv->res2 == 1, "got %08lx\n", priv->res2);
ok(priv->count == count, "got %08lx expected %08lx\n", priv->count, count);
ok(priv->res3[0] == 0, "got %08lx\n", priv->res3[0]);
/* win64 sets the lsb */
if(sizeof(fmt_ptr->fmt.ptd) == 8)
todo_wine ok(priv->res3[1] == 1, "got %08x\n", priv->res3[1]);
todo_wine ok(priv->res3[1] == 1, "got %08lx\n", priv->res3[1]);
else
ok(priv->res3[1] == 0, "got %08x\n", priv->res3[1]);
ok(priv->res3[1] == 0, "got %08lx\n", priv->res3[1]);
GlobalUnlock(h);
IEnumFORMATETC_Release(enum_fmt);
......@@ -851,11 +851,11 @@ static void test_cf_dataobject(IDataObject *data)
DataObjectImpl_GetDataHere_calls = 0;
h = GetClipboardData(cf);
ok(DataObjectImpl_GetDataHere_calls == 1, "got %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetDataHere_calls == 1, "got %ld\n", DataObjectImpl_GetDataHere_calls);
ptr = GlobalLock(h);
size = GlobalSize(h);
ok(size == strlen(cmpl_stm_data),
"expected %d got %d\n", lstrlenA(cmpl_stm_data), size);
"expected %d got %ld\n", lstrlenA(cmpl_stm_data), size);
ok(!memcmp(ptr, cmpl_stm_data, strlen(cmpl_stm_data)), "mismatch\n");
GlobalUnlock(h);
}
......@@ -867,11 +867,11 @@ static void test_cf_dataobject(IDataObject *data)
DataObjectImpl_GetDataHere_calls = 0;
h = GetClipboardData(cf);
ok(DataObjectImpl_GetDataHere_calls == 0, "got %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetDataHere_calls == 0, "got %ld\n", DataObjectImpl_GetDataHere_calls);
ptr = GlobalLock(h);
size = GlobalSize(h);
ok(size == strlen(cmpl_text_data) + 1,
"expected %d got %d\n", lstrlenA(cmpl_text_data) + 1, size);
"expected %d got %ld\n", lstrlenA(cmpl_text_data) + 1, size);
ok(!memcmp(ptr, cmpl_text_data, strlen(cmpl_text_data) + 1), "mismatch\n");
GlobalUnlock(h);
}
......@@ -889,32 +889,32 @@ static void test_complex_get_clipboard(void)
STGMEDIUM stgmedium;
hr = OleGetClipboard(&data_obj);
ok(hr == S_OK, "OleGetClipboard failed with error 0x%08x\n", hr);
ok(hr == S_OK, "OleGetClipboard failed with error 0x%08lx\n", hr);
DataObjectImpl_GetData_calls = 0;
InitFormatEtc(fmtetc, CF_METAFILEPICT, TYMED_MFPICT);
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr);
ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
InitFormatEtc(fmtetc, CF_METAFILEPICT, TYMED_HGLOBAL);
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr);
ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
InitFormatEtc(fmtetc, CF_ENHMETAFILE, TYMED_HGLOBAL);
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr);
ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
InitFormatEtc(fmtetc, CF_ENHMETAFILE, TYMED_ENHMF);
hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr);
ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium);
ok(DataObjectImpl_GetData_calls == 5,
"DataObjectImpl_GetData called 5 times instead of %d times\n",
"DataObjectImpl_GetData called 5 times instead of %ld times\n",
DataObjectImpl_GetData_calls);
IDataObject_Release(data_obj);
}
......@@ -934,51 +934,51 @@ static void test_set_clipboard(void)
cf_onemore = RegisterClipboardFormatA("one more format");
hr = DataObjectImpl_CreateText("data1", &data1);
ok(hr == S_OK, "Failed to create data1 object: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to create data1 object: 0x%08lx\n", hr);
if(FAILED(hr))
return;
hr = DataObjectImpl_CreateText("data2", &data2);
ok(hr == S_OK, "Failed to create data2 object: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to create data2 object: 0x%08lx\n", hr);
if(FAILED(hr))
return;
hr = DataObjectImpl_CreateComplex(&data_cmpl);
ok(hr == S_OK, "Failed to create complex data object: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to create complex data object: 0x%08lx\n", hr);
if(FAILED(hr))
return;
hr = OleSetClipboard(data1);
ok(hr == CO_E_NOTINITIALIZED, "OleSetClipboard should have failed with CO_E_NOTINITIALIZED instead of 0x%08x\n", hr);
ok(hr == CO_E_NOTINITIALIZED, "OleSetClipboard should have failed with CO_E_NOTINITIALIZED instead of 0x%08lx\n", hr);
CoInitialize(NULL);
hr = OleSetClipboard(data1);
ok(hr == CO_E_NOTINITIALIZED, "OleSetClipboard failed with 0x%08x\n", hr);
ok(hr == CO_E_NOTINITIALIZED, "OleSetClipboard failed with 0x%08lx\n", hr);
CoUninitialize();
hr = OleInitialize(NULL);
ok(hr == S_OK, "OleInitialize failed with error 0x%08x\n", hr);
ok(hr == S_OK, "OleInitialize failed with error 0x%08lx\n", hr);
hr = OleSetClipboard(data1);
ok(hr == S_OK, "failed to set clipboard to data1, hr = 0x%08x\n", hr);
ok(hr == S_OK, "failed to set clipboard to data1, hr = 0x%08lx\n", hr);
test_cf_dataobject(data1);
hr = OleIsCurrentClipboard(data1);
ok(hr == S_OK, "expected current clipboard to be data1, hr = 0x%08x\n", hr);
ok(hr == S_OK, "expected current clipboard to be data1, hr = 0x%08lx\n", hr);
hr = OleIsCurrentClipboard(data2);
ok(hr == S_FALSE, "did not expect current clipboard to be data2, hr = 0x%08x\n", hr);
ok(hr == S_FALSE, "did not expect current clipboard to be data2, hr = 0x%08lx\n", hr);
hr = OleIsCurrentClipboard(NULL);
ok(hr == S_FALSE, "expect S_FALSE, hr = 0x%08x\n", hr);
ok(hr == S_FALSE, "expect S_FALSE, hr = 0x%08lx\n", hr);
test_get_clipboard();
hr = OleSetClipboard(data2);
ok(hr == S_OK, "failed to set clipboard to data2, hr = 0x%08x\n", hr);
ok(hr == S_OK, "failed to set clipboard to data2, hr = 0x%08lx\n", hr);
hr = OleIsCurrentClipboard(data1);
ok(hr == S_FALSE, "did not expect current clipboard to be data1, hr = 0x%08x\n", hr);
ok(hr == S_FALSE, "did not expect current clipboard to be data1, hr = 0x%08lx\n", hr);
hr = OleIsCurrentClipboard(data2);
ok(hr == S_OK, "expected current clipboard to be data2, hr = 0x%08x\n", hr);
ok(hr == S_OK, "expected current clipboard to be data2, hr = 0x%08lx\n", hr);
hr = OleIsCurrentClipboard(NULL);
ok(hr == S_FALSE, "expect S_FALSE, hr = 0x%08x\n", hr);
ok(hr == S_FALSE, "expect S_FALSE, hr = 0x%08lx\n", hr);
/* put a format directly onto the clipboard to show
OleFlushClipboard doesn't empty the clipboard */
......@@ -997,13 +997,13 @@ static void test_set_clipboard(void)
ok( CloseClipboard(), "CloseClipboard failed\n" );
hr = OleFlushClipboard();
ok(hr == S_OK, "failed to flush clipboard, hr = 0x%08x\n", hr);
ok(hr == S_OK, "failed to flush clipboard, hr = 0x%08lx\n", hr);
hr = OleIsCurrentClipboard(data1);
ok(hr == S_FALSE, "did not expect current clipboard to be data1, hr = 0x%08x\n", hr);
ok(hr == S_FALSE, "did not expect current clipboard to be data1, hr = 0x%08lx\n", hr);
hr = OleIsCurrentClipboard(data2);
ok(hr == S_FALSE, "did not expect current clipboard to be data2, hr = 0x%08x\n", hr);
ok(hr == S_FALSE, "did not expect current clipboard to be data2, hr = 0x%08lx\n", hr);
hr = OleIsCurrentClipboard(NULL);
ok(hr == S_FALSE, "expect S_FALSE, hr = 0x%08x\n", hr);
ok(hr == S_FALSE, "expect S_FALSE, hr = 0x%08lx\n", hr);
/* format should survive the flush */
ok( OpenClipboard(NULL), "OpenClipboard failed\n" );
......@@ -1017,7 +1017,7 @@ static void test_set_clipboard(void)
test_cf_dataobject(NULL);
hr = OleSetClipboard(NULL);
ok(hr == S_OK, "Failed to clear clipboard, hr = 0x%08x\n", hr);
ok(hr == S_OK, "Failed to clear clipboard, hr = 0x%08lx\n", hr);
OpenClipboard(NULL);
h = GetClipboardData(cf_onemore);
......@@ -1026,23 +1026,23 @@ static void test_set_clipboard(void)
trace("setting complex\n");
hr = OleSetClipboard(data_cmpl);
ok(hr == S_OK, "failed to set clipboard to complex data, hr = 0x%08x\n", hr);
ok(hr == S_OK, "failed to set clipboard to complex data, hr = 0x%08lx\n", hr);
test_complex_get_clipboard();
test_cf_dataobject(data_cmpl);
test_enum_fmtetc(data_cmpl);
hr = OleSetClipboard(NULL);
ok(hr == S_OK, "failed to clear clipboard, hr = 0x%08x.\n", hr);
ok(hr == S_OK, "failed to clear clipboard, hr = 0x%08lx.\n", hr);
test_no_cf_dataobject();
test_enum_fmtetc(NULL);
ref = IDataObject_Release(data1);
ok(ref == 0, "expected data1 ref=0, got %d\n", ref);
ok(ref == 0, "expected data1 ref=0, got %ld\n", ref);
ref = IDataObject_Release(data2);
ok(ref == 0, "expected data2 ref=0, got %d\n", ref);
ok(ref == 0, "expected data2 ref=0, got %ld\n", ref);
ref = IDataObject_Release(data_cmpl);
ok(ref == 0, "expected data_cmpl ref=0, got %d\n", ref);
ok(ref == 0, "expected data_cmpl ref=0, got %ld\n", ref);
OleUninitialize();
}
......@@ -1065,7 +1065,7 @@ static LRESULT CALLBACK clipboard_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARA
/* this demonstrates an issue in Qt where it will free the data while it's being set */
HRESULT hr = OleIsCurrentClipboard( clip_data );
ok( hr == (wm_drawclipboard > 1) ? S_OK : S_FALSE,
"OleIsCurrentClipboard returned %x\n", hr );
"OleIsCurrentClipboard returned %lx\n", hr );
}
break;
case WM_CHANGECBCHAIN:
......@@ -1101,7 +1101,7 @@ static void test_set_clipboard_DRAWCLIPBOARD(void)
HANDLE thread;
hr = DataObjectImpl_CreateText("data", &data);
ok(hr == S_OK, "Failed to create data object: 0x%08x\n", hr);
ok(hr == S_OK, "Failed to create data object: 0x%08lx\n", hr);
memset(&cls, 0, sizeof(cls));
cls.lpfnWndProc = clipboard_wnd_proc;
......@@ -1110,33 +1110,33 @@ static void test_set_clipboard_DRAWCLIPBOARD(void)
RegisterClassA(&cls);
viewer = CreateWindowA("clipboard_test", NULL, 0, 0, 0, 0, 0, NULL, 0, NULL, 0);
ok(viewer != NULL, "CreateWindow failed: %d\n", GetLastError());
ok(viewer != NULL, "CreateWindow failed: %ld\n", GetLastError());
next_wnd = SetClipboardViewer( viewer );
ret = SendMessageA( viewer, WM_USER, 0, 0 );
ok( ret == 1, "%u WM_DRAWCLIPBOARD received\n", ret );
hr = OleInitialize(NULL);
ok(hr == S_OK, "OleInitialize failed with error 0x%08x\n", hr);
ok(hr == S_OK, "OleInitialize failed with error 0x%08lx\n", hr);
ret = SendMessageA( viewer, WM_USER, 0, 0 );
ok( !ret, "%u WM_DRAWCLIPBOARD received\n", ret );
thread = CreateThread(NULL, 0, set_clipboard_thread, NULL, 0, NULL);
ok(thread != NULL, "CreateThread failed (%d)\n", GetLastError());
ok(thread != NULL, "CreateThread failed (%ld)\n", GetLastError());
ret = WaitForSingleObject(thread, 5000);
ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", ret);
clip_data = data;
hr = OleSetClipboard(data);
ok(hr == S_OK, "failed to set clipboard to data, hr = 0x%08x\n", hr);
ok(hr == S_OK, "failed to set clipboard to data, hr = 0x%08lx\n", hr);
ret = SendMessageA( viewer, WM_USER, 0, 0 );
ok( ret == 2, "%u WM_DRAWCLIPBOARD received\n", ret );
clip_data = NULL;
hr = OleFlushClipboard();
ok(hr == S_OK, "failed to flush clipboard, hr = 0x%08x\n", hr);
ok(hr == S_OK, "failed to flush clipboard, hr = 0x%08lx\n", hr);
ret = IDataObject_Release(data);
ok(ret == 0, "got %d\n", ret);
......@@ -1167,41 +1167,41 @@ static void test_consumer_refs(void)
a different data object */
hr = DataObjectImpl_CreateText("data1", &src);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = DataObjectImpl_CreateText("data2", &src2);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleSetClipboard(src);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleGetClipboard(&get1);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleGetClipboard(&get2);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(get1 == get2, "data objects differ\n");
refs = IDataObject_Release(get2);
ok(refs == (get1 == get2 ? 1 : 0), "got %d\n", refs);
ok(refs == (get1 == get2 ? 1 : 0), "got %ld\n", refs);
OleFlushClipboard();
DataObjectImpl_GetData_calls = 0;
hr = IDataObject_GetData(get1, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(DataObjectImpl_GetData_calls == 0, "GetData called\n");
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
hr = OleGetClipboard(&get2);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(get1 != get2, "data objects match\n");
hr = OleSetClipboard(NULL);
ok(hr == S_OK, "Failed to clear clipboard, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to clear clipboard, hr %#lx.\n", hr);
hr = OleGetClipboard(&get3);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(get1 != get3, "data objects match\n");
ok(get2 != get3, "data objects match\n");
......@@ -1214,75 +1214,75 @@ static void test_consumer_refs(void)
takes a ref on our src data obj. */
hr = OleSetClipboard(src);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
old_refs = count_refs(src);
hr = OleGetClipboard(&get1);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
refs = count_refs(src);
ok(refs == old_refs, "%d %d\n", refs, old_refs);
ok(refs == old_refs, "%ld %ld\n", refs, old_refs);
DataObjectImpl_GetData_calls = 0;
hr = IDataObject_GetData(get1, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(DataObjectImpl_GetData_calls == 1, "GetData not called\n");
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
refs = count_refs(src);
ok(refs == old_refs + 1, "%d %d\n", refs, old_refs);
ok(refs == old_refs + 1, "%ld %ld\n", refs, old_refs);
OleFlushClipboard();
DataObjectImpl_GetData_calls = 0;
hr = IDataObject_GetData(get1, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(DataObjectImpl_GetData_calls == 1, "GetData not called\n");
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
refs = count_refs(src);
ok(refs == 2, "%d\n", refs);
ok(refs == 2, "%ld\n", refs);
IDataObject_Release(get1);
refs = count_refs(src);
ok(refs == 1, "%d\n", refs);
ok(refs == 1, "%ld\n", refs);
/* Now set a second src object before the call to GetData
and show that GetData calls that second src. */
hr = OleSetClipboard(src);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
old_refs = count_refs(src);
hr = OleGetClipboard(&get1);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
refs = count_refs(src);
ok(refs == old_refs, "%d %d\n", refs, old_refs);
ok(refs == old_refs, "%ld %ld\n", refs, old_refs);
hr = OleSetClipboard(src2);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
old_refs = count_refs(src2);
DataObjectImpl_GetData_calls = 0;
hr = IDataObject_GetData(get1, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(DataObjectImpl_GetData_calls == 1, "GetData not called\n");
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
refs = count_refs(src);
ok(refs == 1, "%d\n", refs);
ok(refs == 1, "%ld\n", refs);
refs = count_refs(src2);
ok(refs == old_refs + 1, "%d %d\n", refs, old_refs);
ok(refs == old_refs + 1, "%ld %ld\n", refs, old_refs);
hr = OleSetClipboard(NULL);
ok(hr == S_OK, "Failed to clear clipboard, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to clear clipboard, hr %#lx.\n", hr);
refs = count_refs(src2);
ok(refs == 2, "%d\n", refs);
ok(refs == 2, "%ld\n", refs);
IDataObject_Release(get1);
......@@ -1291,25 +1291,25 @@ static void test_consumer_refs(void)
/* Show that OleUninitialize() doesn't release the
dataobject's ref, and thus the object is leaked. */
old_refs = count_refs(src);
ok(old_refs == 1, "%d\n", old_refs);
ok(old_refs == 1, "%ld\n", old_refs);
hr = OleSetClipboard(src);
ok(hr == S_OK, "Failed to clear clipboard, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to clear clipboard, hr %#lx.\n", hr);
refs = count_refs(src);
ok(refs > old_refs, "%d %d\n", refs, old_refs);
ok(refs > old_refs, "%ld %ld\n", refs, old_refs);
OleUninitialize();
refs = count_refs(src);
ok(refs == 2, "%d\n", refs);
ok(refs == 2, "%ld\n", refs);
OleInitialize(NULL);
hr = OleSetClipboard(NULL);
ok(hr == S_OK, "Failed to clear clipboard, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to clear clipboard, hr %#lx.\n", hr);
OleUninitialize();
refs = count_refs(src);
ok(refs == 2, "%d\n", refs);
ok(refs == 2, "%ld\n", refs);
IDataObject_Release(src);
}
......@@ -1322,12 +1322,12 @@ static HGLOBAL create_storage(void)
HRESULT hr;
hr = CreateILockBytesOnHGlobal(NULL, FALSE, &ilb);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = StgCreateDocfileOnILockBytes(ilb, STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &stg);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
IStorage_Release(stg);
hr = GetHGlobalFromILockBytes(ilb, &hg);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ILockBytes_Release(ilb);
return hg;
}
......@@ -1344,109 +1344,109 @@ static void test_flushed_getdata(void)
OleInitialize(NULL);
hr = DataObjectImpl_CreateComplex(&src);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleSetClipboard(src);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleFlushClipboard();
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleGetClipboard(&get);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
/* global format -> global & stream */
InitFormatEtc(fmt, CF_TEXT, TYMED_HGLOBAL);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, CF_TEXT, TYMED_ISTREAM);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, CF_TEXT, TYMED_ISTORAGE);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == E_FAIL, "got %08x\n", hr);
ok(hr == E_FAIL, "got %08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, CF_TEXT, 0xffff);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
/* stream format -> global & stream */
InitFormatEtc(fmt, cf_stream, TYMED_ISTREAM);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, cf_stream, TYMED_ISTORAGE);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == E_FAIL, "got %08x\n", hr);
ok(hr == E_FAIL, "got %08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, cf_stream, TYMED_HGLOBAL);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, cf_stream, 0xffff);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
/* storage format -> global, stream & storage */
InitFormatEtc(fmt, cf_storage, TYMED_ISTORAGE);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) {
hr = IStorage_Stat(med.u.pstg, &stat, STATFLAG_NONAME);
ok(hr == S_OK, "got %08x\n", hr);
ok(stat.grfMode == (STGM_SHARE_EXCLUSIVE | STGM_READWRITE), "got %08x\n", stat.grfMode);
ok(hr == S_OK, "got %08lx\n", hr);
ok(stat.grfMode == (STGM_SHARE_EXCLUSIVE | STGM_READWRITE), "got %08lx\n", stat.grfMode);
ReleaseStgMedium(&med);
}
InitFormatEtc(fmt, cf_storage, TYMED_ISTREAM);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, cf_storage, TYMED_HGLOBAL);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, cf_storage, TYMED_HGLOBAL | TYMED_ISTREAM);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, cf_storage, 0xffff);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
/* complex format with target device */
InitFormatEtc(fmt, cf_another, 0xffff);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
if (0) /* Causes crashes on both Wine and Windows */
......@@ -1466,8 +1466,8 @@ static void test_flushed_getdata(void)
memcpy(fmt.ptd->tdData + sizeof(device_name), &dm, dm.dmSize + dm.dmDriverExtra);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
HeapFree(GetProcessHeap(), 0, fmt.ptd);
......@@ -1476,43 +1476,43 @@ static void test_flushed_getdata(void)
/* CF_ENHMETAFILE format */
InitFormatEtc(fmt, CF_ENHMETAFILE, TYMED_ENHMF);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
IDataObject_Release(get);
IDataObject_Release(src);
hr = DataObjectImpl_CreateFromHGlobal(create_storage(), &src);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleSetClipboard(src);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleGetClipboard(&get);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
InitFormatEtc(fmt, CF_TEXT, TYMED_ISTORAGE);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
IDataObject_Release(get);
hr = OleFlushClipboard();
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleGetClipboard(&get);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
InitFormatEtc(fmt, CF_TEXT, TYMED_ISTORAGE);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, CF_TEXT, 0xffff);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
IDataObject_Release(get);
......@@ -1570,22 +1570,22 @@ static void test_nonole_clipboard(void)
HDROP hdrop;
r = OpenClipboard(NULL);
ok(r, "gle %d\n", GetLastError());
ok(r, "gle %ld\n", GetLastError());
r = EmptyClipboard();
ok(r, "gle %d\n", GetLastError());
ok(r, "gle %ld\n", GetLastError());
r = CloseClipboard();
ok(r, "gle %d\n", GetLastError());
ok(r, "gle %ld\n", GetLastError());
OleInitialize(NULL);
/* empty clipboard */
hr = OleGetClipboard(&get);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IDataObject_EnumFormatEtc(get, DATADIR_GET, &enum_fmt);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_FALSE, "got %08x\n", hr);
ok(hr == S_FALSE, "got %08lx\n", hr);
IEnumFORMATETC_Release(enum_fmt);
IDataObject_Release(get);
......@@ -1599,7 +1599,7 @@ static void test_nonole_clipboard(void)
hdrop = create_dropped_file();
r = OpenClipboard(NULL);
ok(r, "gle %d\n", GetLastError());
ok(r, "gle %ld\n", GetLastError());
h = SetClipboardData(CF_TEXT, htext);
ok(h == htext, "got %p\n", h);
h = SetClipboardData(cf_onemore, hblob);
......@@ -1611,12 +1611,12 @@ static void test_nonole_clipboard(void)
h = SetClipboardData(CF_HDROP, hdrop);
ok(h == hdrop, "got %p\n", h);
r = CloseClipboard();
ok(r, "gle %d\n", GetLastError());
ok(r, "gle %ld\n", GetLastError());
hr = OleGetClipboard(&get);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IDataObject_EnumFormatEtc(get, DATADIR_GET, &enum_fmt);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
if (FAILED(hr))
{
skip("EnumFormatEtc failed, skipping tests.\n");
......@@ -1624,104 +1624,104 @@ static void test_nonole_clipboard(void)
}
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(fmt.cfFormat == CF_TEXT, "cf %04x\n", fmt.cfFormat);
ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %lx\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %ld\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %lx\n", fmt.tymed);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(fmt.cfFormat == cf_onemore, "cf %04x\n", fmt.cfFormat);
ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %lx\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %ld\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %lx\n", fmt.tymed);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(fmt.cfFormat == CF_ENHMETAFILE, "cf %04x\n", fmt.cfFormat);
ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex);
ok(fmt.tymed == TYMED_ENHMF, "tymed %x\n", fmt.tymed);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %lx\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %ld\n", fmt.lindex);
ok(fmt.tymed == TYMED_ENHMF, "tymed %lx\n", fmt.tymed);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(fmt.cfFormat == cf_storage, "cf %04x\n", fmt.cfFormat);
ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %lx\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %ld\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %lx\n", fmt.tymed);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(fmt.cfFormat == CF_HDROP, "cf %04x\n", fmt.cfFormat);
ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %lx\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %ld\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %lx\n", fmt.tymed);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr); /* User32 adds some synthesised formats */
ok(hr == S_OK, "got %08lx\n", hr); /* User32 adds some synthesised formats */
ok(fmt.cfFormat == CF_LOCALE, "cf %04x\n", fmt.cfFormat);
ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex);
todo_wine ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %lx\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %ld\n", fmt.lindex);
todo_wine ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %lx\n", fmt.tymed);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(fmt.cfFormat == CF_OEMTEXT, "cf %04x\n", fmt.cfFormat);
ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %lx\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %ld\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %lx\n", fmt.tymed);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(fmt.cfFormat == CF_UNICODETEXT, "cf %04x\n", fmt.cfFormat);
ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %lx\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %ld\n", fmt.lindex);
ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %lx\n", fmt.tymed);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(fmt.cfFormat == CF_METAFILEPICT, "cf %04x\n", fmt.cfFormat);
ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex);
ok(fmt.tymed == TYMED_MFPICT, "tymed %x\n", fmt.tymed);
ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %lx\n", fmt.dwAspect);
ok(fmt.lindex == -1, "lindex %ld\n", fmt.lindex);
ok(fmt.tymed == TYMED_MFPICT, "tymed %lx\n", fmt.tymed);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_FALSE, "got %08x\n", hr);
ok(hr == S_FALSE, "got %08lx\n", hr);
IEnumFORMATETC_Release(enum_fmt);
InitFormatEtc(fmt, CF_ENHMETAFILE, TYMED_ENHMF);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
obj_type = GetObjectType(U(med).hEnhMetaFile);
ok(obj_type == OBJ_ENHMETAFILE, "got %d\n", obj_type);
ok(obj_type == OBJ_ENHMETAFILE, "got %ld\n", obj_type);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
InitFormatEtc(fmt, cf_storage, TYMED_ISTORAGE);
hr = IDataObject_GetData(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %lx\n", med.tymed);
if(SUCCEEDED(hr)) ReleaseStgMedium(&med);
IDataObject_Release(get);
r = OpenClipboard(NULL);
ok(r, "gle %d\n", GetLastError());
ok(r, "gle %ld\n", GetLastError());
r = EmptyClipboard();
ok(r, "gle %d\n", GetLastError());
ok(r, "gle %ld\n", GetLastError());
r = CloseClipboard();
ok(r, "gle %d\n", GetLastError());
ok(r, "gle %ld\n", GetLastError());
OleUninitialize();
}
......@@ -1736,13 +1736,13 @@ static void test_getdatahere(void)
OleInitialize(NULL);
hr = DataObjectImpl_CreateComplex(&src);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleSetClipboard(src);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = OleGetClipboard(&get);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
/* global format -> global & stream */
......@@ -1755,11 +1755,11 @@ static void test_getdatahere(void)
med.tymed = TYMED_HGLOBAL;
U(med).hGlobal = GlobalAlloc(GMEM_MOVEABLE, 100);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 1, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 1, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 1, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 1, "called %ld\n", DataObjectImpl_GetData_calls);
InitFormatEtc(fmt, CF_TEXT, 0);
......@@ -1767,41 +1767,41 @@ static void test_getdatahere(void)
med.tymed = TYMED_HGLOBAL;
U(med).hGlobal = GlobalAlloc(GMEM_MOVEABLE, 100);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 2, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 1, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 2, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 1, "called %ld\n", DataObjectImpl_GetData_calls);
med.pUnkForRelease = NULL;
med.tymed = TYMED_HGLOBAL;
U(med).hGlobal = GlobalAlloc(GMEM_MOVEABLE, 1);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == E_FAIL, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == E_FAIL, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 3, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 1, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 3, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 1, "called %ld\n", DataObjectImpl_GetData_calls);
med.pUnkForRelease = NULL;
med.tymed = TYMED_ISTREAM;
CreateStreamOnHGlobal(NULL, TRUE, &U(med).pstm);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 4, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 1, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 4, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 1, "called %ld\n", DataObjectImpl_GetData_calls);
med.pUnkForRelease = NULL;
med.tymed = TYMED_ISTORAGE;
StgCreateDocfile(NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_DELETEONRELEASE, 0, &U(med).pstg);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == E_FAIL, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed);
ok(hr == E_FAIL, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 5, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 1, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 5, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 1, "called %ld\n", DataObjectImpl_GetData_calls);
InitFormatEtc(fmt, cf_stream, 0);
......@@ -1809,31 +1809,31 @@ static void test_getdatahere(void)
med.tymed = TYMED_HGLOBAL;
U(med).hGlobal = GlobalAlloc(GMEM_MOVEABLE, 100);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 7, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 2, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 7, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 2, "called %ld\n", DataObjectImpl_GetData_calls);
med.pUnkForRelease = NULL;
med.tymed = TYMED_ISTREAM;
CreateStreamOnHGlobal(NULL, TRUE, &U(med).pstm);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 8, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 2, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 8, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 2, "called %ld\n", DataObjectImpl_GetData_calls);
med.pUnkForRelease = NULL;
med.tymed = TYMED_ISTORAGE;
StgCreateDocfile(NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_DELETEONRELEASE, 0, &U(med).pstg);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == E_FAIL, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed);
ok(hr == E_FAIL, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 9, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 2, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 9, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 2, "called %ld\n", DataObjectImpl_GetData_calls);
InitFormatEtc(fmt, cf_storage, 0);
......@@ -1841,31 +1841,31 @@ static void test_getdatahere(void)
med.tymed = TYMED_HGLOBAL;
U(med).hGlobal = GlobalAlloc(GMEM_MOVEABLE, 3000);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_HGLOBAL, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 11, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 3, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 11, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 3, "called %ld\n", DataObjectImpl_GetData_calls);
med.pUnkForRelease = NULL;
med.tymed = TYMED_ISTREAM;
CreateStreamOnHGlobal(NULL, TRUE, &U(med).pstm);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTREAM, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 12, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 3, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 12, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 3, "called %ld\n", DataObjectImpl_GetData_calls);
med.pUnkForRelease = NULL;
med.tymed = TYMED_ISTORAGE;
StgCreateDocfile(NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_DELETEONRELEASE, 0, &U(med).pstg);
hr = IDataObject_GetDataHere(get, &fmt, &med);
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed);
ok(hr == S_OK, "got %08lx\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %lx\n", med.tymed);
ReleaseStgMedium(&med);
ok(DataObjectImpl_GetDataHere_calls == 13, "called %d\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 3, "called %d\n", DataObjectImpl_GetData_calls);
ok(DataObjectImpl_GetDataHere_calls == 13, "called %ld\n", DataObjectImpl_GetDataHere_calls);
ok(DataObjectImpl_GetData_calls == 3, "called %ld\n", DataObjectImpl_GetData_calls);
IDataObject_Release(get);
......@@ -1893,15 +1893,15 @@ static void test_multithreaded_clipboard(void)
OleInitialize(NULL);
hr = OleGetClipboard(&data_obj);
ok(hr == S_OK, "OleGetClipboard returned %x\n", hr);
ok(hr == S_OK, "OleGetClipboard returned %lx\n", hr);
thread = CreateThread(NULL, 0, test_data_obj, data_obj, 0, NULL);
ok(thread != NULL, "CreateThread failed (%d)\n", GetLastError());
ok(thread != NULL, "CreateThread failed (%ld)\n", GetLastError());
ret = WaitForSingleObject(thread, 5000);
ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", ret);
ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", ret);
hr = OleGetClipboard(&data_obj);
ok(hr == S_OK, "OleGetClipboard returned %x\n", hr);
ok(hr == S_OK, "OleGetClipboard returned %lx\n", hr);
IDataObject_Release(data_obj);
OleUninitialize();
......@@ -1918,7 +1918,7 @@ static void test_get_clipboard_locked(void)
/* lock clipboard */
OpenClipboard(NULL);
hr = OleGetClipboard(&pDObj);
todo_wine ok(hr == CLIPBRD_E_CANT_OPEN, "OleGetClipboard() got 0x%08x instead of 0x%08x\n", hr, CLIPBRD_E_CANT_OPEN);
todo_wine ok(hr == CLIPBRD_E_CANT_OPEN, "OleGetClipboard() got 0x%08lx instead of 0x%08lx\n", hr, CLIPBRD_E_CANT_OPEN);
todo_wine ok(pDObj == NULL, "OleGetClipboard() got 0x%p instead of NULL\n",pDObj);
if (pDObj) IDataObject_Release(pDObj);
CloseClipboard();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -101,30 +101,30 @@ static void test_olestream(void)
ole_stream_header_t header;
hr = create_storage(&stg);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IStorage_OpenStream(stg, olestream, NULL, STGM_SHARE_EXCLUSIVE | STGM_READ, 0, &stm);
ok(hr == STG_E_FILENOTFOUND, "got %08x\n", hr);
ok(hr == STG_E_FILENOTFOUND, "got %08lx\n", hr);
hr = OleCreateDefaultHandler(&non_existent_class, 0, &IID_IOleObject, (void**)&ole_obj);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IOleObject_QueryInterface(ole_obj, &IID_IPersistStorage, (void**)&persist);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IPersistStorage_InitNew(persist, stg);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IStorage_OpenStream(stg, olestream, NULL, STGM_SHARE_EXCLUSIVE | STGM_READ, 0, &stm);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IStream_Read(stm, &header, sizeof(header), &read);
ok(hr == S_OK, "got %08x\n", hr);
ok(read == sizeof(header), "read %d\n", read);
ok(header.version == 0x02000001, "got version %08x\n", header.version);
ok(header.flags == 0x0, "got flags %08x\n", header.flags);
ok(header.link_update_opt == 0x0, "got link update option %08x\n", header.link_update_opt);
ok(header.res == 0x0, "got reserved %08x\n", header.res);
ok(header.moniker_size == 0x0, "got moniker size %08x\n", header.moniker_size);
ok(hr == S_OK, "got %08lx\n", hr);
ok(read == sizeof(header), "read %ld\n", read);
ok(header.version == 0x02000001, "got version %08lx\n", header.version);
ok(header.flags == 0x0, "got flags %08lx\n", header.flags);
ok(header.link_update_opt == 0x0, "got link update option %08lx\n", header.link_update_opt);
ok(header.res == 0x0, "got reserved %08lx\n", header.res);
ok(header.moniker_size == 0x0, "got moniker size %08lx\n", header.moniker_size);
IStream_Release(stm);
......@@ -247,17 +247,17 @@ static void test_default_handler_run(void)
hres = CoRegisterClassObject(&test_server_clsid, (IUnknown*)&ClassFactory,
CLSCTX_INPROC_SERVER, 0, &class_reg);
ok(hres == S_OK, "CoRegisterClassObject failed: %x\n", hres);
ok(hres == S_OK, "CoRegisterClassObject failed: %lx\n", hres);
hres = OleCreateDefaultHandler(&test_server_clsid, NULL, &IID_IUnknown, (void**)&unk);
ok(hres == S_OK, "OleCreateDefaultHandler failed: %x\n", hres);
ok(hres == S_OK, "OleCreateDefaultHandler failed: %lx\n", hres);
hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&ro);
ok(hres == S_OK, "QueryInterface(IRunnableObject) failed: %x\n", hres);
ok(hres == S_OK, "QueryInterface(IRunnableObject) failed: %lx\n", hres);
IUnknown_Release(unk);
hres = IRunnableObject_Run(ro, NULL);
ok(hres == REGDB_E_CLASSNOTREG, "Run returned: %x, expected REGDB_E_CLASSNOTREG\n", hres);
ok(hres == REGDB_E_CLASSNOTREG, "Run returned: %lx, expected REGDB_E_CLASSNOTREG\n", hres);
IRunnableObject_Release(ro);
SET_EXPECT(CF_QueryInterface_IMarshal);
......@@ -266,28 +266,28 @@ static void test_default_handler_run(void)
hres = CoRegisterClassObject(&test_server_clsid, (IUnknown*)&ClassFactory,
CLSCTX_LOCAL_SERVER, 0, &class_reg);
ok(hres == S_OK, "CoRegisterClassObject failed: %x\n", hres);
ok(hres == S_OK, "CoRegisterClassObject failed: %lx\n", hres);
hres = OleCreateDefaultHandler(&test_server_clsid, NULL, &IID_IUnknown, (void**)&unk);
ok(hres == S_OK, "OleCreateDefaultHandler failed: %x\n", hres);
ok(hres == S_OK, "OleCreateDefaultHandler failed: %lx\n", hres);
hres = IUnknown_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj);
ok(hres == S_OK, "QueryInterface(IID_IOleObject) failed: %x\n", hres);
ok(hres == S_OK, "QueryInterface(IID_IOleObject) failed: %lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IPersistStorage, (void**)&persist);
ok(hres == S_OK, "QueryInterface(IID_IPersistStorage) failed: %x\n", hres);
ok(hres == S_OK, "QueryInterface(IID_IPersistStorage) failed: %lx\n", hres);
IPersistStorage_Release(persist);
IOleObject_Release(oleobj);
hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&ro);
ok(hres == S_OK, "QueryInterface(IRunnableObject) failed: %x\n", hres);
ok(hres == S_OK, "QueryInterface(IRunnableObject) failed: %lx\n", hres);
IUnknown_Release(unk);
SET_EXPECT(CF_QueryInterface_ClassFactory);
SET_EXPECT(CF_CreateInstance);
hres = IRunnableObject_Run(ro, NULL);
todo_wine
ok(hres == S_OK, "Run failed: %x\n", hres);
ok(hres == S_OK, "Run failed: %lx\n", hres);
CHECK_CALLED(CF_QueryInterface_ClassFactory);
CHECK_CALLED(CF_CreateInstance);
IRunnableObject_Release(ro);
......@@ -297,7 +297,7 @@ static void test_default_handler_run(void)
hres = CoCreateInstance(&test_server_clsid, NULL, CLSCTX_LOCAL_SERVER,
&IID_IOleObject, (void**)&oleobj);
todo_wine
ok(hres == REGDB_E_CLASSNOTREG, "expected REGDB_E_CLASSNOTREG, got %x\n", hres);
ok(hres == REGDB_E_CLASSNOTREG, "expected REGDB_E_CLASSNOTREG, got %lx\n", hres);
todo_wine
CHECK_NOT_CALLED(CF_QueryInterface_ClassFactory);
todo_wine
......
......@@ -89,7 +89,7 @@ static HRESULT check_expect_(enum method func, DWORD expect_param, DWORD *set_pa
if (call_ptr->method == func) break;
} while ((++call_ptr)->method != end_seq);
ok_( file, line )( expect_param == call_ptr->expect_param, "%s: unexpected param %08x expected %08x\n",
ok_( file, line )( expect_param == call_ptr->expect_param, "%s: unexpected param %08lx expected %08lx\n",
method_names[func], expect_param, call_ptr->expect_param );
if (set_param) *set_param = call_ptr->set_param;
hr = call_ptr->set_ret;
......@@ -263,7 +263,7 @@ static int droptarget_refs;
static int test_reentrance;
/* helper macros to make tests a bit leaner */
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error %#08lx\n", hr)
static HRESULT WINAPI DropTarget_QueryInterface(IDropTarget* iface, REFIID riid,
void** ppvObject)
......@@ -430,7 +430,7 @@ static HRESULT WINAPI EnumFORMATETC_Next(IEnumFORMATETC *iface,
static FORMATETC format = { CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
HRESULT hr = check_expect(EnumFMT_Next, 0, NULL);
ok(celt == 1, "celt = %d\n", celt);
ok(celt == 1, "celt = %ld\n", celt);
ok(rgelt != NULL, "rgelt == NULL\n");
ok(pceltFetched == NULL, "pceltFetched != NULL\n");
......@@ -624,18 +624,18 @@ static void test_Register_Revoke(void)
hr = RegisterDragDrop(hwnd, &DropTarget);
ok(hr == E_OUTOFMEMORY ||
broken(hr == CO_E_NOTINITIALIZED), /* NT4 */
"RegisterDragDrop without OLE initialized should have returned E_OUTOFMEMORY instead of 0x%08x\n", hr);
"RegisterDragDrop without OLE initialized should have returned E_OUTOFMEMORY instead of 0x%08lx\n", hr);
OleInitialize(NULL);
hr = RegisterDragDrop(hwnd, NULL);
ok(hr == E_INVALIDARG, "RegisterDragDrop with NULL IDropTarget * should return E_INVALIDARG instead of 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "RegisterDragDrop with NULL IDropTarget * should return E_INVALIDARG instead of 0x%08lx\n", hr);
hr = RegisterDragDrop(NULL, &DropTarget);
ok(hr == DRAGDROP_E_INVALIDHWND, "RegisterDragDrop with NULL hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08x\n", hr);
ok(hr == DRAGDROP_E_INVALIDHWND, "RegisterDragDrop with NULL hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08lx\n", hr);
hr = RegisterDragDrop((HWND)0xdeadbeef, &DropTarget);
ok(hr == DRAGDROP_E_INVALIDHWND, "RegisterDragDrop with garbage hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08x\n", hr);
ok(hr == DRAGDROP_E_INVALIDHWND, "RegisterDragDrop with garbage hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08lx\n", hr);
ok(droptarget_refs == 0, "DropTarget refs should be zero not %d\n", droptarget_refs);
hr = RegisterDragDrop(hwnd, &DropTarget);
......@@ -646,7 +646,7 @@ static void test_Register_Revoke(void)
ok(prop == &DropTarget, "expected IDropTarget pointer %p, got %p\n", &DropTarget, prop);
hr = RegisterDragDrop(hwnd, &DropTarget);
ok(hr == DRAGDROP_E_ALREADYREGISTERED, "RegisterDragDrop with already registered hwnd should return DRAGDROP_E_ALREADYREGISTERED instead of 0x%08x\n", hr);
ok(hr == DRAGDROP_E_ALREADYREGISTERED, "RegisterDragDrop with already registered hwnd should return DRAGDROP_E_ALREADYREGISTERED instead of 0x%08lx\n", hr);
ok(droptarget_refs >= 1, "DropTarget refs should be at least one\n");
OleUninitialize();
......@@ -662,7 +662,7 @@ static void test_Register_Revoke(void)
}
hr = RevokeDragDrop(NULL);
ok(hr == DRAGDROP_E_INVALIDHWND, "RevokeDragDrop with NULL hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08x\n", hr);
ok(hr == DRAGDROP_E_INVALIDHWND, "RevokeDragDrop with NULL hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08lx\n", hr);
DestroyWindow(hwnd);
......@@ -674,12 +674,12 @@ static void test_Register_Revoke(void)
NULL, NULL, NULL);
hr = RegisterDragDrop(hwnd, &DropTarget);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
DestroyWindow(hwnd);
hr = RevokeDragDrop(hwnd);
ok(hr == DRAGDROP_E_INVALIDHWND, "got 0x%08x\n", hr);
ok(hr == DRAGDROP_E_INVALIDHWND, "got 0x%08lx\n", hr);
OleUninitialize();
}
......@@ -698,32 +698,32 @@ static void test_DoDragDrop(void)
ok(IsWindow(hwnd), "failed to create window\n");
hr = OleInitialize(NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = RegisterDragDrop(hwnd, &DropTarget);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* incomplete arguments set */
hr = DoDragDrop(NULL, NULL, 0, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = DoDragDrop(NULL, &DropSource, 0, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = DoDragDrop(&DataObject, NULL, 0, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = DoDragDrop(NULL, NULL, 0, &effect);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = DoDragDrop(&DataObject, &DropSource, 0, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = DoDragDrop(NULL, &DropSource, 0, &effect);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = DoDragDrop(&DataObject, NULL, 0, &effect);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
ShowWindow(hwnd, SW_SHOW);
GetWindowRect(hwnd, &rect);
......
......@@ -29,7 +29,7 @@
#include "wine/test.h"
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error %#08lx\n", hr)
static const CLSID CLSID_WineTest =
{ /* 9474ba1a-258b-490b-bc13-516e9239ace0 */
......@@ -101,17 +101,17 @@ static void test_error_info(void)
IErrorInfo_Release(pErrorInfo);
hr = GetErrorInfo(0, &pErrorInfo);
ok(hr == S_FALSE, "GetErrorInfo should have returned S_FALSE instead of 0x%08x\n", hr);
ok(hr == S_FALSE, "GetErrorInfo should have returned S_FALSE instead of 0x%08lx\n", hr);
ok(!pErrorInfo, "pErrorInfo should be set to NULL\n");
hr = SetErrorInfo(0, NULL);
ok_ole_success(hr, "SetErrorInfo");
hr = GetErrorInfo(0xdeadbeef, &pErrorInfo);
ok(hr == E_INVALIDARG, "GetErrorInfo should have returned E_INVALIDARG instead of 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "GetErrorInfo should have returned E_INVALIDARG instead of 0x%08lx\n", hr);
hr = SetErrorInfo(0xdeadbeef, NULL);
ok(hr == E_INVALIDARG, "SetErrorInfo should have returned E_INVALIDARG instead of 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "SetErrorInfo should have returned E_INVALIDARG instead of 0x%08lx\n", hr);
}
START_TEST(errorinfo)
......
......@@ -29,7 +29,7 @@
#include "wine/test.h"
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error %#08lx\n", hr)
static char const * const *expected_method_list;
......@@ -56,7 +56,7 @@ static void test_streamonhglobal(void)
HRESULT hr;
hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
ull.QuadPart = sizeof(data);
hr = IStream_SetSize(pStream, ull);
......@@ -72,7 +72,7 @@ static void test_streamonhglobal(void)
/* should return S_OK, not S_FALSE */
hr = IStream_Read(pStream, buffer, sizeof(buffer), &read);
ok_ole_success(hr, "IStream_Read");
ok(read == sizeof(data), "IStream_Read returned read %d\n", read);
ok(read == sizeof(data), "IStream_Read returned read %ld\n", read);
/* ignores HighPart */
ull.u.HighPart = -1;
......@@ -93,8 +93,8 @@ static void test_streamonhglobal(void)
ll.u.LowPart = 0;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- invalid seek argument */
ull.u.HighPart = 0xCAFECAFE;
......@@ -102,9 +102,9 @@ static void test_streamonhglobal(void)
ll.u.HighPart = 0;
ll.u.LowPart = 123;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_END+1, &ull);
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n", hr);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should not have changed HighPart, got %d\n", ull.u.HighPart);
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n", hr);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should not have changed HighPart, got %ld\n", ull.u.HighPart);
/* IStream_Seek -- valid position argument (seek to beginning) */
ull.u.HighPart = 0xCAFECAFE;
......@@ -113,8 +113,8 @@ static void test_streamonhglobal(void)
ll.u.LowPart = 0;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_SET, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- valid position argument (seek to end) */
ull.u.HighPart = 0xCAFECAFE;
......@@ -123,8 +123,8 @@ static void test_streamonhglobal(void)
ll.u.LowPart = 0;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_END, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- ignore HighPart in the move value (seek from current position) */
ll.u.HighPart = 0;
......@@ -138,8 +138,8 @@ static void test_streamonhglobal(void)
ll.u.LowPart = 0;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- ignore HighPart in the move value (seek to beginning) */
ll.u.HighPart = 0;
......@@ -153,8 +153,8 @@ static void test_streamonhglobal(void)
ll.u.LowPart = 0;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_SET, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- invalid LowPart value (seek before start of stream) */
ll.u.HighPart = 0;
......@@ -167,9 +167,9 @@ static void test_streamonhglobal(void)
ll.u.HighPart = 0;
ll.u.LowPart = 0x80000000;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n", hr);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n", hr);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- valid LowPart value (seek to start of stream) */
ll.u.HighPart = 0;
......@@ -183,8 +183,8 @@ static void test_streamonhglobal(void)
ll.u.LowPart = -(DWORD)sizeof(data);
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == 0, "LowPart set to %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == 0, "LowPart set to %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- invalid LowPart value (seek to start of stream-1) */
ll.u.HighPart = 0;
......@@ -197,9 +197,9 @@ static void test_streamonhglobal(void)
ll.u.HighPart = 0;
ll.u.LowPart = -(DWORD)sizeof(data)-1;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n", hr);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n", hr);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- valid LowPart value (seek forward to 0x80000000) */
ll.u.HighPart = 0;
......@@ -213,8 +213,8 @@ static void test_streamonhglobal(void)
ll.u.LowPart = 0x80000000 - sizeof(data);
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == 0x80000000, "LowPart set to %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == 0x80000000, "LowPart set to %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- invalid LowPart value (seek to beginning) */
ll.u.HighPart = 0;
......@@ -227,9 +227,9 @@ static void test_streamonhglobal(void)
ll.u.HighPart = 0;
ll.u.LowPart = 0x80000000;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_SET, &ull);
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n", hr);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n", hr);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- valid LowPart value (seek to beginning) */
ull.u.HighPart = 0xCAFECAFE;
......@@ -238,8 +238,8 @@ static void test_streamonhglobal(void)
ll.u.LowPart = 0x7FFFFFFF;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_SET, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == 0x7FFFFFFF, "should have set LowPart to 0x7FFFFFFF instead of %08x\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == 0x7FFFFFFF, "should have set LowPart to 0x7FFFFFFF instead of %08lx\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- valid LowPart value (seek from current position) */
ll.u.HighPart = 0;
......@@ -253,8 +253,8 @@ static void test_streamonhglobal(void)
ll.u.LowPart = 0x7FFFFFFF;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == 0x7FFFFFFF, "should have set LowPart to 0x7FFFFFFF instead of %08x\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == 0x7FFFFFFF, "should have set LowPart to 0x7FFFFFFF instead of %08lx\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- second seek allows you to go past 0x7FFFFFFF size */
ull.u.HighPart = 0xCAFECAFE;
......@@ -263,8 +263,8 @@ static void test_streamonhglobal(void)
ll.u.LowPart = 9;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08x\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08lx\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
/* IStream_Seek -- seek wraps position/size on integer overflow, but not on win8 */
ull.u.HighPart = 0xCAFECAFE;
......@@ -274,10 +274,10 @@ static void test_streamonhglobal(void)
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok(hr == S_OK || hr == STG_E_SEEKERROR /* win8 */, "IStream_Seek\n");
if (SUCCEEDED(hr))
ok(ull.u.LowPart == 0x00000007, "should have set LowPart to 0x00000007 instead of %08x\n", ull.u.LowPart);
ok(ull.u.LowPart == 0x00000007, "should have set LowPart to 0x00000007 instead of %08lx\n", ull.u.LowPart);
else
ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08x\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08lx\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
hr = IStream_Commit(pStream, STGC_DEFAULT);
ok_ole_success(hr, "IStream_Commit");
......@@ -286,18 +286,18 @@ static void test_streamonhglobal(void)
ok_ole_success(hr, "IStream_Revert");
hr = IStream_LockRegion(pStream, ull, ull, LOCK_WRITE);
ok(hr == STG_E_INVALIDFUNCTION, "IStream_LockRegion should have returned STG_E_INVALIDFUNCTION instead of 0x%08x\n", hr);
ok(hr == STG_E_INVALIDFUNCTION, "IStream_LockRegion should have returned STG_E_INVALIDFUNCTION instead of 0x%08lx\n", hr);
hr = IStream_Stat(pStream, &statstg, STATFLAG_DEFAULT);
ok_ole_success(hr, "IStream_Stat");
ok(statstg.type == STGTY_STREAM, "statstg.type should have been STGTY_STREAM instead of %d\n", statstg.type);
ok(statstg.type == STGTY_STREAM, "statstg.type should have been STGTY_STREAM instead of %ld\n", statstg.type);
/* test OOM condition */
ull.u.HighPart = -1;
ull.u.LowPart = -1;
hr = IStream_SetSize(pStream, ull);
ok(hr == E_OUTOFMEMORY || broken(hr == S_OK), /* win9x */
"IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08x\n", hr);
"IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08lx\n", hr);
IStream_Release(pStream);
}
......@@ -437,15 +437,15 @@ static void test_copyto(void)
hr = IStream_Write(pStream, szHello, sizeof(szHello), &written);
ok_ole_success(hr, "IStream_Write");
ok(written == sizeof(szHello), "only %d bytes written\n", written);
ok(written == sizeof(szHello), "only %ld bytes written\n", written);
hr = IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
ok_ole_success(hr, "IStream_Seek");
cb.QuadPart = sizeof(szHello);
hr = IStream_CopyTo(pStream, &Test_Stream, cb, &ullRead, &ullWritten);
ok(ullWritten.QuadPart == 5, "ullWritten was %d instead\n", (ULONG)ullWritten.QuadPart);
ok(ullRead.QuadPart == sizeof(szHello), "only %d bytes read\n", (ULONG)ullRead.QuadPart);
ok(ullWritten.QuadPart == 5, "ullWritten was %ld instead\n", (ULONG)ullWritten.QuadPart);
ok(ullRead.QuadPart == sizeof(szHello), "only %ld bytes read\n", (ULONG)ullRead.QuadPart);
ok_ole_success(hr, "IStream_CopyTo");
ok(!*expected_method_list, "Method sequence starting from %s not called\n", *expected_method_list);
......@@ -480,7 +480,7 @@ static void test_freed_hglobal(void)
ULONG read, written;
hglobal = GlobalAlloc(GMEM_DDESHARE|GMEM_NODISCARD|GMEM_MOVEABLE, strlen(teststring) + 1);
ok(hglobal != NULL, "GlobalAlloc failed with error %d\n", GetLastError());
ok(hglobal != NULL, "GlobalAlloc failed with error %ld\n", GetLastError());
p = GlobalLock(hglobal);
strcpy(p, teststring);
GlobalUnlock(hglobal);
......@@ -493,7 +493,7 @@ static void test_freed_hglobal(void)
ok(!strcmp(buffer, teststring), "buffer data %s differs\n", buffer);
ok(read == sizeof(teststring) ||
broken(read == ((sizeof(teststring) + 3) & ~3)), /* win9x rounds the size */
"read should be sizeof(teststring) instead of %d\n", read);
"read should be sizeof(teststring) instead of %ld\n", read);
GlobalFree(hglobal);
......@@ -502,15 +502,15 @@ static void test_freed_hglobal(void)
hr = IStream_Read(pStream, buffer, sizeof(buffer), &read);
ok_ole_success(hr, "IStream_Read");
ok(buffer[0] == 0, "buffer data should be untouched\n");
ok(read == 0, "read should be 0 instead of %d\n", read);
ok(read == 0, "read should be 0 instead of %ld\n", read);
ull.QuadPart = sizeof(buffer);
hr = IStream_SetSize(pStream, ull);
ok(hr == E_OUTOFMEMORY, "IStream_SetSize with invalid HGLOBAL should return E_OUTOFMEMORY instead of 0x%08x\n", hr);
ok(hr == E_OUTOFMEMORY, "IStream_SetSize with invalid HGLOBAL should return E_OUTOFMEMORY instead of 0x%08lx\n", hr);
hr = IStream_Write(pStream, buffer, sizeof(buffer), &written);
ok(hr == E_OUTOFMEMORY, "IStream_Write with invalid HGLOBAL should return E_OUTOFMEMORY instead of 0x%08x\n", hr);
ok(written == 0, "written should be 0 instead of %d\n", written);
ok(hr == E_OUTOFMEMORY, "IStream_Write with invalid HGLOBAL should return E_OUTOFMEMORY instead of 0x%08lx\n", hr);
ok(written == 0, "written should be 0 instead of %ld\n", written);
IStream_Release(pStream);
}
......@@ -526,21 +526,21 @@ static void stream_info(IStream *stream, HGLOBAL *hmem, int *size, int *pos)
*size = *pos = -1;
hr = GetHGlobalFromStream(stream, hmem);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
memset(&stat, 0x55, sizeof(stat));
hr = IStream_Stat(stream, &stat, STATFLAG_DEFAULT);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(stat.type == STGTY_STREAM, "unexpected %#x\n", stat.type);
ok(hr == S_OK, "unexpected %#lx\n", hr);
ok(stat.type == STGTY_STREAM, "unexpected %#lx\n", stat.type);
ok(!stat.pwcsName, "unexpected %p\n", stat.pwcsName);
ok(IsEqualIID(&stat.clsid, &GUID_NULL), "unexpected %s\n", wine_dbgstr_guid(&stat.clsid));
ok(!stat.cbSize.HighPart, "unexpected %#x\n", stat.cbSize.HighPart);
ok(!stat.cbSize.HighPart, "unexpected %#lx\n", stat.cbSize.HighPart);
*size = stat.cbSize.LowPart;
offset.QuadPart = 0;
hr = IStream_Seek(stream, offset, STREAM_SEEK_CUR, &newpos);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(!newpos.HighPart, "unexpected %#x\n", newpos.HighPart);
ok(hr == S_OK, "unexpected %#lx\n", hr);
ok(!newpos.HighPart, "unexpected %#lx\n", newpos.HighPart);
*pos = newpos.LowPart;
}
......@@ -559,13 +559,13 @@ static void test_IStream_Clone(void)
orig_hmem = GlobalAlloc(GMEM_MOVEABLE, 0);
ok(orig_hmem != 0, "unexpected %p\n", orig_hmem);
hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
hr = GetHGlobalFromStream(stream, NULL);
ok(hr == E_INVALIDARG, "unexpected %#x\n", hr);
ok(hr == E_INVALIDARG, "unexpected %#lx\n", hr);
hr = GetHGlobalFromStream(NULL, &hmem);
ok(hr == E_INVALIDARG, "unexpected %#x\n", hr);
ok(hr == E_INVALIDARG, "unexpected %#lx\n", hr);
stream_info(stream, &hmem, &size, &pos);
ok(hmem == orig_hmem, "handles should match\n");
......@@ -573,10 +573,10 @@ static void test_IStream_Clone(void)
ok(pos == 0, "unexpected %d\n", pos);
hr = IStream_Clone(stream, &clone);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
hr = IStream_Write(stream, hello, sizeof(hello), NULL);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
stream_info(stream, &hmem, &size, &pos);
ok(hmem == orig_hmem, "handles should match\n");
......@@ -590,12 +590,12 @@ static void test_IStream_Clone(void)
buf[0] = 0;
hr = IStream_Read(clone, buf, sizeof(buf), NULL);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
ok(!strcmp(buf, hello), "wrong stream contents\n");
newsize.QuadPart = 0x8000;
hr = IStream_SetSize(stream, newsize);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
stream_info(stream, &hmem, &size, &pos);
ok(hmem == orig_hmem, "handles should match\n");
......@@ -614,10 +614,10 @@ static void test_IStream_Clone(void)
orig_hmem = GlobalAlloc(GMEM_FIXED, 1);
ok(orig_hmem != 0, "unexpected %p\n", orig_hmem);
hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
hr = IStream_Clone(stream, &clone);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
stream_info(stream, &hmem, &size, &pos);
ok(hmem == orig_hmem, "handles should match\n");
......@@ -631,7 +631,7 @@ static void test_IStream_Clone(void)
newsize.QuadPart = 0x8000;
hr = IStream_SetSize(stream, newsize);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
stream_info(stream, &hmem, &size, &pos);
ok(hmem != 0, "unexpected %p\n", hmem);
......@@ -649,10 +649,10 @@ static void test_IStream_Clone(void)
/* test Release of cloned stream */
hr = CreateStreamOnHGlobal(0, TRUE, &stream);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
hr = IStream_Clone(stream, &clone);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
stream_info(stream, &hmem, &size, &pos);
ok(hmem != 0, "unexpected %p\n", hmem);
......@@ -669,7 +669,7 @@ static void test_IStream_Clone(void)
newsize.QuadPart = 0x8000;
hr = IStream_SetSize(clone, newsize);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
stream_info(clone, &hmem_clone, &size, &pos);
ok(hmem_clone == hmem, "handles should match\n");
......@@ -677,7 +677,7 @@ static void test_IStream_Clone(void)
ok(pos == 0, "unexpected %d\n", pos);
hr = IStream_Write(clone, hello, sizeof(hello), NULL);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
stream_info(clone, &hmem_clone, &size, &pos);
ok(hmem_clone == hmem, "handles should match\n");
......@@ -686,11 +686,11 @@ static void test_IStream_Clone(void)
offset.QuadPart = 0;
hr = IStream_Seek(clone, offset, STREAM_SEEK_SET, NULL);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
buf[0] = 0;
hr = IStream_Read(clone, buf, sizeof(buf), NULL);
ok(hr == S_OK, "unexpected %#x\n", hr);
ok(hr == S_OK, "unexpected %#lx\n", hr);
ok(!strcmp(buf, hello), "wrong stream contents\n");
stream_info(clone, &hmem_clone, &size, &pos);
......
......@@ -67,11 +67,11 @@ static const GUID CLSID_ft_unmarshaler_1809 = {0x00000359, 0x0000, 0x0000, {0xc0
static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID,REFIID,LPVOID);
/* helper macros to make tests a bit leaner */
#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks)
#define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %d\n", cLocks)
#define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08x\n", hr)
#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %ld\n", cLocks)
#define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %ld\n", cLocks)
#define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error %#08lx\n", hr)
#define ok_non_zero_external_conn() do {if (with_external_conn) ok(external_connections, "got no external connections\n");} while(0);
#define ok_zero_external_conn() do {if (with_external_conn) ok(!external_connections, "got %d external connections\n", external_connections);} while(0);
#define ok_zero_external_conn() do {if (with_external_conn) ok(!external_connections, "got %ld external connections\n", external_connections);} while(0);
#define ok_last_release_closes(b) do {if (with_external_conn) ok(last_release_closes == b, "got %d expected %d\n", last_release_closes, b);} while(0);
#define OBJREF_SIGNATURE (0x574f454d)
......@@ -490,8 +490,8 @@ static HRESULT WINAPI RpcStubBuffer_Invoke(IRpcStubBuffer *iface, RPCOLEMESSAGE
CHECK_EXPECT(Invoke);
hr = IRpcChannelBuffer_GetDestCtx(_pRpcChannelBuffer, &dest_context, &dest_context_data);
ok(hr == S_OK, "GetDestCtx failed: %08x\n", hr);
ok(dest_context == MSHCTX_INPROC, "desc_context = %x\n", dest_context);
ok(hr == S_OK, "GetDestCtx failed: %08lx\n", hr);
ok(dest_context == MSHCTX_INPROC, "desc_context = %lx\n", dest_context);
ok(!dest_context_data, "desc_context_data = %p\n", dest_context_data);
return IRpcStubBuffer_Invoke(This->buffer, _prpcmsg, _pRpcChannelBuffer);
......@@ -580,7 +580,7 @@ static HRESULT WINAPI PSFactoryBuffer_CreateStub(IPSFactoryBuffer *iface, REFIID
stub->ref = 1;
hr = IPSFactoryBuffer_CreateStub(ps_factory_buffer, riid, server, &stub->buffer);
ok(hr == S_OK, "CreateStub failed: %08x\n", hr);
ok(hr == S_OK, "CreateStub failed: %08lx\n", hr);
*ppStub = &stub->IRpcStubBuffer_iface;
return S_OK;
......@@ -625,7 +625,7 @@ static DWORD CALLBACK host_object_proc(LPVOID p)
if(data->register_object) {
hr = CoRegisterClassObject(data->register_clsid, data->register_object,
CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &registration_key);
ok(hr == S_OK, "CoRegisterClassObject failed: %08x\n", hr);
ok(hr == S_OK, "CoRegisterClassObject failed: %08lx\n", hr);
}
if (data->filter)
......@@ -698,7 +698,7 @@ static void release_host_object(DWORD tid, WPARAM wp)
static void end_host_object(DWORD tid, HANDLE thread)
{
BOOL ret = PostThreadMessageA(tid, WM_QUIT, 0, 0);
ok(ret, "PostThreadMessage failed with error %d\n", GetLastError());
ok(ret, "PostThreadMessage failed with error %ld\n", GetLastError());
/* be careful of races - don't return until hosting thread has terminated */
ok( !WaitForSingleObject(thread, 10000), "wait timed out\n" );
CloseHandle(thread);
......@@ -714,7 +714,7 @@ static void test_no_marshaler(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
ok_ole_success(hr, CreateStreamOnHGlobal);
hr = CoMarshalInterface(pStream, &IID_IWineTest, (IUnknown*)&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
ok(hr == E_NOINTERFACE, "CoMarshalInterface should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
ok(hr == E_NOINTERFACE, "CoMarshalInterface should have returned E_NOINTERFACE instead of 0x%08lx\n", hr);
IStream_Release(pStream);
}
......@@ -815,7 +815,7 @@ static void test_marshal_and_unmarshal_invalid(void)
if (pProxy)
{
hr = IClassFactory_CreateInstance(pProxy, NULL, &IID_IUnknown, &dummy);
ok(hr == RPC_E_DISCONNECTED, "Remote call should have returned RPC_E_DISCONNECTED, instead of 0x%08x\n", hr);
ok(hr == RPC_E_DISCONNECTED, "Remote call should have returned RPC_E_DISCONNECTED, instead of 0x%08lx\n", hr);
IClassFactory_Release(pProxy);
}
......@@ -848,7 +848,7 @@ static void test_same_apartment_unmarshal_failure(void)
ok_ole_success(hr, IStream_Seek);
hr = CoUnmarshalInterface(pStream, &IID_IParseDisplayName, (void **)&pProxy);
ok(hr == E_NOINTERFACE, "CoUnmarshalInterface should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
ok(hr == E_NOINTERFACE, "CoUnmarshalInterface should have returned E_NOINTERFACE instead of 0x%08lx\n", hr);
ok_no_locks();
ok_zero_external_conn();
......@@ -1078,7 +1078,7 @@ static void test_proxy_marshal_and_unmarshal_weak(void)
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy2);
todo_wine
ok(hr == CO_E_OBJNOTREG, "CoUnmarshalInterface should return CO_E_OBJNOTREG instead of 0x%08x\n", hr);
ok(hr == CO_E_OBJNOTREG, "CoUnmarshalInterface should return CO_E_OBJNOTREG instead of 0x%08lx\n", hr);
ok_no_locks();
ok_zero_external_conn();
......@@ -1119,7 +1119,7 @@ static void test_proxy_marshal_and_unmarshal_strong(void)
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
/* marshal the proxy */
hr = CoMarshalInterface(pStream, &IID_IClassFactory, pProxy, MSHCTX_INPROC, NULL, MSHLFLAGS_TABLESTRONG);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok_more_than_one_lock();
ok_non_zero_external_conn();
......@@ -1227,10 +1227,10 @@ static void test_marshal_proxy_apartment_shutdown(void)
ok_last_release_closes(TRUE);
hr = IClassFactory_CreateInstance(proxy, NULL, &IID_IUnknown, (void **)&unk);
ok(hr == CO_E_OBJNOTCONNECTED, "got %#x\n", hr);
ok(hr == CO_E_OBJNOTCONNECTED, "got %#lx\n", hr);
ref = IClassFactory_Release(proxy);
ok(!ref, "got %d refs\n", ref);
ok(!ref, "got %ld refs\n", ref);
ok_no_locks();
......@@ -1320,22 +1320,22 @@ static void test_marshal_channel_buffer(void)
hr = CoRegisterClassObject(&CLSID_WineTestPSFactoryBuffer, (IUnknown *)&PSFactoryBuffer,
CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &registration_key);
ok(hr == S_OK, "CoRegisterClassObject failed: %08x\n", hr);
ok(hr == S_OK, "CoRegisterClassObject failed: %08lx\n", hr);
hr = CoRegisterPSClsid(&IID_IOleWindow, &CLSID_WineTestPSFactoryBuffer);
ok(hr == S_OK, "CoRegisterPSClsid failed: %08x\n", hr);
ok(hr == S_OK, "CoRegisterPSClsid failed: %08lx\n", hr);
SET_EXPECT(CreateStub);
SET_EXPECT(CreateProxy);
hr = IUnknown_QueryInterface(proxy, &IID_IOleWindow, (void**)&ole_window);
ok(hr == S_OK, "Could not get IOleWindow iface: %08x\n", hr);
ok(hr == S_OK, "Could not get IOleWindow iface: %08lx\n", hr);
CHECK_CALLED(CreateStub);
CHECK_CALLED(CreateProxy);
SET_EXPECT(Invoke);
SET_EXPECT(GetWindow);
hr = IOleWindow_GetWindow(ole_window, &hwnd);
ok(hr == S_OK, "GetWindow failed: %08x\n", hr);
ok(hr == S_OK, "GetWindow failed: %08lx\n", hr);
ok((DWORD)(DWORD_PTR)hwnd == 0xdeadbeef, "hwnd = %p\n", hwnd);
CHECK_CALLED(Invoke);
CHECK_CALLED(GetWindow);
......@@ -1348,7 +1348,7 @@ static void test_marshal_channel_buffer(void)
CHECK_CALLED(Disconnect);
hr = CoRevokeClassObject(registration_key);
ok(hr == S_OK, "CoRevokeClassObject failed: %08x\n", hr);
ok(hr == S_OK, "CoRevokeClassObject failed: %08lx\n", hr);
end_host_object(tid, thread);
}
......@@ -1414,8 +1414,8 @@ static HRESULT WINAPI CustomMarshal_MarshalInterface(IMarshal *iface, IStream *s
hr = IStream_Stat(stream, &stat, STATFLAG_DEFAULT);
ok_ole_success(hr, IStream_Stat);
ok(U(stat.cbSize).LowPart == 0, "stream is not empty (%d)\n", U(stat.cbSize).LowPart);
ok(U(stat.cbSize).HighPart == 0, "stream is not empty (%d)\n", U(stat.cbSize).HighPart);
ok(U(stat.cbSize).LowPart == 0, "stream is not empty (%ld)\n", U(stat.cbSize).LowPart);
ok(U(stat.cbSize).HighPart == 0, "stream is not empty (%ld)\n", U(stat.cbSize).HighPart);
hr = CoGetStandardMarshal(riid, (IUnknown*)iface,
dwDestContext, NULL, mshlflags, &std_marshal);
......@@ -1511,7 +1511,7 @@ static void test_StdMarshal_custom_marshaling(void)
MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
ok_ole_success(hr, CoGetMarshalSizeMax);
CHECK_CALLED(CustomMarshal_GetMarshalSizeMax);
ok(size == sizeof(OBJREF), "size = %d, expected %d\n", size, (int)sizeof(OBJREF));
ok(size == sizeof(OBJREF), "size = %ld, expected %d\n", size, (int)sizeof(OBJREF));
}
static void test_DfMarshal_custom_marshaling(void)
......@@ -1540,17 +1540,17 @@ static void test_DfMarshal_custom_marshaling(void)
size = FIELD_OFFSET(OBJREF, u_objref.u_custom.pData);
hr = IStream_Read(stream, &objref, size, &read);
ok_ole_success(hr, IStream_Read);
ok(read == size, "read = %d, expected %d\n", read, size);
ok(objref.signature == OBJREF_SIGNATURE, "objref.signature = %x\n",
ok(read == size, "read = %ld, expected %ld\n", read, size);
ok(objref.signature == OBJREF_SIGNATURE, "objref.signature = %lx\n",
objref.signature);
ok(objref.flags == OBJREF_CUSTOM, "objref.flags = %x\n", objref.flags);
ok(objref.flags == OBJREF_CUSTOM, "objref.flags = %lx\n", objref.flags);
ok(IsEqualIID(&objref.iid, &IID_IUnknown), "objref.iid = %s\n",
wine_dbgstr_guid(&objref.iid));
ok(IsEqualIID(&objref.u_objref.u_custom.clsid, &CLSID_DfMarshal),
"custom.clsid = %s\n", wine_dbgstr_guid(&objref.u_objref.u_custom.clsid));
ok(!objref.u_objref.u_custom.cbExtension, "custom.cbExtension = %d\n",
ok(!objref.u_objref.u_custom.cbExtension, "custom.cbExtension = %ld\n",
objref.u_objref.u_custom.cbExtension);
ok(!objref.u_objref.u_custom.size, "custom.size = %d\n",
ok(!objref.u_objref.u_custom.size, "custom.size = %ld\n",
objref.u_objref.u_custom.size);
IStream_Release(stream);
......@@ -1560,7 +1560,7 @@ static void test_DfMarshal_custom_marshaling(void)
MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
ok_ole_success(hr, CoGetMarshalSizeMax);
CHECK_CALLED(CustomMarshal_GetMarshalSizeMax);
ok(size == sizeof(OBJREF), "size = %d, expected %d\n", size, (int)sizeof(OBJREF));
ok(size == sizeof(OBJREF), "size = %ld, expected %d\n", size, (int)sizeof(OBJREF));
}
static void test_CoGetStandardMarshal(void)
......@@ -1593,7 +1593,7 @@ static void test_CoGetStandardMarshal(void)
hr = CoGetMarshalSizeMax(&read, &IID_IUnknown, &Test_Unknown,
MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
ok_ole_success(hr, CoGetMarshalSizeMax);
ok(size == read, "IMarshal_GetMarshalSizeMax size = %d, expected %d\n", size, read);
ok(size == read, "IMarshal_GetMarshalSizeMax size = %ld, expected %ld\n", size, read);
hr = IMarshal_MarshalInterface(marshal, stream, &IID_IUnknown,
&Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
......@@ -1604,15 +1604,15 @@ static void test_CoGetStandardMarshal(void)
size = FIELD_OFFSET(OBJREF, u_objref.u_standard.saResAddr.aStringArray);
hr = IStream_Read(stream, &objref, size, &read);
ok_ole_success(hr, IStream_Read);
ok(read == size, "read = %d, expected %d\n", read, size);
ok(objref.signature == OBJREF_SIGNATURE, "objref.signature = %x\n",
ok(read == size, "read = %ld, expected %ld\n", read, size);
ok(objref.signature == OBJREF_SIGNATURE, "objref.signature = %lx\n",
objref.signature);
ok(objref.flags == OBJREF_STANDARD, "objref.flags = %x\n", objref.flags);
ok(objref.flags == OBJREF_STANDARD, "objref.flags = %lx\n", objref.flags);
ok(IsEqualIID(&objref.iid, &IID_IUnknown), "objref.iid = %s\n",
wine_dbgstr_guid(&objref.iid));
stdobjref = &objref.u_objref.u_standard.std;
ok(stdobjref->flags == 0, "stdobjref.flags = %d\n", stdobjref->flags);
ok(stdobjref->cPublicRefs == 5, "stdobjref.cPublicRefs = %d\n",
ok(stdobjref->flags == 0, "stdobjref.flags = %ld\n", stdobjref->flags);
ok(stdobjref->cPublicRefs == 5, "stdobjref.cPublicRefs = %ld\n",
stdobjref->cPublicRefs);
dualstringarr = &objref.u_objref.u_standard.saResAddr;
ok(dualstringarr->wNumEntries == 0, "dualstringarr.wNumEntries = %d\n",
......@@ -1978,7 +1978,7 @@ static void test_tableweak_marshal_releasedata2(void)
todo_wine
{
ok(hr == CO_E_OBJNOTREG,
"CoUnmarshalInterface should have failed with CO_E_OBJNOTREG, but returned 0x%08x instead\n",
"CoUnmarshalInterface should have failed with CO_E_OBJNOTREG, but returned 0x%08lx instead\n",
hr);
}
IStream_Release(pStream);
......@@ -2389,7 +2389,7 @@ static void test_disconnect_stub(void)
ok_non_zero_external_conn();
hr = CoDisconnectObject(NULL, 0);
ok( hr == E_INVALIDARG, "wrong status %x\n", hr );
ok( hr == E_INVALIDARG, "wrong status %lx\n", hr );
}
/* tests failure case of a same-thread marshal and unmarshal twice */
......@@ -2422,7 +2422,7 @@ static void test_normal_marshal_and_unmarshal_twice(void)
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy2);
ok(hr == CO_E_OBJNOTCONNECTED,
"CoUnmarshalInterface should have failed with error CO_E_OBJNOTCONNECTED for double unmarshal, instead of 0x%08x\n", hr);
"CoUnmarshalInterface should have failed with error CO_E_OBJNOTCONNECTED for double unmarshal, instead of 0x%08lx\n", hr);
IStream_Release(pStream);
......@@ -2451,14 +2451,14 @@ static void test_hresult_marshaling(void)
hr = IStream_Read(pStream, &hr_marshaled, sizeof(HRESULT), NULL);
ok_ole_success(hr, IStream_Read);
ok(hr_marshaled == E_DEADBEEF, "Didn't marshal HRESULT as expected: got value 0x%08x instead\n", hr_marshaled);
ok(hr_marshaled == E_DEADBEEF, "Didn't marshal HRESULT as expected: got value 0x%08lx instead\n", hr_marshaled);
hr_marshaled = 0;
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalHresult(pStream, &hr_marshaled);
ok_ole_success(hr, CoUnmarshalHresult);
ok(hr_marshaled == E_DEADBEEF, "Didn't marshal HRESULT as expected: got value 0x%08x instead\n", hr_marshaled);
ok(hr_marshaled == E_DEADBEEF, "Didn't marshal HRESULT as expected: got value 0x%08lx instead\n", hr_marshaled);
IStream_Release(pStream);
}
......@@ -2472,15 +2472,15 @@ static DWORD CALLBACK bad_thread_proc(LPVOID p)
IUnknown * proxy = NULL;
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (LPVOID*)&proxy);
todo_wine ok(hr == CO_E_NOTINITIALIZED, "Got hr %#x.\n", hr);
todo_wine ok(hr == CO_E_NOTINITIALIZED, "Got hr %#lx.\n", hr);
hr = IClassFactory_QueryInterface(cf, &IID_IMultiQI, (LPVOID *)&proxy);
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#x.\n", hr);
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr))
IUnknown_Release(proxy);
hr = IClassFactory_QueryInterface(cf, &IID_IStream, (LPVOID *)&proxy);
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#x.\n", hr);
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr))
IUnknown_Release(proxy);
......@@ -2489,11 +2489,11 @@ static DWORD CALLBACK bad_thread_proc(LPVOID p)
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (LPVOID*)&proxy);
if (proxy) IUnknown_Release(proxy);
ok(hr == RPC_E_WRONG_THREAD,
"COM should have failed with RPC_E_WRONG_THREAD on using proxy from wrong apartment, but instead returned 0x%08x\n",
"COM should have failed with RPC_E_WRONG_THREAD on using proxy from wrong apartment, but instead returned 0x%08lx\n",
hr);
hr = IClassFactory_QueryInterface(cf, &IID_IStream, (LPVOID *)&proxy);
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#x.\n", hr);
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#lx.\n", hr);
/* now be really bad and release the proxy from the wrong apartment */
IClassFactory_Release(cf);
......@@ -2653,7 +2653,7 @@ static void test_message_filter(void)
ok_more_than_one_lock();
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (LPVOID*)&proxy);
ok(hr == RPC_E_CALL_REJECTED, "Call should have returned RPC_E_CALL_REJECTED, but return 0x%08x instead\n", hr);
ok(hr == RPC_E_CALL_REJECTED, "Call should have returned RPC_E_CALL_REJECTED, but return 0x%08lx instead\n", hr);
if (proxy) IUnknown_Release(proxy);
proxy = NULL;
......@@ -2690,7 +2690,7 @@ static void test_bad_marshal_stream(void)
/* try to read beyond end of stream */
hr = CoReleaseMarshalData(pStream);
ok(hr == STG_E_READFAULT, "Should have failed with STG_E_READFAULT, but returned 0x%08x instead\n", hr);
ok(hr == STG_E_READFAULT, "Should have failed with STG_E_READFAULT, but returned 0x%08lx instead\n", hr);
/* now release for real */
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
......@@ -2821,16 +2821,16 @@ static void test_proxybuffer(REFIID riid)
/* release our reference to the outer unknown object - the PS factory
* buffer will have AddRef's it in the CreateProxy call */
refs = IUnknown_Release(&pUnkOuter->IUnknown_iface);
ok(refs == 1, "Ref count of outer unknown should have been 1 instead of %d\n", refs);
ok(refs == 1, "Ref count of outer unknown should have been 1 instead of %ld\n", refs);
/* Not checking return, unreliable on native. Maybe it leaks references? */
IPSFactoryBuffer_Release(psfb);
refs = IUnknown_Release((IUnknown *)lpvtbl);
ok(refs == 0, "Ref-count leak of %d on IRpcProxyBuffer\n", refs);
ok(refs == 0, "Ref-count leak of %ld on IRpcProxyBuffer\n", refs);
refs = IRpcProxyBuffer_Release(proxy);
ok(refs == 0, "Ref-count leak of %d on IRpcProxyBuffer\n", refs);
ok(refs == 0, "Ref-count leak of %ld on IRpcProxyBuffer\n", refs);
}
static void test_stubbuffer(REFIID riid)
......@@ -2862,7 +2862,7 @@ static void test_stubbuffer(REFIID riid)
ok_no_locks();
refs = IRpcStubBuffer_Release(stub);
ok(refs == 0, "Ref-count leak of %d on IRpcProxyBuffer\n", refs);
ok(refs == 0, "Ref-count leak of %ld on IRpcProxyBuffer\n", refs);
}
static HWND hwnd_app;
......@@ -2925,7 +2925,7 @@ static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
/* note the use of the magic IID_IWineTest value to tell remote thread
* to try to send a message back to us */
hr = IClassFactory_CreateInstance(proxy, NULL, &IID_IWineTest, (void **)&object);
ok(hr == S_FALSE, "expected S_FALSE, got %d\n", hr);
ok(hr == S_FALSE, "expected S_FALSE, got %ld\n", hr);
IClassFactory_Release(proxy);
......@@ -2965,7 +2965,7 @@ static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
* WM_QUIT message doesn't stop the call from succeeding */
PostMessageA(hwnd, WM_QUIT, 0, 0);
hr = IClassFactory_CreateInstance(proxy, NULL, &IID_IUnknown, (void **)&object);
ok(hr == S_FALSE, "IClassFactory_CreateInstance returned 0x%08x, expected S_FALSE\n", hr);
ok(hr == S_FALSE, "IClassFactory_CreateInstance returned 0x%08lx, expected S_FALSE\n", hr);
IClassFactory_Release(proxy);
......@@ -2997,7 +2997,7 @@ static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
* messages should fail */
hr = IClassFactory_CreateInstance(proxy, NULL, &IID_IUnknown, (void **)&object);
ok(hr == RPC_E_CANTCALLOUT_ININPUTSYNCCALL,
"COM call during processing of sent message should return RPC_E_CANTCALLOUT_ININPUTSYNCCALL instead of 0x%08x\n", hr);
"COM call during processing of sent message should return RPC_E_CANTCALLOUT_ININPUTSYNCCALL instead of 0x%08lx\n", hr);
IClassFactory_Release(proxy);
......@@ -3153,15 +3153,15 @@ static void test_freethreadedmarshaldata(IStream *pStream, MSHCTX mshctx, void *
if (mshctx == MSHCTX_INPROC)
{
DWORD expected_size = round_global_size(3*sizeof(DWORD) + sizeof(GUID));
ok(size == expected_size, "expected size %u, got %u\n", expected_size, size);
ok(size == expected_size, "expected size %lu, got %lu\n", expected_size, size);
ok(*(DWORD *)marshal_data == mshlflags, "expected 0x%x, but got 0x%x for mshctx\n", mshlflags, *(DWORD *)marshal_data);
ok(*(DWORD *)marshal_data == mshlflags, "expected 0x%lx, but got 0x%lx for mshctx\n", mshlflags, *(DWORD *)marshal_data);
marshal_data += sizeof(DWORD);
ok(*(void **)marshal_data == ptr, "expected %p, but got %p for mshctx\n", ptr, *(void **)marshal_data);
marshal_data += sizeof(void *);
if (sizeof(void*) == 4 && size >= 3*sizeof(DWORD))
{
ok(*(DWORD *)marshal_data == 0, "expected 0x0, but got 0x%x\n", *(DWORD *)marshal_data);
ok(*(DWORD *)marshal_data == 0, "expected 0x0, but got 0x%lx\n", *(DWORD *)marshal_data);
marshal_data += sizeof(DWORD);
}
if (size >= 3*sizeof(DWORD) + sizeof(GUID) && winetest_debug > 1)
......@@ -3171,7 +3171,7 @@ static void test_freethreadedmarshaldata(IStream *pStream, MSHCTX mshctx, void *
}
else
{
ok(size > sizeof(DWORD), "size should have been > sizeof(DWORD), not %d\n", size);
ok(size > sizeof(DWORD), "size should have been > sizeof(DWORD), not %ld\n", size);
ok(*(DWORD *)marshal_data == 0x574f454d /* MEOW */,
"marshal data should be filled by standard marshal and start with MEOW signature\n");
}
......@@ -3206,8 +3206,8 @@ static void test_freethreadedmarshaler(void)
expected_size = sizeof(DWORD) /* flags */ + sizeof(UINT64) + sizeof(GUID);
hr = IMarshal_GetMarshalSizeMax(pFTMarshal, &IID_IClassFactory, &Test_ClassFactory, MSHCTX_INPROC,
NULL, MSHLFLAGS_NORMAL, &size);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(size == expected_size, "Unexpected marshal size %u, expected %u.\n", size, expected_size);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(size == expected_size, "Unexpected marshal size %lu, expected %lu.\n", size, expected_size);
hr = IMarshal_GetUnmarshalClass(pFTMarshal, &IID_IClassFactory,
&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL, &clsid);
......@@ -3357,10 +3357,10 @@ static HRESULT reg_unreg_wine_test_class(BOOL Register)
skip("Not authorized to modify the Classes key\n");
return E_FAIL;
}
ok(error == ERROR_SUCCESS, "RegCreateKeyEx failed with error %d\n", error);
ok(error == ERROR_SUCCESS, "RegCreateKeyEx failed with error %ld\n", error);
if (error != ERROR_SUCCESS) hr = E_FAIL;
error = RegSetValueExA(hkey, NULL, 0, REG_SZ, (const unsigned char *)"\"ole32.dll\"", strlen("\"ole32.dll\"") + 1);
ok(error == ERROR_SUCCESS, "RegSetValueEx failed with error %d\n", error);
ok(error == ERROR_SUCCESS, "RegSetValueEx failed with error %ld\n", error);
if (error != ERROR_SUCCESS) hr = E_FAIL;
RegCloseKey(hkey);
}
......@@ -3388,7 +3388,7 @@ static void test_inproc_handler(void)
if (SUCCEEDED(hr))
{
hr = IUnknown_QueryInterface(pObject, &IID_IWineTest, (void **)&pObject2);
ok(hr == E_NOINTERFACE, "IUnknown_QueryInterface on handler for invalid interface returned 0x%08x instead of E_NOINTERFACE\n", hr);
ok(hr == E_NOINTERFACE, "IUnknown_QueryInterface on handler for invalid interface returned 0x%08lx instead of E_NOINTERFACE\n", hr);
/* it's a handler as it supports IOleObject */
hr = IUnknown_QueryInterface(pObject, &IID_IOleObject, (void **)&pObject2);
......@@ -3481,7 +3481,7 @@ static void test_handler_marshaling(void)
ok_more_than_one_lock();
hr = IUnknown_QueryInterface(pProxy, &IID_IWineTest, (void **)&pObject);
ok(hr == E_NOINTERFACE, "IUnknown_QueryInterface with unknown IID should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
ok(hr == E_NOINTERFACE, "IUnknown_QueryInterface with unknown IID should have returned E_NOINTERFACE instead of 0x%08lx\n", hr);
/* it's a handler as it supports IOleObject */
hr = IUnknown_QueryInterface(pProxy, &IID_IOleObject, (void **)&pObject);
......@@ -3541,7 +3541,7 @@ static void test_client_security(void)
if (SUCCEEDED(IClassFactory_QueryInterface(pProxy, &IID_IRemUnknown, (void **)&pProxy2)))
{
hr = IUnknown_QueryInterface(pProxy2, &IID_IUnknown, (void **)&pUnknown2);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(pUnknown1 == pUnknown2, "both proxy's IUnknowns should be the same - %p, %p\n", pUnknown1, pUnknown2);
IUnknown_Release(pUnknown2);
......@@ -3559,7 +3559,7 @@ static void test_client_security(void)
todo_wine ok_ole_success(hr, "IClientSecurity_QueryBlanket (all NULLs)");
hr = IClientSecurity_QueryBlanket(pCliSec, (IUnknown *)pMarshal, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
todo_wine ok(hr == E_NOINTERFACE, "IClientSecurity_QueryBlanket with local interface should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IClientSecurity_QueryBlanket with local interface should have returned E_NOINTERFACE instead of 0x%08lx\n", hr);
hr = IClientSecurity_QueryBlanket(pCliSec, (IUnknown *)pProxy, &dwAuthnSvc, &dwAuthzSvc, &pServerPrincName, &dwAuthnLevel, &dwImpLevel, &pAuthInfo, &dwCapabilities);
todo_wine ok_ole_success(hr, "IClientSecurity_QueryBlanket");
......@@ -3568,13 +3568,13 @@ static void test_client_security(void)
todo_wine ok_ole_success(hr, "IClientSecurity_SetBlanket");
hr = IClassFactory_CreateInstance(pProxy, NULL, &IID_IWineTest, &pv);
ok(hr == E_NOINTERFACE, "COM call should have succeeded instead of returning 0x%08x\n", hr);
ok(hr == E_NOINTERFACE, "COM call should have succeeded instead of returning 0x%08lx\n", hr);
hr = IClientSecurity_SetBlanket(pCliSec, (IUnknown *)pMarshal, dwAuthnSvc, dwAuthzSvc, pServerPrincName, dwAuthnLevel, dwImpLevel, pAuthInfo, dwCapabilities);
todo_wine ok(hr == E_NOINTERFACE, "IClientSecurity_SetBlanket with local interface should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
todo_wine ok(hr == E_NOINTERFACE, "IClientSecurity_SetBlanket with local interface should have returned E_NOINTERFACE instead of 0x%08lx\n", hr);
hr = IClientSecurity_SetBlanket(pCliSec, (IUnknown *)pProxy, 0xdeadbeef, dwAuthzSvc, pServerPrincName, dwAuthnLevel, dwImpLevel, pAuthInfo, dwCapabilities);
todo_wine ok(hr == E_INVALIDARG, "IClientSecurity_SetBlanke with invalid dwAuthnSvc should have returned E_INVALIDARG instead of 0x%08x\n", hr);
todo_wine ok(hr == E_INVALIDARG, "IClientSecurity_SetBlanke with invalid dwAuthnSvc should have returned E_INVALIDARG instead of 0x%08lx\n", hr);
CoTaskMemFree(pServerPrincName);
......@@ -3647,12 +3647,12 @@ static HRESULT WINAPI local_server_GetClassID(IPersist *iface, CLSID *clsid)
/* Test calling CoDisconnectObject within a COM call */
hr = CoDisconnectObject((IUnknown *)iface, 0);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
/* Initialize and uninitialize the apartment to show that we
* remain in the autojoined mta */
hr = CoInitializeEx( NULL, COINIT_MULTITHREADED );
ok( hr == S_FALSE, "got %08x\n", hr );
ok( hr == S_FALSE, "got %08lx\n", hr );
CoUninitialize();
return S_OK;
......@@ -3798,7 +3798,7 @@ static HANDLE create_target_process(const char *arg)
winetest_get_mainargs( &argv );
sprintf(cmdline, "\"%s\" %s %s", argv[0], argv[1], arg);
ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
ok(ret, "CreateProcess failed with error: %u\n", GetLastError());
ok(ret, "CreateProcess failed with error: %lu\n", GetLastError());
if (pi.hThread) CloseHandle(pi.hThread);
return pi.hProcess;
}
......@@ -3830,7 +3830,7 @@ static void test_local_server(void)
* class in the registry */
hr = CoGetClassObject(&CLSID_WineOOPTest, CLSCTX_INPROC_SERVER,
NULL, &IID_IClassFactory, (LPVOID*)&cf);
todo_wine ok(hr == REGDB_E_CLASSNOTREG, "Got hr %#x.\n", hr);
todo_wine ok(hr == REGDB_E_CLASSNOTREG, "Got hr %#lx.\n", hr);
/* Resume the object suspended above ... */
hr = CoResumeClassObjects();
......@@ -3865,7 +3865,7 @@ static void test_local_server(void)
/* try to connect again after SCM has suspended registered class objects */
hr = CoGetClassObject(&CLSID_WineOOPTest, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, NULL,
&IID_IClassFactory, (LPVOID*)&cf);
todo_wine ok(hr == CO_E_SERVER_STOPPING || hr == REGDB_E_CLASSNOTREG /* Win10 1709+ */, "Got hr %#x.\n", hr);
todo_wine ok(hr == CO_E_SERVER_STOPPING || hr == REGDB_E_CLASSNOTREG /* Win10 1709+ */, "Got hr %#lx.\n", hr);
hr = CoRevokeClassObject(cookie);
ok_ole_success(hr, CoRevokeClassObject);
......@@ -3873,7 +3873,7 @@ static void test_local_server(void)
CloseHandle(heventShutdown);
process = create_target_process("-Embedding");
ok(process != NULL, "couldn't start local server process, error was %d\n", GetLastError());
ok(process != NULL, "couldn't start local server process, error was %ld\n", GetLastError());
ready_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Ready Event");
ok( !WaitForSingleObject(ready_event, 10000), "wait timed out\n" );
......@@ -3922,7 +3922,7 @@ static DWORD CALLBACK get_global_interface_proc(LPVOID pv)
IClassFactory *cf;
hr = IGlobalInterfaceTable_GetInterfaceFromGlobal(params->git, params->cookie, &IID_IClassFactory, (void **)&cf);
ok(hr == CO_E_NOTINITIALIZED, "Got hr %#x.\n", hr);
ok(hr == CO_E_NOTINITIALIZED, "Got hr %#lx.\n", hr);
CoInitialize(NULL);
......@@ -3952,10 +3952,10 @@ static void test_globalinterfacetable(void)
cLocks = 0;
hr = pDllGetClassObject(&CLSID_StdGlobalInterfaceTable, &IID_IClassFactory, (void**)&cf);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IClassFactory_QueryInterface(cf, &IID_IGlobalInterfaceTable, (void**)&object);
ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
IClassFactory_Release(cf);
......@@ -3963,14 +3963,14 @@ static void test_globalinterfacetable(void)
ok_ole_success(hr, CoCreateInstance);
ref = IGlobalInterfaceTable_AddRef(git);
ok(ref == 1, "ref=%d\n", ref);
ok(ref == 1, "ref=%ld\n", ref);
ref = IGlobalInterfaceTable_AddRef(git);
ok(ref == 1, "ref=%d\n", ref);
ok(ref == 1, "ref=%ld\n", ref);
ref = IGlobalInterfaceTable_Release(git);
ok(ref == 1, "ref=%d\n", ref);
ok(ref == 1, "ref=%ld\n", ref);
ref = IGlobalInterfaceTable_Release(git);
ok(ref == 1, "ref=%d\n", ref);
ok(ref == 1, "ref=%ld\n", ref);
hr = IGlobalInterfaceTable_RegisterInterfaceInGlobal(git, (IUnknown *)&Test_ClassFactory, &IID_IClassFactory, &cookie);
ok_ole_success(hr, IGlobalInterfaceTable_RegisterInterfaceInGlobal);
......@@ -4012,7 +4012,7 @@ static void test_globalinterfacetable(void)
IGlobalInterfaceTable_Release(git);
hr = CoGetClassObject(&CLSID_StdGlobalInterfaceTable, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void **)&cf);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IClassFactory_Release(cf);
}
......@@ -4027,77 +4027,77 @@ static void test_manualresetevent(void)
HRESULT hr;
hr = pDllGetClassObject(&CLSID_ManualResetEvent, &IID_IClassFactory, (void **)&factory);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IClassFactory_Release(factory);
hr = CoGetClassObject(&CLSID_ManualResetEvent, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void **)&factory);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IClassFactory_Release(factory);
hr = CoCreateInstance(&CLSID_ManualResetEvent, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&punk);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!!punk, "Got NULL.\n");
IUnknown_Release(punk);
hr = CoCreateInstance(&CLSID_ManualResetEvent, NULL, CLSCTX_INPROC_SERVER, &IID_ISynchronize, (void**)&psync1);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!!psync1, "Got NULL.\n");
hr = ISynchronize_Wait(psync1, 0, 5);
ok(hr == RPC_S_CALLPENDING, "Got 0x%08x\n", hr);
ok(hr == RPC_S_CALLPENDING, "Got 0x%08lx\n", hr);
hr = ISynchronize_Reset(psync1);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = ISynchronize_Signal(psync1);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = ISynchronize_Wait(psync1, 0, 5);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = ISynchronize_Wait(psync1, 0, 5);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = ISynchronize_Reset(psync1);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = ISynchronize_Wait(psync1, 0, 5);
ok(hr == RPC_S_CALLPENDING, "Got 0x%08x\n", hr);
ok(hr == RPC_S_CALLPENDING, "Got 0x%08lx\n", hr);
hr = CoCreateInstance(&CLSID_ManualResetEvent, NULL, CLSCTX_INPROC_SERVER, &IID_ISynchronize, (void**)&psync2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!!psync2, "Got NULL.\n");
ok(psync1 != psync2, "psync1 == psync2.\n");
hr = ISynchronize_QueryInterface(psync2, &IID_ISynchronizeHandle, (void**)&sync_handle);
ok(hr == S_OK, "QueryInterface(IID_ISynchronizeHandle) failed: %08x\n", hr);
ok(hr == S_OK, "QueryInterface(IID_ISynchronizeHandle) failed: %08lx\n", hr);
handle = NULL;
hr = ISynchronizeHandle_GetHandle(sync_handle, &handle);
ok(hr == S_OK, "GetHandle failed: %08x\n", hr);
ok(hr == S_OK, "GetHandle failed: %08lx\n", hr);
ok(handle != NULL && handle != INVALID_HANDLE_VALUE, "handle = %p\n", handle);
ISynchronizeHandle_Release(sync_handle);
hr = ISynchronize_Wait(psync2, 0, 5);
ok(hr == RPC_S_CALLPENDING, "Got 0x%08x\n", hr);
ok(hr == RPC_S_CALLPENDING, "Got 0x%08lx\n", hr);
hr = ISynchronize_Reset(psync1);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = ISynchronize_Reset(psync2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = ISynchronize_Signal(psync1);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = ISynchronize_Wait(psync2, 0, 5);
ok(hr == RPC_S_CALLPENDING, "Got 0x%08x\n", hr);
ok(hr == RPC_S_CALLPENDING, "Got 0x%08lx\n", hr);
ref = ISynchronize_AddRef(psync1);
ok(ref == 2, "Got ref: %d\n", ref);
ok(ref == 2, "Got ref: %ld\n", ref);
ref = ISynchronize_AddRef(psync1);
ok(ref == 3, "Got ref: %d\n", ref);
ok(ref == 3, "Got ref: %ld\n", ref);
ref = ISynchronize_Release(psync1);
ok(ref == 2, "Got nonzero ref: %d\n", ref);
ok(ref == 2, "Got nonzero ref: %ld\n", ref);
ref = ISynchronize_Release(psync2);
ok(!ref, "Got nonzero ref: %d\n", ref);
ok(!ref, "Got nonzero ref: %ld\n", ref);
ref = ISynchronize_Release(psync1);
ok(ref == 1, "Got nonzero ref: %d\n", ref);
ok(ref == 1, "Got nonzero ref: %ld\n", ref);
ref = ISynchronize_Release(psync1);
ok(!ref, "Got nonzero ref: %d\n", ref);
ok(!ref, "Got nonzero ref: %ld\n", ref);
}
static DWORD CALLBACK implicit_mta_unmarshal_proc(void *param)
......@@ -4120,7 +4120,7 @@ static DWORD CALLBACK implicit_mta_unmarshal_proc(void *param)
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void **)&proxy);
ok(hr == RPC_E_WRONG_THREAD, "got %#x\n", hr);
ok(hr == RPC_E_WRONG_THREAD, "got %#lx\n", hr);
CoUninitialize();
......@@ -4150,7 +4150,7 @@ static DWORD CALLBACK implicit_mta_use_proc(void *param)
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void **)&proxy);
ok(hr == RPC_E_WRONG_THREAD, "got %#x\n", hr);
ok(hr == RPC_E_WRONG_THREAD, "got %#lx\n", hr);
CoUninitialize();
return 0;
......@@ -4301,8 +4301,8 @@ static void WINAPI TestChannelHook_ClientGetSize(
if (info->cbSize == sizeof(*info))
{
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method);
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%lx instead of 0x%lx\n", info->dwServerPid, GetCurrentProcessId());
ok(info->iMethod == method, "iMethod was %ld should be %d\n", info->iMethod, method);
ok(!info->pObject, "pObject should be NULL\n");
if (method == 3)
causality = info->uCausality;
......@@ -4328,8 +4328,8 @@ static void WINAPI TestChannelHook_ClientFillBuffer(
if (info->cbSize == sizeof(*info))
{
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method);
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%lx instead of 0x%lx\n", info->dwServerPid, GetCurrentProcessId());
ok(info->iMethod == method, "iMethod was %ld should be %d\n", info->iMethod, method);
ok(!info->pObject, "pObject should be NULL\n");
ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n");
}
......@@ -4351,12 +4351,12 @@ static void WINAPI TestChannelHook_ClientNotify(
{
SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid;
if (winetest_debug > 1) trace("IChannelHook::ClientNotify(hr %#x)\n", hrFault);
if (winetest_debug > 1) trace("IChannelHook::ClientNotify(hr %#lx)\n", hrFault);
if (info->cbSize == sizeof(*info))
{
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method);
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%lx instead of 0x%lx\n", info->dwServerPid, GetCurrentProcessId());
ok(info->iMethod == method, "iMethod was %ld should be %d\n", info->iMethod, method);
todo_wine {
ok(info->pObject != NULL, "pObject shouldn't be NULL\n");
}
......@@ -4380,13 +4380,13 @@ static void WINAPI TestChannelHook_ServerNotify(
if (info->cbSize == sizeof(*info))
{
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method);
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%lx instead of 0x%lx\n", info->dwServerPid, GetCurrentProcessId());
ok(info->iMethod == method, "iMethod was %ld should be %d\n", info->iMethod, method);
ok(info->pObject != NULL, "pObject shouldn't be NULL\n");
ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n");
}
ok(cbDataSize == 1, "cbDataSize should have been 1 instead of %d\n", cbDataSize);
ok(cbDataSize == 1, "cbDataSize should have been 1 instead of %ld\n", cbDataSize);
ok(*(unsigned char *)pDataBuffer == 0xcc, "pDataBuffer should have contained 0xcc instead of 0x%x\n", *(unsigned char *)pDataBuffer);
ok(IsEqualGUID(uExtent, &EXTENTID_WineTest), "uExtent wasn't correct\n");
}
......@@ -4400,12 +4400,12 @@ static void WINAPI TestChannelHook_ServerGetSize(
{
SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid;
if (winetest_debug > 1) trace("IChannelHook::ServerGetSize(iid %s, hr %#x)\n", debugstr_guid(riid), hrFault);
if (winetest_debug > 1) trace("IChannelHook::ServerGetSize(iid %s, hr %#lx)\n", debugstr_guid(riid), hrFault);
if (info->cbSize == sizeof(*info))
{
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method);
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%lx instead of 0x%lx\n", info->dwServerPid, GetCurrentProcessId());
ok(info->iMethod == method, "iMethod was %ld should be %d\n", info->iMethod, method);
ok(info->pObject != NULL, "pObject shouldn't be NULL\n");
ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n");
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -114,7 +114,7 @@ static ULONG WINAPI UnknownImpl_AddRef(IUnknown *iface)
InterlockedIncrement(&obj_ref);
trace("server: unknown_AddRef: %p, ref %u\n", iface, ref);
trace("server: unknown_AddRef: %p, ref %lu\n", iface, ref);
return ref;
}
......@@ -125,7 +125,7 @@ static ULONG WINAPI UnknownImpl_Release(IUnknown *iface)
InterlockedDecrement(&obj_ref);
trace("server: unknown_Release: %p, ref %u\n", iface, ref);
trace("server: unknown_Release: %p, ref %lu\n", iface, ref);
if (ref == 0) HeapFree(GetProcessHeap(), 0, This);
return ref;
}
......@@ -176,7 +176,7 @@ static ULONG WINAPI ClassFactoryImpl_AddRef(IClassFactory *iface)
InterlockedIncrement(&class_ref);
trace("server: factory_AddRef: %p, ref %u\n", iface, ref);
trace("server: factory_AddRef: %p, ref %lu\n", iface, ref);
return ref;
}
......@@ -187,7 +187,7 @@ static ULONG WINAPI ClassFactoryImpl_Release(IClassFactory *iface)
InterlockedDecrement(&class_ref);
trace("server: factory_Release: %p, ref %u\n", iface, ref);
trace("server: factory_Release: %p, ref %lu\n", iface, ref);
return ref;
}
......@@ -218,7 +218,7 @@ static HRESULT WINAPI ClassFactoryImpl_LockServer(IClassFactory *iface, BOOL loc
{
ULONG ref = lock ? InterlockedIncrement(&server_locks) : InterlockedDecrement(&server_locks);
trace("server: factory_LockServer: %p,%d, ref %u\n", iface, lock, ref);
trace("server: factory_LockServer: %p,%d, ref %lu\n", iface, lock, ref);
return S_OK;
}
......@@ -238,7 +238,7 @@ static void ole_server(void)
HRESULT hr;
DWORD key;
trace("server: starting %u\n", GetCurrentProcessId());
trace("server: starting %lu\n", GetCurrentProcessId());
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (hr == S_OK)
......@@ -251,9 +251,9 @@ static void ole_server(void)
HANDLE done_event, init_done_event;
done_event = OpenEventA(SYNCHRONIZE, FALSE, "ole_server_done_event");
ok(done_event != 0, "server: OpenEvent error %d\n", GetLastError());
ok(done_event != 0, "server: OpenEvent error %ld\n", GetLastError());
init_done_event = OpenEventA(EVENT_MODIFY_STATE, FALSE, "ole_server_init_done_event");
ok(init_done_event != 0, "server: OpenEvent error %d\n", GetLastError());
ok(init_done_event != 0, "server: OpenEvent error %ld\n", GetLastError());
SetEvent(init_done_event);
......@@ -261,9 +261,9 @@ static void ole_server(void)
WaitForSingleObject(done_event, INFINITE);
/* 1 remainining class ref is supposed to be cleared by CoRevokeClassObject */
ok(class_ref == 1, "expected 1 class refs, got %d\n", class_ref);
ok(!obj_ref, "expected 0 object refs, got %d\n", obj_ref);
ok(!server_locks, "expected 0 server locks, got %d\n", server_locks);
ok(class_ref == 1, "expected 1 class refs, got %ld\n", class_ref);
ok(!obj_ref, "expected 0 object refs, got %ld\n", obj_ref);
ok(!server_locks, "expected 0 server locks, got %ld\n", server_locks);
CloseHandle(done_event);
CloseHandle(init_done_event);
......@@ -280,7 +280,7 @@ static void ole_server(void)
trace("server: ret CoUninitialize\n");
}
trace("server: exiting %u\n", GetCurrentProcessId());
trace("server: exiting %lu\n", GetCurrentProcessId());
}
/******************************* OLE client *******************************/
......@@ -303,12 +303,12 @@ static BOOL register_server(const char *server, BOOL inproc_handler)
if (ret == ERROR_SUCCESS)
{
ret = RegSetValueA(root, "LocalServer32", REG_SZ, server_path, strlen(server_path));
ok(ret == ERROR_SUCCESS, "RegSetValue error %u\n", ret);
ok(ret == ERROR_SUCCESS, "RegSetValue error %lu\n", ret);
if (inproc_handler)
{
ret = RegSetValueA(root, "InprocHandler32", REG_SZ, "ole32.dll", 9);
ok(ret == ERROR_SUCCESS, "RegSetValue error %u\n", ret);
ok(ret == ERROR_SUCCESS, "RegSetValue error %lu\n", ret);
}
RegCloseKey(root);
......@@ -332,11 +332,11 @@ static void unregister_server(void)
if (ret == ERROR_SUCCESS)
{
ret = RegDeleteKeyA(root, "InprocHandler32");
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %u\n", ret);
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %lu\n", ret);
ret = RegDeleteKeyA(root, "LocalServer32");
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %u\n", ret);
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %lu\n", ret);
ret = RegDeleteKeyA(root, "");
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %u\n", ret);
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %lu\n", ret);
RegCloseKey(root);
}
}
......@@ -362,7 +362,7 @@ static HANDLE start_server(const char *argv0)
sprintf(cmdline, "\"%s\" ole_server -server", argv0);
ret = CreateProcessA(argv0, cmdline, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi);
ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError());
ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError());
if (!ret) return 0;
CloseHandle(pi.hThread);
......@@ -390,9 +390,9 @@ START_TEST(ole_server)
argc = winetest_get_mainargs(&argv);
done_event = CreateEventA(NULL, TRUE, FALSE, "ole_server_done_event");
ok(done_event != 0, "CreateEvent error %d\n", GetLastError());
ok(done_event != 0, "CreateEvent error %ld\n", GetLastError());
init_done_event = CreateEventA(NULL, TRUE, FALSE, "ole_server_init_done_event");
ok(init_done_event != 0, "CreateEvent error %d\n", GetLastError());
ok(init_done_event != 0, "CreateEvent error %ld\n", GetLastError());
if (argc > 2)
{
......@@ -428,10 +428,10 @@ START_TEST(ole_server)
WaitForSingleObject(init_done_event, 5000);
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
ok(hr == S_OK, "OleInitialize error %#x\n", hr);
ok(hr == S_OK, "OleInitialize error %#lx\n", hr);
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_HANDLER, &IID_IUnknown, (void **)&unknown);
ok(hr == REGDB_E_CLASSNOTREG, "expected REGDB_E_CLASSNOTREG, got %#x\n", hr);
ok(hr == REGDB_E_CLASSNOTREG, "expected REGDB_E_CLASSNOTREG, got %#lx\n", hr);
if (!register_server(argv[0], TRUE))
{
......@@ -443,13 +443,13 @@ START_TEST(ole_server)
trace("call CoCreateInstance(&IID_NULL)\n");
hr = CoCreateInstance(&clsid, NULL, CLSCTX_LOCAL_SERVER, &IID_NULL, (void **)&unknown);
trace("ret CoCreateInstance(&IID_NULL)\n");
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
/* in-process handler supports IID_IUnknown starting from Vista */
trace("call CoCreateInstance(&IID_IUnknown)\n");
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_HANDLER, &IID_IUnknown, (void **)&unknown);
trace("ret CoCreateInstance(&IID_IUnknown)\n");
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /* XP,win2000 and earlier */, "CoCreateInstance(IID_IUnknown) error %#x\n", hr);
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /* XP,win2000 and earlier */, "CoCreateInstance(IID_IUnknown) error %#lx\n", hr);
if (hr != S_OK)
{
win_skip("In-process handler doesn't support IID_IUnknown on this platform\n");
......@@ -459,92 +459,92 @@ START_TEST(ole_server)
trace("call CoCreateInstance(&IID_IOleObject)\n");
hr = CoCreateInstance(&clsid, NULL, CLSCTX_LOCAL_SERVER, &IID_IOleObject, (void **)&oleobj);
trace("ret CoCreateInstance(&IID_IOleObject)\n");
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
trace("call IUnknown_QueryInterface(&IID_IRunnableObject)\n");
hr = IUnknown_QueryInterface(unknown, &IID_IRunnableObject, (void **)&runobj);
trace("ret IUnknown_QueryInterface(&IID_IRunnableObject)\n");
ok(hr == S_OK, "QueryInterface(&IID_IRunnableObject) error %#x\n", hr);
ok(hr == S_OK, "QueryInterface(&IID_IRunnableObject) error %#lx\n", hr);
ret = IRunnableObject_IsRunning(runobj);
ok(!ret, "expected 0, got %d\n", ret);
ok(!ret, "expected 0, got %ld\n", ret);
trace("call OleRun\n");
hr = OleRun(unknown);
trace("ret OleRun\n");
todo_wine
ok(hr == S_OK, "OleRun error %#x\n", hr);
ok(hr == S_OK, "OleRun error %#lx\n", hr);
ret = IRunnableObject_IsRunning(runobj);
todo_wine
ok(ret == 1, "expected 1, got %d\n", ret);
ok(ret == 1, "expected 1, got %ld\n", ret);
trace("call IRunnableObject_Release\n");
ret = IRunnableObject_Release(runobj);
trace("ret IRunnableObject_Release\n");
ok(ret == 1, "expected ref 1, got %u\n", ret);
ok(ret == 1, "expected ref 1, got %lu\n", ret);
trace("call IUnknown_QueryInterface(&IID_IOleObject)\n");
hr = IUnknown_QueryInterface(unknown, &IID_IOleObject, (void **)&oleobj);
trace("ret IUnknown_QueryInterface(&IID_IOleObject)\n");
ok(hr == S_OK, "QueryInterface(&IID_IOleObject) error %#x\n", hr);
ok(hr == S_OK, "QueryInterface(&IID_IOleObject) error %#lx\n", hr);
trace("call IOleObject_Release\n");
ret = IOleObject_Release(oleobj);
trace("ret IOleObject_Release\n");
ok(ret == 1, "expected ref 1, got %u\n", ret);
ok(ret == 1, "expected ref 1, got %lu\n", ret);
trace("call IUnknown_Release\n");
ret = IUnknown_Release(unknown);
trace("ret IUnknown_Release\n");
ok(!ret, "expected ref 0, got %u\n", ret);
ok(!ret, "expected ref 0, got %lu\n", ret);
test_local_server:
/* local server supports IID_IUnknown */
trace("call CoCreateInstance(&IID_IUnknown)\n");
hr = CoCreateInstance(&clsid, NULL, CLSCTX_LOCAL_SERVER, &IID_IUnknown, (void **)&unknown);
trace("ret CoCreateInstance(&IID_IUnknown)\n");
ok(hr == S_OK, "CoCreateInstance(IID_IUnknown) error %#x\n", hr);
ok(hr == S_OK, "CoCreateInstance(IID_IUnknown) error %#lx\n", hr);
trace("call IUnknown_QueryInterface(&IID_IRunnableObject)\n");
hr = IUnknown_QueryInterface(unknown, &IID_IRunnableObject, (void **)&runobj);
trace("ret IUnknown_QueryInterface(&IID_IRunnableObject)\n");
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
trace("call OleRun\n");
hr = OleRun(unknown);
trace("ret OleRun\n");
ok(hr == S_OK, "OleRun error %#x\n", hr);
ok(hr == S_OK, "OleRun error %#lx\n", hr);
trace("call IUnknown_QueryInterface(&IID_IOleObject)\n");
hr = IUnknown_QueryInterface(unknown, &IID_IOleObject, (void **)&oleobj);
trace("ret IUnknown_QueryInterface(&IID_IOleObject)\n");
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
trace("call IUnknown_Release\n");
ret = IUnknown_Release(unknown);
trace("ret IUnknown_Release\n");
ok(!ret, "expected ref 0, got %u\n", ret);
ok(!ret, "expected ref 0, got %lu\n", ret);
trace("call CoGetClassObject(&IID_IClassFactory)\n");
hr = CoGetClassObject(&clsid, CLSCTX_LOCAL_SERVER, NULL, &IID_IClassFactory, (void **)&factory);
trace("ret CoGetClassObject(&IID_IClassFactory)\n");
ok(hr == S_OK, "CoGetClassObject error %#x\n", hr);
ok(hr == S_OK, "CoGetClassObject error %#lx\n", hr);
trace("call IClassFactory_CreateInstance(&IID_NULL)\n");
hr = IClassFactory_CreateInstance(factory, NULL, &IID_NULL, (void **)&oleobj);
trace("ret IClassFactory_CreateInstance(&IID_NULL)\n");
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
trace("call IClassFactory_CreateInstance(&IID_IOleObject)\n");
hr = IClassFactory_CreateInstance(factory, NULL, &IID_IOleObject, (void **)&oleobj);
trace("ret IClassFactory_CreateInstance(&IID_IOleObject)\n");
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
trace("call IClassFactory_Release\n");
ret = IClassFactory_Release(factory);
trace("ret IClassFactory_Release\n");
ok(!ret, "expected ref 0, got %u\n", ret);
ok(!ret, "expected ref 0, got %lu\n", ret);
trace("signalling termination\n");
SetEvent(done_event);
......@@ -557,7 +557,7 @@ test_local_server:
if (info->child_failures)
{
trace("%d failures in child process\n", info->child_failures);
trace("%ld failures in child process\n", info->child_failures);
winetest_add_failures(info->child_failures);
}
}
......@@ -162,17 +162,17 @@ static void expect(HRESULT hr, VARTYPE vt, BOOL copy, int line)
if(flags == PROP_INV)
{
if (copy && (vt & VT_VECTOR))
ok(hr == DISP_E_BADVARTYPE || hr == STG_E_INVALIDPARAMETER, "%s (%s): got %08x (line %d)\n", wine_vtypes[idx], modifier, hr, line);
ok(hr == DISP_E_BADVARTYPE || hr == STG_E_INVALIDPARAMETER, "%s (%s): got %08lx (line %d)\n", wine_vtypes[idx], modifier, hr, line);
else
ok(hr == (copy ? DISP_E_BADVARTYPE : STG_E_INVALIDPARAMETER), "%s (%s): got %08x (line %d)\n", wine_vtypes[idx], modifier, hr, line);
ok(hr == (copy ? DISP_E_BADVARTYPE : STG_E_INVALIDPARAMETER), "%s (%s): got %08lx (line %d)\n", wine_vtypes[idx], modifier, hr, line);
}
else if(flags == PROP_V0)
ok(hr == S_OK, "%s (%s): got %08x\n", wine_vtypes[idx], modifier, hr);
ok(hr == S_OK, "%s (%s): got %08lx\n", wine_vtypes[idx], modifier, hr);
else todo_wine_if(flags & PROP_TODO)
{
if(hr != S_OK)
win_skip("%s (%s): unsupported\n", wine_vtypes[idx], modifier);
else ok(hr == S_OK, "%s (%s): got %08x\n", wine_vtypes[idx], modifier, hr);
else ok(hr == S_OK, "%s (%s): got %08lx\n", wine_vtypes[idx], modifier, hr);
}
}
......@@ -186,9 +186,9 @@ static void test_validtypes(void)
memset(&propvar, 0x55, sizeof(propvar));
hr = PropVariantClear(&propvar);
ok(hr == STG_E_INVALIDPARAMETER, "expected STG_E_INVALIDPARAMETER, got %08x\n", hr);
ok(hr == STG_E_INVALIDPARAMETER, "expected STG_E_INVALIDPARAMETER, got %08lx\n", hr);
ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt);
ok(U(propvar).uhVal.QuadPart == 0, "expected 0, got %#x/%#x\n",
ok(U(propvar).uhVal.QuadPart == 0, "expected 0, got %#lx/%#lx\n",
U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart);
for (i = 0; i < ARRAY_SIZE(valid_types); i++)
......@@ -212,7 +212,7 @@ static void test_validtypes(void)
if (hr == S_OK)
{
ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt);
ok(U(copy).uhVal.QuadPart == U(propvar).uhVal.QuadPart, "%u: expected %#x/%#x, got %#x/%#x\n",
ok(U(copy).uhVal.QuadPart == U(propvar).uhVal.QuadPart, "%u: expected %#lx/%#lx, got %#lx/%#lx\n",
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart,
U(copy).uhVal.u.LowPart, U(copy).uhVal.u.HighPart);
}
......@@ -224,7 +224,7 @@ static void test_validtypes(void)
hr = PropVariantClear(&propvar);
expect(hr, vt, FALSE, __LINE__);
ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt);
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n",
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#lx/%#lx\n",
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart);
memset(&propvar, 0x55, sizeof(propvar));
......@@ -236,7 +236,7 @@ static void test_validtypes(void)
if (hr == S_OK)
{
ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt);
ok(U(copy).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n",
ok(U(copy).uhVal.QuadPart == 0, "%u: expected 0, got %#lx/%#lx\n",
i, U(copy).uhVal.u.LowPart, U(copy).uhVal.u.HighPart);
}
else
......@@ -247,7 +247,7 @@ static void test_validtypes(void)
hr = PropVariantClear(&propvar);
expect(hr, vt, FALSE, __LINE__);
ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt);
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n",
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#lx/%#lx\n",
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart);
memset(&propvar, 0x55, sizeof(propvar));
......@@ -260,7 +260,7 @@ static void test_validtypes(void)
if (hr == S_OK)
{
ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt);
ok(!U(copy).caub.cElems, "%u: expected 0, got %d\n", i, U(copy).caub.cElems);
ok(!U(copy).caub.cElems, "%u: expected 0, got %ld\n", i, U(copy).caub.cElems);
ok(!U(copy).caub.pElems, "%u: expected NULL, got %p\n", i, U(copy).caub.pElems);
}
else
......@@ -271,7 +271,7 @@ static void test_validtypes(void)
hr = PropVariantClear(&propvar);
expect(hr, vt, FALSE, __LINE__);
ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt);
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n",
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#lx/%#lx\n",
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart);
memset(&propvar, 0x55, sizeof(propvar));
......@@ -283,7 +283,7 @@ static void test_validtypes(void)
if (hr == S_OK)
{
ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt);
ok(U(copy).uhVal.QuadPart == U(propvar).uhVal.QuadPart, "%u: expected %#x/%#x, got %#x/%#x\n",
ok(U(copy).uhVal.QuadPart == U(propvar).uhVal.QuadPart, "%u: expected %#lx/%#lx, got %#lx/%#lx\n",
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart,
U(copy).uhVal.u.LowPart, U(copy).uhVal.u.HighPart);
}
......@@ -295,7 +295,7 @@ static void test_validtypes(void)
hr = PropVariantClear(&propvar);
expect(hr, vt, FALSE, __LINE__);
ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt);
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n",
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#lx/%#lx\n",
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart);
}
}
......@@ -371,14 +371,14 @@ static void test_copy(void)
propvarSrc.vt = VT_BSTR;
U(propvarSrc).bstrVal = SysAllocStringLen(L"Test Str\0ing", 12);
hr = PropVariantCopy(&propvarDst, &propvarSrc);
ok(hr == S_OK, "Failed to copy propvar, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to copy propvar, hr %#lx.\n", hr);
ok(SysStringLen(U(propvarDst).bstrVal) == 8, "Unexpected copy length.\n");
ok(SysStringLen(U(propvarSrc).bstrVal) == 12, "Unexpected source length.\n");
ok(!lstrcmpW(U(propvarSrc).bstrVal, U(propvarDst).bstrVal), "BSTR not copied properly\n");
hr = PropVariantClear(&propvarSrc);
ok(hr == S_OK, "Failed to clear propvar, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to clear propvar, hr %#lx.\n", hr);
hr = PropVariantClear(&propvarDst);
ok(hr == S_OK, "Failed to clear propvar, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to clear propvar, hr %#lx.\n", hr);
propvarSrc.vt = VT_LPWSTR;
U(propvarSrc).pwszVal = wszTestString;
......@@ -401,12 +401,12 @@ static void test_copy(void)
propvarSrc.vt = VT_UNKNOWN;
U(propvarSrc).punkVal = &unk_obj.IUnknown_iface;
hr = PropVariantCopy(&propvarDst, &propvarSrc);
ok(hr == S_OK, "PropVariantCopy(...VT_UNKNOWN...) failed: 0x%08x.\n", hr);
ok(hr == S_OK, "PropVariantCopy(...VT_UNKNOWN...) failed: 0x%08lx.\n", hr);
ok(U(propvarDst).punkVal == &unk_obj.IUnknown_iface, "Got wrong IUnknown pointer\n");
ok(unk_obj.ref == 2, "got wrong refcount: %d.\n", unk_obj.ref);
ok(unk_obj.ref == 2, "got wrong refcount: %ld.\n", unk_obj.ref);
hr = PropVariantClear(&propvarDst);
ok(hr == S_OK, "PropVariantClear(...VT_UNKNOWN...) failed: 0x%08x.\n", hr);
ok(unk_obj.ref == 1, "got wrong refcount: %d.\n", unk_obj.ref);
ok(hr == S_OK, "PropVariantClear(...VT_UNKNOWN...) failed: 0x%08lx.\n", hr);
ok(unk_obj.ref == 1, "got wrong refcount: %ld.\n", unk_obj.ref);
memset(&propvarSrc, 0, sizeof(propvarSrc));
sabound.lLbound = 0;
......@@ -416,19 +416,19 @@ static void test_copy(void)
SafeArrayPutElement(sa, &saindex, &unk_obj.IUnknown_iface);
saindex = 1;
SafeArrayPutElement(sa, &saindex, &unk_obj.IUnknown_iface);
ok(unk_obj.ref == 3, "got wrong refcount: %d.\n", unk_obj.ref);
ok(unk_obj.ref == 3, "got wrong refcount: %ld.\n", unk_obj.ref);
propvarSrc.vt = VT_ARRAY | VT_UNKNOWN;
U(propvarSrc).parray = sa;
hr = PropVariantCopy(&propvarDst, &propvarSrc);
ok(hr == S_OK, "PropVariantCopy(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08x.\n", hr);
ok(unk_obj.ref == 5, "got wrong refcount: %d.\n", unk_obj.ref);
ok(hr == S_OK, "PropVariantCopy(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08lx.\n", hr);
ok(unk_obj.ref == 5, "got wrong refcount: %ld.\n", unk_obj.ref);
hr = PropVariantClear(&propvarDst);
ok(hr == S_OK, "PropVariantClear(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08x.\n", hr);
ok(unk_obj.ref == 3, "got wrong refcount: %d.\n", unk_obj.ref);
ok(hr == S_OK, "PropVariantClear(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08lx.\n", hr);
ok(unk_obj.ref == 3, "got wrong refcount: %ld.\n", unk_obj.ref);
hr = PropVariantClear(&propvarSrc);
ok(hr == S_OK, "PropVariantClear(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08x.\n", hr);
ok(unk_obj.ref == 1, "got wrong refcount: %d.\n", unk_obj.ref);
ok(hr == S_OK, "PropVariantClear(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08lx.\n", hr);
ok(unk_obj.ref == 1, "got wrong refcount: %ld.\n", unk_obj.ref);
memset(&propvarSrc, 0, sizeof(propvarSrc));
}
......@@ -570,7 +570,7 @@ static void test_propertytovariant(void)
ok(ret == 0, "StgConvertPropertyToVariant returned %i\n", ret);
ok(propvar.vt == VT_I4, "unexpected vt %x\n", propvar.vt);
ok(U(propvar).lVal == 0xfeabcdef, "unexpected lVal %x\n", U(propvar).lVal);
ok(U(propvar).lVal == 0xfeabcdef, "unexpected lVal %lx\n", U(propvar).lVal);
ret = pStgConvertPropertyToVariant((SERIALIZEDPROPERTYVALUE*)serialized_bstr_wc,
CP_WINUNICODE, &propvar, &allocator);
......@@ -622,7 +622,7 @@ static void test_varianttoproperty(void)
0, FALSE, 0);
ok(propvalue == NULL, "got nonnull propvalue\n");
todo_wine ok(len == 8, "unexpected length %d\n", len);
todo_wine ok(len == 8, "unexpected length %ld\n", len);
if (len == 0xdeadbeef)
{
......@@ -635,7 +635,7 @@ static void test_varianttoproperty(void)
0, FALSE, 0);
ok(propvalue == own_propvalue, "unexpected propvalue %p\n", propvalue);
ok(len == 8, "unexpected length %d\n", len);
ok(len == 8, "unexpected length %ld\n", len);
ok(!memcmp(propvalue, serialized_i4, 8), "got wrong data\n");
propvar.vt = VT_EMPTY;
......@@ -645,9 +645,9 @@ static void test_varianttoproperty(void)
0, FALSE, 0);
ok(propvalue == own_propvalue, "unexpected propvalue %p\n", propvalue);
ok(len == 4 || broken(len == 0) /* before Vista */, "unexpected length %d\n", len);
ok(len == 4 || broken(len == 0) /* before Vista */, "unexpected length %ld\n", len);
if (len) ok(!memcmp(propvalue, serialized_empty, 4), "got wrong data\n");
else ok(propvalue->dwType == 0xdeadbeef, "unexpected type %d\n", propvalue->dwType);
else ok(propvalue->dwType == 0xdeadbeef, "unexpected type %ld\n", propvalue->dwType);
propvar.vt = VT_NULL;
len = 20;
......@@ -655,7 +655,7 @@ static void test_varianttoproperty(void)
0, FALSE, 0);
ok(propvalue == own_propvalue, "unexpected propvalue %p\n", propvalue);
ok(len == 4, "unexpected length %d\n", len);
ok(len == 4, "unexpected length %ld\n", len);
ok(!memcmp(propvalue, serialized_null, 4), "got wrong data\n");
test_string_bstr = SysAllocString(test_string);
......@@ -667,7 +667,7 @@ static void test_varianttoproperty(void)
0, FALSE, 0);
ok(propvalue == own_propvalue, "unexpected propvalue %p\n", propvalue);
ok(len == 20, "unexpected length %d\n", len);
ok(len == 20, "unexpected length %ld\n", len);
ok(!memcmp(propvalue, serialized_bstr_wc, 20), "got wrong data\n");
len = 20;
......@@ -675,7 +675,7 @@ static void test_varianttoproperty(void)
0, FALSE, 0);
ok(propvalue == own_propvalue, "unexpected propvalue %p\n", propvalue);
ok(len == 16, "unexpected length %d\n", len);
ok(len == 16, "unexpected length %ld\n", len);
ok(!memcmp(propvalue, serialized_bstr_mb, 16), "got wrong data\n");
SysFreeString(test_string_bstr);
......
......@@ -59,34 +59,34 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
hr = StgCreateDocfile(filename,
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, &storage);
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08lx\n", hr);
if(propSetStorage)
{
hr = StgCreatePropSetStg(storage, 0, propSetStorage);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
hr = IPropertySetStorage_Create(*propSetStorage,
&FMTID_SummaryInformation, NULL, PROPSETFLAG_ANSI,
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
&propertyStorage);
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08x\n", hr);
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08lx\n", hr);
}
else
{
hr = IStorage_CreateStream(storage, szSummaryInfo,
STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stream);
ok(hr == S_OK, "IStorage_CreateStream failed: 0x%08x\n", hr);
ok(hr == S_OK, "IStorage_CreateStream failed: 0x%08lx\n", hr);
hr = StgCreatePropStg((IUnknown *)stream, &FMTID_SummaryInformation,
NULL, PROPSETFLAG_ANSI, 0, &propertyStorage);
ok(hr == S_OK, "StgCreatePropStg failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreatePropStg failed: 0x%08lx\n", hr);
}
hr = IPropertyStorage_WriteMultiple(propertyStorage, 0, NULL, NULL, 0);
ok(hr == S_OK, "WriteMultiple with 0 args failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple with 0 args failed: 0x%08lx\n", hr);
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, NULL, NULL, 0);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
/* test setting one that I can't set */
spec.ulKind = PRSPEC_PROPID;
......@@ -95,7 +95,7 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
U(var).lVal = 1;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == STG_E_INVALIDPARAMETER,
"Expected STG_E_INVALIDPARAMETER, got 0x%08x\n", hr);
"Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n", hr);
/* test setting one by name with an invalid propidNameFirst */
spec.ulKind = PRSPEC_LPWSTR;
......@@ -103,7 +103,7 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var,
PID_DICTIONARY);
ok(hr == STG_E_INVALIDPARAMETER,
"Expected STG_E_INVALIDPARAMETER, got 0x%08x\n", hr);
"Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n", hr);
/* test setting behavior (case-sensitive) */
spec.ulKind = PRSPEC_PROPID;
......@@ -111,14 +111,14 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
U(var).lVal = 1;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == STG_E_INVALIDPARAMETER,
"Expected STG_E_INVALIDPARAMETER, got 0x%08x\n", hr);
"Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n", hr);
/* set one by value.. */
spec.ulKind = PRSPEC_PROPID;
U(spec).propid = PID_FIRST_USABLE;
U(var).lVal = 1;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* set one by name */
spec.ulKind = PRSPEC_LPWSTR;
......@@ -126,7 +126,7 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
U(var).lVal = 2;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var,
PID_FIRST_USABLE);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* set a string value */
spec.ulKind = PRSPEC_PROPID;
......@@ -134,7 +134,7 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
var.vt = VT_LPSTR;
U(var).pszVal = val;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* set a clipboard value */
spec.ulKind = PRSPEC_PROPID;
......@@ -145,35 +145,35 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
clipdata.pClipData = clipcontent;
U(var).pclipdata = &clipdata;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* check reading */
hr = IPropertyStorage_ReadMultiple(propertyStorage, 0, NULL, NULL);
ok(hr == S_FALSE, "ReadMultiple with 0 args failed: 0x%08x\n", hr);
ok(hr == S_FALSE, "ReadMultiple with 0 args failed: 0x%08lx\n", hr);
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, NULL, NULL);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
/* read by propid */
spec.ulKind = PRSPEC_PROPID;
U(spec).propid = PID_FIRST_USABLE;
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_I4 && U(var).lVal == 1,
"Didn't get expected type or value for property (got type %d, value %d)\n",
"Didn't get expected type or value for property (got type %d, value %ld)\n",
var.vt, U(var).lVal);
/* read by name */
spec.ulKind = PRSPEC_LPWSTR;
U(spec).lpwstr = propName;
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_I4 && U(var).lVal == 2,
"Didn't get expected type or value for property (got type %d, value %d)\n",
"Didn't get expected type or value for property (got type %d, value %ld)\n",
var.vt, U(var).lVal);
/* read string value */
spec.ulKind = PRSPEC_PROPID;
U(spec).propid = PIDSI_AUTHOR;
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_LPSTR && !lstrcmpA(U(var).pszVal, val),
"Didn't get expected type or value for property (got type %d, value %s)\n",
var.vt, U(var).pszVal);
......@@ -183,7 +183,7 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
spec.ulKind = PRSPEC_PROPID;
U(spec).propid = PIDSI_THUMBNAIL;
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_CF, "variant type wrong\n");
ok(U(var).pclipdata->ulClipFmt == CF_ENHMETAFILE,
"clipboard type wrong\n");
......@@ -195,54 +195,54 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
/* check deleting */
hr = IPropertyStorage_DeleteMultiple(propertyStorage, 0, NULL);
ok(hr == S_OK, "DeleteMultiple with 0 args failed: 0x%08x\n", hr);
ok(hr == S_OK, "DeleteMultiple with 0 args failed: 0x%08lx\n", hr);
hr = IPropertyStorage_DeleteMultiple(propertyStorage, 1, NULL);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
/* contrary to what the docs say, you can't delete the dictionary */
spec.ulKind = PRSPEC_PROPID;
U(spec).propid = PID_DICTIONARY;
hr = IPropertyStorage_DeleteMultiple(propertyStorage, 1, &spec);
ok(hr == STG_E_INVALIDPARAMETER,
"Expected STG_E_INVALIDPARAMETER, got 0x%08x\n", hr);
"Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n", hr);
/* now delete the first value.. */
U(spec).propid = PID_FIRST_USABLE;
hr = IPropertyStorage_DeleteMultiple(propertyStorage, 1, &spec);
ok(hr == S_OK, "DeleteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "DeleteMultiple failed: 0x%08lx\n", hr);
/* and check that it's no longer readable */
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_FALSE, "Expected S_FALSE, got 0x%08x\n", hr);
ok(hr == S_FALSE, "Expected S_FALSE, got 0x%08lx\n", hr);
hr = IPropertyStorage_Commit(propertyStorage, STGC_DEFAULT);
ok(hr == S_OK, "Commit failed: 0x%08x\n", hr);
ok(hr == S_OK, "Commit failed: 0x%08lx\n", hr);
/* check reverting */
spec.ulKind = PRSPEC_PROPID;
U(spec).propid = PID_FIRST_USABLE;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
hr = IPropertyStorage_Revert(propertyStorage);
ok(hr == S_OK, "Revert failed: 0x%08x\n", hr);
ok(hr == S_OK, "Revert failed: 0x%08lx\n", hr);
/* now check that it's still not there */
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_FALSE, "Expected S_FALSE, got 0x%08x\n", hr);
ok(hr == S_FALSE, "Expected S_FALSE, got 0x%08lx\n", hr);
/* set an integer value again */
spec.ulKind = PRSPEC_PROPID;
U(spec).propid = PID_FIRST_USABLE;
var.vt = VT_I4;
U(var).lVal = 1;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* commit it */
hr = IPropertyStorage_Commit(propertyStorage, STGC_DEFAULT);
ok(hr == S_OK, "Commit failed: 0x%08x\n", hr);
ok(hr == S_OK, "Commit failed: 0x%08lx\n", hr);
/* set it to a string value */
var.vt = VT_LPSTR;
U(var).pszVal = val;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* revert it */
hr = IPropertyStorage_Revert(propertyStorage);
ok(hr == S_OK, "Revert failed: 0x%08x\n", hr);
ok(hr == S_OK, "Revert failed: 0x%08lx\n", hr);
/* Oddly enough, there's no guarantee that a successful revert actually
* implies the value wasn't saved. Maybe transactional mode needs to be
* used for that?
......@@ -256,40 +256,40 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
/* now open it again */
hr = StgOpenStorage(filename, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
NULL, 0, &storage);
ok(hr == S_OK, "StgOpenStorage failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgOpenStorage failed: 0x%08lx\n", hr);
if(propSetStorage)
{
hr = StgCreatePropSetStg(storage, 0, propSetStorage);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
hr = IPropertySetStorage_Open(*propSetStorage, &FMTID_SummaryInformation,
STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &propertyStorage);
ok(hr == S_OK, "IPropertySetStorage_Open failed: 0x%08x\n", hr);
ok(hr == S_OK, "IPropertySetStorage_Open failed: 0x%08lx\n", hr);
}
else
{
hr = IStorage_OpenStream(storage, szSummaryInfo,
0, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &stream);
ok(hr == S_OK, "IStorage_OpenStream failed: 0x%08x\n", hr);
ok(hr == S_OK, "IStorage_OpenStream failed: 0x%08lx\n", hr);
hr = StgOpenPropStg((IUnknown *)stream, &FMTID_SummaryInformation,
PROPSETFLAG_DEFAULT, 0, &propertyStorage);
ok(hr == S_OK, "StgOpenPropStg failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgOpenPropStg failed: 0x%08lx\n", hr);
}
/* check properties again */
spec.ulKind = PRSPEC_LPWSTR;
U(spec).lpwstr = propName;
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_I4 && U(var).lVal == 2,
"Didn't get expected type or value for property (got type %d, value %d)\n",
"Didn't get expected type or value for property (got type %d, value %ld)\n",
var.vt, U(var).lVal);
spec.ulKind = PRSPEC_PROPID;
U(spec).propid = PIDSI_AUTHOR;
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_LPSTR && !lstrcmpA(U(var).pszVal, val),
"Didn't get expected type or value for property (got type %d, value %s)\n",
var.vt, U(var).pszVal);
......@@ -305,28 +305,28 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
/* Test creating a property set storage with a random GUID */
hr = StgCreateDocfile(filename,
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, &storage);
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08lx\n", hr);
if(propSetStorage)
{
hr = StgCreatePropSetStg(storage, 0, propSetStorage);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
hr = IPropertySetStorage_Create(*propSetStorage,
&anyOldGuid, NULL, PROPSETFLAG_ANSI,
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
&propertyStorage);
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08x\n", hr);
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08lx\n", hr);
}
else
{
hr = IStorage_CreateStream(storage, szSummaryInfo,
STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stream);
ok(hr == S_OK, "IStorage_CreateStream failed: 0x%08x\n", hr);
ok(hr == S_OK, "IStorage_CreateStream failed: 0x%08lx\n", hr);
hr = StgCreatePropStg((IUnknown *)stream, &anyOldGuid, NULL,
PROPSETFLAG_DEFAULT, 0, &propertyStorage);
ok(hr == S_OK, "StgCreatePropStg failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreatePropStg failed: 0x%08lx\n", hr);
}
spec.ulKind = PRSPEC_PROPID;
......@@ -334,10 +334,10 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
var.vt = VT_I4;
U(var).lVal = 1;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
hr = IPropertyStorage_Commit(propertyStorage, STGC_DEFAULT);
ok(hr == S_OK, "Commit failed: 0x%08x\n", hr);
ok(hr == S_OK, "Commit failed: 0x%08lx\n", hr);
IPropertyStorage_Release(propertyStorage);
if(propSetStorage) IPropertySetStorage_Release(*propSetStorage);
......@@ -347,35 +347,35 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
/* now open it again */
hr = StgOpenStorage(filename, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
NULL, 0, &storage);
ok(hr == S_OK, "StgOpenStorage failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgOpenStorage failed: 0x%08lx\n", hr);
if(propSetStorage)
{
hr = StgCreatePropSetStg(storage, 0, propSetStorage);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
hr = IPropertySetStorage_Open(*propSetStorage, &anyOldGuid,
STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &propertyStorage);
ok(hr == S_OK, "IPropertySetStorage_Open failed: 0x%08x\n", hr);
ok(hr == S_OK, "IPropertySetStorage_Open failed: 0x%08lx\n", hr);
}
else
{
hr = IStorage_OpenStream(storage, szSummaryInfo,
0, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &stream);
ok(hr == S_OK, "IStorage_OpenStream failed: 0x%08x\n", hr);
ok(hr == S_OK, "IStorage_OpenStream failed: 0x%08lx\n", hr);
hr = StgOpenPropStg((IUnknown *)stream, &anyOldGuid,
PROPSETFLAG_DEFAULT, 0, &propertyStorage);
ok(hr == S_OK, "StgOpenPropStg failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgOpenPropStg failed: 0x%08lx\n", hr);
}
spec.ulKind = PRSPEC_PROPID;
U(spec).propid = PID_FIRST_USABLE;
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_I4 && U(var).lVal == 1,
"Didn't get expected type or value for property (got type %d, value %d)\n",
"Didn't get expected type or value for property (got type %d, value %ld)\n",
var.vt, U(var).lVal);
IPropertyStorage_Release(propertyStorage);
......@@ -413,42 +413,42 @@ static void testCodepage(void)
hr = StgCreateDocfile(fileName,
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, &storage);
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08lx\n", hr);
hr = StgCreatePropSetStg(storage, 0, &propSetStorage);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
hr = IPropertySetStorage_Create(propSetStorage,
&FMTID_SummaryInformation, NULL, PROPSETFLAG_DEFAULT,
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
&propertyStorage);
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08x\n", hr);
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08lx\n", hr);
PropVariantInit(&var);
spec.ulKind = PRSPEC_PROPID;
U(spec).propid = PID_CODEPAGE;
/* check code page before it's been explicitly set */
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_I2 && U(var).iVal == 1200,
"Didn't get expected type or value for property\n");
/* Set the code page to ascii */
var.vt = VT_I2;
U(var).iVal = 1252;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* check code page */
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_I2 && U(var).iVal == 1252,
"Didn't get expected type or value for property\n");
/* Set code page to Unicode */
U(var).iVal = 1200;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* check code page */
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_I2 && U(var).iVal == 1200,
"Didn't get expected type or value for property\n");
/* Set a string value */
......@@ -457,9 +457,9 @@ static void testCodepage(void)
var.vt = VT_LPSTR;
U(var).pszVal = aval;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_LPSTR && !strcmp(U(var).pszVal, "hi"),
"Didn't get expected type or value for property\n");
PropVariantClear(&var);
......@@ -471,9 +471,9 @@ static void testCodepage(void)
var.vt = VT_LPSTR;
U(var).pszVal = (LPSTR)wval;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_LPSTR && !strcmp(U(var).pszVal, "h"),
"Didn't get expected type or value for property\n");
PropVariantClear(&var);
......@@ -485,7 +485,7 @@ static void testCodepage(void)
U(var).iVal = 1200;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == STG_E_INVALIDPARAMETER,
"Expected STG_E_INVALIDPARAMETER, got 0x%08x\n", hr);
"Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n", hr);
IPropertyStorage_Release(propertyStorage);
IPropertySetStorage_Release(propSetStorage);
......@@ -496,28 +496,28 @@ static void testCodepage(void)
/* same tests, but with PROPSETFLAG_ANSI */
hr = StgCreateDocfile(fileName,
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, &storage);
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08lx\n", hr);
hr = StgCreatePropSetStg(storage, 0, &propSetStorage);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
hr = IPropertySetStorage_Create(propSetStorage,
&FMTID_SummaryInformation, NULL, PROPSETFLAG_ANSI,
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
&propertyStorage);
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08x\n", hr);
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08lx\n", hr);
/* check code page before it's been explicitly set */
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_I2, "Didn't get expected type for property (%u)\n", var.vt);
/* Set code page to Unicode */
U(var).iVal = 1200;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* check code page */
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_I2 && U(var).iVal == 1200,
"Didn't get expected type or value for property\n");
/* This test is commented out for documentation. It fails under Wine,
......@@ -529,7 +529,7 @@ static void testCodepage(void)
/* Set code page to 950 (Traditional Chinese) */
U(var).iVal = 950;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* Try writing an invalid string: lead byte 0x81 is unused in Traditional
* Chinese.
*/
......@@ -538,10 +538,10 @@ static void testCodepage(void)
var.vt = VT_LPSTR;
U(var).pszVal = (LPSTR)strVal;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
/* Check returned string */
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
ok(var.vt == VT_LPSTR && !strcmp(U(var).pszVal, (LPCSTR)strVal),
"Didn't get expected type or value for property\n");
}
......@@ -568,57 +568,57 @@ static void testFmtId(void)
HRESULT hr;
hr = FmtIdToPropStgName(NULL, name);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
hr = FmtIdToPropStgName(&FMTID_SummaryInformation, NULL);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
hr = FmtIdToPropStgName(&FMTID_SummaryInformation, name);
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08x\n", hr);
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08lx\n", hr);
ok(!memcmp(name, szSummaryInfo, (lstrlenW(szSummaryInfo) + 1) *
sizeof(WCHAR)), "Got wrong name for FMTID_SummaryInformation\n");
hr = FmtIdToPropStgName(&FMTID_DocSummaryInformation, name);
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08x\n", hr);
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08lx\n", hr);
ok(!memcmp(name, szDocSummaryInfo, (lstrlenW(szDocSummaryInfo) + 1) *
sizeof(WCHAR)), "Got wrong name for FMTID_DocSummaryInformation\n");
hr = FmtIdToPropStgName(&FMTID_UserDefinedProperties, name);
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08x\n", hr);
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08lx\n", hr);
ok(!memcmp(name, szDocSummaryInfo, (lstrlenW(szDocSummaryInfo) + 1) *
sizeof(WCHAR)), "Got wrong name for FMTID_DocSummaryInformation\n");
hr = FmtIdToPropStgName(&IID_IPropertySetStorage, name);
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08x\n", hr);
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08lx\n", hr);
ok(!memcmp(name, szIID_IPropSetStg, (lstrlenW(szIID_IPropSetStg) + 1) *
sizeof(WCHAR)), "Got wrong name for IID_IPropertySetStorage\n");
/* test args first */
hr = PropStgNameToFmtId(NULL, NULL);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
hr = PropStgNameToFmtId(NULL, &fmtid);
ok(hr == STG_E_INVALIDNAME, "Expected STG_E_INVALIDNAME, got 0x%08x\n",
ok(hr == STG_E_INVALIDNAME, "Expected STG_E_INVALIDNAME, got 0x%08lx\n",
hr);
hr = PropStgNameToFmtId(szDocSummaryInfo, NULL);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
/* test the known format IDs */
hr = PropStgNameToFmtId(szSummaryInfo, &fmtid);
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08x\n", hr);
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08lx\n", hr);
ok(!memcmp(&fmtid, &FMTID_SummaryInformation, sizeof(fmtid)),
"Got unexpected FMTID, expected FMTID_SummaryInformation\n");
hr = PropStgNameToFmtId(szDocSummaryInfo, &fmtid);
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08x\n", hr);
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08lx\n", hr);
ok(!memcmp(&fmtid, &FMTID_DocSummaryInformation, sizeof(fmtid)),
"Got unexpected FMTID, expected FMTID_DocSummaryInformation\n");
/* test another GUID */
hr = PropStgNameToFmtId(szIID_IPropSetStg, &fmtid);
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08x\n", hr);
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08lx\n", hr);
ok(!memcmp(&fmtid, &IID_IPropertySetStorage, sizeof(fmtid)),
"Got unexpected FMTID, expected IID_IPropertySetStorage\n");
/* now check case matching */
CharUpperW(szDocSummaryInfo + 1);
hr = PropStgNameToFmtId(szDocSummaryInfo, &fmtid);
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08x\n", hr);
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08lx\n", hr);
ok(!memcmp(&fmtid, &FMTID_DocSummaryInformation, sizeof(fmtid)),
"Got unexpected FMTID, expected FMTID_DocSummaryInformation\n");
CharUpperW(szIID_IPropSetStg + 1);
hr = PropStgNameToFmtId(szIID_IPropSetStg, &fmtid);
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08x\n", hr);
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08lx\n", hr);
ok(!memcmp(&fmtid, &IID_IPropertySetStorage, sizeof(fmtid)),
"Got unexpected FMTID, expected IID_IPropertySetStorage\n");
}
......@@ -639,91 +639,91 @@ static void test_propertyset_storage_enum(void)
ok(ret, "Failed to get temporary file name.\n");
hr = StgCreateDocfile(filename, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, &storage);
ok(hr == S_OK, "Failed to crate storage, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to crate storage, hr %#lx.\n", hr);
hr = StgCreatePropSetStg(storage, 0, &ps_storage);
ok(hr == S_OK, "Failed to create property set storage, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to create property set storage, hr %#lx.\n", hr);
hr = IPropertySetStorage_Create(ps_storage, &FMTID_SummaryInformation, &IID_IUnknown, PROPSETFLAG_ANSI,
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE, &prop_storage);
ok(hr == S_OK, "Failed to create property storage, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to create property storage, hr %#lx.\n", hr);
hr = IPropertyStorage_Stat(prop_storage, &psstg);
ok(hr == S_OK, "Failed to get prop storage stats, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to get prop storage stats, hr %#lx.\n", hr);
todo_wine
ok(IsEqualCLSID(&psstg.clsid, &IID_IUnknown), "Unexpected storage clsid %s.\n", wine_dbgstr_guid(&psstg.clsid));
hr = IPropertySetStorage_Enum(ps_storage, NULL);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IPropertySetStorage_Enum(ps_storage, &ps_enum);
ok(hr == S_OK, "Failed to get enum object, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to get enum object, hr %#lx.\n", hr);
memset(&psstg, 0, sizeof(psstg));
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
ok(hr == S_OK, "Failed to get enum item, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to get enum item, hr %#lx.\n", hr);
ok(fetched == 1, "Unexpected fetched count.\n");
ok(IsEqualCLSID(&psstg.fmtid, &FMTID_SummaryInformation), "Unexpected fmtid %s.\n",
wine_dbgstr_guid(&psstg.fmtid));
ok(psstg.mtime.dwHighDateTime == 0 && psstg.mtime.dwLowDateTime == 0, "Unexpected mtime %#x / %#x.\n",
ok(psstg.mtime.dwHighDateTime == 0 && psstg.mtime.dwLowDateTime == 0, "Unexpected mtime %#lx / %#lx.\n",
psstg.mtime.dwHighDateTime, psstg.mtime.dwLowDateTime);
memset(&ftime, 0, sizeof(ftime));
ftime.dwLowDateTime = 1;
hr = IPropertyStorage_SetTimes(prop_storage, NULL, NULL, &ftime);
todo_wine
ok(hr == S_OK, "Failed to set storage times, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to set storage times, hr %#lx.\n", hr);
hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
ok(hr == S_OK, "Failed to reset enumerator, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to reset enumerator, hr %#lx.\n", hr);
memset(&psstg, 0, sizeof(psstg));
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
ok(hr == S_OK, "Failed to get enum item, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to get enum item, hr %#lx.\n", hr);
ok(fetched == 1, "Unexpected fetched count.\n");
ok(IsEqualCLSID(&psstg.fmtid, &FMTID_SummaryInformation), "Unexpected fmtid %s.\n",
wine_dbgstr_guid(&psstg.fmtid));
ok(psstg.mtime.dwHighDateTime == 0 && psstg.mtime.dwLowDateTime == 0, "Unexpected mtime %#x / %#x.\n",
ok(psstg.mtime.dwHighDateTime == 0 && psstg.mtime.dwLowDateTime == 0, "Unexpected mtime %#lx / %#lx.\n",
psstg.mtime.dwHighDateTime, psstg.mtime.dwLowDateTime);
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IPropertySetStorage_Create(ps_storage, &FMTID_SummaryInformation, &IID_IUnknown, PROPSETFLAG_ANSI,
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE, &prop_storage2);
ok(hr == S_OK, "Failed to create property storage, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to create property storage, hr %#lx.\n", hr);
hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
ok(hr == S_OK, "Failed to reset enumerator, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to reset enumerator, hr %#lx.\n", hr);
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
ok(hr == S_OK, "Failed to get enum item, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to get enum item, hr %#lx.\n", hr);
ok(fetched == 1, "Unexpected fetched count.\n");
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
ok(hr == S_FALSE, "Failed to get enum item, hr %#x.\n", hr);
ok(hr == S_FALSE, "Failed to get enum item, hr %#lx.\n", hr);
/* Skipping. */
hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
ok(hr == S_OK, "Failed to reset enumerator, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to reset enumerator, hr %#lx.\n", hr);
hr = IEnumSTATPROPSETSTG_Skip(ps_enum, 2);
todo_wine
ok(hr == S_FALSE, "Failed to skip, hr %#x.\n", hr);
ok(hr == S_FALSE, "Failed to skip, hr %#lx.\n", hr);
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
todo_wine
ok(hr == S_FALSE, "Failed to get enum item, hr %#x.\n", hr);
ok(hr == S_FALSE, "Failed to get enum item, hr %#lx.\n", hr);
hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
ok(hr == S_OK, "Failed to reset enumerator, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to reset enumerator, hr %#lx.\n", hr);
hr = IEnumSTATPROPSETSTG_Skip(ps_enum, 1);
ok(hr == S_OK, "Failed to skip, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to skip, hr %#lx.\n", hr);
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
todo_wine
ok(hr == S_FALSE, "Failed to get enum item, hr %#x.\n", hr);
ok(hr == S_FALSE, "Failed to get enum item, hr %#lx.\n", hr);
hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
ok(hr == S_OK, "Failed to reset enumerator, hr %#x.\n", hr);
ok(hr == S_OK, "Failed to reset enumerator, hr %#lx.\n", hr);
todo_wine {
hr = IEnumSTATPROPSETSTG_Skip(ps_enum, 0);
ok(hr == S_FALSE, "Failed to skip, hr %#x.\n", hr);
ok(hr == S_FALSE, "Failed to skip, hr %#lx.\n", hr);
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
ok(hr == S_FALSE, "Failed to get enum item, hr %#x.\n", hr);
ok(hr == S_FALSE, "Failed to get enum item, hr %#lx.\n", hr);
}
IEnumSTATPROPSETSTG_Release(ps_enum);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -110,11 +110,11 @@ static DWORD CALLBACK host_object_proc(LPVOID p)
IMessageFilter * prev_filter = NULL;
hr = CoRegisterMessageFilter(data->filter, &prev_filter);
if (prev_filter) IMessageFilter_Release(prev_filter);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
}
hr = CoMarshalInterface(data->stream, &data->iid, data->object, MSHCTX_INPROC, NULL, data->marshal_flags);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
/* force the message queue to be created before signaling parent thread */
PeekMessageA(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
......@@ -164,7 +164,7 @@ static DWORD start_host_object2(IStream *stream, REFIID riid, IUnknown *object,
static void end_host_object(DWORD tid, HANDLE thread)
{
BOOL ret = PostThreadMessageA(tid, WM_QUIT, 0, 0);
ok(ret, "PostThreadMessage failed with error %d\n", GetLastError());
ok(ret, "PostThreadMessage failed with error %ld\n", GetLastError());
/* be careful of races - don't return until hosting thread has terminated */
ok( !WaitForSingleObject(thread, 10000), "wait timed out\n" );
CloseHandle(thread);
......@@ -196,19 +196,19 @@ static void test_marshal_CLIPFORMAT(void)
size = CLIPFORMAT_UserSize(&umcb.Flags, 1, &cf);
ok(size == 12 + sizeof(cf_marshaled) ||
broken(size == 16 + sizeof(cf_marshaled)), /* win64 adds 4 extra (unused) bytes */
"CLIPFORMAT: Wrong size %d\n", size);
"CLIPFORMAT: Wrong size %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
memset( buffer, 0xcc, size );
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
buffer_end = CLIPFORMAT_UserMarshal(&umcb.Flags, buffer + 1, &cf);
ok(buffer_end == buffer + 12 + sizeof(cf_marshaled), "got %p buffer %p\n", buffer_end, buffer);
ok(*(LONG *)(buffer + 4) == WDT_REMOTE_CALL, "CLIPFORMAT: Context should be WDT_REMOTE_CALL instead of 0x%08x\n", *(LONG *)(buffer + 0));
ok(*(DWORD *)(buffer + 8) == cf, "CLIPFORMAT: Marshaled value should be 0x%04x instead of 0x%04x\n", cf, *(DWORD *)(buffer + 4));
ok(*(LONG *)(buffer + 4) == WDT_REMOTE_CALL, "CLIPFORMAT: Context should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(LONG *)(buffer + 0));
ok(*(DWORD *)(buffer + 8) == cf, "CLIPFORMAT: Marshaled value should be 0x%04x instead of 0x%04lx\n", cf, *(DWORD *)(buffer + 4));
ok(!memcmp(buffer + 12, cf_marshaled, min( sizeof(cf_marshaled), size-12 )), "Marshaled data differs\n");
if (size > sizeof(cf_marshaled) + 12) /* make sure the extra bytes are not used */
for (i = sizeof(cf_marshaled) + 12; i < size; i++)
ok( buffer[i] == 0xcc, "buffer offset %u has been set to %x\n", i, buffer[i] );
ok( buffer[i] == 0xcc, "buffer offset %lu has been set to %x\n", i, buffer[i] );
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
buffer_end = CLIPFORMAT_UserUnmarshal(&umcb.Flags, buffer + 1, &cf2);
......@@ -233,15 +233,15 @@ static void test_marshal_HWND(void)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
size = HWND_UserSize(&umcb.Flags, 1, &hwnd);
ok(size == 4 + sizeof(*wirehwnd), "Wrong size %d\n", size);
ok(size == 4 + sizeof(*wirehwnd), "Wrong size %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
buffer_end = HWND_UserMarshal(&umcb.Flags, buffer + 1, &hwnd);
ok(buffer_end == buffer + size, "got %p buffer %p\n", buffer_end, buffer);
wirehwnd = (wireHWND)(buffer + 4);
ok(wirehwnd->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehwnd->fContext);
ok(wirehwnd->u.hInproc == (LONG_PTR)hwnd, "Marshaled value should be %p instead of %x\n", hwnd, wirehwnd->u.hRemote);
ok(wirehwnd->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08lx\n", wirehwnd->fContext);
ok(wirehwnd->u.hInproc == (LONG_PTR)hwnd, "Marshaled value should be %p instead of %lx\n", hwnd, wirehwnd->u.hRemote);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
buffer_end = HWND_UserUnmarshal(&umcb.Flags, buffer + 1, &hwnd2);
......@@ -270,12 +270,12 @@ static void test_marshal_HGLOBAL(void)
size = HGLOBAL_UserSize(&umcb.Flags, 0, &hglobal);
/* native is poorly programmed and allocates 4/8 bytes more than it needs to
* here - Wine doesn't have to emulate that */
ok((size == 8) || broken(size == 12) || broken(size == 16), "Size should be 8, instead of %d\n", size);
ok((size == 8) || broken(size == 12) || broken(size == 16), "Size should be 8, instead of %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
HGLOBAL_UserMarshal(&umcb.Flags, buffer, &hglobal);
wirehglobal = buffer;
ok(*(ULONG *)wirehglobal == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08x\n", *(ULONG *)wirehglobal);
ok(*(ULONG *)wirehglobal == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(ULONG *)wirehglobal);
wirehglobal += sizeof(ULONG);
ok(*(ULONG *)wirehglobal == 0, "buffer+4 should be HGLOBAL\n");
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
......@@ -305,20 +305,20 @@ static void test_marshal_HGLOBAL(void)
ok(size == expected_size ||
broken(size == expected_size + 4) ||
broken(size == expected_size + 8),
"%d: got size %d\n", block_size, size);
"%ld: got size %ld\n", block_size, size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
HGLOBAL_UserMarshal(&umcb.Flags, buffer, &hglobal);
wirehglobal = buffer;
ok(*(ULONG *)wirehglobal == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08x\n", *(ULONG *)wirehglobal);
ok(*(ULONG *)wirehglobal == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(ULONG *)wirehglobal);
wirehglobal += sizeof(ULONG);
ok(*(ULONG *)wirehglobal == (ULONG)(ULONG_PTR)hglobal, "buffer+0x4 should be HGLOBAL\n");
wirehglobal += sizeof(ULONG);
ok(*(ULONG *)wirehglobal == actual_size, "%d: buffer+0x8 %08x\n", block_size, *(ULONG *)wirehglobal);
ok(*(ULONG *)wirehglobal == actual_size, "%ld: buffer+0x8 %08lx\n", block_size, *(ULONG *)wirehglobal);
wirehglobal += sizeof(ULONG);
ok(*(ULONG *)wirehglobal == (ULONG)(ULONG_PTR)hglobal, "buffer+0xc should be HGLOBAL\n");
wirehglobal += sizeof(ULONG);
ok(*(ULONG *)wirehglobal == actual_size, "%d: buffer+0x10 %08x\n", block_size, *(ULONG *)wirehglobal);
ok(*(ULONG *)wirehglobal == actual_size, "%ld: buffer+0x10 %08lx\n", block_size, *(ULONG *)wirehglobal);
wirehglobal += sizeof(ULONG);
for (i = 0; i < block_size; i++)
ok(wirehglobal[i] == i, "buffer+0x%x should be %d\n", 0x10 + i, i);
......@@ -357,21 +357,21 @@ static void test_marshal_HENHMETAFILE(void)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
size = HENHMETAFILE_UserSize(&umcb.Flags, 1, &hemf);
ok(size > 24, "size should be at least 24 bytes, not %d\n", size);
ok(size > 24, "size should be at least 24 bytes, not %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
buffer_end = HENHMETAFILE_UserMarshal(&umcb.Flags, buffer + 1, &hemf);
ok(buffer_end == buffer + size, "got %p buffer %p\n", buffer_end, buffer);
wirehemf = buffer + 4;
ok(*(DWORD *)wirehemf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehemf);
ok(*(DWORD *)wirehemf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehemf);
wirehemf += sizeof(DWORD);
ok(*(DWORD *)wirehemf == (DWORD)(DWORD_PTR)hemf, "wirestgm + 0x4 should be hemf instead of 0x%08x\n", *(DWORD *)wirehemf);
ok(*(DWORD *)wirehemf == (DWORD)(DWORD_PTR)hemf, "wirestgm + 0x4 should be hemf instead of 0x%08lx\n", *(DWORD *)wirehemf);
wirehemf += sizeof(DWORD);
ok(*(DWORD *)wirehemf == (size - 0x14), "wirestgm + 0x8 should be size - 0x14 instead of 0x%08x\n", *(DWORD *)wirehemf);
ok(*(DWORD *)wirehemf == (size - 0x14), "wirestgm + 0x8 should be size - 0x14 instead of 0x%08lx\n", *(DWORD *)wirehemf);
wirehemf += sizeof(DWORD);
ok(*(DWORD *)wirehemf == (size - 0x14), "wirestgm + 0xc should be size - 0x14 instead of 0x%08x\n", *(DWORD *)wirehemf);
ok(*(DWORD *)wirehemf == (size - 0x14), "wirestgm + 0xc should be size - 0x14 instead of 0x%08lx\n", *(DWORD *)wirehemf);
wirehemf += sizeof(DWORD);
ok(*(DWORD *)wirehemf == EMR_HEADER, "wirestgm + 0x10 should be EMR_HEADER instead of %d\n", *(DWORD *)wirehemf);
ok(*(DWORD *)wirehemf == EMR_HEADER, "wirestgm + 0x10 should be EMR_HEADER instead of %ld\n", *(DWORD *)wirehemf);
/* ... rest of data not tested - refer to tests for GetEnhMetaFileBits
* at this point */
......@@ -389,15 +389,15 @@ static void test_marshal_HENHMETAFILE(void)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
size = HENHMETAFILE_UserSize(&umcb.Flags, 1, &hemf);
ok(size == 12, "size should be 12 bytes, not %d\n", size);
ok(size == 12, "size should be 12 bytes, not %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
buffer_end = HENHMETAFILE_UserMarshal(&umcb.Flags, buffer + 1, &hemf);
ok(buffer_end == buffer + size, "got %p buffer %p\n", buffer_end, buffer);
wirehemf = buffer + 4;
ok(*(DWORD *)wirehemf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehemf);
ok(*(DWORD *)wirehemf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehemf);
wirehemf += sizeof(DWORD);
ok(*(DWORD *)wirehemf == (DWORD)(DWORD_PTR)hemf, "wirestgm + 0x4 should be hemf instead of 0x%08x\n", *(DWORD *)wirehemf);
ok(*(DWORD *)wirehemf == (DWORD)(DWORD_PTR)hemf, "wirestgm + 0x4 should be hemf instead of 0x%08lx\n", *(DWORD *)wirehemf);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
buffer_end = HENHMETAFILE_UserUnmarshal(&umcb.Flags, buffer + 1, &hemf2);
......@@ -431,20 +431,20 @@ static void test_marshal_HMETAFILE(void)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
size = HMETAFILE_UserSize(&umcb.Flags, 0, &hmf);
ok(size > 20, "size should be at least 20 bytes, not %d\n", size);
ok(size > 20, "size should be at least 20 bytes, not %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
HMETAFILE_UserMarshal(&umcb.Flags, buffer, &hmf);
wirehmf = buffer;
ok(*(DWORD *)wirehmf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehmf);
ok(*(DWORD *)wirehmf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehmf);
wirehmf += sizeof(DWORD);
ok(*(DWORD *)wirehmf == (DWORD)(DWORD_PTR)hmf, "wirestgm + 0x4 should be hmf instead of 0x%08x\n", *(DWORD *)wirehmf);
ok(*(DWORD *)wirehmf == (DWORD)(DWORD_PTR)hmf, "wirestgm + 0x4 should be hmf instead of 0x%08lx\n", *(DWORD *)wirehmf);
wirehmf += sizeof(DWORD);
ok(*(DWORD *)wirehmf == (size - 0x10), "wirestgm + 0x8 should be size - 0x10 instead of 0x%08x\n", *(DWORD *)wirehmf);
ok(*(DWORD *)wirehmf == (size - 0x10), "wirestgm + 0x8 should be size - 0x10 instead of 0x%08lx\n", *(DWORD *)wirehmf);
wirehmf += sizeof(DWORD);
ok(*(DWORD *)wirehmf == (size - 0x10), "wirestgm + 0xc should be size - 0x10 instead of 0x%08x\n", *(DWORD *)wirehmf);
ok(*(DWORD *)wirehmf == (size - 0x10), "wirestgm + 0xc should be size - 0x10 instead of 0x%08lx\n", *(DWORD *)wirehmf);
wirehmf += sizeof(DWORD);
ok(*(WORD *)wirehmf == 1, "wirestgm + 0x10 should be 1 instead of 0x%08x\n", *(DWORD *)wirehmf);
ok(*(WORD *)wirehmf == 1, "wirestgm + 0x10 should be 1 instead of 0x%08lx\n", *(DWORD *)wirehmf);
wirehmf += sizeof(DWORD);
/* ... rest of data not tested - refer to tests for GetMetaFileBits
* at this point */
......@@ -460,14 +460,14 @@ static void test_marshal_HMETAFILE(void)
hmf = NULL;
size = HMETAFILE_UserSize(&umcb.Flags, 0, &hmf);
ok(size == 8, "size should be 8 bytes, not %d\n", size);
ok(size == 8, "size should be 8 bytes, not %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
HMETAFILE_UserMarshal(&umcb.Flags, buffer, &hmf);
wirehmf = buffer;
ok(*(DWORD *)wirehmf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehmf);
ok(*(DWORD *)wirehmf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehmf);
wirehmf += sizeof(DWORD);
ok(*(DWORD *)wirehmf == (DWORD)(DWORD_PTR)hmf, "wirestgm + 0x4 should be hmf instead of 0x%08x\n", *(DWORD *)wirehmf);
ok(*(DWORD *)wirehmf == (DWORD)(DWORD_PTR)hmf, "wirestgm + 0x4 should be hmf instead of 0x%08lx\n", *(DWORD *)wirehmf);
wirehmf += sizeof(DWORD);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
......@@ -503,36 +503,36 @@ static void test_marshal_HMETAFILEPICT(void)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
size = HMETAFILEPICT_UserSize(&umcb.Flags, 1, &hmfp);
ok(size > 24, "size should be at least 24 bytes, not %d\n", size);
ok(size > 24, "size should be at least 24 bytes, not %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
buffer_end = HMETAFILEPICT_UserMarshal(&umcb.Flags, buffer + 1, &hmfp);
wirehmfp = buffer + 4;
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)hmfp, "wirestgm + 0x4 should be hmf instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)hmfp, "wirestgm + 0x4 should be hmf instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
ok(*(DWORD *)wirehmfp == MM_ISOTROPIC, "wirestgm + 0x8 should be MM_ISOTROPIC instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == MM_ISOTROPIC, "wirestgm + 0x8 should be MM_ISOTROPIC instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
ok(*(DWORD *)wirehmfp == 1, "wirestgm + 0xc should be 1 instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == 1, "wirestgm + 0xc should be 1 instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
ok(*(DWORD *)wirehmfp == 2, "wirestgm + 0x10 should be 2 instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == 2, "wirestgm + 0x10 should be 2 instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
ok(*(DWORD *)wirehmfp == USER_MARSHAL_PTR_PREFIX, "wirestgm + 0x14 should be \"User\" instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == USER_MARSHAL_PTR_PREFIX, "wirestgm + 0x14 should be \"User\" instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x18 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x18 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
pmfp = GlobalLock(hmfp);
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)pmfp->hMF, "wirestgm + 0x1c should be pmfp->hMF instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)pmfp->hMF, "wirestgm + 0x1c should be pmfp->hMF instead of 0x%08lx\n", *(DWORD *)wirehmfp);
GlobalUnlock(hmfp);
wirehmfp += sizeof(DWORD);
/* Note use (buffer_end - buffer) instead of size here, because size is an
* overestimate with native */
ok(*(DWORD *)wirehmfp == (buffer_end - buffer - 0x2c), "wirestgm + 0x20 should be size - 0x34 instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == (buffer_end - buffer - 0x2c), "wirestgm + 0x20 should be size - 0x34 instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
ok(*(DWORD *)wirehmfp == (buffer_end - buffer - 0x2c), "wirestgm + 0x24 should be size - 0x34 instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == (buffer_end - buffer - 0x2c), "wirestgm + 0x24 should be size - 0x34 instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
ok(*(WORD *)wirehmfp == 1, "wirehmfp + 0x28 should be 1 instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(WORD *)wirehmfp == 1, "wirehmfp + 0x28 should be 1 instead of 0x%08lx\n", *(DWORD *)wirehmfp);
/* ... rest of data not tested - refer to tests for GetMetaFileBits
* at this point */
......@@ -552,15 +552,15 @@ static void test_marshal_HMETAFILEPICT(void)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
size = HMETAFILEPICT_UserSize(&umcb.Flags, 1, &hmfp);
ok(size == 12, "size should be 12 bytes, not %d\n", size);
ok(size == 12, "size should be 12 bytes, not %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
buffer_end = HMETAFILEPICT_UserMarshal(&umcb.Flags, buffer + 1, &hmfp);
ok(buffer_end == buffer + size, "got %p buffer %p\n", buffer_end, buffer);
wirehmfp = buffer + 4;
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)hmfp, "wirestgm + 0x4 should be hmf instead of 0x%08x\n", *(DWORD *)wirehmfp);
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)hmfp, "wirestgm + 0x4 should be hmf instead of 0x%08lx\n", *(DWORD *)wirehmfp);
wirehmfp += sizeof(DWORD);
hmfp2 = NULL;
......@@ -702,7 +702,7 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx, BOOL client,
unk = NULL;
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, umcb_ctx);
size = WdtpInterfacePointer_UserSize(&umcb.Flags, ctx, 0, unk, &IID_IUnknown);
ok(size == 0, "size should be 0 bytes, not %d\n", size);
ok(size == 0, "size should be 0 bytes, not %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, ctx, buffer, unk, &IID_IUnknown);
ok(buffer_end == buffer, "buffer_end %p buffer %p\n", buffer_end, buffer);
......@@ -721,23 +721,23 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx, BOOL client,
marshal_size = pos.u.LowPart;
marshal_data = GlobalLock(h);
todo_wine
ok(Test_Unknown.refs == 2, "got %d\n", Test_Unknown.refs);
ok(Test_Unknown.refs == 2, "got %ld\n", Test_Unknown.refs);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, umcb_ctx);
size = WdtpInterfacePointer_UserSize(&umcb.Flags, ctx, 0, unk, &IID_IUnknown);
ok(size >= marshal_size + 2 * sizeof(DWORD), "marshal size %x got %x\n", marshal_size, size);
ok(size >= marshal_size + 2 * sizeof(DWORD), "marshal size %lx got %lx\n", marshal_size, size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, umcb_ctx);
buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, ctx, buffer, unk, &IID_IUnknown);
todo_wine
ok(Test_Unknown.refs == 2, "got %d\n", Test_Unknown.refs);
ok(Test_Unknown.refs == 2, "got %ld\n", Test_Unknown.refs);
wireip = buffer;
ok(buffer_end == buffer + marshal_size + 2 * sizeof(DWORD), "buffer_end %p buffer %p\n", buffer_end, buffer);
ok(*(DWORD *)wireip == marshal_size, "wireip + 0x0 should be %x instead of %x\n", marshal_size, *(DWORD *)wireip);
ok(*(DWORD *)wireip == marshal_size, "wireip + 0x0 should be %lx instead of %lx\n", marshal_size, *(DWORD *)wireip);
wireip += sizeof(DWORD);
ok(*(DWORD *)wireip == marshal_size, "wireip + 0x4 should be %x instead of %x\n", marshal_size, *(DWORD *)wireip);
ok(*(DWORD *)wireip == marshal_size, "wireip + 0x4 should be %lx instead of %lx\n", marshal_size, *(DWORD *)wireip);
wireip += sizeof(DWORD);
ok(!memcmp(marshal_data, wireip, marshal_size), "buffer mismatch\n");
......@@ -756,8 +756,8 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx, BOOL client,
WdtpInterfacePointer_UserUnmarshal(&umcb.Flags, buffer, &unk2, &IID_IUnknown);
ok(unk2 != NULL, "IUnknown object didn't unmarshal properly\n");
ok(Test_Unknown.refs == 2, "got %d\n", Test_Unknown.refs);
ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs);
ok(Test_Unknown.refs == 2, "got %ld\n", Test_Unknown.refs);
ok(Test_Unknown2.refs == 0, "got %ld\n", Test_Unknown2.refs);
HeapFree(GetProcessHeap(), 0, buffer);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_INPROC);
IUnknown_Release(unk2);
......@@ -820,14 +820,14 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
size = STGMEDIUM_UserSize(&umcb.Flags, 0, &med);
ok(size == expect_size, "size %d should be %d bytes\n", size, expect_size);
ok(size == expect_size, "size %ld should be %ld bytes\n", size, expect_size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
buffer_end = STGMEDIUM_UserMarshal(&umcb.Flags, buffer, &med);
ok(buffer_end - buffer == expect_buffer_end - expect_buffer, "buffer size mismatch\n");
ok(*(DWORD*)buffer == TYMED_NULL, "got %08x\n", *(DWORD*)buffer);
ok(*((DWORD*)buffer+1) != 0, "got %08x\n", *((DWORD*)buffer+1));
ok(*(DWORD*)buffer == TYMED_NULL, "got %08lx\n", *(DWORD*)buffer);
ok(*((DWORD*)buffer+1) != 0, "got %08lx\n", *((DWORD*)buffer+1));
ok(!memcmp(buffer+8, expect_buffer + 8, expect_buffer_end - expect_buffer - 8), "buffer mismatch\n");
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
......@@ -842,9 +842,9 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2);
ok(med2.tymed == TYMED_NULL, "got tymed %x\n", med2.tymed);
ok(med2.tymed == TYMED_NULL, "got tymed %lx\n", med2.tymed);
ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n");
ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs);
ok(Test_Unknown2.refs == 0, "got %ld\n", Test_Unknown2.refs);
HeapFree(GetProcessHeap(), 0, buffer);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
......@@ -858,7 +858,7 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
STGMEDIUM_UserFree(&umcb.Flags, &med2);
ok(Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs);
ok(Test_Unknown.refs == 1, "got %ld\n", Test_Unknown.refs);
HeapFree(GetProcessHeap(), 0, expect_buffer);
......@@ -887,16 +887,16 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
size = STGMEDIUM_UserSize(&umcb.Flags, 0, &med);
ok(size == expect_size, "size %d should be %d bytes\n", size, expect_size);
ok(size == expect_size, "size %ld should be %ld bytes\n", size, expect_size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
memset(buffer, 0xcc, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
buffer_end = STGMEDIUM_UserMarshal(&umcb.Flags, buffer, &med);
ok(buffer_end - buffer == expect_buffer_end - expect_buffer, "buffer size mismatch\n");
ok(*(DWORD*)buffer == TYMED_ISTREAM, "got %08x\n", *(DWORD*)buffer);
ok(*((DWORD*)buffer+1) != 0, "got %08x\n", *((DWORD*)buffer+1));
ok(*((DWORD*)buffer+2) != 0, "got %08x\n", *((DWORD*)buffer+2));
ok(*(DWORD*)buffer == TYMED_ISTREAM, "got %08lx\n", *(DWORD*)buffer);
ok(*((DWORD*)buffer+1) != 0, "got %08lx\n", *((DWORD*)buffer+1));
ok(*((DWORD*)buffer+2) != 0, "got %08lx\n", *((DWORD*)buffer+2));
ok(!memcmp(buffer + 12, expect_buffer + 12, (buffer_end - buffer) - 12), "buffer mismatch\n");
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
......@@ -912,11 +912,11 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2);
ok(med2.tymed == TYMED_ISTREAM, "got tymed %x\n", med2.tymed);
ok(med2.tymed == TYMED_ISTREAM, "got tymed %lx\n", med2.tymed);
ok(U(med2).pstm != NULL, "Incorrectly unmarshalled\n");
ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n");
ok(Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs);
ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs);
ok(Test_Stream2.refs == 0, "got %ld\n", Test_Stream2.refs);
ok(Test_Unknown2.refs == 0, "got %ld\n", Test_Unknown2.refs);
HeapFree(GetProcessHeap(), 0, buffer);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
......@@ -930,8 +930,8 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
STGMEDIUM_UserFree(&umcb.Flags, &med2);
ok(Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs);
ok(Test_Stream.refs == 1, "got %d\n", Test_Stream.refs);
ok(Test_Unknown.refs == 1, "got %ld\n", Test_Unknown.refs);
ok(Test_Stream.refs == 1, "got %ld\n", Test_Stream.refs);
HeapFree(GetProcessHeap(), 0, expect_buffer);
......@@ -946,16 +946,16 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
size = STGMEDIUM_UserSize(&umcb.Flags, 0, &med);
ok(size == expect_size, "size %d should be %d bytes\n", size, expect_size);
ok(size == expect_size, "size %ld should be %ld bytes\n", size, expect_size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
memset(buffer, 0xcc, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
buffer_end = STGMEDIUM_UserMarshal(&umcb.Flags, buffer, &med);
ok(buffer_end - buffer == expect_size, "buffer size mismatch\n");
ok(*(DWORD*)buffer == TYMED_ISTREAM, "got %08x\n", *(DWORD*)buffer);
ok(*((DWORD*)buffer+1) == 0, "got %08x\n", *((DWORD*)buffer+1));
ok(*((DWORD*)buffer+2) == 0, "got %08x\n", *((DWORD*)buffer+2));
ok(*(DWORD*)buffer == TYMED_ISTREAM, "got %08lx\n", *(DWORD*)buffer);
ok(*((DWORD*)buffer+1) == 0, "got %08lx\n", *((DWORD*)buffer+1));
ok(*((DWORD*)buffer+2) == 0, "got %08lx\n", *((DWORD*)buffer+2));
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
umcb.pStubMsg->IsClient = client;
......@@ -970,11 +970,11 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2);
ok(med2.tymed == TYMED_ISTREAM, "got tymed %x\n", med2.tymed);
ok(med2.tymed == TYMED_ISTREAM, "got tymed %lx\n", med2.tymed);
ok(U(med2).pstm == NULL, "Incorrectly unmarshalled\n");
ok(med2.pUnkForRelease == &Test_Unknown2.IUnknown_iface, "Incorrectly unmarshalled\n");
ok(Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs);
ok(Test_Unknown2.refs == 1, "got %d\n", Test_Unknown2.refs);
ok(Test_Stream2.refs == 0, "got %ld\n", Test_Stream2.refs);
ok(Test_Unknown2.refs == 1, "got %ld\n", Test_Unknown2.refs);
HeapFree(GetProcessHeap(), 0, buffer);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
......@@ -1011,12 +1011,12 @@ static void test_marshal_SNB(void)
snb = NULL;
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
size = SNB_UserSize(&umcb.Flags, 3, &snb);
ok(size == 16, "Size should be 16, instead of %d\n", size);
ok(size == 16, "Size should be 16, instead of %ld\n", size);
/* NULL block */
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
size = SNB_UserSize(&umcb.Flags, 0, &snb);
ok(size == 12, "Size should be 12, instead of %d\n", size);
ok(size == 12, "Size should be 12, instead of %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
......@@ -1024,9 +1024,9 @@ static void test_marshal_SNB(void)
ok(mbuf == buffer + size, "got %p, %p\n", mbuf, buffer + size);
wiresnb = (RemSNB*)buffer;
ok(wiresnb->ulCntStr == 0, "got %u\n", wiresnb->ulCntStr);
ok(wiresnb->ulCntChar == 0, "got %u\n", wiresnb->ulCntChar);
ok(*(ULONG*)wiresnb->rgString == 0, "got %u\n", *(ULONG*)wiresnb->rgString);
ok(wiresnb->ulCntStr == 0, "got %lu\n", wiresnb->ulCntStr);
ok(wiresnb->ulCntChar == 0, "got %lu\n", wiresnb->ulCntChar);
ok(*(ULONG*)wiresnb->rgString == 0, "got %lu\n", *(ULONG*)wiresnb->rgString);
snb2 = NULL;
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
......@@ -1054,17 +1054,17 @@ static void test_marshal_SNB(void)
snb = (SNB)src;
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
size = SNB_UserSize(&umcb.Flags, 0, &snb);
ok(size == 38, "Size should be 38, instead of %d\n", size);
ok(size == 38, "Size should be 38, instead of %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
SNB_UserMarshal(&umcb.Flags, buffer, &snb);
wiresnb = (RemSNB*)buffer;
ok(wiresnb->ulCntStr == 13, "got %u\n", wiresnb->ulCntStr);
ok(wiresnb->ulCntChar == 2, "got %u\n", wiresnb->ulCntChar);
ok(wiresnb->ulCntStr == 13, "got %lu\n", wiresnb->ulCntStr);
ok(wiresnb->ulCntChar == 2, "got %lu\n", wiresnb->ulCntChar);
/* payload length is stored one more time, as ULONG */
ok(*(ULONG*)wiresnb->rgString == wiresnb->ulCntStr, "got %u\n", *(ULONG*)wiresnb->rgString);
ok(*(ULONG*)wiresnb->rgString == wiresnb->ulCntStr, "got %lu\n", *(ULONG*)wiresnb->rgString);
dataW = &wiresnb->rgString[2];
ok(!lstrcmpW(dataW, str1W), "marshalled string 0: %s\n", wine_dbgstr_w(dataW));
dataW += ARRAY_SIZE(str1W);
......@@ -1106,15 +1106,15 @@ static void test_marshal_HDC(void)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
size = HDC_UserSize(&umcb.Flags, 1, &hdc);
ok(size == 4 + sizeof(*wirehdc), "Wrong size %d\n", size);
ok(size == 4 + sizeof(*wirehdc), "Wrong size %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
buffer_end = HDC_UserMarshal(&umcb.Flags, buffer + 1, &hdc);
ok(buffer_end == buffer + 4 + sizeof(*wirehdc), "got %p buffer %p\n", buffer_end, buffer);
wirehdc = (wireHDC)(buffer + 4);
ok(wirehdc->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehdc->fContext);
ok(wirehdc->u.hInproc == (LONG_PTR)hdc, "Marshaled value should be %p instead of %x\n", hdc, wirehdc->u.hRemote);
ok(wirehdc->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08lx\n", wirehdc->fContext);
ok(wirehdc->u.hInproc == (LONG_PTR)hdc, "Marshaled value should be %p instead of %lx\n", hdc, wirehdc->u.hRemote);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
buffer_end = HDC_UserUnmarshal(&umcb.Flags, buffer + 1, &hdc2);
......@@ -1143,15 +1143,15 @@ static void test_marshal_HICON(void)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
size = HICON_UserSize(&umcb.Flags, 1, &hIcon);
ok(size == 4 + sizeof(*wirehicon), "Wrong size %d\n", size);
ok(size == 4 + sizeof(*wirehicon), "Wrong size %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
buffer_end = HICON_UserMarshal(&umcb.Flags, buffer + 1, &hIcon);
ok(buffer_end == buffer + 4 + sizeof(*wirehicon), "got %p buffer %p\n", buffer_end, buffer);
wirehicon = (wireHICON)(buffer + 4);
ok(wirehicon->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehicon->fContext);
ok(wirehicon->u.hInproc == (LONG_PTR)hIcon, "Marshaled value should be %p instead of %x\n", hIcon, wirehicon->u.hRemote);
ok(wirehicon->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08lx\n", wirehicon->fContext);
ok(wirehicon->u.hInproc == (LONG_PTR)hIcon, "Marshaled value should be %p instead of %lx\n", hIcon, wirehicon->u.hRemote);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
buffer_end = HICON_UserUnmarshal(&umcb.Flags, buffer + 1, &hIcon2);
......@@ -1184,15 +1184,15 @@ static void test_marshal_HBRUSH(void)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
size = HBRUSH_UserSize(&umcb.Flags, 1, &hBrush);
ok(size == 4 + sizeof(*wirehbrush), "Wrong size %d\n", size);
ok(size == 4 + sizeof(*wirehbrush), "Wrong size %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
buffer_end = HBRUSH_UserMarshal(&umcb.Flags, buffer + 1, &hBrush);
ok(buffer_end == buffer + 4 + sizeof(*wirehbrush), "got %p buffer %p\n", buffer_end, buffer);
wirehbrush = (wireHBRUSH)(buffer + 4);
ok(wirehbrush->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehbrush->fContext);
ok(wirehbrush->u.hInproc == (LONG_PTR)hBrush, "Marshaled value should be %p instead of %x\n", hBrush, wirehbrush->u.hRemote);
ok(wirehbrush->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08lx\n", wirehbrush->fContext);
ok(wirehbrush->u.hInproc == (LONG_PTR)hBrush, "Marshaled value should be %p instead of %lx\n", hBrush, wirehbrush->u.hRemote);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
buffer_end = HBRUSH_UserUnmarshal(&umcb.Flags, buffer + 1, &hBrush2);
......@@ -1226,13 +1226,13 @@ static void test_marshal_HBITMAP(void)
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_INPROC);
size = HBITMAP_UserSize(&umcb.Flags, 1, &hBitmap);
ok(size == 0xc, "Wrong size %d\n", size);
ok(size == 0xc, "Wrong size %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size + 4);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_INPROC);
buffer_end = HBITMAP_UserMarshal(&umcb.Flags, buffer + 1, &hBitmap);
ok(buffer_end == buffer + 0xc, "HBITMAP_UserMarshal() returned wrong size %d\n", (LONG)(buffer_end - buffer));
ok(*(ULONG *)(buffer + 0x4) == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", *(ULONG *)(buffer + 0x4));
ok(*(ULONG *)(buffer + 0x8) == (ULONG)(ULONG_PTR)hBitmap, "wirestgm + 0x4 should be bitmap handle instead of 0x%08x\n", *(ULONG *)(buffer + 0x8));
ok(buffer_end == buffer + 0xc, "HBITMAP_UserMarshal() returned wrong size %ld\n", (LONG)(buffer_end - buffer));
ok(*(ULONG *)(buffer + 0x4) == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08lx\n", *(ULONG *)(buffer + 0x4));
ok(*(ULONG *)(buffer + 0x8) == (ULONG)(ULONG_PTR)hBitmap, "wirestgm + 0x4 should be bitmap handle instead of 0x%08lx\n", *(ULONG *)(buffer + 0x8));
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_INPROC);
HBITMAP_UserUnmarshal(&umcb.Flags, buffer + 1, &hBitmap2);
......@@ -1246,15 +1246,15 @@ static void test_marshal_HBITMAP(void)
size = HBITMAP_UserSize(&umcb.Flags, 1, &hBitmap);
ok(size == 0x10 + header_size + bitmap_size ||
broken(size == 0x14 + header_size + bitmap_size), /* Windows adds 4 extra (unused) bytes */
"Wrong size %d\n", size);
"Wrong size %ld\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size + 4);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
buffer_end = HBITMAP_UserMarshal(&umcb.Flags, buffer + 1, &hBitmap);
ok(buffer_end == buffer + 0x10 + header_size + bitmap_size, "HBITMAP_UserMarshal() returned wrong size %d\n", (LONG)(buffer_end - buffer));
ok(*(ULONG *)(buffer + 0x4) == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08x\n", *(ULONG *)buffer);
ok(*(ULONG *)(buffer + 0x8) == (ULONG)(ULONG_PTR)hBitmap, "wirestgm + 0x4 should be bitmap handle instead of 0x%08x\n", *(ULONG *)(buffer + 0x4));
ok(*(ULONG *)(buffer + 0xc) == (ULONG)(ULONG_PTR)bitmap_size, "wirestgm + 0x8 should be bitmap size instead of 0x%08x\n", *(ULONG *)(buffer + 0x4));
ok(buffer_end == buffer + 0x10 + header_size + bitmap_size, "HBITMAP_UserMarshal() returned wrong size %ld\n", (LONG)(buffer_end - buffer));
ok(*(ULONG *)(buffer + 0x4) == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(ULONG *)buffer);
ok(*(ULONG *)(buffer + 0x8) == (ULONG)(ULONG_PTR)hBitmap, "wirestgm + 0x4 should be bitmap handle instead of 0x%08lx\n", *(ULONG *)(buffer + 0x4));
ok(*(ULONG *)(buffer + 0xc) == (ULONG)(ULONG_PTR)bitmap_size, "wirestgm + 0x8 should be bitmap size instead of 0x%08lx\n", *(ULONG *)(buffer + 0x4));
ok(!memcmp(buffer + 0x10, bitmap, header_size), "buffer mismatch\n");
ok(!memcmp(buffer + 0x10 + header_size, bmp_bits, bitmap_size), "buffer mismatch\n");
......@@ -1347,12 +1347,12 @@ static void test_GetDataHere_Proxy(void)
STGMEDIUM med;
hr = CreateStreamOnHGlobal( NULL, TRUE, &stm );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
tid = start_host_object2( stm, &IID_IDataObject, (IUnknown *)&obj.IDataObject_iface, MSHLFLAGS_NORMAL, NULL, &thread );
IStream_Seek( stm, zero, STREAM_SEEK_SET, NULL );
hr = CoUnmarshalInterface( stm, &IID_IDataObject, (void **)&data );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
IStream_Release( stm );
Test_Stream.refs = 1;
......@@ -1368,33 +1368,33 @@ static void test_GetDataHere_Proxy(void)
fmt.tymed = med.tymed = TYMED_NULL;
hr = IDataObject_GetDataHere( data, &fmt, &med );
ok( hr == DV_E_TYMED, "got %08x\n", hr );
ok( hr == DV_E_TYMED, "got %08lx\n", hr );
for (fmt.tymed = TYMED_HGLOBAL; fmt.tymed <= TYMED_ENHMF; fmt.tymed <<= 1)
{
med.tymed = fmt.tymed;
hr = IDataObject_GetDataHere( data, &fmt, &med );
ok( hr == (fmt.tymed <= TYMED_ISTORAGE ? S_OK : DV_E_TYMED), "got %08x for tymed %d\n", hr, fmt.tymed );
ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs );
ok( hr == (fmt.tymed <= TYMED_ISTORAGE ? S_OK : DV_E_TYMED), "got %08lx for tymed %ld\n", hr, fmt.tymed );
ok( Test_Unknown.refs == 1, "got %ld\n", Test_Unknown.refs );
}
fmt.tymed = TYMED_ISTREAM;
med.tymed = TYMED_ISTORAGE;
hr = IDataObject_GetDataHere( data, &fmt, &med );
ok( hr == DV_E_TYMED, "got %08x\n", hr );
ok( hr == DV_E_TYMED, "got %08lx\n", hr );
fmt.tymed = med.tymed = TYMED_ISTREAM;
U(med).pstm = &Test_Stream.IStream_iface;
med.pUnkForRelease = &Test_Unknown.IUnknown_iface;
hr = IDataObject_GetDataHere( data, &fmt, &med );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
ok( U(med).pstm == &Test_Stream.IStream_iface, "stm changed\n" );
ok( med.pUnkForRelease == &Test_Unknown.IUnknown_iface, "punk changed\n" );
ok( Test_Stream.refs == 1, "got %d\n", Test_Stream.refs );
ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs );
ok( Test_Stream.refs == 1, "got %ld\n", Test_Stream.refs );
ok( Test_Unknown.refs == 1, "got %ld\n", Test_Unknown.refs );
fmt.cfFormat = 2;
fmt.tymed = med.tymed = TYMED_ISTREAM;
......@@ -1402,14 +1402,14 @@ static void test_GetDataHere_Proxy(void)
med.pUnkForRelease = &Test_Unknown.IUnknown_iface;
hr = IDataObject_GetDataHere( data, &fmt, &med );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
ok( U(med).pstm == &Test_Stream.IStream_iface, "stm changed\n" );
ok( med.pUnkForRelease == &Test_Unknown.IUnknown_iface, "punk changed\n" );
ok( Test_Stream.refs == 1, "got %d\n", Test_Stream.refs );
ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs );
ok( Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs );
ok( Test_Stream.refs == 1, "got %ld\n", Test_Stream.refs );
ok( Test_Unknown.refs == 1, "got %ld\n", Test_Unknown.refs );
ok( Test_Stream2.refs == 0, "got %ld\n", Test_Stream2.refs );
IDataObject_Release( data );
end_host_object( tid, thread );
......
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