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