[KMTESTS]
[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 <thfabba@gmx.de>
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 #if defined KMT_KERNEL_MODE || defined KMT_STANDALONE_DRIVER
16 #include <ntddk.h>
17 #include <ntifs.h>
18 #include <ndk/ntndk.h>
19 #include <ntstrsafe.h>
20
21 #elif defined KMT_USER_MODE
22 #define WIN32_LEAN_AND_MEAN
23 #define WIN32_NO_STATUS
24 #define UNICODE
25 #include <windows.h>
26 #include <ndk/ntndk.h>
27 #include <strsafe.h>
28 #include <winioctl.h>
29
30 #ifdef KMT_EMULATE_KERNEL
31 #define ok_irql(i)
32 #define KIRQL int
33 typedef const UCHAR CUCHAR, *PCUCHAR;
34 typedef ULONG LOGICAL, *PLOGICAL;
35
36 #undef KeRaiseIrql
37 #define KeRaiseIrql(new, old) *(old) = 123
38 #undef KeLowerIrql
39 #define KeLowerIrql(i) (void)(i)
40 #define ExAllocatePool(type, size) HeapAlloc(GetProcessHeap(), 0, size)
41 #define ExAllocatePoolWithTag(type, size, tag) HeapAlloc(GetProcessHeap(), 0, size)
42 #define ExFreePool(p) HeapFree(GetProcessHeap(), 0, p)
43 #define ExFreePoolWithTag(p, tag) HeapFree(GetProcessHeap(), 0, p)
44 #define RtlCopyMemoryNonTemporal RtlCopyMemory
45 #define RtlPrefetchMemoryNonTemporal(s, l)
46 #endif /* defined KMT_EMULATE_KERNEL */
47
48 #endif /* defined KMT_USER_MODE */
49
50 #include <pseh/pseh2.h>
51 #include <limits.h>
52 #include <malloc.h>
53 #include <stdarg.h>
54
55 #endif /* !defined _KMTEST_PLATFORM_H_ */