[KMTESTS:KE]
[reactos.git] / 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
29 #elif defined KMT_USER_MODE
30 #define WIN32_NO_STATUS
31 #define UNICODE
32 #include <windef.h>
33 #include <winbase.h>
34 #include <winreg.h>
35 #include <winsvc.h>
36 #include <ndk/cmfuncs.h>
37 #include <ndk/obfuncs.h>
38 #include <ndk/rtlfuncs.h>
39 #include <ndk/mmfuncs.h>
40 #include <strsafe.h>
41
42 #ifdef KMT_EMULATE_KERNEL
43 #define ok_irql(i)
44 #define KIRQL int
45 typedef const UCHAR CUCHAR, *PCUCHAR;
46 typedef ULONG LOGICAL, *PLOGICAL;
47
48 #undef KeRaiseIrql
49 #define KeRaiseIrql(new, old) *(old) = 123
50 #undef KeLowerIrql
51 #define KeLowerIrql(i) (void)(i)
52 #define ExAllocatePool(type, size) HeapAlloc(GetProcessHeap(), 0, size)
53 #define ExAllocatePoolWithTag(type, size, tag) HeapAlloc(GetProcessHeap(), 0, size)
54 #define ExFreePool(p) HeapFree(GetProcessHeap(), 0, p)
55 #define ExFreePoolWithTag(p, tag) HeapFree(GetProcessHeap(), 0, p)
56 #define RtlCopyMemoryNonTemporal RtlCopyMemory
57 #define RtlPrefetchMemoryNonTemporal(s, l)
58 #endif /* defined KMT_EMULATE_KERNEL */
59
60 #endif /* defined KMT_USER_MODE */
61
62 #include <pseh/pseh2.h>
63
64 #endif /* !defined _KMTEST_PLATFORM_H_ */