https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2cd1c84f7f27f5b218d27…
commit 2cd1c84f7f27f5b218d273368891b712efb78ae3
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Wed Dec 20 13:13:26 2017 +0100
[OLE32_WINETEST] Add a PCH.
---
modules/rostests/winetests/ole32/CMakeLists.txt | 5 ++-
modules/rostests/winetests/ole32/clipboard.c | 20 +---------
modules/rostests/winetests/ole32/compobj.c | 24 +-----------
modules/rostests/winetests/ole32/defaulthandler.c | 17 +--------
modules/rostests/winetests/ole32/dragdrop.c | 19 +---------
modules/rostests/winetests/ole32/errorinfo.c | 16 +-------
modules/rostests/winetests/ole32/hglobalstream.c | 15 +-------
modules/rostests/winetests/ole32/marshal.c | 24 +-----------
modules/rostests/winetests/ole32/moniker.c | 22 +----------
modules/rostests/winetests/ole32/ole2.c | 21 +----------
modules/rostests/winetests/ole32/ole_server.c | 10 +----
modules/rostests/winetests/ole32/precomp.h | 21 +++++++++++
modules/rostests/winetests/ole32/propvariant.c | 14 +------
modules/rostests/winetests/ole32/stg_prop.c | 14 +------
modules/rostests/winetests/ole32/storage32.c | 45 ++++++++---------------
modules/rostests/winetests/ole32/usrmarshal.c | 17 +--------
16 files changed, 57 insertions(+), 247 deletions(-)
diff --git a/modules/rostests/winetests/ole32/CMakeLists.txt
b/modules/rostests/winetests/ole32/CMakeLists.txt
index 78fe6dff66..0cb4ec3312 100644
--- a/modules/rostests/winetests/ole32/CMakeLists.txt
+++ b/modules/rostests/winetests/ole32/CMakeLists.txt
@@ -16,9 +16,9 @@ list(APPEND SOURCE
stg_prop.c
storage32.c
usrmarshal.c
- testlist.c)
+ precomp.h)
-add_executable(ole32_winetest ${SOURCE})
+add_executable(ole32_winetest ${SOURCE} testlist.c)
target_link_libraries(ole32_winetest uuid)
set_module_type(ole32_winetest win32cui)
add_importlibs(ole32_winetest oleaut32 ole32 user32 gdi32 advapi32 msvcrt kernel32)
@@ -27,4 +27,5 @@ if(MSVC)
add_importlibs(ole32_winetest ntdll)
endif()
+add_pch(ole32_winetest precomp.h SOURCE)
add_rostests_file(TARGET ole32_winetest)
diff --git a/modules/rostests/winetests/ole32/clipboard.c
b/modules/rostests/winetests/ole32/clipboard.c
index ff3b03da0d..64fafaf1f2 100644
--- a/modules/rostests/winetests/ole32/clipboard.c
+++ b/modules/rostests/winetests/ole32/clipboard.c
@@ -18,24 +18,8 @@
* 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
-#define NONAMELESSUNION
-
-//#include <stdarg.h>
-#include <stdio.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <wingdi.h>
-#include <ole2.h>
-//#include "objbase.h"
-
-#include <wine/test.h>
+#include "precomp.h"
#define InitFormatEtc(fe, cf, med) \
{\
@@ -1290,7 +1274,7 @@ static void test_flushed_getdata(void)
ok(hr == S_OK, "got %08x\n", hr);
ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed);
if(SUCCEEDED(hr)) {
- hr = IStorage_Stat(med.u.pstg, &stat, STATFLAG_NONAME);
+ hr = IStorage_Stat(med.pstg, &stat, STATFLAG_NONAME);
ok(hr == S_OK, "got %08x\n", hr);
ok(stat.grfMode == (STGM_SHARE_EXCLUSIVE | STGM_READWRITE), "got
%08x\n", stat.grfMode);
ReleaseStgMedium(&med);
diff --git a/modules/rostests/winetests/ole32/compobj.c
b/modules/rostests/winetests/ole32/compobj.c
index 6dd9e334cc..eeb4686f15 100644
--- a/modules/rostests/winetests/ole32/compobj.c
+++ b/modules/rostests/winetests/ole32/compobj.c
@@ -18,31 +18,11 @@
* 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 <stdarg.h>
-#include <stdio.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <winnls.h>
-#include <winreg.h>
-#define USE_COM_CONTEXT_DEF
-#include <initguid.h>
-//#include "objbase.h"
-//#include "shlguid.h"
-#include <ole2.h>
-#include <urlmon.h> /* for CLSID_FileProtocol */
#include <dde.h>
-
#include <ctxtcall.h>
-
-#include <wine/test.h>
+#include <initguid.h>
extern const IID GUID_NULL;
diff --git a/modules/rostests/winetests/ole32/defaulthandler.c
b/modules/rostests/winetests/ole32/defaulthandler.c
index d8119b1b67..c9e6af98b9 100644
--- a/modules/rostests/winetests/ole32/defaulthandler.c
+++ b/modules/rostests/winetests/ole32/defaulthandler.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 <stdarg.h>
-#include <stdio.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <ole2.h>
-//#include "objbase.h"
-
-#include <wine/test.h>
+#include "precomp.h"
#define DEFINE_EXPECT(func) \
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
diff --git a/modules/rostests/winetests/ole32/dragdrop.c
b/modules/rostests/winetests/ole32/dragdrop.c
index a2b2dbfe4c..e14e757287 100644
--- a/modules/rostests/winetests/ole32/dragdrop.c
+++ b/modules/rostests/winetests/ole32/dragdrop.c
@@ -18,24 +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 _WIN32_DCOM
-#define COBJMACROS
-#define CONST_VTABLE
-
-#include <stdarg.h>
-//#include <stdio.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <ole2.h>
-//#include "objbase.h"
-
-#include <wine/test.h>
-
+#include "precomp.h"
#define METHOD_LIST \
METHOD(DO_EnumFormatEtc), \
diff --git a/modules/rostests/winetests/ole32/errorinfo.c
b/modules/rostests/winetests/ole32/errorinfo.c
index 25a7cdb498..c3e99a7a7b 100644
--- a/modules/rostests/winetests/ole32/errorinfo.c
+++ b/modules/rostests/winetests/ole32/errorinfo.c
@@ -18,21 +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 <stdarg.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <ole2.h>
-//#include "objbase.h"
-
-#include <wine/test.h>
+#include "precomp.h"
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error
0x%08x\n", hr)
diff --git a/modules/rostests/winetests/ole32/hglobalstream.c
b/modules/rostests/winetests/ole32/hglobalstream.c
index 52cf915cbb..8789623869 100644
--- a/modules/rostests/winetests/ole32/hglobalstream.c
+++ b/modules/rostests/winetests/ole32/hglobalstream.c
@@ -19,20 +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
-
-#define COBJMACROS
-
-#include <stdarg.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <ole2.h>
-//#include "objbase.h"
-
-#include <wine/test.h>
+#include "precomp.h"
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error
0x%08x\n", hr)
diff --git a/modules/rostests/winetests/ole32/marshal.c
b/modules/rostests/winetests/ole32/marshal.c
index 020b678778..10564cd536 100644
--- a/modules/rostests/winetests/ole32/marshal.c
+++ b/modules/rostests/winetests/ole32/marshal.c
@@ -18,29 +18,9 @@
* 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 _WIN32_DCOM
-#define COBJMACROS
-#define CONST_VTABLE
-
-//#include <stdarg.h>
-#include <stdio.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <winreg.h>
-#include <winnls.h>
-#include <ole2.h>
-//#include "objbase.h"
-//#include "olectl.h"
-#include <shlguid.h>
-//#include "shobjidl.h"
-//#include "initguid.h"
+#include "precomp.h"
-#include <wine/test.h>
+#include <shlguid.h>
DEFINE_GUID(CLSID_StdGlobalInterfaceTable,0x00000323,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
DEFINE_GUID(CLSID_ManualResetEvent,
0x0000032c,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
diff --git a/modules/rostests/winetests/ole32/moniker.c
b/modules/rostests/winetests/ole32/moniker.c
index 464ba62dc1..ca94904696 100644
--- a/modules/rostests/winetests/ole32/moniker.c
+++ b/modules/rostests/winetests/ole32/moniker.c
@@ -18,29 +18,11 @@
* 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 _WIN32_DCOM
-#define COBJMACROS
-#define CONST_VTABLE
-
-//#include <stdarg.h>
-#include <stdio.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <winnls.h>
-#include <ole2.h>
-//#include "objbase.h"
-//#include "ocidl.h"
-//#include "initguid.h"
+#include "precomp.h"
+
#include <comcat.h>
#include <olectl.h>
-#include <wine/test.h>
-
#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0,
but actually is %d\n", cLocks)
#define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is
%d\n", cLocks)
#define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error
0x%08x\n", hr)
diff --git a/modules/rostests/winetests/ole32/ole2.c
b/modules/rostests/winetests/ole32/ole2.c
index 82ec820b62..288517c7d9 100644
--- a/modules/rostests/winetests/ole32/ole2.c
+++ b/modules/rostests/winetests/ole32/ole2.c
@@ -18,26 +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
-#define WIN32_LEAN_AND_MEAN
-
-#include <stdarg.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <winnls.h>
-#include <wingdi.h>
-#include <winreg.h>
-#include <ole2.h>
-//#include "objbase.h"
-//#include "shlguid.h"
-
-#include <wine/test.h>
+#include "precomp.h"
#ifndef __REACTOS__
#include "initguid.h"
diff --git a/modules/rostests/winetests/ole32/ole_server.c
b/modules/rostests/winetests/ole32/ole_server.c
index 77abda47aa..9ca8bdf122 100644
--- a/modules/rostests/winetests/ole32/ole_server.c
+++ b/modules/rostests/winetests/ole32/ole_server.c
@@ -18,15 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
-#define CONST_VTABLE
-
-#include <windows.h>
-#include <exdisp.h>
-#include <tlhelp32.h>
-#include <stdio.h>
-#include <assert.h>
-#include "wine/test.h"
+#include "precomp.h"
#include <initguid.h>
DEFINE_GUID(CLSID_WineTestObject,
0xdeadbeef,0xdead,0xbeef,0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef);
diff --git a/modules/rostests/winetests/ole32/precomp.h
b/modules/rostests/winetests/ole32/precomp.h
new file mode 100644
index 0000000000..24b5295b71
--- /dev/null
+++ b/modules/rostests/winetests/ole32/precomp.h
@@ -0,0 +1,21 @@
+#ifndef _OLE32_WINETEST_PRECOMP_H_
+#define _OLE32_WINETEST_PRECOMP_H_
+
+#include <stdio.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+#define COBJMACROS
+#define CONST_VTABLE
+
+#include <wine/test.h>
+
+#include <winnls.h>
+#include <winreg.h>
+#include <wingdi.h>
+#define USE_COM_CONTEXT_DEF
+#include <ole2.h>
+
+#endif /* !_OLE32_WINETEST_PRECOMP_H_ */
diff --git a/modules/rostests/winetests/ole32/propvariant.c
b/modules/rostests/winetests/ole32/propvariant.c
index 26a5a91115..8c3256621e 100644
--- a/modules/rostests/winetests/ole32/propvariant.c
+++ b/modules/rostests/winetests/ole32/propvariant.c
@@ -18,21 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-//#include "windows.h"
+#include "precomp.h"
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#include <stdarg.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <winnls.h>
#include <ddeml.h>
-#include <ole2.h>
-
-#include <wine/test.h>
/* invalid in all versions */
#define PROP_INV 0x7f
diff --git a/modules/rostests/winetests/ole32/stg_prop.c
b/modules/rostests/winetests/ole32/stg_prop.c
index 318159d9ac..9b189c64c9 100644
--- a/modules/rostests/winetests/ole32/stg_prop.c
+++ b/modules/rostests/winetests/ole32/stg_prop.c
@@ -16,19 +16,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 <stdio.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <winuser.h>
-#define COBJMACROS
-#include <objbase.h>
-#include <wine/test.h>
-//#include "initguid.h"
+#include "precomp.h"
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
DEFINE_GUID(FMTID_SummaryInformation,0xF29F85E0,0x4FF9,0x1068,0xAB,0x91,0x08,0x00,0x2B,0x27,0xB3,0xD9);
diff --git a/modules/rostests/winetests/ole32/storage32.c
b/modules/rostests/winetests/ole32/storage32.c
index b7ed290954..756b7691df 100644
--- a/modules/rostests/winetests/ole32/storage32.c
+++ b/modules/rostests/winetests/ole32/storage32.c
@@ -18,21 +18,8 @@
* 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 <stdio.h>
-
-#define COBJMACROS
-#define NONAMELESSUNION
-#define NONAMELESSSTRUCT
-
-//#include <windows.h>
-#include <wine/test.h>
-#include <winnls.h>
-#include <ole2.h>
-//#include "objidl.h"
#include <initguid.h>
DEFINE_GUID( test_stg_cls, 0x88888888, 0x0425, 0x0000, 0,0,0,0,0,0,0,0);
@@ -3540,10 +3527,10 @@ static void test_locking(void)
hfile = CreateFileW(filename, open_mode,
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(hfile != INVALID_HANDLE_VALUE, "couldn't open file with mode
%x\n", current->stg_mode);
- ol.u.s.OffsetHigh = 0;
+ ol.OffsetHigh = 0;
ol.hEvent = NULL;
- for (ol.u.s.Offset = 0x7ffffe00; ol.u.s.Offset != 0x80000000;
ol.u.s.Offset++)
+ for (ol.Offset = 0x7ffffe00; ol.Offset != 0x80000000; ol.Offset++)
{
if (LockFileEx(hfile, LOCKFILE_EXCLUSIVE_LOCK|LOCKFILE_FAIL_IMMEDIATELY,
0, 1, 0, &ol))
locked = FALSE;
@@ -3555,7 +3542,7 @@ static void test_locking(void)
UnlockFileEx(hfile, 0, 1, 0, &ol);
- if ((ol.u.s.Offset&0x1ff) == *next_lock)
+ if ((ol.Offset&0x1ff) == *next_lock)
{
expect_locked = TRUE;
next_lock++;
@@ -3565,12 +3552,12 @@ static void test_locking(void)
if (!current->todo || locked == expect_locked)
ok(locked == expect_locked, "byte %x of file with mode %x is
%slocked but should %sbe\n",
- ol.u.s.Offset, current->stg_mode, locked?"":"not
", expect_locked?"":"not ");
+ ol.Offset, current->stg_mode, locked?"":"not
", expect_locked?"":"not ");
else
{
any_failure = TRUE;
todo_wine ok(locked == expect_locked, "byte %x of file with mode
%x is %slocked but should %sbe\n",
- ol.u.s.Offset, current->stg_mode,
locked?"":"not ", expect_locked?"":"not ");
+ ol.Offset, current->stg_mode,
locked?"":"not ", expect_locked?"":"not ");
}
}
@@ -3589,17 +3576,17 @@ static void test_locking(void)
hfile = CreateFileW(filename, open_mode,
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(hfile != INVALID_HANDLE_VALUE, "couldn't open file with mode
%x\n", current->stg_mode);
- ol.u.s.OffsetHigh = 0;
+ ol.OffsetHigh = 0;
ol.hEvent = NULL;
- for (ol.u.s.Offset = 0x7ffffe00; ol.u.s.Offset != 0x80000000;
ol.u.s.Offset++)
+ for (ol.Offset = 0x7ffffe00; ol.Offset != 0x80000000; ol.Offset++)
{
- if (ol.u.s.Offset == 0x7fffff92 ||
- (ol.u.s.Offset == 0x7fffff80 && current->stg_mode ==
(STGM_TRANSACTED|STGM_READWRITE)) ||
- (ol.u.s.Offset == 0x7fffff80 && current->stg_mode ==
(STGM_TRANSACTED|STGM_READ)))
+ if (ol.Offset == 0x7fffff92 ||
+ (ol.Offset == 0x7fffff80 && current->stg_mode ==
(STGM_TRANSACTED|STGM_READWRITE)) ||
+ (ol.Offset == 0x7fffff80 && current->stg_mode ==
(STGM_TRANSACTED|STGM_READ)))
continue; /* This makes opens hang */
- if (ol.u.s.Offset < 0x7fffff00)
+ if (ol.Offset < 0x7fffff00)
LockFileEx(hfile, 0, 0, 1, 0, &ol);
else
LockFileEx(hfile, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &ol);
@@ -3612,11 +3599,11 @@ static void test_locking(void)
failed = FAILED(hr);
- if (!expect_failed && (ol.u.s.Offset&0x1ff) ==
next_range[0])
+ if (!expect_failed && (ol.Offset&0x1ff) == next_range[0])
{
expect_failed = TRUE;
}
- else if (expect_failed && (ol.u.s.Offset&0x1ff) ==
next_range[1])
+ else if (expect_failed && (ol.Offset&0x1ff) ==
next_range[1])
{
expect_failed = FALSE;
next_range += 2;
@@ -3624,12 +3611,12 @@ static void test_locking(void)
if (!current->todo || failed == expect_failed)
ok(failed == expect_failed, "open with byte %x locked, mode %x
%s but should %s\n",
- ol.u.s.Offset, current->stg_mode,
failed?"failed":"succeeded",
expect_failed?"fail":"succeed");
+ ol.Offset, current->stg_mode,
failed?"failed":"succeeded",
expect_failed?"fail":"succeed");
else
{
any_failure = TRUE;
todo_wine ok(failed == expect_failed, "open with byte %x locked,
mode %x %s but should %s\n",
- ol.u.s.Offset, current->stg_mode,
failed?"failed":"succeeded",
expect_failed?"fail":"succeed");
+ ol.Offset, current->stg_mode,
failed?"failed":"succeeded",
expect_failed?"fail":"succeed");
}
}
diff --git a/modules/rostests/winetests/ole32/usrmarshal.c
b/modules/rostests/winetests/ole32/usrmarshal.c
index 8cce648209..bc9525914e 100644
--- a/modules/rostests/winetests/ole32/usrmarshal.c
+++ b/modules/rostests/winetests/ole32/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 <stdarg.h>
-
-#include <windef.h>
-#include <winbase.h>
-#include <wingdi.h>
-#include <ole2.h>
-//#include "objbase.h"
-//#include "objidl.h"
-
-#include <wine/test.h>
+#include "precomp.h"
ULONG __RPC_USER HMETAFILE_UserSize(ULONG *, ULONG, HMETAFILE *);
unsigned char * __RPC_USER HMETAFILE_UserMarshal(ULONG *, unsigned char *, HMETAFILE *);