1 | /* $Id: the-nt-kernel.h 3672 2007-07-17 12:39:30Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * innotek Portable Runtime - Include all necessary headers for the NT kernel.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
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 as published by the Free Software Foundation,
|
---|
13 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * If you received this file as part of a commercial VirtualBox
|
---|
18 | * distribution, then only the terms of your commercial VirtualBox
|
---|
19 | * license agreement apply instead of the previous paragraph.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef __the_nt_kernel_h__
|
---|
23 | #define __the_nt_kernel_h__
|
---|
24 |
|
---|
25 | #include <iprt/cdefs.h>
|
---|
26 |
|
---|
27 | #if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
|
---|
28 | # include <iprt/asm.h>
|
---|
29 | # define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
|
---|
30 | # define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
|
---|
31 | # define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
|
---|
32 | # define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
|
---|
33 | __BEGIN_DECLS
|
---|
34 | # include <ntddk.h>
|
---|
35 | __END_DECLS
|
---|
36 | # undef _InterlockedExchange
|
---|
37 | # undef _InterlockedExchangeAdd
|
---|
38 | # undef _InterlockedCompareExchange
|
---|
39 | # undef _InterlockedAddLargeStatistic
|
---|
40 | #else
|
---|
41 | __BEGIN_DECLS
|
---|
42 | # include <ntddk.h>
|
---|
43 | __END_DECLS
|
---|
44 | #endif
|
---|
45 |
|
---|
46 | #include <memory.h>
|
---|
47 | #if !defined(__WIN32__) && !defined(__WIN64__)
|
---|
48 | # error "__WIN32__ or __WIN64__ must be defined!"
|
---|
49 | #endif
|
---|
50 | #if !defined(RT_OS_WINDOWS)
|
---|
51 | # error "RT_OS_WINDOWS must be defined!"
|
---|
52 | #endif
|
---|
53 |
|
---|
54 | #ifndef PAGE_OFFSET_MASK
|
---|
55 | # define PAGE_OFFSET_MASK (PAGE_SIZE - 1)
|
---|
56 | #endif
|
---|
57 |
|
---|
58 | /*
|
---|
59 | * When targeting NT4 we have to undo some of the nice macros
|
---|
60 | * installed by the later DDKs.
|
---|
61 | */
|
---|
62 | #ifdef IPRT_TARGET_NT4
|
---|
63 | # undef ExAllocatePoolWithTag
|
---|
64 | # define ExAllocatePoolWithTag(a,b,c) ExAllocatePool(a,b)
|
---|
65 | # undef ExAllocatePoolWithQuotaTag
|
---|
66 | # define ExAllocatePoolWithQuotaTag(a,b,c) ExAllocatePoolWithQuota(a,b)
|
---|
67 | # undef ExAllocatePool
|
---|
68 | NTKERNELAPI PVOID NTAPI ExAllocatePool(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes);
|
---|
69 | # undef ExFreePool
|
---|
70 | NTKERNELAPI VOID NTAPI ExFreePool(IN PVOID P);
|
---|
71 | #endif /* IPRT_TARGET_NT4 */
|
---|
72 |
|
---|
73 | /** @def IPRT_NT_POOL_TAG
|
---|
74 | * Tag to use with the NT Pool APIs.
|
---|
75 | * In memory and in the various windbg tool it appears in the reverse order of
|
---|
76 | * what it is given as here, so it'll read "IPRT".
|
---|
77 | */
|
---|
78 | #define IPRT_NT_POOL_TAG 'TRPI'
|
---|
79 |
|
---|
80 | #endif
|
---|
81 |
|
---|