[OLE32_WINETEST] Add a PCH.
authorAmine Khaldi <amine.khaldi@reactos.org>
Wed, 20 Dec 2017 12:13:26 +0000 (13:13 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Wed, 20 Dec 2017 12:13:26 +0000 (13:13 +0100)
16 files changed:
modules/rostests/winetests/ole32/CMakeLists.txt
modules/rostests/winetests/ole32/clipboard.c
modules/rostests/winetests/ole32/compobj.c
modules/rostests/winetests/ole32/defaulthandler.c
modules/rostests/winetests/ole32/dragdrop.c
modules/rostests/winetests/ole32/errorinfo.c
modules/rostests/winetests/ole32/hglobalstream.c
modules/rostests/winetests/ole32/marshal.c
modules/rostests/winetests/ole32/moniker.c
modules/rostests/winetests/ole32/ole2.c
modules/rostests/winetests/ole32/ole_server.c
modules/rostests/winetests/ole32/precomp.h [new file with mode: 0644]
modules/rostests/winetests/ole32/propvariant.c
modules/rostests/winetests/ole32/stg_prop.c
modules/rostests/winetests/ole32/storage32.c
modules/rostests/winetests/ole32/usrmarshal.c

index 78fe6df..0cb4ec3 100644 (file)
@@ -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)
index ff3b03d..64fafaf 100644 (file)
  * 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);
index 6dd9e33..eeb4686 100644 (file)
  * 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;
 
index d8119b1..c9e6af9 100644 (file)
  * 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
index a2b2dbf..e14e757 100644 (file)
  * 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), \
index 25a7cdb..c3e99a7 100644 (file)
  * 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)
 
index 52cf915..8789623 100644 (file)
  * 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)
 
index 020b678..10564cd 100644 (file)
  * 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);
index 464ba62..ca94904 100644 (file)
  * 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)
index 82ec820..288517c 100644 (file)
  * 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"
index 77abda4..9ca8bdf 100644 (file)
  * 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 (file)
index 0000000..24b5295
--- /dev/null
@@ -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_ */
index 26a5a91..8c32566 100644 (file)
  * 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
index 318159d..9b189c6 100644 (file)
  * 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);
index b7ed290..756b769 100644 (file)
  * 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");
                 }
             }
 
index 8cce648..bc95259 100644 (file)
  * 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 *);