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 #ifdef KMT_EMULATE_KERNEL
48 #define ok_irql(i)
49 #define KIRQL int
50 typedef const UCHAR CUCHAR, *PCUCHAR;
51 typedef ULONG LOGICAL, *PLOGICAL;
52 
53 #undef KeRaiseIrql
54 #define KeRaiseIrql(new, old) *(old) = 123
55 #undef KeLowerIrql
56 #define KeLowerIrql(i) (void)(i)
57 #define ExAllocatePool(type, size)              HeapAlloc(GetProcessHeap(), 0, size)
58 #define ExAllocatePoolWithTag(type, size, tag)  HeapAlloc(GetProcessHeap(), 0, size)
59 #define ExFreePool(p)                           HeapFree(GetProcessHeap(), 0, p)
60 #define ExFreePoolWithTag(p, tag)               HeapFree(GetProcessHeap(), 0, p)
61 #define RtlCopyMemoryNonTemporal                RtlCopyMemory
62 #define RtlPrefetchMemoryNonTemporal(s, l)
63 #define ExRaiseStatus                           RtlRaiseStatus
64 #define KmtIsCheckedBuild                       FALSE
65 #endif /* defined KMT_EMULATE_KERNEL */
66 
67 #endif /* defined KMT_USER_MODE */
68 
69 #include <pseh/pseh2.h>
70 
71 #endif /* !defined _KMTEST_PLATFORM_H_ */
72