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