1
2add_subdirectory(load_notifications)
3
4include_directories($<TARGET_FILE_DIR:load_notifications>)
5spec2def(ntdll_apitest.exe ntdll_apitest.spec)
6
7list(APPEND SOURCE
8    LdrEnumResources.c
9    load_notifications.c
10    NtAcceptConnectPort.c
11    NtAllocateVirtualMemory.c
12    NtApphelpCacheControl.c
13    NtContinue.c
14    NtCreateFile.c
15    NtCreateKey.c
16    NtCreateThread.c
17    NtDeleteKey.c
18    NtFreeVirtualMemory.c
19    NtLoadUnloadKey.c
20    NtMapViewOfSection.c
21    NtMutant.c
22    NtOpenKey.c
23    NtOpenProcessToken.c
24    NtOpenThreadToken.c
25    NtProtectVirtualMemory.c
26    NtQueryInformationProcess.c
27    NtQueryKey.c
28    NtQuerySystemEnvironmentValue.c
29    NtQueryVolumeInformationFile.c
30    NtReadFile.c
31    NtSaveKey.c
32    NtSetValueKey.c
33    NtWriteFile.c
34    RtlAllocateHeap.c
35    RtlBitmap.c
36    RtlCopyMappedMemory.c
37    RtlDeleteAce.c
38    RtlDetermineDosPathNameType.c
39    RtlDoesFileExists.c
40    RtlDosApplyFileIsolationRedirection_Ustr.c
41    RtlDosPathNameToNtPathName_U.c
42    RtlDosSearchPath_U.c
43    RtlDosSearchPath_Ustr.c
44    RtlFirstFreeAce.c
45    RtlGenerate8dot3Name.c
46    RtlGetFullPathName_U.c
47    RtlGetFullPathName_Ustr.c
48    RtlGetFullPathName_UstrEx.c
49    RtlGetLengthWithoutTrailingPathSeperators.c
50    RtlGetLongestNtPathLength.c
51    RtlHandle.c
52    RtlImageRvaToVa.c
53    RtlInitializeBitMap.c
54    RtlIsNameLegalDOS8Dot3.c
55    RtlMemoryStream.c
56    RtlNtPathNameToDosPathName.c
57    RtlpEnsureBufferSize.c
58    RtlQueryTimeZoneInfo.c
59    RtlReAllocateHeap.c
60    RtlUnicodeStringToAnsiString.c
61    RtlUpcaseUnicodeStringToCountedOemString.c
62    StackOverflow.c
63    SystemInfo.c
64    Timer.c
65    precomp.h)
66
67if(ARCH STREQUAL "i386")
68    add_asm_files(ntdll_apitest_asm i386/NtContinue.S)
69endif()
70
71add_rc_deps(testdata.rc ${CMAKE_CURRENT_BINARY_DIR}/load_notifications/load_notifications.dll)
72add_executable(ntdll_apitest
73    ${SOURCE}
74    ${ntdll_apitest_asm}
75    testdata.rc
76    ${CMAKE_CURRENT_BINARY_DIR}/ntdll_apitest.def
77    testlist.c)
78target_link_libraries(ntdll_apitest wine uuid ${PSEH_LIB})
79set_module_type(ntdll_apitest win32cui)
80add_importlibs(ntdll_apitest msvcrt advapi32 kernel32 ntdll)
81add_pch(ntdll_apitest precomp.h SOURCE)
82
83if(NOT MSVC)
84    set_source_files_properties(RtlGetFullPathName_UstrEx.c PROPERTIES COMPILE_FLAGS "-Wno-format")
85endif()
86
87add_rostests_file(TARGET ntdll_apitest)
88add_rostests_file(TARGET ntdll_apitest SUBDIR testdata)
89# These are empty files
90add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdll_apitest.exe.local" SUBDIR testdata)
91add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/shell32.dll" SUBDIR testdata)
92add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.dll" SUBDIR testdata)
93add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdlltest.manifest" SUBDIR testdata)
94add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/fil1.txt" SUBDIR testdata)
95
96# Convenience target for running from IDE
97if(MSVC_IDE)
98    set(NTDLL_APITEST_DATADIR $<TARGET_FILE_DIR:ntdll_apitest>/testdata/)
99    add_custom_command(TARGET ntdll_apitest
100                       POST_BUILD
101                       COMMAND "${CMAKE_COMMAND}" -E make_directory ${NTDLL_APITEST_DATADIR}
102                       COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_FILE:ntdll_apitest> ${NTDLL_APITEST_DATADIR}
103                       COMMAND "${CMAKE_COMMAND}" -E copy ntdll_apitest.exe.local ${NTDLL_APITEST_DATADIR}
104                       COMMAND "${CMAKE_COMMAND}" -E copy shell32.dll ${NTDLL_APITEST_DATADIR}
105                       COMMAND "${CMAKE_COMMAND}" -E copy test.dll ${NTDLL_APITEST_DATADIR}
106                       COMMAND "${CMAKE_COMMAND}" -E copy ntdlltest.manifest ${NTDLL_APITEST_DATADIR}
107                       COMMAND "${CMAKE_COMMAND}" -E copy fil1.txt ${NTDLL_APITEST_DATADIR}
108                       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
109endif()
110