Skip to content

Commit ddfdb0d

Browse files
committed
[KERNEL32_WINETEST] Sync kernel32 winetest to wine-10.0
- [KERNEL32_WINETEST] Sync to wine-10.0 - [KERNEL32_WINETEST] Define out tests we can't yet build, fix test failures for WS03-Win 10 1607. - [KERNEL32_WINETEST] Consolidate header hacks needed for the winesync in winehacks.h. This documents what incompatibilities we need to work around in our and Wine headers in one place.
1 parent c20ec94 commit ddfdb0d

41 files changed

Lines changed: 36357 additions & 12114 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎modules/rostests/winetests/kernel32/CMakeLists.txt‎

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11

2-
add_definitions(-D__ROS_LONG64__)
3-
42
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/wine)
5-
remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502)
6-
add_definitions(-DWINVER=0x600 -D_WIN32_WINNT=0x601)
3+
remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502 -D_CRT_NON_CONFORMING_SWPRINTFS)
4+
add_definitions(-DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 -DNTDDI_VERSION=0x0A000007)
5+
6+
# Comment this block out if you want to debug the heap issue with these tests on ROS x64. ROSTESTS-415
7+
if(ARCH STREQUAL "amd64")
8+
add_definitions(-DSKIPBADHEAP_K32_WINETEST=1)
9+
endif()
710

8-
add_definitions(
9-
-Dstrcasecmp=_stricmp
10-
)
11+
spec2def(dummy.dll dummy.spec)
12+
add_library(kernel32_winetest_dummy MODULE dummy.c ${CMAKE_CURRENT_BINARY_DIR}/dummy.def)
13+
set_target_properties(kernel32_winetest_dummy PROPERTIES OUTPUT_NAME "dummy")
14+
set_module_type(kernel32_winetest_dummy win32dll)
15+
add_importlibs(kernel32_winetest_dummy msvcrt kernel32)
16+
add_rostests_file(TARGET kernel32_winetest_dummy)
1117

1218
list(APPEND SOURCE
1319
actctx.c
@@ -31,6 +37,7 @@ list(APPEND SOURCE
3137
module.c
3238
path.c
3339
pipe.c
40+
power.c
3441
process.c
3542
profile.c
3643
resource.c
@@ -46,28 +53,57 @@ list(APPEND SOURCE
4653
list(APPEND PCH_SKIP_SOURCE
4754
testlist.c)
4855

56+
if (MSVC AND ARCH STREQUAL "amd64")
57+
list(APPEND SOURCE
58+
get_fpu_cw.asm)
59+
endif()
60+
4961
add_executable(kernel32_winetest
5062
${SOURCE}
5163
${PCH_SKIP_SOURCE}
5264
resource.rc)
5365

54-
if(MSVC)
55-
# Disable warning C4477 (printf format warnings)
56-
remove_target_compile_option(kernel32_winetest "/we4477")
66+
# CMake 3.9 and higher requires to specify this dependency manually
67+
# see https://gitlab.kitware.com/cmake/cmake/issues/19933
68+
set_property(SOURCE resource.rc PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dummy.dll ${CMAKE_CURRENT_BINARY_DIR}/dummy.dll)
69+
70+
# resource.rc: let rc.exe find the dlls in their subdirectory, i.e. Debug.
71+
if (MSVC_IDE)
72+
target_include_directories(kernel32_winetest PRIVATE
73+
$<$<COMPILE_LANGUAGE:RC>:$<TARGET_FILE_DIR:kernel32_winetest_dummy>>)
74+
endif()
75+
76+
if (MSVC)
77+
# error C4101: unreferenced local variable
78+
target_compile_options(kernel32_winetest PRIVATE /wd4101)
5779

58-
if(ARCH STREQUAL "amd64")
59-
# error C4101: 'is_wow64': unreferenced local variable
60-
remove_target_compile_option(kernel32_winetest "/we4101")
61-
target_compile_options(kernel32_winetest PRIVATE /wd4101)
62-
endif()
80+
# Approximates a __FILE__ macro with forward slashes instead of back slashes
81+
# and defines it as __FILE_FW_SLASH__.
82+
foreach(source_file ${SOURCE})
83+
get_filename_component(abs_source_file "${source_file}" ABSOLUTE)
84+
file(RELATIVE_PATH rel_path "${CMAKE_SOURCE_DIR}" "${abs_source_file}")
85+
string(REPLACE "\\" "/" rel_path_forward "${rel_path}")
86+
set_source_files_properties(${source_file} PROPERTIES
87+
COMPILE_DEFINITIONS "__FILE_FW_SLASH__=\"../${rel_path_forward}\""
88+
)
89+
endforeach()
6390
endif()
6491

6592
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
66-
target_compile_options(kernel32_winetest PRIVATE "-Wno-format")
93+
target_compile_options(kernel32_winetest PRIVATE
94+
-Wno-format
95+
-Wno-int-conversion
96+
-Wno-old-style-declaration
97+
-Wno-unused)
6798
endif()
6899

69100
set_module_type(kernel32_winetest win32cui)
70-
target_link_libraries(kernel32_winetest pseh)
101+
target_link_libraries(kernel32_winetest pseh oldnames)
71102
add_importlibs(kernel32_winetest user32 advapi32 msvcrt kernel32 ntdll)
72103
add_pch(kernel32_winetest precomp.h "${PCH_SKIP_SOURCE}")
73104
add_rostests_file(TARGET kernel32_winetest)
105+
target_compile_definitions(kernel32_winetest PRIVATE
106+
WINETEST_USE_DBGSTR_LONGLONG
107+
__WINESRC__
108+
strncasecmp=_strnicmp
109+
strcasecmp=_stricmp)

0 commit comments

Comments
 (0)