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    NtSetInformationFile.c
51    NtSetInformationProcess.c
52    NtSetInformationThread.c
53    NtSetInformationToken.c
54    NtSetValueKey.c
55    NtSetVolumeInformationFile.c
56    NtUnloadDriver.c
57    NtWriteFile.c
58    probelib.c
59    RtlAllocateHeap.c
60    RtlBitmap.c
61    RtlComputePrivatizedDllName_U.c
62    RtlCopyMappedMemory.c
63    RtlCriticalSection.c
64    RtlDebugInformation.c
65    RtlDeleteAce.c
66    RtlDetermineDosPathNameType.c
67    RtlDoesFileExists.c
68    RtlDosApplyFileIsolationRedirection_Ustr.c
69    RtlDosPathNameToNtPathName_U.c
70    RtlDosSearchPath_U.c
71    RtlDosSearchPath_Ustr.c
72    RtlFirstFreeAce.c
73    RtlGenerate8dot3Name.c
74    RtlGetFullPathName_U.c
75    RtlGetFullPathName_Ustr.c
76    RtlGetFullPathName_UstrEx.c
77    RtlGetLengthWithoutLastFullDosOrNtPathElement.c
78    RtlGetLengthWithoutTrailingPathSeperators.c
79    RtlGetLongestNtPathLength.c
80    RtlGetNtProductType.c
81    RtlGetUnloadEventTrace.c
82    RtlHandle.c
83    RtlImageDirectoryEntryToData.c
84    RtlImageRvaToVa.c
85    RtlIsNameLegalDOS8Dot3.c
86    RtlMemoryStream.c
87    RtlMultipleAllocateHeap.c
88    RtlNtPathNameToDosPathName.c
89    RtlpApplyLengthFunction.c
90    RtlpEnsureBufferSize.c
91    RtlQueryTimeZoneInfo.c
92    RtlReAllocateHeap.c
93    RtlRemovePrivileges.c
94    RtlUnicodeStringToAnsiString.c
95    RtlUnicodeStringToCountedOemString.c
96    RtlUnicodeToOemN.c
97    RtlUpcaseUnicodeStringToCountedOemString.c
98    RtlValidateUnicodeString.c
99    RtlxUnicodeStringToAnsiSize.c
100    RtlxUnicodeStringToOemSize.c
101    StackOverflow.c
102    SystemInfo.c
103    UserModeException.c
104    Timer.c)
105
106if(ARCH STREQUAL "i386")
107    add_asm_files(ntdll_apitest_asm i386/NtContinue.S)
108elseif(ARCH STREQUAL "amd64")
109    add_asm_files(ntdll_apitest_asm amd64/NtContinue.S)
110endif()
111
112list(APPEND PCH_SKIP_SOURCE
113    testlist.c)
114
115add_rc_deps(testdata.rc ${CMAKE_CURRENT_BINARY_DIR}/load_notifications/load_notifications.dll)
116
117add_executable(ntdll_apitest
118    ${SOURCE}
119    ${ntdll_apitest_asm}
120    ${PCH_SKIP_SOURCE}
121    testdata.rc
122    ${CMAKE_CURRENT_BINARY_DIR}/ntdll_apitest.def)
123
124set_target_properties(ntdll_apitest
125    PROPERTIES
126    ENABLE_EXPORTS TRUE
127    DEFINE_SYMBOL "")
128
129target_link_libraries(ntdll_apitest wine uuid ${PSEH_LIB})
130set_module_type(ntdll_apitest win32cui)
131add_importlibs(ntdll_apitest msvcrt advapi32 kernel32 ntdll)
132add_pch(ntdll_apitest precomp.h "${PCH_SKIP_SOURCE}")
133add_dependencies(ntdll_apitest load_notifications)
134
135if(NOT MSVC)
136    set_source_files_properties(RtlGetFullPathName_UstrEx.c PROPERTIES COMPILE_FLAGS "-Wno-format")
137
138    # Avoid "universal character names are only valid in C++ and C99" error.
139    set_property(TARGET ntdll_apitest PROPERTY C_STANDARD 99)
140endif()
141
142add_rostests_file(TARGET ntdll_apitest)
143add_rostests_file(TARGET ntdll_apitest SUBDIR testdata)
144# These are empty files
145add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdll_apitest.exe.local" SUBDIR testdata)
146add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/shell32.dll" SUBDIR testdata)
147# add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.dll" SUBDIR testdata)
148add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdlltest.manifest" SUBDIR testdata)
149add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/fil1.txt" SUBDIR testdata)
150
151# Convenience target for running from IDE
152if(MSVC_IDE)
153    set(NTDLL_APITEST_DATADIR $<TARGET_FILE_DIR:ntdll_apitest>/testdata/)
154    add_custom_command(TARGET ntdll_apitest
155                       POST_BUILD
156                       COMMAND "${CMAKE_COMMAND}" -E make_directory ${NTDLL_APITEST_DATADIR}
157                       COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_FILE:ntdll_apitest> ${NTDLL_APITEST_DATADIR}
158                       COMMAND "${CMAKE_COMMAND}" -E copy ntdll_apitest.exe.local ${NTDLL_APITEST_DATADIR}
159                       COMMAND "${CMAKE_COMMAND}" -E copy shell32.dll ${NTDLL_APITEST_DATADIR}
160                       COMMAND "${CMAKE_COMMAND}" -E copy test.dll ${NTDLL_APITEST_DATADIR}
161                       COMMAND "${CMAKE_COMMAND}" -E copy ntdlltest.manifest ${NTDLL_APITEST_DATADIR}
162                       COMMAND "${CMAKE_COMMAND}" -E copy fil1.txt ${NTDLL_APITEST_DATADIR}
163                       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
164endif()
165