From e32018ba19bef687b25e48b1351214aed7a6329a Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 20 Dec 2017 13:29:32 +0100 Subject: [PATCH] [SHELL32_WINETEST] Add a PCH. --- .../rostests/winetests/shell32/CMakeLists.txt | 6 +++- modules/rostests/winetests/shell32/appbar.c | 7 +---- modules/rostests/winetests/shell32/assoc.c | 11 ++----- .../rostests/winetests/shell32/autocomplete.c | 11 +------ .../rostests/winetests/shell32/brsfolder.c | 9 +----- modules/rostests/winetests/shell32/ebrowser.c | 14 ++------- .../rostests/winetests/shell32/generated.c | 17 +---------- modules/rostests/winetests/shell32/msg.h | 4 +-- modules/rostests/winetests/shell32/precomp.h | 30 +++++++++++++++++++ .../rostests/winetests/shell32/progman_dde.c | 8 +---- .../rostests/winetests/shell32/recyclebin.c | 7 +---- .../rostests/winetests/shell32/shell32_test.h | 1 + .../winetests/shell32/shelldispatch.c | 12 ++------ .../rostests/winetests/shell32/shelllink.c | 15 +--------- modules/rostests/winetests/shell32/shellole.c | 25 ++++++---------- .../rostests/winetests/shell32/shellpath.c | 15 ++-------- .../winetests/shell32/shfldr_special.c | 20 +++---------- modules/rostests/winetests/shell32/shlexec.c | 19 +----------- .../rostests/winetests/shell32/shlfileop.c | 14 +-------- .../rostests/winetests/shell32/shlfolder.c | 21 +------------ modules/rostests/winetests/shell32/shlview.c | 22 +------------- modules/rostests/winetests/shell32/string.c | 13 +------- modules/rostests/winetests/shell32/systray.c | 7 +---- 23 files changed, 73 insertions(+), 235 deletions(-) create mode 100644 modules/rostests/winetests/shell32/precomp.h diff --git a/modules/rostests/winetests/shell32/CMakeLists.txt b/modules/rostests/winetests/shell32/CMakeLists.txt index 7d33d85e3e4..ded63d7065f 100644 --- a/modules/rostests/winetests/shell32/CMakeLists.txt +++ b/modules/rostests/winetests/shell32/CMakeLists.txt @@ -23,10 +23,13 @@ list(APPEND SOURCE shlview.c string.c systray.c + precomp.h) + +add_executable(shell32_winetest + ${SOURCE} testlist.c rsrc.rc) -add_executable(shell32_winetest ${SOURCE}) target_link_libraries(shell32_winetest uuid) set_module_type(shell32_winetest win32cui) add_importlibs(shell32_winetest shell32 ole32 oleaut32 user32 gdi32 advapi32 msvcrt kernel32) @@ -35,4 +38,5 @@ if(MSVC) add_importlibs(shell32_winetest ntdll) endif() +add_pch(shell32_winetest precomp.h SOURCE) add_rostests_file(TARGET shell32_winetest) diff --git a/modules/rostests/winetests/shell32/appbar.c b/modules/rostests/winetests/shell32/appbar.c index 1505a40aeb8..f25fed91591 100644 --- a/modules/rostests/winetests/shell32/appbar.c +++ b/modules/rostests/winetests/shell32/appbar.c @@ -17,12 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#include -#include "shellapi.h" - -#include "wine/test.h" +#include "precomp.h" #define MSG_APPBAR WM_APP diff --git a/modules/rostests/winetests/shell32/assoc.c b/modules/rostests/winetests/shell32/assoc.c index 2cd06d2c08e..ac6edef099c 100644 --- a/modules/rostests/winetests/shell32/assoc.c +++ b/modules/rostests/winetests/shell32/assoc.c @@ -17,16 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COBJMACROS - -#include - -#include "shlwapi.h" -#include "shlguid.h" -#include "shobjidl.h" - -#include "wine/test.h" +#include "precomp.h" +#include static void test_IQueryAssociations_QueryInterface(void) { diff --git a/modules/rostests/winetests/shell32/autocomplete.c b/modules/rostests/winetests/shell32/autocomplete.c index 63a2eb2b11e..c2c02e2ca9e 100644 --- a/modules/rostests/winetests/shell32/autocomplete.c +++ b/modules/rostests/winetests/shell32/autocomplete.c @@ -18,16 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COBJMACROS - -#include -#include - -#include "windows.h" -#include "shobjidl.h" -#include "shlguid.h" -#include "initguid.h" -#include "shldisp.h" +#include "precomp.h" static HWND hMainWnd, hEdit; static HINSTANCE hinst; diff --git a/modules/rostests/winetests/shell32/brsfolder.c b/modules/rostests/winetests/shell32/brsfolder.c index bf29d1169f2..d564ed5e618 100644 --- a/modules/rostests/winetests/shell32/brsfolder.c +++ b/modules/rostests/winetests/shell32/brsfolder.c @@ -19,15 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COBJMACROS +#include "precomp.h" -#include -#include -#include -#include -#include "shellapi.h" - -#include "wine/test.h" #define IDD_MAKENEWFOLDER 0x3746 /* From "../shresdef.h" */ #define TIMER_WAIT_MS 50 /* Should be long enough for slow systems */ diff --git a/modules/rostests/winetests/shell32/ebrowser.c b/modules/rostests/winetests/shell32/ebrowser.c index 7db584225e2..27beff5eccf 100644 --- a/modules/rostests/winetests/shell32/ebrowser.c +++ b/modules/rostests/winetests/shell32/ebrowser.c @@ -18,18 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include "precomp.h" -#define COBJMACROS -#define CONST_VTABLE - -#include "shlobj.h" -#include "shlwapi.h" - -#include "wine/test.h" - -#include "initguid.h" -#include "mshtml.h" +#include +#include /********************************************************************** * Some IIDs for test_SetSite. diff --git a/modules/rostests/winetests/shell32/generated.c b/modules/rostests/winetests/shell32/generated.c index ace877eb420..b18fdec02c1 100755 --- a/modules/rostests/winetests/shell32/generated.c +++ b/modules/rostests/winetests/shell32/generated.c @@ -5,22 +5,7 @@ * Unit tests for data structure packing */ -#define WINVER 0x0501 -#define _WIN32_IE 0x0501 -#define _WIN32_WINNT 0x0501 - -#define WINE_NOWINSOCK - -#include -#include "windef.h" -#include "winbase.h" -#include "wtypes.h" -#include "shellapi.h" -#include "winuser.h" -#include "wingdi.h" -#include "shlobj.h" - -#include "wine/test.h" +#include "precomp.h" /*********************************************************************** * Compatibility macros diff --git a/modules/rostests/winetests/shell32/msg.h b/modules/rostests/winetests/shell32/msg.h index a457fd4fce5..7afdc7af895 100644 --- a/modules/rostests/winetests/shell32/msg.h +++ b/modules/rostests/winetests/shell32/msg.h @@ -18,9 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include -#include "wine/test.h" +#pragma once /* undocumented SWP flags - from SDK 3.1 */ #define SWP_NOCLIENTSIZE 0x0800 diff --git a/modules/rostests/winetests/shell32/precomp.h b/modules/rostests/winetests/shell32/precomp.h new file mode 100644 index 00000000000..ffa1f861d57 --- /dev/null +++ b/modules/rostests/winetests/shell32/precomp.h @@ -0,0 +1,30 @@ +#ifndef _SHELL32_WINETEST_PRECOMP_H_ +#define _SHELL32_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 +#include +#include +#include +#include +#include + +#include "shell32_test.h" + +#endif /* !_SHELL32_WINETEST_PRECOMP_H_ */ diff --git a/modules/rostests/winetests/shell32/progman_dde.c b/modules/rostests/winetests/shell32/progman_dde.c index 6e1378ff84b..bb566ba1253 100644 --- a/modules/rostests/winetests/shell32/progman_dde.c +++ b/modules/rostests/winetests/shell32/progman_dde.c @@ -26,13 +26,7 @@ * Tests for Invalid Characters in Names / Invalid Parameters */ -#include -#include -#include -#include "dde.h" -#include "ddeml.h" -#include "winuser.h" -#include "shlobj.h" +#include "precomp.h" /* Timeout on DdeClientTransaction Call */ #define MS_TIMEOUT_VAL 1000 diff --git a/modules/rostests/winetests/shell32/recyclebin.c b/modules/rostests/winetests/shell32/recyclebin.c index 50e262e918d..7cb8f6e8cae 100644 --- a/modules/rostests/winetests/shell32/recyclebin.c +++ b/modules/rostests/winetests/shell32/recyclebin.c @@ -18,12 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_LEAN_AND_MEAN -#include -#include "shellapi.h" - -#include -#include "wine/test.h" +#include "precomp.h" static int (WINAPI *pSHQueryRecycleBinA)(LPCSTR,LPSHQUERYRBINFO); static int (WINAPI *pSHFileOperationA)(LPSHFILEOPSTRUCTA); diff --git a/modules/rostests/winetests/shell32/shell32_test.h b/modules/rostests/winetests/shell32/shell32_test.h index 42a74fb2d5f..906dcac0339 100755 --- a/modules/rostests/winetests/shell32/shell32_test.h +++ b/modules/rostests/winetests/shell32/shell32_test.h @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma once /* Helper function for creating .lnk files */ typedef struct diff --git a/modules/rostests/winetests/shell32/shelldispatch.c b/modules/rostests/winetests/shell32/shelldispatch.c index 04f664c1cfa..30b31335479 100644 --- a/modules/rostests/winetests/shell32/shelldispatch.c +++ b/modules/rostests/winetests/shell32/shelldispatch.c @@ -18,16 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT +#include "precomp.h" -#include "shldisp.h" -#include "shlobj.h" -#include "shlwapi.h" -#include "wine/test.h" - -#include "initguid.h" +#include +#include #define EXPECT_HR(hr,hr_exp) \ ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp) diff --git a/modules/rostests/winetests/shell32/shelllink.c b/modules/rostests/winetests/shell32/shelllink.c index 050c0339ba5..5e995db54ed 100755 --- a/modules/rostests/winetests/shell32/shelllink.c +++ b/modules/rostests/winetests/shell32/shelllink.c @@ -19,20 +19,7 @@ * */ -#define COBJMACROS - -#include "initguid.h" -#include "windows.h" -#include "shlguid.h" -#include "shobjidl.h" -#include "shlobj.h" -#include "shellapi.h" -#include "commoncontrols.h" -#include "wine/test.h" - -#include "shell32_test.h" - -#include +#include "precomp.h" #ifndef SLDF_HAS_LOGO3ID # define SLDF_HAS_LOGO3ID 0x00000800 /* not available in the Vista SDK */ diff --git a/modules/rostests/winetests/shell32/shellole.c b/modules/rostests/winetests/shell32/shellole.c index eedbdf677c1..f2485928e4d 100644 --- a/modules/rostests/winetests/shell32/shellole.c +++ b/modules/rostests/winetests/shell32/shellole.c @@ -16,16 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COBJMACROS -#define CONST_VTABLE -#define NONAMELESSUNION +#include "precomp.h" -#include -#include - -#include "winbase.h" -#include "shlobj.h" -#include "initguid.h" +#include DEFINE_GUID(FMTID_Test,0x12345678,0x1234,0x1234,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12); DEFINE_GUID(FMTID_NotExisting, 0x12345678,0x1234,0x1234,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x13); @@ -116,10 +109,10 @@ static HRESULT WINAPI PropertyStorage_ReadMultiple(IPropertyStorage *This, ULONG ok(rgpropvar != NULL, "rgpropvar = NULL\n"); ok(rgpspec[0].ulKind == PRSPEC_PROPID, "rgpspec[0].ulKind = %d\n", rgpspec[0].ulKind); - ok(rgpspec[0].u.propid == PID_CODEPAGE, "rgpspec[0].propid = %d\n", rgpspec[0].u.propid); + ok(rgpspec[0].propid == PID_CODEPAGE, "rgpspec[0].propid = %d\n", rgpspec[0].propid); rgpropvar[0].vt = VT_I2; - rgpropvar[0].u.iVal = 1234; + rgpropvar[0].iVal = 1234; } else { CHECK_EXPECT(ReadMultiple); @@ -130,13 +123,13 @@ static HRESULT WINAPI PropertyStorage_ReadMultiple(IPropertyStorage *This, ULONG ok(rgpropvar[0].vt==0 || broken(rgpropvar[0].vt==VT_BSTR), "rgpropvar[0].vt = %d\n", rgpropvar[0].vt); rgpropvar[0].vt = VT_BSTR; - rgpropvar[0].u.bstrVal = (void*)0xdeadbeef; + rgpropvar[0].bstrVal = (void*)0xdeadbeef; rgpropvar[1].vt = VT_LPSTR; - rgpropvar[1].u.pszVal = (void*)0xdeadbeef; + rgpropvar[1].pszVal = (void*)0xdeadbeef; rgpropvar[2].vt = VT_BYREF|VT_I1; - rgpropvar[2].u.pcVal = (void*)0xdeadbeef; + rgpropvar[2].pcVal = (void*)0xdeadbeef; rgpropvar[3].vt = VT_BYREF|VT_VARIANT; - rgpropvar[3].u.pvarVal = (void*)0xdeadbeef; + rgpropvar[3].pvarVal = (void*)0xdeadbeef; } return S_OK; @@ -419,7 +412,7 @@ static void test_SHPropStg_functions(void) CHECK_CALLED(WriteMultiple); read[0].vt = VT_BSTR; - read[0].u.bstrVal = (void*)0xdeadbeef; + read[0].bstrVal = (void*)0xdeadbeef; SET_EXPECT(ReadMultiple); SET_EXPECT(ReadMultipleCodePage); SET_EXPECT(Stat); diff --git a/modules/rostests/winetests/shell32/shellpath.c b/modules/rostests/winetests/shell32/shellpath.c index 9fea876e8bd..02eecb972a6 100644 --- a/modules/rostests/winetests/shell32/shellpath.c +++ b/modules/rostests/winetests/shell32/shellpath.c @@ -21,20 +21,9 @@ * namespace) path for a given folder (CSIDL value). */ -#define COBJMACROS +#include "precomp.h" -#include -#include -#include "windef.h" -#include "winbase.h" -#include "shlguid.h" -#include "shlobj.h" -#include "shlwapi.h" -#include "knownfolders.h" -#include "shellapi.h" -#include "wine/test.h" - -#include "initguid.h" +#include /* CSIDL_MYDOCUMENTS is now the same as CSIDL_PERSONAL, but what we want * here is its original value. diff --git a/modules/rostests/winetests/shell32/shfldr_special.c b/modules/rostests/winetests/shell32/shfldr_special.c index dd4cc044023..08efed9720a 100644 --- a/modules/rostests/winetests/shell32/shfldr_special.c +++ b/modules/rostests/winetests/shell32/shfldr_special.c @@ -19,19 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#define WIN32_LEAN_AND_MEAN -#include -#include "shellapi.h" -#include "shlobj.h" - -#include "wine/test.h" +#include "precomp.h" static inline BOOL SHELL_OsIsUnicode(void) { @@ -164,10 +152,10 @@ if (0) hr = IShellFolder2_GetDefaultColumnState(folder, 6, &state); ok(broken(hr == E_NOTIMPL) || hr == E_INVALIDARG /* Win7 */, "got 0x%08x\n", hr); - details.str.u.pOleStr = NULL; + details.str.pOleStr = NULL; hr = IShellFolder2_GetDetailsOf(folder, NULL, 0, &details); ok(hr == S_OK || broken(hr == E_NOTIMPL) /* W2K */, "got 0x%08x\n", hr); - if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr); + if (SHELL_OsIsUnicode()) SHFree(details.str.pOleStr); /* test every column if method is implemented */ if (hr == S_OK) @@ -183,7 +171,7 @@ if (0) ok(details.fmt == LVCFMT_LEFT, "got 0x%x\n", details.fmt); /* can't be on w9x at this point, IShellFolder2 unsupported there, check present for running Wine with w9x setup */ - if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr); + if (SHELL_OsIsUnicode()) SHFree(details.str.pOleStr); hr = IShellFolder2_GetDefaultColumnState(folder, i, &state); ok(hr == S_OK, "got 0x%08x\n", hr); diff --git a/modules/rostests/winetests/shell32/shlexec.c b/modules/rostests/winetests/shell32/shlexec.c index f0f51f54568..34f76e3e3b6 100755 --- a/modules/rostests/winetests/shell32/shlexec.c +++ b/modules/rostests/winetests/shell32/shlexec.c @@ -30,24 +30,7 @@ * we could check */ -/* Needed to get SEE_MASK_NOZONECHECKS with the PSDK */ -#define NTDDI_WINXPSP1 0x05010100 -#define NTDDI_VERSION NTDDI_WINXPSP1 -#define _WIN32_WINNT 0x0501 - -#include -#include - -#include "wtypes.h" -#include "winbase.h" -#include "windef.h" -#include "shellapi.h" -#include "shlwapi.h" -#include "ddeml.h" -#include "wine/test.h" - -#include "shell32_test.h" - +#include "precomp.h" static char argv0[MAX_PATH]; static int myARGC; diff --git a/modules/rostests/winetests/shell32/shlfileop.c b/modules/rostests/winetests/shell32/shlfileop.c index 0f44082e596..4e898586e3e 100644 --- a/modules/rostests/winetests/shell32/shlfileop.c +++ b/modules/rostests/winetests/shell32/shlfileop.c @@ -18,19 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include - -#define COBJMACROS -#define WINE_NOWINSOCK -#include -#include "shellapi.h" -#include "shlobj.h" -#include "commoncontrols.h" - -#include "wine/test.h" - -#include +#include "precomp.h" #ifndef FOF_NORECURSION #define FOF_NORECURSION 0x1000 diff --git a/modules/rostests/winetests/shell32/shlfolder.c b/modules/rostests/winetests/shell32/shlfolder.c index 1e03978dbc0..8d2481ffc4d 100644 --- a/modules/rostests/winetests/shell32/shlfolder.c +++ b/modules/rostests/winetests/shell32/shlfolder.c @@ -18,26 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include - -#define COBJMACROS -#define CONST_VTABLE - -#include "windef.h" -#include "winbase.h" -#include "wtypes.h" -#include "shellapi.h" - - -#include "shlguid.h" -#include "shlobj.h" -#include "shobjidl.h" -#include "shlwapi.h" -#include "ocidl.h" -#include "oleauto.h" - -#include "wine/test.h" +#include "precomp.h" #include DEFINE_GUID(IID_IParentAndItem, 0xB3A4B685, 0xB685, 0x4805, 0x99,0xD9, 0x5D,0xEA,0xD2,0x87,0x32,0x36); diff --git a/modules/rostests/winetests/shell32/shlview.c b/modules/rostests/winetests/shell32/shlview.c index 76855067c02..5b08473cfd3 100644 --- a/modules/rostests/winetests/shell32/shlview.c +++ b/modules/rostests/winetests/shell32/shlview.c @@ -18,27 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include - -#define COBJMACROS -#define CONST_VTABLE - -#include "windef.h" -#include "winbase.h" -#include "wtypes.h" -#include "shellapi.h" - -#include "shlguid.h" -#include "shlobj.h" -#include "shobjidl.h" -#include "shlwapi.h" -#include "ocidl.h" -#include "oleauto.h" - -#include "initguid.h" - -#include "wine/test.h" +#include "precomp.h" #include "msg.h" diff --git a/modules/rostests/winetests/shell32/string.c b/modules/rostests/winetests/shell32/string.c index 6cdb386eba6..4d7096203c2 100755 --- a/modules/rostests/winetests/shell32/string.c +++ b/modules/rostests/winetests/shell32/string.c @@ -18,18 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include - -#define WINE_NOWINSOCK -#include "windef.h" -#include "winbase.h" -#include "wtypes.h" -#include "shellapi.h" -#include "shtypes.h" -#include "objbase.h" - -#include "wine/test.h" +#include "precomp.h" static HMODULE hShell32; static BOOL (WINAPI *pStrRetToStrNAW)(LPVOID,DWORD,LPSTRRET,const ITEMIDLIST *); diff --git a/modules/rostests/winetests/shell32/systray.c b/modules/rostests/winetests/shell32/systray.c index 4af10f040dd..5473868de36 100644 --- a/modules/rostests/winetests/shell32/systray.c +++ b/modules/rostests/winetests/shell32/systray.c @@ -16,13 +16,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define _WIN32_IE 0x600 -#include - -#include - -#include "wine/test.h" +#include "precomp.h" static HWND hMainWnd; static BOOL (WINAPI *pShell_NotifyIconW)(DWORD,PNOTIFYICONDATAW);