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

inetcomm/tests: Enable compilation with long types.

parent afd2e6c8
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = inetcomm.dll
IMPORTS = inetcomm urlmon oleaut32 ole32
......
......@@ -41,9 +41,9 @@ static void test_create(void)
ULONG ref;
hr = MimeOleGetInternat(&internat);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = MimeOleGetInternat(&internat2);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
/* Under w2k8 it's no longer a singleton */
if(internat == internat2)
......@@ -53,18 +53,18 @@ static void test_create(void)
ref = IMimeInternational_Release(internat2);
ok(ref == 2 ||
ref == 1, /* win95 - object is a static singleton */
"got %d\n", ref);
"got %ld\n", ref);
ref = IMimeInternational_Release(internat);
ok(ref == 1, "got %d\n", ref);
ok(ref == 1, "got %ld\n", ref);
}
else
{
ref = IMimeInternational_Release(internat2);
ok(ref == 0, "got %d\n", ref);
ok(ref == 0, "got %ld\n", ref);
ref = IMimeInternational_Release(internat);
ok(ref == 0, "got %d\n", ref);
ok(ref == 0, "got %ld\n", ref);
}
}
......@@ -153,46 +153,46 @@ static void test_charset(void)
MIMECSETINFO mlang_cs_info;
hr = MimeOleGetInternat(&internat);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeInternational_FindCharset(internat, "nonexistent", &hcs);
ok(hr == MIME_E_NOT_FOUND, "got %08x\n", hr);
ok(hr == MIME_E_NOT_FOUND, "got %08lx\n", hr);
hr = IMimeInternational_FindCharset(internat, "windows-1252", &hcs_windows_1252);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IMimeInternational_FindCharset(internat, "windows-1252", &hcs);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(hcs_windows_1252 == hcs, "got different hcharsets for the same name\n");
hr = IMimeInternational_FindCharset(internat, "WiNdoWs-1252", &hcs);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(hcs_windows_1252 == hcs, "got different hcharsets for the same name\n");
hr = IMimeInternational_FindCharset(internat, "windows-1251", &hcs_windows_1251);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
ok(hcs_windows_1252 != hcs_windows_1251, "got the same hcharset for the different names\n");
hr = IMimeInternational_GetCharsetInfo(internat, hcs_windows_1252, &cs_info);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = mlang_getcsetinfo("windows-1252", &mlang_cs_info);
ok(hr == S_OK, "got %08x\n", hr);
ok(cs_info.cpiWindows == mlang_cs_info.uiCodePage, "cpiWindows %d while mlang uiCodePage %d\n",
ok(hr == S_OK, "got %08lx\n", hr);
ok(cs_info.cpiWindows == mlang_cs_info.uiCodePage, "cpiWindows %ld while mlang uiCodePage %d\n",
cs_info.cpiWindows, mlang_cs_info.uiCodePage);
ok(cs_info.cpiInternet == mlang_cs_info.uiInternetEncoding, "cpiInternet %d while mlang uiInternetEncoding %d\n",
ok(cs_info.cpiInternet == mlang_cs_info.uiInternetEncoding, "cpiInternet %ld while mlang uiInternetEncoding %d\n",
cs_info.cpiInternet, mlang_cs_info.uiInternetEncoding);
ok(cs_info.hCharset == hcs_windows_1252, "hCharset doesn't match requested\n");
ok(!strcmp(cs_info.szName, "windows-1252"), "szName doesn't match requested\n");
hr = IMimeInternational_GetCodePageCharset(internat, 1252, CHARSET_BODY, &hcs);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IMimeInternational_GetCharsetInfo(internat, hcs, &cs_info);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = mlang_getcsetinfo_from_cp(1252, CHARSET_BODY, &mlang_cs_info);
ok(hr == S_OK, "got %08x\n", hr);
ok(cs_info.cpiWindows == mlang_cs_info.uiCodePage, "cpiWindows %d while mlang uiCodePage %d\n",
ok(hr == S_OK, "got %08lx\n", hr);
ok(cs_info.cpiWindows == mlang_cs_info.uiCodePage, "cpiWindows %ld while mlang uiCodePage %d\n",
cs_info.cpiWindows, mlang_cs_info.uiCodePage);
ok(cs_info.cpiInternet == mlang_cs_info.uiInternetEncoding, "cpiInternet %d while mlang uiInternetEncoding %d\n",
ok(cs_info.cpiInternet == mlang_cs_info.uiInternetEncoding, "cpiInternet %ld while mlang uiInternetEncoding %d\n",
cs_info.cpiInternet, mlang_cs_info.uiInternetEncoding);
IMimeInternational_Release(internat);
......@@ -205,24 +205,24 @@ static void test_defaultcharset(void)
HCHARSET hcs_default, hcs, hcs_windows_1251;
hr = MimeOleGetInternat(&internat);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeInternational_GetDefaultCharset(internat, &hcs_default);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeInternational_GetCodePageCharset(internat, GetACP(), CHARSET_BODY, &hcs);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(hcs_default == hcs, "Unexpected default charset\n");
hr = IMimeInternational_FindCharset(internat, "windows-1251", &hcs_windows_1251);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IMimeInternational_SetDefaultCharset(internat, hcs_windows_1251);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeInternational_GetDefaultCharset(internat, &hcs);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(hcs == hcs_windows_1251, "didn't retrieve recently set default\n");
/* Set the old default back again */
hr = IMimeInternational_SetDefaultCharset(internat, hcs_default);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
IMimeInternational_Release(internat);
}
......@@ -238,27 +238,27 @@ static void test_convert(void)
static WCHAR test_stringW[] = L"test string";
hr = MimeOleGetInternat(&internat);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
src.pBlobData = (BYTE*)test_string;
src.cbSize = sizeof(test_string);
hr = IMimeInternational_ConvertBuffer(internat, 1252, 28591, &src, &dst, &read);
ok(hr == S_OK, "ret %08x\n", hr);
ok(read == sizeof(test_string), "got %d\n", read);
ok(dst.cbSize == sizeof(test_string), "got %d\n", dst.cbSize);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(read == sizeof(test_string), "got %ld\n", read);
ok(dst.cbSize == sizeof(test_string), "got %ld\n", dst.cbSize);
CoTaskMemFree(dst.pBlobData);
src.cbSize = 2;
hr = IMimeInternational_ConvertBuffer(internat, 1252, 28591, &src, &dst, &read);
ok(hr == S_OK, "ret %08x\n", hr);
ok(read == 2, "got %d\n", read);
ok(dst.cbSize == 2, "got %d\n", dst.cbSize);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(read == 2, "got %ld\n", read);
ok(dst.cbSize == 2, "got %ld\n", dst.cbSize);
CoTaskMemFree(dst.pBlobData);
prop_in.vt = VT_LPWSTR;
prop_in.pwszVal = test_stringW;
hr = IMimeInternational_ConvertString(internat, CP_UNICODE, 1252, &prop_in, &prop_out);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(prop_out.vt == VT_LPSTR, "got %d\n", prop_out.vt);
ok(!strcmp(prop_out.pszVal, test_string), "got %s\n", prop_out.pszVal);
PropVariantClear(&prop_out);
......@@ -267,7 +267,7 @@ static void test_convert(void)
prop_in.vt = VT_LPWSTR;
prop_in.pwszVal = test_stringW;
hr = IMimeInternational_ConvertString(internat, 28591, 1252, &prop_in, &prop_out);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(prop_out.vt == VT_LPSTR, "got %d\n", prop_out.vt);
ok(!strcmp(prop_out.pszVal, test_string), "got %s\n", prop_out.pszVal);
PropVariantClear(&prop_out);
......@@ -275,7 +275,7 @@ static void test_convert(void)
prop_in.vt = VT_LPSTR;
prop_in.pszVal = test_string;
hr = IMimeInternational_ConvertString(internat, 28591, CP_UNICODE, &prop_in, &prop_out);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(prop_out.vt == VT_LPWSTR, "got %d\n", prop_out.vt);
ok(!lstrcmpW(prop_out.pwszVal, test_stringW), "mismatched strings\n");
PropVariantClear(&prop_out);
......@@ -284,7 +284,7 @@ static void test_convert(void)
prop_in.vt = VT_LPSTR;
prop_in.pszVal = test_string;
hr = IMimeInternational_ConvertString(internat, CP_UNICODE, CP_UNICODE, &prop_in, &prop_out);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(prop_out.vt == VT_LPWSTR, "got %d\n", prop_out.vt);
ok(!lstrcmpW(prop_out.pwszVal, test_stringW), "mismatched strings\n");
PropVariantClear(&prop_out);
......
......@@ -118,7 +118,7 @@ static void test_CreateVirtualStream(void)
IStream *pstm;
hr = MimeOleCreateVirtualStream(&pstm);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
IStream_Release(pstm);
}
......@@ -129,7 +129,7 @@ static void test_CreateSecurity(void)
IMimeSecurity *sec;
hr = MimeOleCreateSecurity(&sec);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
IMimeSecurity_Release(sec);
}
......@@ -141,14 +141,14 @@ static IStream *create_stream_from_string(const char *data)
HRESULT hr;
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IStream_Write(stream, data, strlen(data), NULL);
ok(hr == S_OK, "Write failed: %08x\n", hr);
ok(hr == S_OK, "Write failed: %08lx\n", hr);
off.QuadPart = 0;
hr = IStream_Seek(stream, off, STREAM_SEEK_SET, NULL);
ok(hr == S_OK, "Seek failed: %08x\n", hr);
ok(hr == S_OK, "Seek failed: %08lx\n", hr);
return stream;
}
......@@ -160,7 +160,7 @@ static void _test_current_encoding(unsigned line, IMimeBody *mime_body, ENCODING
HRESULT hres;
hres = IMimeBody_GetCurrentEncoding(mime_body, &current_encoding);
ok_(__FILE__,line)(hres == S_OK, "GetCurrentEncoding failed: %08x\n", hres);
ok_(__FILE__,line)(hres == S_OK, "GetCurrentEncoding failed: %08lx\n", hres);
ok_(__FILE__,line)(current_encoding == encoding, "encoding = %d, expected %d\n", current_encoding, encoding);
}
......@@ -179,77 +179,77 @@ static void test_CreateBody(void)
CLSID clsid;
hr = CoCreateInstance(&CLSID_IMimeBody, NULL, CLSCTX_INPROC_SERVER, &IID_IMimeBody, (void**)&body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetClassID(body, NULL);
ok(hr == E_INVALIDARG, "ret %08x\n", hr);
ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hr = IMimeBody_GetClassID(body, &clsid);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(IsEqualGUID(&clsid, &IID_IMimeBody), "got %s\n", wine_dbgstr_guid(&clsid));
hr = IMimeBody_GetHandle(body, &handle);
ok(hr == MIME_E_NO_DATA, "ret %08x\n", hr);
ok(hr == MIME_E_NO_DATA, "ret %08lx\n", hr);
ok(handle == NULL, "handle %p\n", handle);
in = create_stream_from_string(msg1);
/* Need to call InitNew before Load otherwise Load crashes with native inetcomm */
hr = IMimeBody_InitNew(body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
test_current_encoding(body, IET_7BIT);
hr = IMimeBody_Load(body, in);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
off.QuadPart = 0;
IStream_Seek(in, off, STREAM_SEEK_CUR, &pos);
ok(pos.u.LowPart == 359, "pos %u\n", pos.u.LowPart);
ok(pos.u.LowPart == 359, "pos %lu\n", pos.u.LowPart);
hr = IMimeBody_IsContentType(body, "multipart", "mixed");
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_IsContentType(body, "text", "plain");
ok(hr == S_FALSE, "ret %08x\n", hr);
ok(hr == S_FALSE, "ret %08lx\n", hr);
hr = IMimeBody_IsContentType(body, NULL, "mixed");
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_IsType(body, IBT_EMPTY);
ok(hr == S_OK, "got %08x\n", hr);
ok(hr == S_OK, "got %08lx\n", hr);
hr = IMimeBody_SetData(body, IET_8BIT, "text", "plain", &IID_IStream, in);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_IsContentType(body, "text", "plain");
todo_wine
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
test_current_encoding(body, IET_8BIT);
memset(&offsets, 0xcc, sizeof(offsets));
hr = IMimeBody_GetOffsets(body, &offsets);
ok(hr == MIME_E_NO_DATA, "ret %08x\n", hr);
ok(offsets.cbBoundaryStart == 0, "got %d\n", offsets.cbBoundaryStart);
ok(offsets.cbHeaderStart == 0, "got %d\n", offsets.cbHeaderStart);
ok(offsets.cbBodyStart == 0, "got %d\n", offsets.cbBodyStart);
ok(offsets.cbBodyEnd == 0, "got %d\n", offsets.cbBodyEnd);
ok(hr == MIME_E_NO_DATA, "ret %08lx\n", hr);
ok(offsets.cbBoundaryStart == 0, "got %ld\n", offsets.cbBoundaryStart);
ok(offsets.cbHeaderStart == 0, "got %ld\n", offsets.cbHeaderStart);
ok(offsets.cbBodyStart == 0, "got %ld\n", offsets.cbBodyStart);
ok(offsets.cbBodyEnd == 0, "got %ld\n", offsets.cbBodyEnd);
hr = IMimeBody_IsType(body, IBT_EMPTY);
ok(hr == S_FALSE, "got %08x\n", hr);
ok(hr == S_FALSE, "got %08lx\n", hr);
hr = MimeOleGetAllocator(&alloc);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetParameters(body, "nothere", &count, &param_info);
ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr);
ok(count == 0, "got %d\n", count);
ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
ok(count == 0, "got %ld\n", count);
ok(!param_info, "got %p\n", param_info);
hr = IMimeBody_GetParameters(body, "bar", &count, &param_info);
ok(hr == S_OK, "ret %08x\n", hr);
ok(count == 0, "got %d\n", count);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(count == 0, "got %ld\n", count);
ok(!param_info, "got %p\n", param_info);
hr = IMimeBody_GetParameters(body, "Content-Type", &count, &param_info);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
todo_wine /* native adds a charset parameter */
ok(count == 4, "got %d\n", count);
ok(count == 4, "got %ld\n", count);
ok(param_info != NULL, "got %p\n", param_info);
found_param = 0;
......@@ -268,10 +268,10 @@ static void test_CreateBody(void)
"got %s\n", param_info[i].pszData);
}
}
ok(found_param == 2, "matched %d params\n", found_param);
ok(found_param == 2, "matched %ld params\n", found_param);
hr = IMimeAllocator_FreeParamInfoArray(alloc, count, param_info, TRUE);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
IMimeAllocator_Release(alloc);
IStream_Release(in);
......@@ -347,7 +347,7 @@ static HRESULT WINAPI Stream_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD
if(dwOrigin == STREAM_SEEK_END) {
CHECK_EXPECT(Stream_Seek_END);
ok(dlibMove.QuadPart == expect_seek_pos, "unexpected seek pos %u\n", dlibMove.u.LowPart);
ok(dlibMove.QuadPart == expect_seek_pos, "unexpected seek pos %lu\n", dlibMove.u.LowPart);
if(plibNewPosition)
plibNewPosition->QuadPart = 10;
return S_OK;
......@@ -355,8 +355,8 @@ static HRESULT WINAPI Stream_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD
CHECK_EXPECT(Stream_Seek);
ok(dlibMove.QuadPart == expect_seek_pos, "unexpected seek pos %u\n", dlibMove.u.LowPart);
ok(dwOrigin == STREAM_SEEK_SET, "dwOrigin = %d\n", dwOrigin);
ok(dlibMove.QuadPart == expect_seek_pos, "unexpected seek pos %lu\n", dlibMove.u.LowPart);
ok(dwOrigin == STREAM_SEEK_SET, "dwOrigin = %ld\n", dwOrigin);
This->pos = dlibMove.QuadPart;
if(plibNewPosition)
plibNewPosition->QuadPart = This->pos;
......@@ -405,7 +405,7 @@ static HRESULT WINAPI Stream_UnlockRegion(IStream *iface,
static HRESULT WINAPI Stream_Stat(IStream *iface, STATSTG *pstatstg, DWORD dwStatFlag)
{
CHECK_EXPECT(Stream_Stat);
ok(dwStatFlag == STATFLAG_NONAME, "dwStatFlag = %x\n", dwStatFlag);
ok(dwStatFlag == STATFLAG_NONAME, "dwStatFlag = %lx\n", dwStatFlag);
return E_NOTIMPL;
}
......@@ -453,8 +453,8 @@ static void _test_stream_read(unsigned line, IStream *stream, HRESULT exhres, co
read_size = sizeof(buf)-1;
hres = IStream_Read(stream, buf, read_size, &read);
ok_(__FILE__,line)(hres == exhres, "Read returned %08x, expected %08x\n", hres, exhres);
ok_(__FILE__,line)(read == exread, "unexpected read size %u, expected %u\n", read, exread);
ok_(__FILE__,line)(hres == exhres, "Read returned %08lx, expected %08lx\n", hres, exhres);
ok_(__FILE__,line)(read == exread, "unexpected read size %lu, expected %lu\n", read, exread);
buf[read] = 0;
ok_(__FILE__,line)(read == exread && !memcmp(buf, exdata, read), "unexpected data %s\n", buf);
}
......@@ -466,24 +466,24 @@ static void test_SetData(void)
HRESULT hr;
hr = CoCreateInstance(&CLSID_IMimeBody, NULL, CLSCTX_INPROC_SERVER, &IID_IMimeBody, (void**)&body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
/* Need to call InitNew before Load otherwise Load crashes with native inetcomm */
hr = IMimeBody_InitNew(body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
stream = create_stream_from_string(msg1);
hr = IMimeBody_Load(body, stream);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
IStream_Release(stream);
test_stream = create_test_stream();
hr = IMimeBody_SetData(body, IET_BINARY, "text", "plain", &IID_IStream, test_stream);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_IsContentType(body, "text", "plain");
todo_wine
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
test_current_encoding(body, IET_BINARY);
......@@ -492,7 +492,7 @@ static void test_SetData(void)
hr = IMimeBody_GetData(body, IET_BINARY, &stream);
CHECK_CALLED(Stream_Stat);
CHECK_CALLED(Stream_Seek_END);
ok(hr == S_OK, "GetData failed %08x\n", hr);
ok(hr == S_OK, "GetData failed %08lx\n", hr);
ok(stream != test_stream, "unexpected stream\n");
SET_EXPECT(Stream_Seek);
......@@ -506,7 +506,7 @@ static void test_SetData(void)
hr = IMimeBody_GetData(body, IET_BINARY, &stream2);
CHECK_CALLED(Stream_Stat);
CHECK_CALLED(Stream_Seek_END);
ok(hr == S_OK, "GetData failed %08x\n", hr);
ok(hr == S_OK, "GetData failed %08lx\n", hr);
ok(stream2 != stream, "unexpected stream\n");
SET_EXPECT(Stream_Seek);
......@@ -529,12 +529,12 @@ static void test_SetData(void)
stream = create_stream_from_string(" \t\r\n|}~YWJj ZGV|}~mZw== \t"); /* "abcdefg" in base64 obscured by invalid chars */
hr = IMimeBody_SetData(body, IET_BASE64, "text", "plain", &IID_IStream, stream);
IStream_Release(stream);
ok(hr == S_OK, "SetData failed: %08x\n", hr);
ok(hr == S_OK, "SetData failed: %08lx\n", hr);
test_current_encoding(body, IET_BASE64);
hr = IMimeBody_GetData(body, IET_BINARY, &stream);
ok(hr == S_OK, "GetData failed %08x\n", hr);
ok(hr == S_OK, "GetData failed %08lx\n", hr);
test_stream_read(stream, S_OK, "abc", 3);
test_stream_read(stream, S_OK, "defg", -1);
......@@ -542,7 +542,7 @@ static void test_SetData(void)
IStream_Release(stream);
hr = IMimeBody_GetData(body, IET_BASE64, &stream);
ok(hr == S_OK, "GetData failed %08x\n", hr);
ok(hr == S_OK, "GetData failed %08lx\n", hr);
test_stream_read(stream, S_OK, " \t\r", 3);
IStream_Release(stream);
......@@ -550,12 +550,12 @@ static void test_SetData(void)
stream = create_stream_from_string(" =3d=3D\"one\" \t=\r\ntw= o=\nx3\n=34\r\n5");
hr = IMimeBody_SetData(body, IET_QP, "text", "plain", &IID_IStream, stream);
IStream_Release(stream);
ok(hr == S_OK, "SetData failed: %08x\n", hr);
ok(hr == S_OK, "SetData failed: %08lx\n", hr);
test_current_encoding(body, IET_QP);
hr = IMimeBody_GetData(body, IET_BINARY, &stream);
ok(hr == S_OK, "GetData failed %08x\n", hr);
ok(hr == S_OK, "GetData failed %08lx\n", hr);
test_stream_read(stream, S_OK, " ==\"one\" \ttw=o=3\n4\r\n5", -1);
......@@ -570,7 +570,7 @@ static void test_Allocator(void)
IMimeAllocator *alloc;
hr = MimeOleGetAllocator(&alloc);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
IMimeAllocator_Release(alloc);
}
......@@ -594,74 +594,74 @@ static void test_CreateMessage(void)
static const char att_pritype[] = "att:pri-content-type";
hr = MimeOleCreateMessage(NULL, &msg);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
stream = create_stream_from_string(msg1);
hr = IMimeMessage_Load(msg, stream);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeMessage_CountBodies(msg, HBODY_ROOT, TRUE, &count);
ok(hr == S_OK, "ret %08x\n", hr);
ok(count == 3, "got %d\n", count);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(count == 3, "got %ld\n", count);
hr = IMimeMessage_CountBodies(msg, HBODY_ROOT, FALSE, &count);
ok(hr == S_OK, "ret %08x\n", hr);
ok(count == 3, "got %d\n", count);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(count == 3, "got %ld\n", count);
hr = IMimeMessage_BindToObject(msg, HBODY_ROOT, &IID_IMimeBody, (void**)&body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetOffsets(body, &offsets);
ok(hr == S_OK, "ret %08x\n", hr);
ok(offsets.cbBoundaryStart == 0, "got %d\n", offsets.cbBoundaryStart);
ok(offsets.cbHeaderStart == 0, "got %d\n", offsets.cbHeaderStart);
ok(offsets.cbBodyStart == 359, "got %d\n", offsets.cbBodyStart);
ok(offsets.cbBodyEnd == 666, "got %d\n", offsets.cbBodyEnd);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(offsets.cbBoundaryStart == 0, "got %ld\n", offsets.cbBoundaryStart);
ok(offsets.cbHeaderStart == 0, "got %ld\n", offsets.cbHeaderStart);
ok(offsets.cbBodyStart == 359, "got %ld\n", offsets.cbBodyStart);
ok(offsets.cbBodyEnd == 666, "got %ld\n", offsets.cbBodyEnd);
IMimeBody_Release(body);
hr = IMimeMessage_GetBody(msg, IBL_ROOT, NULL, &hbody);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetHandle(body, NULL);
ok(hr == E_INVALIDARG, "ret %08x\n", hr);
ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hr = IMimeBody_GetHandle(body, &handle);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(handle != NULL, "handle %p\n", handle);
hr = IMimeMessage_GetBody(msg, IBL_PARENT, hbody, NULL);
ok(hr == E_INVALIDARG, "ret %08x\n", hr);
ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hbody2 = (HBODY)0xdeadbeef;
hr = IMimeMessage_GetBody(msg, IBL_PARENT, hbody, &hbody2);
ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr);
ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
ok(hbody2 == NULL, "hbody2 %p\n", hbody2);
PropVariantInit(&prop);
hr = IMimeMessage_GetBodyProp(msg, hbody, att_pritype, 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(prop.vt == VT_LPSTR, "vt %08x\n", prop.vt);
ok(!strcasecmp(prop.pszVal, "multipart"), "got %s\n", prop.pszVal);
PropVariantClear(&prop);
hr = IMimeMessage_GetBody(msg, IBL_FIRST, hbody, &hbody);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeMessage_BindToObject(msg, hbody, &IID_IMimeBody, (void**)&body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetHandle(body, &handle);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(handle == hbody, "handle %p\n", handle);
hr = IMimeBody_GetOffsets(body, &offsets);
ok(hr == S_OK, "ret %08x\n", hr);
ok(offsets.cbBoundaryStart == 405, "got %d\n", offsets.cbBoundaryStart);
ok(offsets.cbHeaderStart == 428, "got %d\n", offsets.cbHeaderStart);
ok(offsets.cbBodyStart == 518, "got %d\n", offsets.cbBodyStart);
ok(offsets.cbBodyEnd == 523, "got %d\n", offsets.cbBodyEnd);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(offsets.cbBoundaryStart == 405, "got %ld\n", offsets.cbBoundaryStart);
ok(offsets.cbHeaderStart == 428, "got %ld\n", offsets.cbHeaderStart);
ok(offsets.cbBodyStart == 518, "got %ld\n", offsets.cbBodyStart);
ok(offsets.cbBodyEnd == 523, "got %ld\n", offsets.cbBodyEnd);
hr = IMimeBody_GetCharset(body, &hcs);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
todo_wine
{
ok(hcs != NULL, "Expected non-NULL charset\n");
......@@ -670,37 +670,37 @@ static void test_CreateMessage(void)
IMimeBody_Release(body);
hr = IMimeMessage_GetBody(msg, IBL_NEXT, hbody, &hbody);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeMessage_BindToObject(msg, hbody, &IID_IMimeBody, (void**)&body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetHandle(body, &handle);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(handle == hbody, "handle %p\n", handle);
hr = IMimeBody_GetOffsets(body, &offsets);
ok(hr == S_OK, "ret %08x\n", hr);
ok(offsets.cbBoundaryStart == 525, "got %d\n", offsets.cbBoundaryStart);
ok(offsets.cbHeaderStart == 548, "got %d\n", offsets.cbHeaderStart);
ok(offsets.cbBodyStart == 629, "got %d\n", offsets.cbBodyStart);
ok(offsets.cbBodyEnd == 639, "got %d\n", offsets.cbBodyEnd);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(offsets.cbBoundaryStart == 525, "got %ld\n", offsets.cbBoundaryStart);
ok(offsets.cbHeaderStart == 548, "got %ld\n", offsets.cbHeaderStart);
ok(offsets.cbBodyStart == 629, "got %ld\n", offsets.cbBodyStart);
ok(offsets.cbBodyEnd == 639, "got %ld\n", offsets.cbBodyEnd);
IMimeBody_Release(body);
find_struct.pszPriType = text;
find_struct.pszSubType = NULL;
hr = IMimeMessage_FindFirst(msg, &find_struct, &hbody);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeMessage_FindNext(msg, &find_struct, &hbody);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeMessage_FindNext(msg, &find_struct, &hbody);
ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr);
ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
hr = IMimeMessage_GetAttachments(msg, &count, &body_list);
ok(hr == S_OK, "ret %08x\n", hr);
ok(count == 2, "got %d\n", count);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(count == 2, "got %ld\n", count);
if(count == 2)
{
IMimeBody *attachment;
......@@ -709,50 +709,50 @@ static void test_CreateMessage(void)
PropVariantInit(&prop);
hr = IMimeMessage_BindToObject(msg, body_list[0], &IID_IMimeBody, (void**)&attachment);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_IsContentType(attachment, "multipart", NULL);
ok(hr == S_FALSE, "ret %08x\n", hr);
ok(hr == S_FALSE, "ret %08lx\n", hr);
test_current_encoding(attachment, IET_8BIT);
prop.vt = VT_LPSTR;
hr = IMimeBody_GetProp(attachment, "Content-Transfer-Encoding", 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt);
ok(!strcmp(prop.pszVal, "8bit"), "got %s\n", prop.pszVal);
PropVariantClear(&prop);
hr = IMimeBody_IsType(attachment, IBT_ATTACHMENT);
todo_wine ok(hr == S_FALSE, "ret %08x\n", hr);
todo_wine ok(hr == S_FALSE, "ret %08lx\n", hr);
IMimeBody_Release(attachment);
hr = IMimeMessage_BindToObject(msg, body_list[1], &IID_IMimeBody, (void**)&attachment);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_IsContentType(attachment, "multipart", NULL);
ok(hr == S_FALSE, "ret %08x\n", hr);
ok(hr == S_FALSE, "ret %08lx\n", hr);
test_current_encoding(attachment, IET_7BIT);
prop.vt = VT_LPSTR;
hr = IMimeBody_GetProp(attachment, "Content-Transfer-Encoding", 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt);
ok(!strcmp(prop.pszVal, "7bit"), "got %s\n", prop.pszVal);
PropVariantClear(&prop);
hr = IMimeBody_IsType(attachment, IBT_ATTACHMENT);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
IMimeBody_Release(attachment);
}
CoTaskMemFree(body_list);
hr = IMimeBody_GetCharset(body, &hcs);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
todo_wine
{
ok(hcs != NULL, "Expected non-NULL charset\n");
......@@ -763,7 +763,7 @@ static void test_CreateMessage(void)
ref = IStream_AddRef(stream);
ok(ref == 2 ||
broken(ref == 1), /* win95 */
"ref %d\n", ref);
"ref %ld\n", ref);
IStream_Release(stream);
IStream_Release(stream);
......@@ -779,26 +779,26 @@ static void test_mhtml_message(void)
HRESULT hres;
hres = MimeOleCreateMessage(NULL, &mime_message);
ok(hres == S_OK, "MimeOleCreateMessage failed: %08x\n", hres);
ok(hres == S_OK, "MimeOleCreateMessage failed: %08lx\n", hres);
stream = create_stream_from_string(mhtml_page1);
hres = IMimeMessage_Load(mime_message, stream);
IStream_Release(stream);
ok(hres == S_OK, "Load failed: %08x\n", hres);
ok(hres == S_OK, "Load failed: %08lx\n", hres);
hres = IMimeMessage_CountBodies(mime_message, HBODY_ROOT, TRUE, &count);
ok(hres == S_OK, "CountBodies failed: %08x\n", hres);
ok(count == 3, "got %d\n", count);
ok(hres == S_OK, "CountBodies failed: %08lx\n", hres);
ok(count == 3, "got %ld\n", count);
hres = IMimeMessage_GetAttachments(mime_message, &count, &body_list);
ok(hres == S_OK, "GetAttachments failed: %08x\n", hres);
ok(count == 2, "count = %u\n", count);
ok(hres == S_OK, "GetAttachments failed: %08lx\n", hres);
ok(count == 2, "count = %lu\n", count);
hres = IMimeMessage_BindToObject(mime_message, body_list[0], &IID_IMimeBody, (void**)&mime_body);
ok(hres == S_OK, "BindToObject failed: %08x\n", hres);
ok(hres == S_OK, "BindToObject failed: %08lx\n", hres);
hres = IMimeBody_GetData(mime_body, IET_BINARY, &stream);
ok(hres == S_OK, "GetData failed: %08x\n", hres);
ok(hres == S_OK, "GetData failed: %08lx\n", hres);
test_stream_read(stream, S_OK, "<HTML></HTML>", -1);
IStream_Release(stream);
......@@ -807,12 +807,12 @@ static void test_mhtml_message(void)
IMimeBody_Release(mime_body);
hres = IMimeMessage_BindToObject(mime_message, body_list[1], &IID_IMimeBody, (void**)&mime_body);
ok(hres == S_OK, "BindToObject failed: %08x\n", hres);
ok(hres == S_OK, "BindToObject failed: %08lx\n", hres);
test_current_encoding(mime_body, IET_BASE64);
hres = IMimeBody_GetData(mime_body, IET_BINARY, &stream);
ok(hres == S_OK, "GetData failed: %08x\n", hres);
ok(hres == S_OK, "GetData failed: %08lx\n", hres);
test_stream_read(stream, S_OK, "Test", -1);
IStream_Release(stream);
......@@ -832,38 +832,38 @@ static void test_MessageSetProp(void)
PROPVARIANT prop;
hr = MimeOleCreateMessage(NULL, &msg);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantInit(&prop);
hr = IMimeMessage_BindToObject(msg, HBODY_ROOT, &IID_IMimeBody, (void**)&body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_SetProp(body, NULL, 0, &prop);
ok(hr == E_INVALIDARG, "ret %08x\n", hr);
ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hr = IMimeBody_SetProp(body, "Thread-Topic", 0, NULL);
ok(hr == E_INVALIDARG, "ret %08x\n", hr);
ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
prop.vt = VT_LPSTR;
prop.pszVal = CoTaskMemAlloc(strlen(topic)+1);
strcpy(prop.pszVal, topic);
hr = IMimeBody_SetProp(body, "Thread-Topic", 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantClear(&prop);
hr = IMimeBody_GetProp(body, NULL, 0, &prop);
ok(hr == E_INVALIDARG, "ret %08x\n", hr);
ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hr = IMimeBody_GetProp(body, "Thread-Topic", 0, NULL);
ok(hr == E_INVALIDARG, "ret %08x\n", hr);
ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hr = IMimeBody_GetProp(body, "Wine-Topic", 0, &prop);
ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr);
ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
prop.vt = VT_LPSTR;
hr = IMimeBody_GetProp(body, "Thread-Topic", 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
if(hr == S_OK)
{
ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt);
......@@ -875,12 +875,12 @@ static void test_MessageSetProp(void)
prop.pszVal = CoTaskMemAlloc(strlen(topic)+1);
strcpy(prop.pszVal, topic);
hr = IMimeBody_SetProp(body, PIDTOSTR(PID_HDR_SUBJECT), 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantClear(&prop);
prop.vt = VT_LPSTR;
hr = IMimeBody_GetProp(body, PIDTOSTR(PID_HDR_SUBJECT), 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
if(hr == S_OK)
{
ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt);
......@@ -891,7 +891,7 @@ static void test_MessageSetProp(void)
/* Using the name or PID returns the same result. */
prop.vt = VT_LPSTR;
hr = IMimeBody_GetProp(body, "Subject", 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
if(hr == S_OK)
{
ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt);
......@@ -901,7 +901,7 @@ static void test_MessageSetProp(void)
prop.vt = VT_LPWSTR;
hr = IMimeBody_GetProp(body, "Subject", 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
if(hr == S_OK)
{
ok(prop.vt == VT_LPWSTR, "type %d\n", prop.vt);
......@@ -913,7 +913,7 @@ static void test_MessageSetProp(void)
prop.pszVal = CoTaskMemAlloc(strlen(topic)+1);
strcpy(prop.pszVal, topic);
hr = IMimeBody_SetProp(body, PIDTOSTR(PID_HDR_TO), 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantClear(&prop);
/* Out of Range PID */
......@@ -921,7 +921,7 @@ static void test_MessageSetProp(void)
prop.pszVal = CoTaskMemAlloc(strlen(topic)+1);
strcpy(prop.pszVal, topic);
hr = IMimeBody_SetProp(body, PIDTOSTR(124), 0, &prop);
ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr);
ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
PropVariantClear(&prop);
IMimeBody_Release(body);
......@@ -939,60 +939,60 @@ static void test_MessageGetPropInfo(void)
MIMEPROPINFO info;
hr = MimeOleCreateMessage(NULL, &msg);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantInit(&prop);
hr = IMimeMessage_BindToObject(msg, HBODY_ROOT, &IID_IMimeBody, (void**)&body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
prop.vt = VT_LPSTR;
prop.pszVal = CoTaskMemAlloc(strlen(topic)+1);
strcpy(prop.pszVal, topic);
hr = IMimeBody_SetProp(body, "Thread-Topic", 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantClear(&prop);
prop.vt = VT_LPSTR;
prop.pszVal = CoTaskMemAlloc(strlen(subject)+1);
strcpy(prop.pszVal, subject);
hr = IMimeBody_SetProp(body, PIDTOSTR(PID_HDR_SUBJECT), 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantClear(&prop);
memset(&info, 0, sizeof(info));
info.dwMask = PIM_ENCODINGTYPE | PIM_FLAGS | PIM_PROPID;
hr = IMimeBody_GetPropInfo(body, NULL, &info);
ok(hr == E_INVALIDARG, "ret %08x\n", hr);
ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
memset(&info, 0, sizeof(info));
info.dwMask = PIM_ENCODINGTYPE | PIM_FLAGS | PIM_PROPID;
hr = IMimeBody_GetPropInfo(body, "Subject", NULL);
ok(hr == E_INVALIDARG, "ret %08x\n", hr);
ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
memset(&info, 0xfe, sizeof(info));
info.dwMask = PIM_ENCODINGTYPE | PIM_FLAGS | PIM_PROPID;
hr = IMimeBody_GetPropInfo(body, "Subject", &info);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
if(hr == S_OK)
{
ok(info.dwMask & (PIM_ENCODINGTYPE | PIM_FLAGS| PIM_PROPID), "Invalid mask 0x%08x\n", info.dwFlags);
todo_wine ok(info.dwFlags & 0x10000000, "Invalid flags 0x%08x\n", info.dwFlags);
ok(info.dwMask & (PIM_ENCODINGTYPE | PIM_FLAGS| PIM_PROPID), "Invalid mask 0x%08lx\n", info.dwFlags);
todo_wine ok(info.dwFlags & 0x10000000, "Invalid flags 0x%08lx\n", info.dwFlags);
ok(info.ietEncoding == 0, "Invalid encoding %d\n", info.ietEncoding);
ok(info.dwPropId == PID_HDR_SUBJECT, "Invalid propid %d\n", info.dwPropId);
ok(info.cValues == 0xfefefefe, "Invalid cValues %d\n", info.cValues);
ok(info.dwPropId == PID_HDR_SUBJECT, "Invalid propid %ld\n", info.dwPropId);
ok(info.cValues == 0xfefefefe, "Invalid cValues %ld\n", info.cValues);
}
memset(&info, 0xfe, sizeof(info));
info.dwMask = 0;
hr = IMimeBody_GetPropInfo(body, "Subject", &info);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
if(hr == S_OK)
{
ok(info.dwMask == 0, "Invalid mask 0x%08x\n", info.dwFlags);
ok(info.dwFlags == 0xfefefefe, "Invalid flags 0x%08x\n", info.dwFlags);
ok(info.dwMask == 0, "Invalid mask 0x%08lx\n", info.dwFlags);
ok(info.dwFlags == 0xfefefefe, "Invalid flags 0x%08lx\n", info.dwFlags);
ok(info.ietEncoding == -16843010, "Invalid encoding %d\n", info.ietEncoding);
ok(info.dwPropId == -16843010, "Invalid propid %d\n", info.dwPropId);
ok(info.dwPropId == -16843010, "Invalid propid %ld\n", info.dwPropId);
}
memset(&info, 0xfe, sizeof(info));
......@@ -1000,19 +1000,19 @@ static void test_MessageGetPropInfo(void)
info.dwPropId = 1024;
info.ietEncoding = 99;
hr = IMimeBody_GetPropInfo(body, "Subject", &info);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
if(hr == S_OK)
{
ok(info.dwMask == 0, "Invalid mask 0x%08x\n", info.dwFlags);
ok(info.dwFlags == 0xfefefefe, "Invalid flags 0x%08x\n", info.dwFlags);
ok(info.dwMask == 0, "Invalid mask 0x%08lx\n", info.dwFlags);
ok(info.dwFlags == 0xfefefefe, "Invalid flags 0x%08lx\n", info.dwFlags);
ok(info.ietEncoding == 99, "Invalid encoding %d\n", info.ietEncoding);
ok(info.dwPropId == 1024, "Invalid propid %d\n", info.dwPropId);
ok(info.dwPropId == 1024, "Invalid propid %ld\n", info.dwPropId);
}
memset(&info, 0, sizeof(info));
info.dwMask = PIM_ENCODINGTYPE | PIM_FLAGS | PIM_PROPID;
hr = IMimeBody_GetPropInfo(body, "Invalid Property", &info);
ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr);
ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
IMimeBody_Release(body);
IMimeMessage_Release(msg);
......@@ -1027,18 +1027,18 @@ static void test_MessageOptions(void)
PROPVARIANT prop;
hr = MimeOleCreateMessage(NULL, &msg);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantInit(&prop);
prop.vt = VT_BOOL;
prop.boolVal = TRUE;
hr = IMimeMessage_SetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantClear(&prop);
hr = IMimeMessage_GetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
todo_wine ok(hr == S_OK, "ret %08x\n", hr);
todo_wine ok(hr == S_OK, "ret %08lx\n", hr);
todo_wine ok(prop.vt == VT_BOOL, "vt %08x\n", prop.vt);
todo_wine ok(prop.boolVal == TRUE, "Hide Attachments got %d\n", prop.boolVal);
PropVariantClear(&prop);
......@@ -1047,11 +1047,11 @@ static void test_MessageOptions(void)
prop.pszVal = CoTaskMemAlloc(strlen(string)+1);
strcpy(prop.pszVal, string);
hr = IMimeMessage_SetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantClear(&prop);
hr = IMimeMessage_GetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
todo_wine ok(hr == S_OK, "ret %08x\n", hr);
todo_wine ok(hr == S_OK, "ret %08lx\n", hr);
todo_wine ok(prop.vt == VT_BOOL, "vt %08x\n", prop.vt);
todo_wine ok(prop.boolVal == TRUE, "Hide Attachments got %d\n", prop.boolVal);
PropVariantClear(&prop);
......@@ -1061,11 +1061,11 @@ static void test_MessageOptions(void)
prop.pszVal = CoTaskMemAlloc(strlen(zero)+1);
strcpy(prop.pszVal, zero);
hr = IMimeMessage_SetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantClear(&prop);
hr = IMimeMessage_GetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop);
todo_wine ok(hr == S_OK, "ret %08x\n", hr);
todo_wine ok(hr == S_OK, "ret %08lx\n", hr);
todo_wine ok(prop.vt == VT_BOOL, "vt %08x\n", prop.vt);
todo_wine ok(prop.boolVal == TRUE, "Hide Attachments got %d\n", prop.boolVal);
PropVariantClear(&prop);
......@@ -1074,14 +1074,14 @@ static void test_MessageOptions(void)
prop.vt = VT_BOOL;
prop.boolVal = TRUE;
hr = IMimeMessage_SetOption(msg, 0xff00000a, &prop);
ok(hr == MIME_E_INVALID_OPTION_ID, "ret %08x\n", hr);
ok(hr == MIME_E_INVALID_OPTION_ID, "ret %08lx\n", hr);
PropVariantClear(&prop);
/* Out of range before type. */
prop.vt = VT_I4;
prop.lVal = 1;
hr = IMimeMessage_SetOption(msg, 0xff00000a, &prop);
ok(hr == MIME_E_INVALID_OPTION_ID, "ret %08x\n", hr);
ok(hr == MIME_E_INVALID_OPTION_ID, "ret %08lx\n", hr);
PropVariantClear(&prop);
IMimeMessage_Release(msg);
......@@ -1095,14 +1095,14 @@ static void test_BindToObject(void)
ULONG count;
hr = MimeOleCreateMessage(NULL, &msg);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeMessage_CountBodies(msg, HBODY_ROOT, TRUE, &count);
ok(hr == S_OK, "ret %08x\n", hr);
ok(count == 1, "got %d\n", count);
ok(hr == S_OK, "ret %08lx\n", hr);
ok(count == 1, "got %ld\n", count);
hr = IMimeMessage_BindToObject(msg, HBODY_ROOT, &IID_IMimeBody, (void**)&body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
IMimeBody_Release(body);
IMimeMessage_Release(msg);
......@@ -1117,44 +1117,44 @@ static void test_BodyDeleteProp(void)
PROPVARIANT prop;
hr = MimeOleCreateMessage(NULL, &msg);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantInit(&prop);
hr = IMimeMessage_BindToObject(msg, HBODY_ROOT, &IID_IMimeBody, (void**)&body);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_DeleteProp(body, "Subject");
ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr);
ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
hr = IMimeBody_DeleteProp(body, PIDTOSTR(PID_HDR_SUBJECT));
ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr);
ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
prop.vt = VT_LPSTR;
prop.pszVal = CoTaskMemAlloc(strlen(topic)+1);
strcpy(prop.pszVal, topic);
hr = IMimeBody_SetProp(body, "Subject", 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantClear(&prop);
hr = IMimeBody_DeleteProp(body, "Subject");
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetProp(body, "Subject", 0, &prop);
ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr);
ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
prop.vt = VT_LPSTR;
prop.pszVal = CoTaskMemAlloc(strlen(topic)+1);
strcpy(prop.pszVal, topic);
hr = IMimeBody_SetProp(body, PIDTOSTR(PID_HDR_SUBJECT), 0, &prop);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantClear(&prop);
hr = IMimeBody_DeleteProp(body, PIDTOSTR(PID_HDR_SUBJECT));
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetProp(body, PIDTOSTR(PID_HDR_SUBJECT), 0, &prop);
ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr);
ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
IMimeBody_Release(body);
IMimeMessage_Release(msg);
......@@ -1166,7 +1166,7 @@ static void test_MimeOleGetPropertySchema(void)
IMimePropertySchema *schema = NULL;
hr = MimeOleGetPropertySchema(&schema);
ok(hr == S_OK, "ret %08x\n", hr);
ok(hr == S_OK, "ret %08lx\n", hr);
IMimePropertySchema_Release(schema);
}
......@@ -1224,7 +1224,7 @@ static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *grfB
ok(grfBINDF != NULL, "grfBINDF == NULL\n");
ok(pbindinfo != NULL, "pbindinfo == NULL\n");
ok(pbindinfo->cbSize == sizeof(BINDINFO), "wrong size of pbindinfo: %d\n", pbindinfo->cbSize);
ok(pbindinfo->cbSize == sizeof(BINDINFO), "wrong size of pbindinfo: %ld\n", pbindinfo->cbSize);
*grfBINDF = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA | BINDF_FROMURLMON | BINDF_NEEDFILE;
return S_OK;
......@@ -1332,7 +1332,7 @@ static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface,
CHECK_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
return S_OK;
default:
ok(0, "unexpected call %u %s\n", ulStatusCode, wine_dbgstr_w(szStatusText));
ok(0, "unexpected call %lu %s\n", ulStatusCode, wine_dbgstr_w(szStatusText));
}
return E_NOTIMPL;
......@@ -1347,19 +1347,19 @@ static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWOR
CHECK_EXPECT(ReportData);
ok(!ulProgress, "ulProgress = %u\n", ulProgress);
ok(!ulProgress, "ulProgress = %lu\n", ulProgress);
ok(ulProgress == ulProgressMax, "ulProgress != ulProgressMax\n");
ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_INTERMEDIATEDATANOTIFICATION
| BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE | BSCF_AVAILABLEDATASIZEUNKNOWN),
"grcf = %08x\n", grfBSCF);
"grcf = %08lx\n", grfBSCF);
hres = IInternetProtocol_Read(current_binding_protocol, buf, sizeof(buf), &read);
ok(hres == S_OK, "Read failed: %08x\n", hres);
ok(hres == S_OK, "Read failed: %08lx\n", hres);
buf[read] = 0;
ok(!strcmp(buf, current_binding_test->data), "unexpected data: %s\n", buf);
hres = IInternetProtocol_Read(current_binding_protocol, buf, sizeof(buf), &read);
ok(hres == S_FALSE, "Read failed: %08x\n", hres);
ok(hres == S_FALSE, "Read failed: %08lx\n", hres);
return S_OK;
}
......@@ -1367,8 +1367,8 @@ static HRESULT WINAPI ProtocolSink_ReportResult(IInternetProtocolSink *iface, HR
LPCWSTR szResult)
{
CHECK_EXPECT(ReportResult);
ok(hrResult == S_OK, "hrResult = %08x\n", hrResult);
ok(!dwError, "dwError = %u\n", dwError);
ok(hrResult == S_OK, "hrResult = %08lx\n", hrResult);
ok(!dwError, "dwError = %lu\n", dwError);
ok(!szResult, "szResult = %s\n", wine_dbgstr_w(szResult));
return S_OK;
}
......@@ -1411,7 +1411,7 @@ static void test_mhtml_protocol_binding(const mhtml_binding_test_t *test)
MultiByteToWideChar(CP_ACP, 0, urla, -1, test_url, ARRAY_SIZE(test_url));
hres = CoCreateInstance(&CLSID_IMimeHtmlProtocol, NULL, CLSCTX_INPROC_SERVER, &IID_IInternetProtocol, (void**)&protocol);
ok(hres == S_OK, "Could not create protocol handler: %08x\n", hres);
ok(hres == S_OK, "Could not create protocol handler: %08lx\n", hres);
hres = IInternetProtocol_QueryInterface(protocol, &IID_IInternetProtocolEx, (void**)&unk);
ok(hres == E_NOINTERFACE, "Could get IInternetProtocolEx\n");
......@@ -1425,7 +1425,7 @@ static void test_mhtml_protocol_binding(const mhtml_binding_test_t *test)
SET_EXPECT(ReportData);
SET_EXPECT(ReportResult);
hres = IInternetProtocol_Start(protocol, test_url, &protocol_sink, &bind_info, 0, 0);
ok(hres == S_OK, "Start failed: %08x\n", hres);
ok(hres == S_OK, "Start failed: %08lx\n", hres);
CHECK_CALLED(GetBindInfo);
CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
todo_wine CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE);
......@@ -1434,7 +1434,7 @@ static void test_mhtml_protocol_binding(const mhtml_binding_test_t *test)
IInternetProtocol_Release(protocol);
ret = DeleteFileA("winetest.mht");
ok(ret, "DeleteFile failed: %u\n", GetLastError());
ok(ret, "DeleteFile failed: %lu\n", GetLastError());
}
static const struct {
......@@ -1489,7 +1489,7 @@ static void test_mhtml_protocol_info(void)
hres = CoCreateInstance(&CLSID_IMimeHtmlProtocol, NULL, CLSCTX_INPROC_SERVER,
&IID_IInternetProtocolInfo, (void**)&protocol_info);
ok(hres == S_OK, "Could not create protocol info: %08x\n", hres);
ok(hres == S_OK, "Could not create protocol info: %08lx\n", hres);
for(i = 0; i < ARRAY_SIZE(combine_tests); i++) {
combined_len = 0xdeadbeef;
......@@ -1497,10 +1497,10 @@ static void test_mhtml_protocol_info(void)
combine_tests[i].relative_url, ICU_BROWSER_MODE,
combined_url, ARRAY_SIZE(combined_url), &combined_len, 0);
todo_wine_if(combine_tests[i].todo)
ok(hres == S_OK, "[%u] CombineUrl failed: %08x\n", i, hres);
ok(hres == S_OK, "[%u] CombineUrl failed: %08lx\n", i, hres);
if(SUCCEEDED(hres)) {
exlen = lstrlenW(combine_tests[i].expected_result);
ok(combined_len == exlen, "[%u] combined len is %u, expected %u\n", i, combined_len, exlen);
ok(combined_len == exlen, "[%u] combined len is %lu, expected %u\n", i, combined_len, exlen);
ok(!lstrcmpW(combined_url, combine_tests[i].expected_result), "[%u] combined URL is %s, expected %s\n",
i, wine_dbgstr_w(combined_url), wine_dbgstr_w(combine_tests[i].expected_result));
......@@ -1508,15 +1508,15 @@ static void test_mhtml_protocol_info(void)
hres = IInternetProtocolInfo_CombineUrl(protocol_info, combine_tests[i].base_url,
combine_tests[i].relative_url, ICU_BROWSER_MODE,
combined_url, exlen, &combined_len, 0);
ok(hres == E_FAIL, "[%u] CombineUrl returned: %08x\n", i, hres);
ok(!combined_len, "[%u] combined_len = %u\n", i, combined_len);
ok(hres == E_FAIL, "[%u] CombineUrl returned: %08lx\n", i, hres);
ok(!combined_len, "[%u] combined_len = %lu\n", i, combined_len);
}
}
hres = IInternetProtocolInfo_CombineUrl(protocol_info, L"http://test.org", L"http://test.org",
ICU_BROWSER_MODE, combined_url, ARRAY_SIZE(combined_url),
&combined_len, 0);
ok(hres == E_FAIL, "CombineUrl failed: %08x\n", hres);
ok(hres == E_FAIL, "CombineUrl failed: %08lx\n", hres);
IInternetProtocolInfo_Release(protocol_info);
}
......@@ -1555,24 +1555,24 @@ static void test_mhtml_protocol(void)
/* test class factory */
hres = CoGetClassObject(&CLSID_IMimeHtmlProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk);
ok(hres == S_OK, "CoGetClassObject failed: %08x\n", hres);
ok(hres == S_OK, "CoGetClassObject failed: %08lx\n", hres);
hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (void**)&unk2);
ok(hres == E_NOINTERFACE, "IInternetProtocolInfo supported\n");
hres = IUnknown_QueryInterface(unk, &IID_IClassFactory, (void**)&class_factory);
ok(hres == S_OK, "Could not get IClassFactory iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IClassFactory iface: %08lx\n", hres);
IUnknown_Release(unk);
hres = IClassFactory_CreateInstance(class_factory, &outer, &IID_IUnknown, (void**)&unk);
ok(hres == S_OK, "CreateInstance returned: %08x\n", hres);
ok(hres == S_OK, "CreateInstance returned: %08lx\n", hres);
hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocol, (void**)&unk2);
ok(hres == S_OK, "Could not get IInternetProtocol iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IInternetProtocol iface: %08lx\n", hres);
IUnknown_Release(unk2);
IUnknown_Release(unk);
hres = IClassFactory_CreateInstance(class_factory, (IUnknown*)0xdeadbeef, &IID_IInternetProtocol, (void**)&unk2);
ok(hres == CLASS_E_NOAGGREGATION, "CreateInstance returned: %08x\n", hres);
ok(hres == CLASS_E_NOAGGREGATION, "CreateInstance returned: %08lx\n", hres);
IClassFactory_Release(class_factory);
......@@ -1604,13 +1604,13 @@ static void test_MimeOleObjectFromMoniker(void)
for(i = 0; i < ARRAY_SIZE(tests); i++) {
hres = CreateURLMoniker(NULL, tests[i].url, &mon);
ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);
ok(hres == S_OK, "CreateURLMoniker failed: %08lx\n", hres);
hres = CreateBindCtx(0, &bind_ctx);
ok(hres == S_OK, "CreateBindCtx failed: %08x\n", hres);
ok(hres == S_OK, "CreateBindCtx failed: %08lx\n", hres);
hres = MimeOleObjectFromMoniker(0, mon, bind_ctx, &IID_IUnknown, (void**)&unk, &new_mon);
ok(hres == S_OK || broken(!i && hres == INET_E_RESOURCE_NOT_FOUND), "MimeOleObjectFromMoniker failed: %08x\n", hres);
ok(hres == S_OK || broken(!i && hres == INET_E_RESOURCE_NOT_FOUND), "MimeOleObjectFromMoniker failed: %08lx\n", hres);
IBindCtx_Release(bind_ctx);
if(hres == INET_E_RESOURCE_NOT_FOUND) { /* winxp */
win_skip("Broken MHTML behaviour found. Skipping some tests.\n");
......@@ -1619,7 +1619,7 @@ static void test_MimeOleObjectFromMoniker(void)
}
hres = IMoniker_GetDisplayName(new_mon, NULL, NULL, &mhtml_url);
ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres);
ok(hres == S_OK, "GetDisplayName failed: %08lx\n", hres);
ok(!lstrcmpW(mhtml_url, tests[i].mhtml_url), "[%d] unexpected mhtml URL: %s\n", i, wine_dbgstr_w(mhtml_url));
CoTaskMemFree(mhtml_url);
......
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