4895bf25a3167605eb73432108f0450f9a98a475
[reactos.git] / modules / rostests / kmtests / include / kmt_platform.h
1 /*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4 * PURPOSE: Kernel-Mode Test Suite platform declarations
5 * COPYRIGHT: Copyright 2011-2018 Thomas Faber <thomas.faber@reactos.org>
6 * Copyright 2017 Ged Murphy <gedmurphy@reactos.org>
7 */
8
9 #ifndef _KMTEST_PLATFORM_H_
10 #define _KMTEST_PLATFORM_H_
11
12 #if !defined _KMTEST_TEST_H_
13 #error include kmt_test.h instead of including kmt_platform.h!
14 #endif /* !defined _KMTEST_TEST_H_ */
15
16 #include <limits.h>
17 #include <malloc.h>
18 #include <stdarg.h>
19
20 #if defined KMT_KERNEL_MODE || defined KMT_STANDALONE_DRIVER
21 #include <ntddk.h>
22 #include <ntifs.h>
23 #include <ndk/exfuncs.h>
24 #include <ndk/kefuncs.h>
25 #include <ndk/mmfuncs.h>
26 #include <ndk/obfuncs.h>
27 #include <ndk/sefuncs.h>
28 #include <ntstrsafe.h>
29 #if defined KMT_FILTER_DRIVER
30 #include <fltkernel.h>
31 #endif
32
33 #elif defined KMT_USER_MODE
34 #define WIN32_NO_STATUS
35 #define UNICODE
36 #include <windef.h>
37 #include <winbase.h>
38 #include <winreg.h>
39 #include <winsvc.h>
40 #include <ndk/cmfuncs.h>
41 #include <ndk/iofuncs.h>
42 #include <ndk/obfuncs.h>
43 #include <ndk/rtlfuncs.h>
44 #include <ndk/mmfuncs.h>
45 #include <strsafe.h>
46 #include <fltuser.h>
47
48
49 #ifdef KMT_EMULATE_KERNEL
50 #define ok_irql(i)
51 #define KIRQL int
52 typedef const UCHAR CUCHAR, *PCUCHAR;
53 typedef ULONG LOGICAL, *PLOGICAL;
54
55 #undef KeRaiseIrql
56 #define KeRaiseIrql(new, old) *(old) = 123
57 #undef KeLowerIrql
58 #define KeLowerIrql(i) (void)(i)
59 #define ExAllocatePool(type, size) HeapAlloc(GetProcessHeap(), 0, size)
60 #define ExAllocatePoolWithTag(type, size, tag) HeapAlloc(GetProcessHeap(), 0, size)
61 #define ExFreePool(p) HeapFree(GetProcessHeap(), 0, p)
62 #define ExFreePoolWithTag(p, tag) HeapFree(GetProcessHeap(), 0, p)
63 #define RtlCopyMemoryNonTemporal RtlCopyMemory
64 #define RtlPrefetchMemoryNonTemporal(s, l)
65 #define ExRaiseStatus RtlRaiseStatus
66 #define KmtIsCheckedBuild FALSE
67 #endif /* defined KMT_EMULATE_KERNEL */
68
69 #endif /* defined KMT_USER_MODE */
70
71 #include <pseh/pseh2.h>
72
73 #endif /* !defined _KMTEST_PLATFORM_H_ */