VirtualBox

source: vbox/trunk/src/VBox/Runtime/r0drv/nt/the-nt-kernel.h@ 32736

Last change on this file since 32736 was 28800, checked in by vboxsync, 15 years ago

Automated rebranding to Oracle copyright/license strings via filemuncher

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1/* $Id: the-nt-kernel.h 28800 2010-04-27 08:22:32Z vboxsync $ */
2/** @file
3 * IPRT - Include all necessary headers for the NT kernel.
4 */
5
6/*
7 * Copyright (C) 2006-2007 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 (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
33# include <iprt/asm.h>
34# define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
35# define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
36# define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
37# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
38# pragma warning(disable : 4163)
39RT_C_DECLS_BEGIN
40# include <ntddk.h>
41RT_C_DECLS_END
42# pragma warning(default : 4163)
43# undef _InterlockedExchange
44# undef _InterlockedExchangeAdd
45# undef _InterlockedCompareExchange
46# undef _InterlockedAddLargeStatistic
47#else
48RT_C_DECLS_BEGIN
49# include <ntddk.h>
50RT_C_DECLS_END
51#endif
52
53#include <memory.h>
54#if !defined(RT_OS_WINDOWS)
55# error "RT_OS_WINDOWS must be defined!"
56#endif
57
58#include <iprt/param.h>
59#ifndef PAGE_OFFSET_MASK
60# define PAGE_OFFSET_MASK (PAGE_SIZE - 1)
61#endif
62
63/*
64 * When targeting NT4 we have to undo some of the nice macros
65 * installed by the later DDKs.
66 */
67#ifdef IPRT_TARGET_NT4
68# undef ExAllocatePoolWithTag
69# define ExAllocatePoolWithTag(a,b,c) ExAllocatePool(a,b)
70# undef ExAllocatePoolWithQuotaTag
71# define ExAllocatePoolWithQuotaTag(a,b,c) ExAllocatePoolWithQuota(a,b)
72# undef ExAllocatePool
73 NTKERNELAPI PVOID NTAPI ExAllocatePool(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes);
74# undef ExFreePool
75 NTKERNELAPI VOID NTAPI ExFreePool(IN PVOID P);
76#endif /* IPRT_TARGET_NT4 */
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
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette