1c2c66affSColin Finck /*
2c2c66affSColin Finck  * PROJECT:     ReactOS kernel-mode tests
3a9ba7a3fSThomas Faber  * LICENSE:     LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4c2c66affSColin Finck  * PURPOSE:     Kernel-Mode Test Suite platform declarations
5a9ba7a3fSThomas Faber  * COPYRIGHT:   Copyright 2011-2018 Thomas Faber <thomas.faber@reactos.org>
6a9ba7a3fSThomas Faber  *              Copyright 2017 Ged Murphy <gedmurphy@reactos.org>
7c2c66affSColin Finck  */
8c2c66affSColin Finck 
9c2c66affSColin Finck #ifndef _KMTEST_PLATFORM_H_
10c2c66affSColin Finck #define _KMTEST_PLATFORM_H_
11c2c66affSColin Finck 
12c2c66affSColin Finck #if !defined _KMTEST_TEST_H_
13c2c66affSColin Finck #error include kmt_test.h instead of including kmt_platform.h!
14c2c66affSColin Finck #endif /* !defined _KMTEST_TEST_H_ */
15c2c66affSColin Finck 
16c2c66affSColin Finck #include <limits.h>
17c2c66affSColin Finck #include <malloc.h>
18c2c66affSColin Finck #include <stdarg.h>
19c2c66affSColin Finck 
20c2c66affSColin Finck #if defined KMT_KERNEL_MODE || defined KMT_STANDALONE_DRIVER
21c2c66affSColin Finck #include <ntddk.h>
22c2c66affSColin Finck #include <ntifs.h>
23c2c66affSColin Finck #include <ndk/exfuncs.h>
24c2c66affSColin Finck #include <ndk/kefuncs.h>
25c2c66affSColin Finck #include <ndk/mmfuncs.h>
26c2c66affSColin Finck #include <ndk/obfuncs.h>
27*f5290335SPierre Schweitzer #include <ndk/psfuncs.h>
28c2c66affSColin Finck #include <ndk/sefuncs.h>
29c2c66affSColin Finck #include <ntstrsafe.h>
309d15fb92SGed Murphy #if defined KMT_FILTER_DRIVER
319d15fb92SGed Murphy #include <fltkernel.h>
329d15fb92SGed Murphy #endif
33c2c66affSColin Finck 
34c2c66affSColin Finck #elif defined KMT_USER_MODE
35c2c66affSColin Finck #define WIN32_NO_STATUS
36c2c66affSColin Finck #define UNICODE
37c2c66affSColin Finck #include <windef.h>
38c2c66affSColin Finck #include <winbase.h>
39c2c66affSColin Finck #include <winreg.h>
40c2c66affSColin Finck #include <winsvc.h>
41c2c66affSColin Finck #include <ndk/cmfuncs.h>
42c2c66affSColin Finck #include <ndk/iofuncs.h>
43c2c66affSColin Finck #include <ndk/obfuncs.h>
44c2c66affSColin Finck #include <ndk/rtlfuncs.h>
45c2c66affSColin Finck #include <ndk/mmfuncs.h>
46c2c66affSColin Finck #include <strsafe.h>
47b10dd06aSGed Murphy #include <fltuser.h>
48c2c66affSColin Finck 
49dfb77638SGed Murphy 
50c2c66affSColin Finck #ifdef KMT_EMULATE_KERNEL
51c2c66affSColin Finck #define ok_irql(i)
52c2c66affSColin Finck #define KIRQL int
53c2c66affSColin Finck typedef const UCHAR CUCHAR, *PCUCHAR;
54c2c66affSColin Finck typedef ULONG LOGICAL, *PLOGICAL;
55c2c66affSColin Finck 
56c2c66affSColin Finck #undef KeRaiseIrql
57c2c66affSColin Finck #define KeRaiseIrql(new, old) *(old) = 123
58c2c66affSColin Finck #undef KeLowerIrql
59c2c66affSColin Finck #define KeLowerIrql(i) (void)(i)
60c2c66affSColin Finck #define ExAllocatePool(type, size)              HeapAlloc(GetProcessHeap(), 0, size)
61c2c66affSColin Finck #define ExAllocatePoolWithTag(type, size, tag)  HeapAlloc(GetProcessHeap(), 0, size)
62c2c66affSColin Finck #define ExFreePool(p)                           HeapFree(GetProcessHeap(), 0, p)
63c2c66affSColin Finck #define ExFreePoolWithTag(p, tag)               HeapFree(GetProcessHeap(), 0, p)
64c2c66affSColin Finck #define RtlCopyMemoryNonTemporal                RtlCopyMemory
65c2c66affSColin Finck #define RtlPrefetchMemoryNonTemporal(s, l)
66c2c66affSColin Finck #define ExRaiseStatus                           RtlRaiseStatus
67c2c66affSColin Finck #define KmtIsCheckedBuild                       FALSE
68c2c66affSColin Finck #endif /* defined KMT_EMULATE_KERNEL */
69c2c66affSColin Finck 
70c2c66affSColin Finck #endif /* defined KMT_USER_MODE */
71c2c66affSColin Finck 
72c2c66affSColin Finck #include <pseh/pseh2.h>
73c2c66affSColin Finck 
74c2c66affSColin Finck #endif /* !defined _KMTEST_PLATFORM_H_ */
75