4 * Windows NT WDM Driver Developer Kit
6 * This file is part of the ReactOS DDK package.
9 * Amine Khaldi (amine.khaldi@reactos.org)
10 * Timo Kreuzer (timo.kreuzer@reactos.org)
12 * THIS SOFTWARE IS NOT COPYRIGHTED
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAIMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28 #define WDM_MAJORVERSION 0x06
29 #define WDM_MINORVERSION 0x00
31 /* Included via ntddk.h? */
34 #define _WDM_INCLUDED_
36 #define NO_INTERLOCKED_INTRINSICS
44 #include <kernelspecs.h>
55 #endif /* _INC_STRING */
61 typedef GUID UOW
, *PUOW
;
66 #if (NTDDI_VERSION >= NTDDI_WINXP)
72 __internal_kernel_driver
73 __drv_Mode_impl(WDM_INCLUDED
)
81 $
define(USHORT
=USHORT
)
83 #if !defined(_NTHALDLL_) && !defined(_BLDR_)
84 #define NTHALAPI DECLSPEC_IMPORT
90 #if !defined(_NTOSKRNL_) && !defined(_BLDR_) && !defined(_NTSYSTEM_)
91 #define NTKERNELAPI DECLSPEC_IMPORT
99 #if defined(_X86_) && !defined(_NTHAL_)
100 #define _DECL_HAL_KE_IMPORT DECLSPEC_IMPORT
102 #define _DECL_HAL_KE_IMPORT
104 #define _DECL_HAL_KE_IMPORT NTKERNELAPI
108 #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
110 #define POINTER_ALIGNMENT
113 /* Helper macro to enable gcc's extension. */
114 #ifndef __GNU_EXTENSION
116 #define __GNU_EXTENSION __extension__
118 #define __GNU_EXTENSION
122 #if defined(_MSC_VER)
124 /* Disable some warnings */
125 #pragma warning(disable:4115) /* Named type definition in parentheses */
126 #pragma warning(disable:4201) /* Nameless unions and structs */
127 #pragma warning(disable:4214) /* Bit fields of other types than int */
128 #pragma warning(disable:4820) /* Padding added, due to alignment requirement */
130 /* Indicate if #pragma alloc_text() is supported */
131 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
132 #define ALLOC_PRAGMA 1
135 /* Indicate if #pragma data_seg() is supported */
136 #if defined(_M_IX86) || defined(_M_AMD64)
137 #define ALLOC_DATA_PRAGMA 1
140 #endif /* _MSC_VER */
142 /* These macros are used to create aliases for imported data. We need to do
143 this to have declarations that are compatible with MS DDK */
145 #define __SYMBOL(_Name) "_"#_Name
146 #define __IMPORTSYMBOL(_Name) "__imp__"#_Name
147 #define __IMPORTNAME(_Name) __imp__##_Name
149 #define __SYMBOL(_Name) #_Name
150 #define __IMPORTSYMBOL(_Name) "__imp_"#_Name
151 #define __IMPORTNAME(_Name) __imp_##_Name
154 #define __CREATE_NTOS_DATA_IMPORT_ALIAS(_Name) \
155 __pragma(comment(linker, "/alternatename:"__SYMBOL(_Name) "=" __IMPORTSYMBOL(_Name)))
156 #else /* !_MSC_VER */
158 #define __STRINGIFY(_exp) #_exp
160 #define _Pragma_redefine_extname(_Name, _Target) _Pragma(__STRINGIFY(redefine_extname _Name _Target))
161 #define __CREATE_NTOS_DATA_IMPORT_ALIAS(_Name) \
162 _Pragma_redefine_extname(_Name,__IMPORTNAME(_Name))
166 #if !defined(USE_DMA_MACROS) && !defined(_NTHAL_)
167 #define USE_DMA_MACROS
169 #if !defined(NO_LEGACY_DRIVERS) && !defined(__REACTOS__)
170 #define NO_LEGACY_DRIVERS
172 #endif /* defined(_WIN64) */
174 /* Forward declarations */
181 struct _DEVICE_OBJECT
;
182 struct _DRIVER_OBJECT
;
183 struct _IO_STATUS_BLOCK
;
184 struct _DEVICE_DESCRIPTION
;
185 struct _SCATTER_GATHER_LIST
;
186 struct _DRIVE_LAYOUT_INFORMATION
;
187 struct _COMPRESSED_DATA_INFO
;
188 struct _IO_RESOURCE_DESCRIPTOR
;
190 /* Structures not exposed to drivers */
191 typedef struct _OBJECT_TYPE
*POBJECT_TYPE
;
192 typedef struct _HAL_DISPATCH_TABLE
*PHAL_DISPATCH_TABLE
;
193 typedef struct _HAL_PRIVATE_DISPATCH_TABLE
*PHAL_PRIVATE_DISPATCH_TABLE
;
194 typedef struct _CALLBACK_OBJECT
*PCALLBACK_OBJECT
;
195 typedef struct _EPROCESS
*PEPROCESS
;
196 typedef struct _ETHREAD
*PETHREAD
;
197 typedef struct _IO_TIMER
*PIO_TIMER
;
198 typedef struct _KINTERRUPT
*PKINTERRUPT
;
199 typedef struct _KPROCESS
*PKPROCESS
;
200 typedef struct _KTHREAD
*PKTHREAD
, *PRKTHREAD
;
201 typedef struct _CONTEXT
*PCONTEXT
;
203 #if defined(USE_DMA_MACROS) && !defined(_NTHAL_)
204 typedef struct _DMA_ADAPTER
*PADAPTER_OBJECT
;
205 #elif defined(_WDM_INCLUDED_)
206 typedef struct _DMA_ADAPTER
*PADAPTER_OBJECT
;
208 typedef struct _ADAPTER_OBJECT
*PADAPTER_OBJECT
;
211 #ifndef DEFINE_GUIDEX
213 #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
215 #define DEFINE_GUIDEX(name) EXTERN_C const GUID name
217 #endif /* DEFINE_GUIDEX */
220 #define STATICGUIDOF(guid) STATIC_##guid
223 /* GUID Comparison */
224 #ifndef __IID_ALIGNED__
225 #define __IID_ALIGNED__
227 inline int IsEqualGUIDAligned(REFGUID guid1
, REFGUID guid2
)
229 return ( (*(PLONGLONG
)(&guid1
) == *(PLONGLONG
)(&guid2
)) &&
230 (*((PLONGLONG
)(&guid1
) + 1) == *((PLONGLONG
)(&guid2
) + 1)) );
233 #define IsEqualGUIDAligned(guid1, guid2) \
234 ( (*(PLONGLONG)(guid1) == *(PLONGLONG)(guid2)) && \
235 (*((PLONGLONG)(guid1) + 1) == *((PLONGLONG)(guid2) + 1)) )
236 #endif /* __cplusplus */
237 #endif /* !__IID_ALIGNED__ */
241 $
include (interlocked
.h
)
242 $
include (rtltypes
.h
)
252 $
include (wmitypes
.h
)
255 $
include (rtlfuncs
.h
)
264 $
include (wmifuncs
.h
)
266 $
include (halfuncs
.h
)
274 #endif /* !_WDMDDK_ */