1 | /* $Id: the-nt-kernel.h 4219 2007-08-18 23:42:23Z 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 |
|
---|
18 | #ifndef ___the_nt_kernel_h
|
---|
19 | #define ___the_nt_kernel_h
|
---|
20 |
|
---|
21 | #include <iprt/cdefs.h>
|
---|
22 |
|
---|
23 | #if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
|
---|
24 | # include <iprt/asm.h>
|
---|
25 | # define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
|
---|
26 | # define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
|
---|
27 | # define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
|
---|
28 | # define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
|
---|
29 | __BEGIN_DECLS
|
---|
30 | # include <ntddk.h>
|
---|
31 | __END_DECLS
|
---|
32 | # undef _InterlockedExchange
|
---|
33 | # undef _InterlockedExchangeAdd
|
---|
34 | # undef _InterlockedCompareExchange
|
---|
35 | # undef _InterlockedAddLargeStatistic
|
---|
36 | #else
|
---|
37 | __BEGIN_DECLS
|
---|
38 | # include <ntddk.h>
|
---|
39 | __END_DECLS
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | #include <memory.h>
|
---|
43 | #if !defined(RT_OS_WINDOWS)
|
---|
44 | # error "RT_OS_WINDOWS must be defined!"
|
---|
45 | #endif
|
---|
46 |
|
---|
47 | #include <iprt/param.h>
|
---|
48 | #ifndef PAGE_OFFSET_MASK
|
---|
49 | # define PAGE_OFFSET_MASK (PAGE_SIZE - 1)
|
---|
50 | #endif
|
---|
51 |
|
---|
52 | /*
|
---|
53 | * When targeting NT4 we have to undo some of the nice macros
|
---|
54 | * installed by the later DDKs.
|
---|
55 | */
|
---|
56 | #ifdef IPRT_TARGET_NT4
|
---|
57 | # undef ExAllocatePoolWithTag
|
---|
58 | # define ExAllocatePoolWithTag(a,b,c) ExAllocatePool(a,b)
|
---|
59 | # undef ExAllocatePoolWithQuotaTag
|
---|
60 | # define ExAllocatePoolWithQuotaTag(a,b,c) ExAllocatePoolWithQuota(a,b)
|
---|
61 | # undef ExAllocatePool
|
---|
62 | NTKERNELAPI PVOID NTAPI ExAllocatePool(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes);
|
---|
63 | # undef ExFreePool
|
---|
64 | NTKERNELAPI VOID NTAPI ExFreePool(IN PVOID P);
|
---|
65 | #endif /* IPRT_TARGET_NT4 */
|
---|
66 |
|
---|
67 | /** @def IPRT_NT_POOL_TAG
|
---|
68 | * Tag to use with the NT Pool APIs.
|
---|
69 | * In memory and in the various windbg tool it appears in the reverse order of
|
---|
70 | * what it is given as here, so it'll read "IPRT".
|
---|
71 | */
|
---|
72 | #define IPRT_NT_POOL_TAG 'TRPI'
|
---|
73 |
|
---|
74 | #endif
|
---|
75 |
|
---|