1 | /* $Id: the-nt-kernel.h 70157 2017-12-15 16:18:28Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - Include all necessary headers for the NT kernel.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2017 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 ___the_nt_kernel_h
|
---|
28 | #define ___the_nt_kernel_h
|
---|
29 |
|
---|
30 | #include <iprt/cdefs.h>
|
---|
31 |
|
---|
32 | #if defined(RT_ARCH_X86) && !defined(NO_INTERLOCKED_INTRINSICS)
|
---|
33 | # define NO_INTERLOCKED_INTRINSICS /* avoid trouble */
|
---|
34 | #endif
|
---|
35 | #if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
|
---|
36 | # include <iprt/asm.h>
|
---|
37 | # define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
|
---|
38 | # define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
|
---|
39 | # define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
|
---|
40 | # define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
|
---|
41 | # pragma warning(disable : 4163)
|
---|
42 | RT_C_DECLS_BEGIN
|
---|
43 | # include <iprt/nt/nt.h>
|
---|
44 | RT_C_DECLS_END
|
---|
45 | # pragma warning(default : 4163)
|
---|
46 | # undef _InterlockedExchange
|
---|
47 | # undef _InterlockedExchangeAdd
|
---|
48 | # undef _InterlockedCompareExchange
|
---|
49 | # undef _InterlockedAddLargeStatistic
|
---|
50 | #else
|
---|
51 | RT_C_DECLS_BEGIN
|
---|
52 | # include <iprt/nt/nt.h>
|
---|
53 | RT_C_DECLS_END
|
---|
54 | #endif
|
---|
55 |
|
---|
56 | #include <memory.h>
|
---|
57 | #if !defined(RT_OS_WINDOWS)
|
---|
58 | # error "RT_OS_WINDOWS must be defined!"
|
---|
59 | #endif
|
---|
60 |
|
---|
61 | #include <iprt/param.h>
|
---|
62 | #ifndef PAGE_OFFSET_MASK
|
---|
63 | # define PAGE_OFFSET_MASK (PAGE_SIZE - 1)
|
---|
64 | #endif
|
---|
65 |
|
---|
66 | /* Missing if we're compiling against older WDKs. */
|
---|
67 | #ifndef NonPagedPoolNx
|
---|
68 | # define NonPagedPoolNx ((POOL_TYPE)512)
|
---|
69 | #endif
|
---|
70 |
|
---|
71 | /*
|
---|
72 | * When targeting NT4 we have to undo some of the nice macros
|
---|
73 | * installed by the later DDKs.
|
---|
74 | */
|
---|
75 | #undef ExAllocatePool
|
---|
76 | #undef ExFreePool
|
---|
77 |
|
---|
78 | /** @def IPRT_NT_POOL_TAG
|
---|
79 | * Tag to use with the NT Pool APIs.
|
---|
80 | * In memory and in the various windbg tool it appears in the reverse order of
|
---|
81 | * what it is given as here, so it'll read "IPRT".
|
---|
82 | */
|
---|
83 | #define IPRT_NT_POOL_TAG 'TRPI'
|
---|
84 |
|
---|
85 | #endif
|
---|
86 |
|
---|