1
2add_subdirectory(load_notifications)
3
4include_directories($<TARGET_FILE_DIR:load_notifications>)
5include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl/include)
6spec2def(ntdll_apitest.exe ntdll_apitest.spec)
7
8list(APPEND SOURCE
9    LdrEnumResources.c
10    load_notifications.c
11    locale.c
12    NtAcceptConnectPort.c
13    NtAdjustGroupsToken.c
14    NtAdjustPrivilegesToken.c
15    NtAllocateVirtualMemory.c
16    NtApphelpCacheControl.c
17    NtCompareTokens.c
18    NtContinue.c
19    NtCreateFile.c
20    NtCreateKey.c
21    NtCreateThread.c
22    NtDeleteKey.c
23    NtDuplicateObject.c
24    NtDuplicateToken.c
25    NtFilterToken.c
26    NtFreeVirtualMemory.c
27    NtImpersonateAnonymousToken.c
28    NtLoadUnloadKey.c
29    NtMapViewOfSection.c
30    NtMutant.c
31    NtOpenKey.c
32    NtOpenProcessToken.c
33    NtOpenThreadToken.c
34    NtProtectVirtualMemory.c
35    NtQueryInformationFile.c
36    NtQueryInformationProcess.c
37    NtQueryInformationThread.c
38    NtQueryInformationToken.c
39    NtQueryKey.c
40    NtQueryOpenSubKeys.c
41    NtQuerySystemEnvironmentValue.c
42    NtQuerySystemInformation.c
43    NtQueryValueKey.c
44    NtQueryVolumeInformationFile.c
45    NtReadFile.c
46    NtSaveKey.c
47    NtSetInformationFile.c
48    NtSetInformationProcess.c
49    NtSetInformationThread.c
50    NtSetInformationToken.c
51    NtSetValueKey.c
52    NtSetVolumeInformationFile.c
53    NtUnloadDriver.c
54    NtWriteFile.c
55    probelib.c
56    RtlAllocateHeap.c
57    RtlBitmap.c
58    RtlComputePrivatizedDllName_U.c
59    RtlCopyMappedMemory.c
60    RtlDebugInformation.c
61    RtlDeleteAce.c
62    RtlDetermineDosPathNameType.c
63    RtlDoesFileExists.c
64    RtlDosApplyFileIsolationRedirection_Ustr.c
65    RtlDosPathNameToNtPathName_U.c
66    RtlDosSearchPath_U.c
67    RtlDosSearchPath_Ustr.c
68    RtlFirstFreeAce.c
69    RtlGenerate8dot3Name.c
70    RtlGetFullPathName_U.c
71    RtlGetFullPathName_Ustr.c
72    RtlGetFullPathName_UstrEx.c
73    RtlGetLengthWithoutLastFullDosOrNtPathElement.c
74    RtlGetLengthWithoutTrailingPathSeperators.c
75    RtlGetLongestNtPathLength.c
76    RtlGetNtProductType.c
77    RtlGetUnloadEventTrace.c
78    RtlHandle.c
79    RtlImageDirectoryEntryToData.c
80    RtlImageRvaToVa.c
81    RtlIsNameLegalDOS8Dot3.c
82    RtlMemoryStream.c
83    RtlMultipleAllocateHeap.c
84    RtlNtPathNameToDosPathName.c
85    RtlpApplyLengthFunction.c
86    RtlpEnsureBufferSize.c
87    RtlQueryTimeZoneInfo.c
88    RtlReAllocateHeap.c
89    RtlRemovePrivileges.c
90    RtlUnicodeStringToAnsiString.c
91    RtlUnicodeStringToCountedOemString.c
92    RtlUnicodeToOemN.c
93    RtlUpcaseUnicodeStringToCountedOemString.c
94    RtlValidateUnicodeString.c
95    RtlxUnicodeStringToAnsiSize.c
96    RtlxUnicodeStringToOemSize.c
97    StackOverflow.c
98    SystemInfo.c
99    UserModeException.c
100    Timer.c)
101
102if(ARCH STREQUAL "i386")
103    add_asm_files(ntdll_apitest_asm i386/NtContinue.S)
104elseif(ARCH STREQUAL "amd64")
105    add_asm_files(ntdll_apitest_asm amd64/NtContinue.S)
106endif()
107
108list(APPEND PCH_SKIP_SOURCE
109    testlist.c)
110
111add_rc_deps(testdata.rc ${CMAKE_CURRENT_BINARY_DIR}/load_notifications/load_notifications.dll)
112
113add_executable(ntdll_apitest
114    ${SOURCE}
115    ${ntdll_apitest_asm}
116    ${PCH_SKIP_SOURCE}
117    testdata.rc
118    ${CMAKE_CURRENT_BINARY_DIR}/ntdll_apitest.def)
119
120set_target_properties(ntdll_apitest
121    PROPERTIES
122    ENABLE_EXPORTS TRUE
123    DEFINE_SYMBOL "")
124
125target_link_libraries(ntdll_apitest wine uuid ${PSEH_LIB})
126set_module_type(ntdll_apitest win32cui)
127add_importlibs(ntdll_apitest msvcrt advapi32 kernel32 ntdll)
128add_pch(ntdll_apitest precomp.h "${PCH_SKIP_SOURCE}")
129add_dependencies(ntdll_apitest load_notifications)
130
131if(NOT MSVC)
132    set_source_files_properties(RtlGetFullPathName_UstrEx.c PROPERTIES COMPILE_FLAGS "-Wno-format")
133
134    # Avoid "universal character names are only valid in C++ and C99" error.
135    set_property(TARGET ntdll_apitest PROPERTY C_STANDARD 99)
136endif()
137
138add_rostests_file(TARGET ntdll_apitest)
139add_rostests_file(TARGET ntdll_apitest SUBDIR testdata)
140# These are empty files
141add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdll_apitest.exe.local" SUBDIR testdata)
142add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/shell32.dll" SUBDIR testdata)
143# add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.dll" SUBDIR testdata)
144add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdlltest.manifest" SUBDIR testdata)
145add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/fil1.txt" SUBDIR testdata)
146
147# Convenience target for running from IDE
148if(MSVC_IDE)
149    set(NTDLL_APITEST_DATADIR $<TARGET_FILE_DIR:ntdll_apitest>/testdata/)
150    add_custom_command(TARGET ntdll_apitest
151                       POST_BUILD
152                       COMMAND "${CMAKE_COMMAND}" -E make_directory ${NTDLL_APITEST_DATADIR}
153                       COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_FILE:ntdll_apitest> ${NTDLL_APITEST_DATADIR}
154                       COMMAND "${CMAKE_COMMAND}" -E copy ntdll_apitest.exe.local ${NTDLL_APITEST_DATADIR}
155                       COMMAND "${CMAKE_COMMAND}" -E copy shell32.dll ${NTDLL_APITEST_DATADIR}
156                       COMMAND "${CMAKE_COMMAND}" -E copy test.dll ${NTDLL_APITEST_DATADIR}
157                       COMMAND "${CMAKE_COMMAND}" -E copy ntdlltest.manifest ${NTDLL_APITEST_DATADIR}
158                       COMMAND "${CMAKE_COMMAND}" -E copy fil1.txt ${NTDLL_APITEST_DATADIR}
159                       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
160endif()
161