1 | /* $Id: the-nt-kernel.h 82968 2020-02-04 10:35:17Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - Include all necessary headers for the NT kernel.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2020 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef IPRT_INCLUDED_SRC_r0drv_nt_the_nt_kernel_h
|
---|
28 | #define IPRT_INCLUDED_SRC_r0drv_nt_the_nt_kernel_h
|
---|
29 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
30 | # pragma once
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include <iprt/cdefs.h>
|
---|
34 |
|
---|
35 | #if defined(RT_ARCH_X86) && !defined(NO_INTERLOCKED_INTRINSICS)
|
---|
36 | # define NO_INTERLOCKED_INTRINSICS /* avoid trouble */
|
---|
37 | #endif
|
---|
38 | #if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
|
---|
39 | # include <iprt/asm.h>
|
---|
40 | # define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
|
---|
41 | # define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
|
---|
42 | # define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
|
---|
43 | # define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
|
---|
44 | # pragma warning(disable : 4163)
|
---|
45 | RT_C_DECLS_BEGIN
|
---|
46 | # include <iprt/nt/nt.h>
|
---|
47 | RT_C_DECLS_END
|
---|
48 | # pragma warning(default : 4163)
|
---|
49 | # undef _InterlockedExchange
|
---|
50 | # undef _InterlockedExchangeAdd
|
---|
51 | # undef _InterlockedCompareExchange
|
---|
52 | # undef _InterlockedAddLargeStatistic
|
---|
53 | #else
|
---|
54 | RT_C_DECLS_BEGIN
|
---|
55 | # include <iprt/nt/nt.h>
|
---|
56 | RT_C_DECLS_END
|
---|
57 | #endif
|
---|
58 |
|
---|
59 | #include <memory.h>
|
---|
60 | #if !defined(RT_OS_WINDOWS)
|
---|
61 | # error "RT_OS_WINDOWS must be defined!"
|
---|
62 | #endif
|
---|
63 |
|
---|
64 | #include <iprt/param.h>
|
---|
65 | #ifndef PAGE_OFFSET_MASK
|
---|
66 | # define PAGE_OFFSET_MASK (PAGE_SIZE - 1)
|
---|
67 | #endif
|
---|
68 |
|
---|
69 | /* Missing if we're compiling against older WDKs. */
|
---|
70 | #ifndef NonPagedPoolNx
|
---|
71 | # define NonPagedPoolNx ((POOL_TYPE)512)
|
---|
72 | #endif
|
---|
73 |
|
---|
74 | /*
|
---|
75 | * When targeting NT4 we have to undo some of the nice macros
|
---|
76 | * installed by the later DDKs.
|
---|
77 | */
|
---|
78 | #undef ExAllocatePool
|
---|
79 | #undef ExFreePool
|
---|
80 |
|
---|
81 | /** @def IPRT_NT_POOL_TAG
|
---|
82 | * Tag to use with the NT Pool APIs.
|
---|
83 | * In memory and in the various windbg tools it appears in the reverse order of
|
---|
84 | * what it is given as here, so it'll read "IPRT".
|
---|
85 | */
|
---|
86 | #define IPRT_NT_POOL_TAG 'TRPI'
|
---|
87 |
|
---|
88 | #endif /* !IPRT_INCLUDED_SRC_r0drv_nt_the_nt_kernel_h */
|
---|
89 |
|
---|