From: Amine Khaldi Date: Wed, 20 Dec 2017 12:07:06 +0000 (+0100) Subject: [NTDLL_WINETEST] Add a PCH. X-Git-Tag: 0.4.9-dev~611 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=a76e7d13e2b52f91a52a62150906b84fed7d6a21 [NTDLL_WINETEST] Add a PCH. --- diff --git a/modules/rostests/winetests/ntdll/CMakeLists.txt b/modules/rostests/winetests/ntdll/CMakeLists.txt index 0bbc8d33a1f..2e9a5ef2d22 100644 --- a/modules/rostests/winetests/ntdll/CMakeLists.txt +++ b/modules/rostests/winetests/ntdll/CMakeLists.txt @@ -24,15 +24,13 @@ list(APPEND SOURCE rtlstr.c string.c time.c - testlist.c) + ntdll_test.h) if(ARCH STREQUAL "i386") - list(APPEND SOURCE - generated.c - ) + list(APPEND SOURCE generated.c) endif() -add_executable(ntdll_winetest ${SOURCE}) +add_executable(ntdll_winetest ${SOURCE} testlist.c) if(USE_CLANG_CL OR (NOT MSVC)) add_target_compile_flags(ntdll_winetest "-Wno-format") @@ -40,4 +38,5 @@ endif() set_module_type(ntdll_winetest win32cui) add_importlibs(ntdll_winetest user32 ole32 advapi32 msvcrt kernel32 ntdll) +add_pch(ntdll_winetest ntdll_test.h SOURCE) add_rostests_file(TARGET ntdll_winetest) diff --git a/modules/rostests/winetests/ntdll/atom.c b/modules/rostests/winetests/ntdll/atom.c index 6a16a8d0b61..e8ad049aa9b 100755 --- a/modules/rostests/winetests/ntdll/atom.c +++ b/modules/rostests/winetests/ntdll/atom.c @@ -21,22 +21,7 @@ * windows. */ -#include -#include - -#include "ntstatus.h" -/* Define WIN32_NO_STATUS so MSVC does not give us duplicate macro - * definition errors when we get to winnt.h - */ -#define WIN32_NO_STATUS - -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "winnls.h" -#include "winuser.h" -#include "wine/test.h" -#include "wine/winternl.h" +#include "ntdll_test.h" #ifndef __WINE_WINTERNL_H typedef unsigned short RTL_ATOM, *PRTL_ATOM; diff --git a/modules/rostests/winetests/ntdll/change.c b/modules/rostests/winetests/ntdll/change.c index fc9a18185a9..8dfc68d788d 100644 --- a/modules/rostests/winetests/ntdll/change.c +++ b/modules/rostests/winetests/ntdll/change.c @@ -18,14 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#define WIN32_NO_STATUS -#include -#include -#include -#include -#include -#include "wine/test.h" +#include "ntdll_test.h" static NTSTATUS (WINAPI *pNtNotifyChangeDirectoryFile)( HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID, diff --git a/modules/rostests/winetests/ntdll/directory.c b/modules/rostests/winetests/ntdll/directory.c index 21f22ad0439..75f371cfa3b 100644 --- a/modules/rostests/winetests/ntdll/directory.c +++ b/modules/rostests/winetests/ntdll/directory.c @@ -24,18 +24,7 @@ * windows. */ -#include -#include - -#include "ntstatus.h" -/* Define WIN32_NO_STATUS so MSVC does not give us duplicate macro - * definition errors when we get to winnt.h - */ -#define WIN32_NO_STATUS - -#include "wine/test.h" -#include "winnls.h" -#include "wine/winternl.h" +#include "ntdll_test.h" static NTSTATUS (WINAPI *pNtClose)( PHANDLE ); static NTSTATUS (WINAPI *pNtOpenFile) ( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, ULONG, ULONG ); diff --git a/modules/rostests/winetests/ntdll/env.c b/modules/rostests/winetests/ntdll/env.c index 8989760f43c..5d024ec319b 100755 --- a/modules/rostests/winetests/ntdll/env.c +++ b/modules/rostests/winetests/ntdll/env.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - #include "ntdll_test.h" static NTSTATUS (WINAPI *pRtlMultiByteToUnicodeN)( LPWSTR dst, DWORD dstlen, LPDWORD reslen, diff --git a/modules/rostests/winetests/ntdll/error.c b/modules/rostests/winetests/ntdll/error.c index 8a7732bdbaa..5f725e647fb 100755 --- a/modules/rostests/winetests/ntdll/error.c +++ b/modules/rostests/winetests/ntdll/error.c @@ -19,19 +19,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include +#include "ntdll_test.h" -#include "ntstatus.h" -#define WIN32_NO_STATUS - -#include "wine/test.h" - -#include "windef.h" -#include "winbase.h" -#include "rpcnterr.h" -#include "winreg.h" -#include "wine/winternl.h" +#include /* FIXME!!! this test checks only mappings, defined by MSDN * It is necessary to add other mappings and to test them diff --git a/modules/rostests/winetests/ntdll/exception.c b/modules/rostests/winetests/ntdll/exception.c index 8dc2d904828..1fb7786f29a 100644 --- a/modules/rostests/winetests/ntdll/exception.c +++ b/modules/rostests/winetests/ntdll/exception.c @@ -18,24 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include +#include "ntdll_test.h" -#ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x500 /* For NTSTATUS */ -#endif - -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#include "ntstatus.h" -#define WIN32_NO_STATUS -#include "windef.h" -#include "winbase.h" -#include "winnt.h" -#include "winreg.h" -#include "wine/winternl.h" -#include "wine/exception.h" -#include "wine/test.h" +#include static void *code_mem; diff --git a/modules/rostests/winetests/ntdll/file.c b/modules/rostests/winetests/ntdll/file.c index 3316399c2f7..36ca9fc0cfd 100644 --- a/modules/rostests/winetests/ntdll/file.c +++ b/modules/rostests/winetests/ntdll/file.c @@ -24,19 +24,7 @@ * windows. */ -#include -#include - -#include "ntstatus.h" -/* Define WIN32_NO_STATUS so MSVC does not give us duplicate macro - * definition errors when we get to winnt.h - */ -#define WIN32_NO_STATUS - -#include "wine/test.h" -#include "wine/winternl.h" -#include "winuser.h" -#include "wine/winioctl.h" +#include "ntdll_test.h" /* FIXME */ typedef struct _REPARSE_DATA_BUFFER { diff --git a/modules/rostests/winetests/ntdll/generated.c b/modules/rostests/winetests/ntdll/generated.c index b099a5c0848..54b43a33747 100755 --- a/modules/rostests/winetests/ntdll/generated.c +++ b/modules/rostests/winetests/ntdll/generated.c @@ -5,16 +5,8 @@ * Unit tests for data structure packing */ -#define WINVER 0x0501 -#define _WIN32_IE 0x0501 -#define _WIN32_WINNT 0x0501 - -#define WINE_NOWINSOCK - #include "ntdll_test.h" -#include "wine/test.h" - /*********************************************************************** * Compatibility macros */ diff --git a/modules/rostests/winetests/ntdll/info.c b/modules/rostests/winetests/ntdll/info.c index d03d26c0b96..f42619a820a 100755 --- a/modules/rostests/winetests/ntdll/info.c +++ b/modules/rostests/winetests/ntdll/info.c @@ -19,8 +19,6 @@ */ #include "ntdll_test.h" -#include -#include static NTSTATUS (WINAPI * pRtlDowncaseUnicodeString)(UNICODE_STRING *, const UNICODE_STRING *, BOOLEAN); static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); diff --git a/modules/rostests/winetests/ntdll/large_int.c b/modules/rostests/winetests/ntdll/large_int.c index 4562e6768e0..2313f9eab82 100755 --- a/modules/rostests/winetests/ntdll/large_int.c +++ b/modules/rostests/winetests/ntdll/large_int.c @@ -21,11 +21,8 @@ * windows. */ -#include - #include "ntdll_test.h" - /* Function ptrs for ntdll calls */ static HMODULE hntdll = 0; static LONGLONG (WINAPI *pRtlExtendedMagicDivide)(LONGLONG, LONGLONG, INT); diff --git a/modules/rostests/winetests/ntdll/ntdll_test.h b/modules/rostests/winetests/ntdll/ntdll_test.h index 84ed6a4a71d..d192e332dd4 100755 --- a/modules/rostests/winetests/ntdll/ntdll_test.h +++ b/modules/rostests/winetests/ntdll/ntdll_test.h @@ -18,14 +18,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#ifndef _NTDLL_TEST_H_ +#define _NTDLL_TEST_H_ + +#include +#include -#include "ntstatus.h" #define WIN32_NO_STATUS -#include "windef.h" -#include "winbase.h" -#include "winnt.h" -#include "winreg.h" +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#include +#include +#include +#include +#include -#include "wine/winternl.h" -#include "wine/test.h" +#endif /* !_NTDLL_TEST_H_ */ diff --git a/modules/rostests/winetests/ntdll/om.c b/modules/rostests/winetests/ntdll/om.c index 651db0a1ee4..49784e59644 100644 --- a/modules/rostests/winetests/ntdll/om.c +++ b/modules/rostests/winetests/ntdll/om.c @@ -20,10 +20,6 @@ */ #include "ntdll_test.h" -#include "wine/winternl.h" -#include "stdio.h" -#include "winnt.h" -#include "stdlib.h" static HANDLE (WINAPI *pCreateWaitableTimerA)(SECURITY_ATTRIBUTES*, BOOL, LPCSTR); static BOOLEAN (WINAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, LPCSTR); diff --git a/modules/rostests/winetests/ntdll/pipe.c b/modules/rostests/winetests/ntdll/pipe.c index a3984e1a9e9..48cfad03b5f 100644 --- a/modules/rostests/winetests/ntdll/pipe.c +++ b/modules/rostests/winetests/ntdll/pipe.c @@ -17,19 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include - -#include "ntstatus.h" -#define WIN32_NO_STATUS -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "winreg.h" -#include "winnls.h" -#include "wine/test.h" -#include "wine/winternl.h" -#include "winioctl.h" +#include "ntdll_test.h" #ifndef __WINE_WINTERNL_H diff --git a/modules/rostests/winetests/ntdll/port.c b/modules/rostests/winetests/ntdll/port.c index e5bb3edc281..1b477180497 100644 --- a/modules/rostests/winetests/ntdll/port.c +++ b/modules/rostests/winetests/ntdll/port.c @@ -17,18 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include - -#include "ntstatus.h" -#define WIN32_NO_STATUS -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "winreg.h" -#include "winnls.h" -#include "wine/test.h" -#include "wine/winternl.h" +#include "ntdll_test.h" #ifndef __WINE_WINTERNL_H diff --git a/modules/rostests/winetests/ntdll/process.c b/modules/rostests/winetests/ntdll/process.c index 41303b7e9ae..8187f637e38 100644 --- a/modules/rostests/winetests/ntdll/process.c +++ b/modules/rostests/winetests/ntdll/process.c @@ -18,13 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - #include "ntdll_test.h" -#include "windef.h" -#include "winbase.h" - static NTSTATUS (WINAPI *pNtResumeProcess)(HANDLE); static NTSTATUS (WINAPI *pNtSuspendProcess)(HANDLE); static NTSTATUS (WINAPI *pNtSuspendThread)(HANDLE,PULONG); diff --git a/modules/rostests/winetests/ntdll/reg.c b/modules/rostests/winetests/ntdll/reg.c index 67833b18f59..1f3bd0acb4b 100755 --- a/modules/rostests/winetests/ntdll/reg.c +++ b/modules/rostests/winetests/ntdll/reg.c @@ -23,11 +23,8 @@ */ #include "ntdll_test.h" -#include "wine/winternl.h" -#include "stdio.h" -#include "winnt.h" -#include "winnls.h" -#include "stdlib.h" + +#include /* A test string */ static const WCHAR stringW[] = {'s', 't', 'r', 'i', 'n', 'g', 'W', 0}; diff --git a/modules/rostests/winetests/ntdll/rtl.c b/modules/rostests/winetests/ntdll/rtl.c index 5ba6b1159dc..147fd2d116e 100755 --- a/modules/rostests/winetests/ntdll/rtl.c +++ b/modules/rostests/winetests/ntdll/rtl.c @@ -21,14 +21,14 @@ * windows. */ -#include - #include "ntdll_test.h" -#include "inaddr.h" -#include "in6addr.h" -#include "initguid.h" + +#include +#include +#include +#include #define COBJMACROS -#include "shobjidl.h" +#include #ifndef __WINE_WINTERNL_H diff --git a/modules/rostests/winetests/ntdll/rtlstr.c b/modules/rostests/winetests/ntdll/rtlstr.c index 7f889dfa0d0..c113f76a89d 100755 --- a/modules/rostests/winetests/ntdll/rtlstr.c +++ b/modules/rostests/winetests/ntdll/rtlstr.c @@ -22,13 +22,9 @@ * windows. */ -#include - -#define INITGUID - #include "ntdll_test.h" -#include "winnls.h" -#include "guiddef.h" + +#include #define HASH_STRING_ALGORITHM_X65599 1 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff diff --git a/modules/rostests/winetests/ntdll/string.c b/modules/rostests/winetests/ntdll/string.c index 9bbaddd4159..9de0039fe9f 100755 --- a/modules/rostests/winetests/ntdll/string.c +++ b/modules/rostests/winetests/ntdll/string.c @@ -21,11 +21,8 @@ * windows. */ -#include - #include "ntdll_test.h" - /* Function ptrs for ntdll calls */ static HMODULE hntdll = 0; static NTSTATUS (WINAPI *pRtlUnicodeStringToAnsiString)(STRING *, const UNICODE_STRING *, BOOLEAN); diff --git a/modules/rostests/winetests/ntdll/time.c b/modules/rostests/winetests/ntdll/time.c index dc570e14ce9..7d9e65148e3 100755 --- a/modules/rostests/winetests/ntdll/time.c +++ b/modules/rostests/winetests/ntdll/time.c @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION #include "ntdll_test.h" /* FIXME: Inspect */ @@ -203,7 +202,7 @@ static void test_NtGetTickCount(void) for (i = 0; i < 5; ++i) { - diff = (user_shared_data->u.TickCountQuad * user_shared_data->TickCountMultiplier) >> 24; + diff = (user_shared_data->TickCountQuad * user_shared_data->TickCountMultiplier) >> 24; diff = pNtGetTickCount() - diff; ok(diff < 32, "NtGetTickCount - TickCountQuad too high, expected < 32 got %d\n", diff); Sleep(50);