From c08b3680d7258fb4ae94fe209798ea53301092de Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 12 May 2026 20:52:36 +0100 Subject: [PATCH] [INETCOMM_WINETEST] Sync with Wine 10.0. CORE-20614 --- .../winetests/inetcomm/CMakeLists.txt | 13 +- .../rostests/winetests/inetcomm/mimeintl.c | 98 ++- modules/rostests/winetests/inetcomm/mimeole.c | 595 +++++++++--------- .../rostests/winetests/inetcomm/testlist.c | 14 - 4 files changed, 335 insertions(+), 385 deletions(-) delete mode 100644 modules/rostests/winetests/inetcomm/testlist.c diff --git a/modules/rostests/winetests/inetcomm/CMakeLists.txt b/modules/rostests/winetests/inetcomm/CMakeLists.txt index c2f9b364a53..18095f02ace 100644 --- a/modules/rostests/winetests/inetcomm/CMakeLists.txt +++ b/modules/rostests/winetests/inetcomm/CMakeLists.txt @@ -1,15 +1,14 @@ -add_definitions( - -DUSE_WINE_TODOS - -Dstrcasecmp=_stricmp -) - list(APPEND SOURCE mimeintl.c - mimeole.c - testlist.c) + mimeole.c) add_executable(inetcomm_winetest ${SOURCE}) +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + target_compile_options(inetcomm_winetest PRIVATE -Wno-discarded-qualifiers) +endif() set_module_type(inetcomm_winetest win32cui) +target_compile_definitions(inetcomm_winetest PRIVATE USE_WINE_TODOS strcasecmp=_stricmp) +target_link_libraries(inetcomm_winetest winetestlib) add_importlibs(inetcomm_winetest inetcomm oleaut32 ole32 urlmon msvcrt kernel32) add_rostests_file(TARGET inetcomm_winetest) diff --git a/modules/rostests/winetests/inetcomm/mimeintl.c b/modules/rostests/winetests/inetcomm/mimeintl.c index 09f9dae8d8c..85799670264 100644 --- a/modules/rostests/winetests/inetcomm/mimeintl.c +++ b/modules/rostests/winetests/inetcomm/mimeintl.c @@ -19,8 +19,6 @@ */ #define COBJMACROS -#define NONAMELESSUNION - #include "windows.h" #include "ole2.h" #include "ocidl.h" @@ -41,9 +39,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 +51,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 +151,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 +203,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); } @@ -235,58 +233,58 @@ static void test_convert(void) ULONG read; PROPVARIANT prop_in, prop_out; static char test_string[] = "test string"; - static WCHAR test_stringW[] = {'t','e','s','t',' ','s','t','r','i','n','g',0}; + 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.u.pwszVal = test_stringW; + 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.u.pszVal, test_string), "got %s\n", prop_out.u.pszVal); + ok(!strcmp(prop_out.pszVal, test_string), "got %s\n", prop_out.pszVal); PropVariantClear(&prop_out); /* If in.vt is VT_LPWSTR, ignore cpiSrc */ prop_in.vt = VT_LPWSTR; - prop_in.u.pwszVal = test_stringW; + 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.u.pszVal, test_string), "got %s\n", prop_out.u.pszVal); + ok(!strcmp(prop_out.pszVal, test_string), "got %s\n", prop_out.pszVal); PropVariantClear(&prop_out); prop_in.vt = VT_LPSTR; - prop_in.u.pszVal = test_string; + 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.u.pwszVal, test_stringW), "mismatched strings\n"); + ok(!lstrcmpW(prop_out.pwszVal, test_stringW), "mismatched strings\n"); PropVariantClear(&prop_out); /* If in.vt is VT_LPSTR and cpiSrc is CP_UNICODE, use another multibyte codepage (probably GetACP()) */ prop_in.vt = VT_LPSTR; - prop_in.u.pszVal = test_string; + 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.u.pwszVal, test_stringW), "mismatched strings\n"); + ok(!lstrcmpW(prop_out.pwszVal, test_stringW), "mismatched strings\n"); PropVariantClear(&prop_out); IMimeInternational_Release(internat); diff --git a/modules/rostests/winetests/inetcomm/mimeole.c b/modules/rostests/winetests/inetcomm/mimeole.c index 9db7a6ac49a..eef81fed44c 100644 --- a/modules/rostests/winetests/inetcomm/mimeole.c +++ b/modules/rostests/winetests/inetcomm/mimeole.c @@ -19,11 +19,6 @@ */ #define COBJMACROS -#define NONAMELESSUNION -#ifdef __REACTOS__ -#define CONST_VTABLE -#endif - #include "initguid.h" #include "windows.h" #include "ole2.h" @@ -115,34 +110,13 @@ static const char mhtml_page1[] = "\r\n\t\t\t\tVGVzdA==\r\n\r\n" "------=_NextPart_000_00--"; -static WCHAR *a2w(const char *str) -{ - WCHAR *ret; - int len; - - if(!str) - return NULL; - - len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); - ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); - return ret; -} - -static int strcmp_wa(const WCHAR *strw, const char *stra) -{ - WCHAR buf[512]; - MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, ARRAY_SIZE(buf)); - return lstrcmpW(strw, buf); -} - static void test_CreateVirtualStream(void) { HRESULT hr; IStream *pstm; hr = MimeOleCreateVirtualStream(&pstm); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); IStream_Release(pstm); } @@ -153,7 +127,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); } @@ -165,14 +139,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; } @@ -184,7 +158,7 @@ static void _test_current_encoding(unsigned line, IMimeBody *mime_body, ENCODING HRESULT hres; hres = IMimeBody_GetCurrentEncoding(mime_body, ¤t_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); } @@ -203,77 +177,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.LowPart == 359, "pos %lu\n", pos.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, ¶m_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, ¶m_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, ¶m_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; @@ -292,10 +266,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); @@ -371,7 +345,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.LowPart); if(plibNewPosition) plibNewPosition->QuadPart = 10; return S_OK; @@ -379,8 +353,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.LowPart); + ok(dwOrigin == STREAM_SEEK_SET, "dwOrigin = %ld\n", dwOrigin); This->pos = dlibMove.QuadPart; if(plibNewPosition) plibNewPosition->QuadPart = This->pos; @@ -429,7 +403,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; } @@ -477,8 +451,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); } @@ -490,24 +464,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); @@ -516,7 +490,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); @@ -530,7 +504,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); @@ -553,12 +527,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); @@ -566,7 +540,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); @@ -574,12 +548,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); @@ -594,7 +568,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); } @@ -618,74 +592,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.u.pszVal, "multipart"), "got %s\n", prop.u.pszVal); + 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"); @@ -694,37 +668,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; @@ -733,50 +707,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.u.pszVal, "8bit"), "got %s\n", prop.u.pszVal); + 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.u.pszVal, "7bit"), "got %s\n", prop.u.pszVal); + 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"); @@ -787,7 +761,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); @@ -803,26 +777,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, "", -1); IStream_Release(stream); @@ -831,12 +805,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); @@ -850,103 +824,102 @@ static void test_mhtml_message(void) static void test_MessageSetProp(void) { static const char topic[] = "wine topic"; - static const WCHAR topicW[] = {'w','i','n','e',' ','t','o','p','i','c',0}; HRESULT hr; IMimeMessage *msg; IMimeBody *body; 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.u.pszVal = CoTaskMemAlloc(strlen(topic)+1); - strcpy(prop.u.pszVal, topic); + 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); - ok(!strcmp(prop.u.pszVal, topic), "got %s\n", prop.u.pszVal); + ok(!strcmp(prop.pszVal, topic), "got %s\n", prop.pszVal); PropVariantClear(&prop); } prop.vt = VT_LPSTR; - prop.u.pszVal = CoTaskMemAlloc(strlen(topic)+1); - strcpy(prop.u.pszVal, topic); + 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); - ok(!strcmp(prop.u.pszVal, topic), "got %s\n", prop.u.pszVal); + ok(!strcmp(prop.pszVal, topic), "got %s\n", prop.pszVal); PropVariantClear(&prop); } /* 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); - ok(!strcmp(prop.u.pszVal, topic), "got %s\n", prop.u.pszVal); + ok(!strcmp(prop.pszVal, topic), "got %s\n", prop.pszVal); PropVariantClear(&prop); } 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); - ok(!lstrcmpW(prop.u.pwszVal, topicW), "got %s\n", wine_dbgstr_w(prop.u.pwszVal)); + ok(!lstrcmpW(prop.pwszVal, L"wine topic"), "got %s\n", wine_dbgstr_w(prop.pwszVal)); PropVariantClear(&prop); } prop.vt = VT_LPSTR; - prop.u.pszVal = CoTaskMemAlloc(strlen(topic)+1); - strcpy(prop.u.pszVal, topic); + 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 */ prop.vt = VT_LPSTR; - prop.u.pszVal = CoTaskMemAlloc(strlen(topic)+1); - strcpy(prop.u.pszVal, topic); + 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); @@ -964,60 +937,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.u.pszVal = CoTaskMemAlloc(strlen(topic)+1); - strcpy(prop.u.pszVal, topic); + 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.u.pszVal = CoTaskMemAlloc(strlen(subject)+1); - strcpy(prop.u.pszVal, subject); + 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)); @@ -1025,19 +998,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); @@ -1052,61 +1025,61 @@ 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.u.boolVal = TRUE; + 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.u.boolVal == TRUE, "Hide Attachments got %d\n", prop.u.boolVal); + todo_wine ok(prop.boolVal == TRUE, "Hide Attachments got %d\n", prop.boolVal); PropVariantClear(&prop); prop.vt = VT_LPSTR; - prop.u.pszVal = CoTaskMemAlloc(strlen(string)+1); - strcpy(prop.u.pszVal, string); + 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.u.boolVal == TRUE, "Hide Attachments got %d\n", prop.u.boolVal); + todo_wine ok(prop.boolVal == TRUE, "Hide Attachments got %d\n", prop.boolVal); PropVariantClear(&prop); /* Invalid property type doesn't change the value */ prop.vt = VT_LPSTR; - prop.u.pszVal = CoTaskMemAlloc(strlen(zero)+1); - strcpy(prop.u.pszVal, zero); + 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.u.boolVal == TRUE, "Hide Attachments got %d\n", prop.u.boolVal); + todo_wine ok(prop.boolVal == TRUE, "Hide Attachments got %d\n", prop.boolVal); PropVariantClear(&prop); /* Invalid OID */ prop.vt = VT_BOOL; - prop.u.boolVal = TRUE; + 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.u.lVal = 1; + 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); @@ -1120,14 +1093,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); @@ -1142,44 +1115,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.u.pszVal = CoTaskMemAlloc(strlen(topic)+1); - strcpy(prop.u.pszVal, topic); + 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.u.pszVal = CoTaskMemAlloc(strlen(topic)+1); - strcpy(prop.u.pszVal, topic); + 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); @@ -1191,7 +1164,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); } @@ -1199,7 +1172,7 @@ static void test_MimeOleGetPropertySchema(void) typedef struct { const char *url; const char *content; - const char *mime; + const WCHAR *mime; const char *data; } mhtml_binding_test_t; @@ -1207,13 +1180,13 @@ static const mhtml_binding_test_t binding_tests[] = { { "mhtml:file://%s", mhtml_page1, - "text/html", + L"text/html", "" }, { "mhtml:file://%s!http://winehq.org/mhtmltest.html", mhtml_page1, - "Image/Jpeg", + L"Image/Jpeg", "Test" } }; @@ -1249,7 +1222,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; @@ -1351,13 +1324,13 @@ static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface, switch(ulStatusCode) { case BINDSTATUS_MIMETYPEAVAILABLE: CHECK_EXPECT(ReportProgress_MIMETYPEAVAILABLE); - ok(!strcmp_wa(szStatusText, current_binding_test->mime), "status text %s\n", wine_dbgstr_w(szStatusText)); + ok(!lstrcmpW(szStatusText, current_binding_test->mime), "status text %s\n", wine_dbgstr_w(szStatusText)); return S_OK; case BINDSTATUS_CACHEFILENAMEAVAILABLE: 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; @@ -1372,19 +1345,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; } @@ -1392,8 +1365,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; } @@ -1436,7 +1409,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"); @@ -1450,7 +1423,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); @@ -1459,93 +1432,89 @@ 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 { - const char *base_url; - const char *relative_url; - const char *expected_result; + const WCHAR *base_url; + const WCHAR *relative_url; + const WCHAR *expected_result; BOOL todo; } combine_tests[] = { { - "mhtml:file:///c:/dir/test.mht", "http://test.org", - "mhtml:file:///c:/dir/test.mht!x-usc:http://test.org" + L"mhtml:file:///c:/dir/test.mht", L"http://test.org", + L"mhtml:file:///c:/dir/test.mht!x-usc:http://test.org" }, { - "mhtml:file:///c:/dir/test.mht", "3D\"http://test.org\"", - "mhtml:file:///c:/dir/test.mht!x-usc:3D\"http://test.org\"" + L"mhtml:file:///c:/dir/test.mht", L"3D\"http://test.org\"", + L"mhtml:file:///c:/dir/test.mht!x-usc:3D\"http://test.org\"" }, { - "mhtml:file:///c:/dir/test.mht", "123abc", - "mhtml:file:///c:/dir/test.mht!x-usc:123abc" + L"mhtml:file:///c:/dir/test.mht", L"123abc", + L"mhtml:file:///c:/dir/test.mht!x-usc:123abc" }, { - "mhtml:file:///c:/dir/test.mht!x-usc:http://test.org", "123abc", - "mhtml:file:///c:/dir/test.mht!x-usc:123abc" + L"mhtml:file:///c:/dir/test.mht!x-usc:http://test.org", L"123abc", + L"mhtml:file:///c:/dir/test.mht!x-usc:123abc" }, { - "MhtMl:file:///c:/dir/test.mht!x-usc:http://test.org/dir/dir2/file.html", "../..", - "mhtml:file:///c:/dir/test.mht!x-usc:../.." - }, {"mhtml:file:///c:/dir/test.mht!x-usc:file:///c:/dir/dir2/file.html", "../..", - "mhtml:file:///c:/dir/test.mht!x-usc:../.." + L"MhtMl:file:///c:/dir/test.mht!x-usc:http://test.org/dir/dir2/file.html", L"../..", + L"mhtml:file:///c:/dir/test.mht!x-usc:../.." }, { - "mhtml:file:///c:/dir/test.mht!x-usc:http://test.org", "", - "mhtml:file:///c:/dir/test.mht" + L"mhtml:file:///c:/dir/test.mht!x-usc:file:///c:/dir/dir2/file.html", L"../..", + L"mhtml:file:///c:/dir/test.mht!x-usc:../.." }, { - "mhtml:file:///c:/dir/test.mht!x-usc:http://test.org", "mhtml:file:///d:/file.html", - "file:///d:/file.html", TRUE + L"mhtml:file:///c:/dir/test.mht!x-usc:http://test.org", L"", + L"mhtml:file:///c:/dir/test.mht" }, { - "mhtml:file:///c:/dir/test.mht!x-usc:http://test.org", "mhtml:file:///c:/dir2/test.mht!x-usc:http://test.org", - "mhtml:file:///c:/dir2/test.mht!x-usc:http://test.org", TRUE + L"mhtml:file:///c:/dir/test.mht!x-usc:http://test.org", L"mhtml:file:///d:/file.html", + L"file:///d:/file.html", TRUE }, { - "mhtml:file:///c:/dir/test.mht!http://test.org", "123abc", - "mhtml:file:///c:/dir/test.mht!x-usc:123abc" + L"mhtml:file:///c:/dir/test.mht!x-usc:http://test.org", L"mhtml:file:///c:/dir2/test.mht!x-usc:http://test.org", + L"mhtml:file:///c:/dir2/test.mht!x-usc:http://test.org", TRUE }, { - "mhtml:file:///c:/dir/test.mht!http://test.org", "", - "mhtml:file:///c:/dir/test.mht" + L"mhtml:file:///c:/dir/test.mht!http://test.org", L"123abc", + L"mhtml:file:///c:/dir/test.mht!x-usc:123abc" + }, { + L"mhtml:file:///c:/dir/test.mht!http://test.org", L"", + L"mhtml:file:///c:/dir/test.mht" } }; static void test_mhtml_protocol_info(void) { - WCHAR *base_url, *relative_url, combined_url[INTERNET_MAX_URL_LENGTH]; + WCHAR combined_url[INTERNET_MAX_URL_LENGTH]; IInternetProtocolInfo *protocol_info; DWORD combined_len; unsigned i, exlen; HRESULT hres; - static const WCHAR http_url[] = {'h','t','t','p',':','/','/','t','e','s','t','.','o','r','g',0}; - 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++) { - base_url = a2w(combine_tests[i].base_url); - relative_url = a2w(combine_tests[i].relative_url); - combined_len = 0xdeadbeef; - hres = IInternetProtocolInfo_CombineUrl(protocol_info, base_url, relative_url, ICU_BROWSER_MODE, + hres = IInternetProtocolInfo_CombineUrl(protocol_info, combine_tests[i].base_url, + 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 = strlen(combine_tests[i].expected_result); - ok(combined_len == exlen, "[%u] combined len is %u, expected %u\n", i, combined_len, exlen); - ok(!strcmp_wa(combined_url, combine_tests[i].expected_result), "[%u] combined URL is %s, expected %s\n", - i, wine_dbgstr_w(combined_url), combine_tests[i].expected_result); + exlen = lstrlenW(combine_tests[i].expected_result); + 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)); combined_len = 0xdeadbeef; - hres = IInternetProtocolInfo_CombineUrl(protocol_info, base_url, relative_url, ICU_BROWSER_MODE, + 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); } - - HeapFree(GetProcessHeap(), 0, base_url); - HeapFree(GetProcessHeap(), 0, relative_url); } - hres = IInternetProtocolInfo_CombineUrl(protocol_info, http_url, http_url, ICU_BROWSER_MODE, - combined_url, ARRAY_SIZE(combined_url), &combined_len, 0); - ok(hres == E_FAIL, "CombineUrl failed: %08x\n", hres); + 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: %08lx\n", hres); IInternetProtocolInfo_Release(protocol_info); } @@ -1584,24 +1553,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); @@ -1615,33 +1584,31 @@ static void test_mhtml_protocol(void) static void test_MimeOleObjectFromMoniker(void) { IMoniker *mon, *new_mon; - WCHAR *mhtml_url, *url; + WCHAR *mhtml_url; IBindCtx *bind_ctx; IUnknown *unk; unsigned i; HRESULT hres; static const struct { - const char *url; - const char *mhtml_url; + const WCHAR *url; + const WCHAR *mhtml_url; } tests[] = { - {"file:///x:\\dir\\file.mht", "mhtml:file://x:\\dir\\file.mht"}, - {"file:///x:/dir/file.mht", "mhtml:file://x:\\dir\\file.mht"}, - {"http://www.winehq.org/index.html?query#hash", "mhtml:http://www.winehq.org/index.html?query#hash"}, - {"../test.mht", "mhtml:../test.mht"} + {L"file:///x:\\dir\\file.mht", L"mhtml:file://x:\\dir\\file.mht"}, + {L"file:///x:/dir/file.mht", L"mhtml:file://x:\\dir\\file.mht"}, + {L"http://www.winehq.org/index.html?query#hash", L"mhtml:http://www.winehq.org/index.html?query#hash"}, + {L"../test.mht", L"mhtml:../test.mht"} }; for(i = 0; i < ARRAY_SIZE(tests); i++) { - url = a2w(tests[i].url); - hres = CreateURLMoniker(NULL, url, &mon); - ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres); - HeapFree(GetProcessHeap(), 0, url); + hres = CreateURLMoniker(NULL, tests[i].url, &mon); + 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"); @@ -1650,8 +1617,8 @@ static void test_MimeOleObjectFromMoniker(void) } hres = IMoniker_GetDisplayName(new_mon, NULL, NULL, &mhtml_url); - ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres); - ok(!strcmp_wa(mhtml_url, tests[i].mhtml_url), "[%d] unexpected mhtml URL: %s\n", i, wine_dbgstr_w(mhtml_url)); + 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); IUnknown_Release(unk); diff --git a/modules/rostests/winetests/inetcomm/testlist.c b/modules/rostests/winetests/inetcomm/testlist.c deleted file mode 100644 index be36a6a9ca7..00000000000 --- a/modules/rostests/winetests/inetcomm/testlist.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Automatically generated file; DO NOT EDIT!! */ - -#define STANDALONE -#include - -extern void func_mimeintl(void); -extern void func_mimeole(void); - -const struct test winetest_testlist[] = -{ - { "mimeintl", func_mimeintl }, - { "mimeole", func_mimeole }, - { 0, 0 } -};