From de6d0f24bc768e476996a03e04928a4a864dd31c Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 20 Dec 2017 13:21:11 +0100 Subject: [PATCH] [OLEAUT32_WINETEST] Add a PCH. --- .../winetests/oleaut32/CMakeLists.txt | 7 ++- .../rostests/winetests/oleaut32/dispatch.c | 14 +---- modules/rostests/winetests/oleaut32/olefont.c | 25 +------- .../rostests/winetests/oleaut32/olepicture.c | 59 ++++++------------- modules/rostests/winetests/oleaut32/precomp.h | 23 ++++++++ .../rostests/winetests/oleaut32/safearray.c | 24 +------- .../rostests/winetests/oleaut32/tmarshal.c | 19 +----- .../winetests/oleaut32/tmarshal_dispids.h | 2 + modules/rostests/winetests/oleaut32/typelib.c | 22 +------ .../rostests/winetests/oleaut32/usrmarshal.c | 17 +----- .../rostests/winetests/oleaut32/varformat.c | 22 +------ modules/rostests/winetests/oleaut32/vartest.c | 23 +------- modules/rostests/winetests/oleaut32/vartype.c | 14 +---- 13 files changed, 55 insertions(+), 216 deletions(-) create mode 100644 modules/rostests/winetests/oleaut32/precomp.h diff --git a/modules/rostests/winetests/oleaut32/CMakeLists.txt b/modules/rostests/winetests/oleaut32/CMakeLists.txt index e1d61fee9bb..bd9c0f47b68 100644 --- a/modules/rostests/winetests/oleaut32/CMakeLists.txt +++ b/modules/rostests/winetests/oleaut32/CMakeLists.txt @@ -10,7 +10,6 @@ list(APPEND SOURCE olefont.c olepicture.c safearray.c - testlist.c tmarshal.c typelib.c usrmarshal.c @@ -19,7 +18,8 @@ list(APPEND SOURCE vartype.c ${CMAKE_CURRENT_BINARY_DIR}/test_reg_i.c ${CMAKE_CURRENT_BINARY_DIR}/test_tlb_i.c - ${CMAKE_CURRENT_BINARY_DIR}/tmarshal_i.c) + ${CMAKE_CURRENT_BINARY_DIR}/tmarshal_i.c + precomp.h) set(tmarshal.rc_DEPS ${CMAKE_CURRENT_BINARY_DIR}/test_reg.tlb @@ -27,7 +27,7 @@ set(tmarshal.rc_DEPS ${CMAKE_CURRENT_BINARY_DIR}/tmarshal.tlb) set_source_files_properties(tmarshal.rc PROPERTIES OBJECT_DEPENDS "${tmarshal.rc_DEPS}") -add_executable(oleaut32_winetest ${SOURCE} tmarshal.rc) +add_executable(oleaut32_winetest ${SOURCE} testlist.c tmarshal.rc) target_link_libraries(oleaut32_winetest uuid) set_module_type(oleaut32_winetest win32cui) add_importlibs(oleaut32_winetest oleaut32 ole32 rpcrt4 user32 gdi32 advapi32 msvcrt kernel32) @@ -37,4 +37,5 @@ if(MSVC) endif() add_dependencies(oleaut32_winetest stdole2 oleaut32_idlheaders) +add_pch(oleaut32_winetest precomp.h SOURCE) add_rostests_file(TARGET oleaut32_winetest) diff --git a/modules/rostests/winetests/oleaut32/dispatch.c b/modules/rostests/winetests/oleaut32/dispatch.c index d5ac4f0383e..722488da318 100644 --- a/modules/rostests/winetests/oleaut32/dispatch.c +++ b/modules/rostests/winetests/oleaut32/dispatch.c @@ -18,19 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS -#define CONST_VTABLE - -#include -//#include -//#include -#include -#include -//#include +#include "precomp.h" static const WCHAR szSunshine[] = {'S','u','n','s','h','i','n','e',0}; diff --git a/modules/rostests/winetests/oleaut32/olefont.c b/modules/rostests/winetests/oleaut32/olefont.c index 5cf49871738..9763271208b 100644 --- a/modules/rostests/winetests/oleaut32/olefont.c +++ b/modules/rostests/winetests/oleaut32/olefont.c @@ -20,30 +20,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -//#include -//#include -//#include -//#include - -#define COBJMACROS - -#include -//#include -//#include -//#include -#include -//#include -//#include -//#include -//#include -//#include -#include -#include -//#include +#include "precomp.h" DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); diff --git a/modules/rostests/winetests/oleaut32/olepicture.c b/modules/rostests/winetests/oleaut32/olepicture.c index 1b8e3957cca..02d68a41713 100644 --- a/modules/rostests/winetests/oleaut32/olepicture.c +++ b/modules/rostests/winetests/oleaut32/olepicture.c @@ -19,32 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -//#include -#include -//#include -//#include - -#define COBJMACROS -#define CONST_VTABLE -#define NONAMELESSUNION - -#include -//#include -//#include -//#include -#include -#include -//#include -//#include -#include -//#include -//#include -#include -//#include +#include "precomp.h" #define expect_eq(expr, value, type, format) { type ret = (expr); ok((value) == ret, #expr " expected " format " got " format "\n", value, ret); } @@ -761,8 +736,8 @@ static void test_Render(void) desc.cbSizeofstruct = sizeof(PICTDESC); desc.picType = PICTYPE_ICON; - desc.u.icon.hicon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); - if(!desc.u.icon.hicon){ + desc.icon.hicon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); + if(!desc.icon.hicon){ win_skip("LoadIcon failed. Skipping...\n"); delete_render_dc(hdc); return; @@ -1065,14 +1040,14 @@ static void test_himetric(void) desc.cbSizeofstruct = sizeof(desc); desc.picType = PICTYPE_BITMAP; - desc.u.bmp.hpal = NULL; + desc.bmp.hpal = NULL; hdc = CreateCompatibleDC(0); bmp = CreateBitmap(1.9 * GetDeviceCaps(hdc, LOGPIXELSX), 1.9 * GetDeviceCaps(hdc, LOGPIXELSY), 1, 1, NULL); - desc.u.bmp.hbitmap = bmp; + desc.bmp.hbitmap = bmp; /* size in himetric units reported rounded up to next integer value */ hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic); @@ -1099,7 +1074,7 @@ static void test_himetric(void) ok(icon != NULL, "failed to create icon\n"); desc.picType = PICTYPE_ICON; - desc.u.icon.hicon = icon; + desc.icon.hicon = icon; hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1138,8 +1113,8 @@ static void test_load_save_bmp(void) desc.cbSizeofstruct = sizeof(desc); desc.picType = PICTYPE_BITMAP; - desc.u.bmp.hpal = 0; - desc.u.bmp.hbitmap = CreateBitmap(1, 1, 1, 1, NULL); + desc.bmp.hpal = 0; + desc.bmp.hbitmap = CreateBitmap(1, 1, 1, 1, NULL); hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic); ok(hr == S_OK, "OleCreatePictureIndirect error %#x\n", hr); @@ -1150,7 +1125,7 @@ static void test_load_save_bmp(void) hr = IPicture_get_Handle(pic, &handle); ok(hr == S_OK,"get_Handle error %#8x\n", hr); - ok(IntToPtr(handle) == desc.u.bmp.hbitmap, "get_Handle returned wrong handle %#x\n", handle); + ok(IntToPtr(handle) == desc.bmp.hbitmap, "get_Handle returned wrong handle %#x\n", handle); hmem = GlobalAlloc(GMEM_ZEROINIT, 4096); hr = CreateStreamOnHGlobal(hmem, FALSE, &dst_stream); @@ -1190,7 +1165,7 @@ static void test_load_save_bmp(void) GlobalUnlock(hmem); GlobalFree(hmem); - DeleteObject(desc.u.bmp.hbitmap); + DeleteObject(desc.bmp.hbitmap); IPicture_Release(pic); } @@ -1210,7 +1185,7 @@ static void test_load_save_icon(void) desc.cbSizeofstruct = sizeof(desc); desc.picType = PICTYPE_ICON; - desc.u.icon.hicon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); + desc.icon.hicon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic); ok(hr == S_OK, "OleCreatePictureIndirect error %#x\n", hr); @@ -1221,7 +1196,7 @@ static void test_load_save_icon(void) hr = IPicture_get_Handle(pic, &handle); ok(hr == S_OK,"get_Handle error %#8x\n", hr); - ok(IntToPtr(handle) == desc.u.icon.hicon, "get_Handle returned wrong handle %#x\n", handle); + ok(IntToPtr(handle) == desc.icon.hicon, "get_Handle returned wrong handle %#x\n", handle); hmem = GlobalAlloc(GMEM_ZEROINIT, 8192); hr = CreateStreamOnHGlobal(hmem, FALSE, &dst_stream); @@ -1263,7 +1238,7 @@ todo_wine GlobalUnlock(hmem); GlobalFree(hmem); - DestroyIcon(desc.u.icon.hicon); + DestroyIcon(desc.icon.hicon); IPicture_Release(pic); } @@ -1397,8 +1372,8 @@ static void test_load_save_emf(void) desc.cbSizeofstruct = sizeof(desc); desc.picType = PICTYPE_ENHMETAFILE; - desc.u.emf.hemf = CloseEnhMetaFile(hdc); - ok(desc.u.emf.hemf != 0, "CloseEnhMetaFile failed\n"); + desc.emf.hemf = CloseEnhMetaFile(hdc); + ok(desc.emf.hemf != 0, "CloseEnhMetaFile failed\n"); hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic); ok(hr == S_OK, "OleCreatePictureIndirect error %#x\n", hr); @@ -1409,7 +1384,7 @@ static void test_load_save_emf(void) hr = IPicture_get_Handle(pic, &handle); ok(hr == S_OK,"get_Handle error %#8x\n", hr); - ok(IntToPtr(handle) == desc.u.emf.hemf, "get_Handle returned wrong handle %#x\n", handle); + ok(IntToPtr(handle) == desc.emf.hemf, "get_Handle returned wrong handle %#x\n", handle); hmem = GlobalAlloc(GMEM_MOVEABLE, 0); hr = CreateStreamOnHGlobal(hmem, FALSE, &dst_stream); @@ -1455,7 +1430,7 @@ if (size) GlobalUnlock(hmem); GlobalFree(hmem); - DeleteEnhMetaFile(desc.u.emf.hemf); + DeleteEnhMetaFile(desc.emf.hemf); IPicture_Release(pic); } diff --git a/modules/rostests/winetests/oleaut32/precomp.h b/modules/rostests/winetests/oleaut32/precomp.h new file mode 100644 index 00000000000..eb417ca71f0 --- /dev/null +++ b/modules/rostests/winetests/oleaut32/precomp.h @@ -0,0 +1,23 @@ +#ifndef _OLEAUT32_WINETEST_PRECOMP_H_ +#define _OLEAUT32_WINETEST_PRECOMP_H_ + +#include +#include + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS +#define CONST_VTABLE + +#include + +#include +#include +#include +#include +#include +#include + +#endif /* !_OLEAUT32_WINETEST_PRECOMP_H_ */ diff --git a/modules/rostests/winetests/oleaut32/safearray.c b/modules/rostests/winetests/oleaut32/safearray.c index a73829dead3..06dbb269a6f 100644 --- a/modules/rostests/winetests/oleaut32/safearray.c +++ b/modules/rostests/winetests/oleaut32/safearray.c @@ -19,29 +19,7 @@ * */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -//#include -#include -//#include -//#include - -#define COBJMACROS -#define CONST_VTABLE -#include -//#include "windef.h" -//#include "winbase.h" -//#include "winuser.h" -//#include "wingdi.h" -//#include "winnls.h" -//#include "winsock.h" -//#include "winerror.h" -//#include "winnt.h" -#include -//#include "wtypes.h" -#include +#include "precomp.h" #ifndef FADF_CREATEVECTOR const USHORT FADF_CREATEVECTOR = 0x2000; diff --git a/modules/rostests/winetests/oleaut32/tmarshal.c b/modules/rostests/winetests/oleaut32/tmarshal.c index 8ee2f808bff..c801494c495 100644 --- a/modules/rostests/winetests/oleaut32/tmarshal.c +++ b/modules/rostests/winetests/oleaut32/tmarshal.c @@ -17,25 +17,8 @@ * */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H +#include "precomp.h" -#define COBJMACROS -#define CONST_VTABLE - -//#include -#include -#include -#include -#include -#include -//#include -//#include - -#include - -#include #include "tmarshal_dispids.h" static HRESULT (WINAPI *pVarAdd)(LPVARIANT,LPVARIANT,LPVARIANT); diff --git a/modules/rostests/winetests/oleaut32/tmarshal_dispids.h b/modules/rostests/winetests/oleaut32/tmarshal_dispids.h index 26f40273bfb..9cdc12a7b7e 100644 --- a/modules/rostests/winetests/oleaut32/tmarshal_dispids.h +++ b/modules/rostests/winetests/oleaut32/tmarshal_dispids.h @@ -17,6 +17,8 @@ * */ +#pragma once + #define DISPID_TM_NAME 1 #define DISPID_TM_DOSOMETHING 2 #define DISPID_TM_STATE 3 diff --git a/modules/rostests/winetests/oleaut32/typelib.c b/modules/rostests/winetests/oleaut32/typelib.c index 8d5687f71ea..c6626991c0b 100644 --- a/modules/rostests/winetests/oleaut32/typelib.c +++ b/modules/rostests/winetests/oleaut32/typelib.c @@ -19,30 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H +#include "precomp.h" -#define COBJMACROS -#define CONST_VTABLE - -#include -//#include -#include - -//#include "windef.h" -//#include "winbase.h" -#include #include -#include -#include -//#include "ocidl.h" -//#include "shlwapi.h" -#include -#include - #include -#include #define expect_eq(expr, value, type, format) { type _ret = (expr); ok((value) == _ret, #expr " expected " format " got " format "\n", value, _ret); } #define expect_int(expr, value) expect_eq(expr, (int)(value), int, "%d") diff --git a/modules/rostests/winetests/oleaut32/usrmarshal.c b/modules/rostests/winetests/oleaut32/usrmarshal.c index 924183e9aab..d570842a4eb 100644 --- a/modules/rostests/winetests/oleaut32/usrmarshal.c +++ b/modules/rostests/winetests/oleaut32/usrmarshal.c @@ -18,22 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS -#define CONST_VTABLE - -#include - -#include -#include -#include -//#include "objbase.h" -//#include "propidl.h" /* for LPSAFEARRAY_User* routines */ - -#include +#include "precomp.h" #if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION) # define V_U2(A) ((A)->n1.n2) diff --git a/modules/rostests/winetests/oleaut32/varformat.c b/modules/rostests/winetests/oleaut32/varformat.c index cabab801b72..78faa277e46 100644 --- a/modules/rostests/winetests/oleaut32/varformat.c +++ b/modules/rostests/winetests/oleaut32/varformat.c @@ -19,27 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -//#include -//#include -//#include -//#include - -//#include "windef.h" -//#include "winbase.h" -//#include "winsock.h" -#include -//#include "winuser.h" -//#include "wingdi.h" -#include -//#include "winerror.h" -//#include "winnt.h" -#include -//#include "wtypes.h" -#include +#include "precomp.h" static HMODULE hOleaut32; diff --git a/modules/rostests/winetests/oleaut32/vartest.c b/modules/rostests/winetests/oleaut32/vartest.c index 770ca826809..38eb1806a8d 100644 --- a/modules/rostests/winetests/oleaut32/vartest.c +++ b/modules/rostests/winetests/oleaut32/vartest.c @@ -19,31 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H +#include "precomp.h" -//#include -#include -#include #include -#define COBJMACROS -#define CONST_VTABLE - -//#include "windef.h" -//#include "winbase.h" -//#include "winsock.h" -#include -//#include "winuser.h" -//#include "wingdi.h" -#include -//#include "winerror.h" -//#include "winnt.h" -#include -//#include "wtypes.h" -#include - static HMODULE hOleaut32; static HRESULT (WINAPI *pVarUdateFromDate)(DATE,ULONG,UDATE*); diff --git a/modules/rostests/winetests/oleaut32/vartype.c b/modules/rostests/winetests/oleaut32/vartype.c index e6a577c8448..5086e4b500b 100644 --- a/modules/rostests/winetests/oleaut32/vartype.c +++ b/modules/rostests/winetests/oleaut32/vartype.c @@ -18,19 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define CONST_VTABLE -#define COBJMACROS - -#include -#include -#include -#include -#include -#include +#include "precomp.h" #include