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