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