[KMTESTS]
[reactos.git] / 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 KMT_KERNEL_MODE || defined KMT_STANDALONE_DRIVER
12 #include <ntddk.h>
13 #include <ntifs.h>
14 #include <ndk/ntndk.h>
15 #include <ntstrsafe.h>
16
17 #elif defined KMT_USER_MODE
18 #define WIN32_LEAN_AND_MEAN
19 #define WIN32_NO_STATUS
20 #define UNICODE
21 #include <windows.h>
22 #include <ndk/ntndk.h>
23 #include <strsafe.h>
24 #include <winioctl.h>
25
26 #ifdef KMT_EMULATE_KERNEL
27 #define ok_irql(i)
28 #ifdef __GNUC__
29 #define KIRQL __attribute__((__unused__)) int
30 #elif !defined __GNUC__
31 #define KIRQL int
32 #endif /* !defined __GNUC__ */
33 typedef const UCHAR CUCHAR, *PCUCHAR;
34 typedef ULONG LOGICAL, *PLOGICAL;
35
36 #undef KeRaiseIrql
37 #define KeRaiseIrql(new, old)
38 #undef KeLowerIrql
39 #define KeLowerIrql(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
53 #endif /* !defined _KMTEST_PLATFORM_H_ */