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
53 #endif /* _INC_STRING */
59 typedef GUID UOW
, *PUOW
;
64 #if (NTDDI_VERSION >= NTDDI_WINXP)
70 __internal_kernel_driver
71 __drv_Mode_impl(WDM_INCLUDED
)
77 #if !defined(_NTHALDLL_) && !defined(_BLDR_)
78 #define NTHALAPI DECLSPEC_IMPORT
84 #if !defined(_NTOSKRNL_) && !defined(_BLDR_)
85 #define NTKERNELAPI DECLSPEC_IMPORT
90 #if defined(_X86_) && !defined(_NTHAL_)
91 #define _DECL_HAL_KE_IMPORT DECLSPEC_IMPORT
93 #define _DECL_HAL_KE_IMPORT
95 #define _DECL_HAL_KE_IMPORT NTKERNELAPI
99 #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
101 #define POINTER_ALIGNMENT
104 /* Helper macro to enable gcc's extension. */
105 #ifndef __GNU_EXTENSION
107 #define __GNU_EXTENSION __extension__
109 #define __GNU_EXTENSION
113 #if defined(_MSC_VER)
115 /* Disable some warnings */
116 #pragma warning(disable:4115) /* Named type definition in parentheses */
117 #pragma warning(disable:4201) /* Nameless unions and structs */
118 #pragma warning(disable:4214) /* Bit fields of other types than int */
119 #pragma warning(disable:4820) /* Padding added, due to alignemnet requirement */
121 /* Indicate if #pragma alloc_text() is supported */
122 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
123 #define ALLOC_PRAGMA 1
126 /* Indicate if #pragma data_seg() is supported */
127 #if defined(_M_IX86) || defined(_M_AMD64)
128 #define ALLOC_DATA_PRAGMA 1
134 #if !defined(USE_DMA_MACROS) && !defined(_NTHAL_)
135 #define USE_DMA_MACROS
137 #if !defined(NO_LEGACY_DRIVERS) && !defined(__REACTOS__)
138 #define NO_LEGACY_DRIVERS
140 #endif /* defined(_WIN64) */
142 /* Forward declarations */
149 struct _DEVICE_OBJECT
;
150 struct _DRIVER_OBJECT
;
151 struct _IO_STATUS_BLOCK
;
152 struct _DEVICE_DESCRIPTION
;
153 struct _SCATTER_GATHER_LIST
;
154 struct _DRIVE_LAYOUT_INFORMATION
;
155 struct _COMPRESSED_DATA_INFO
;
156 struct _IO_RESOURCE_DESCRIPTOR
;
158 /* Structures not exposed to drivers */
159 typedef struct _OBJECT_TYPE
*POBJECT_TYPE
;
160 typedef struct _HAL_DISPATCH_TABLE
*PHAL_DISPATCH_TABLE
;
161 typedef struct _HAL_PRIVATE_DISPATCH_TABLE
*PHAL_PRIVATE_DISPATCH_TABLE
;
162 typedef struct _CALLBACK_OBJECT
*PCALLBACK_OBJECT
;
163 typedef struct _EPROCESS
*PEPROCESS
;
164 typedef struct _ETHREAD
*PETHREAD
;
165 typedef struct _IO_TIMER
*PIO_TIMER
;
166 typedef struct _KINTERRUPT
*PKINTERRUPT
;
167 typedef struct _KPROCESS
*PKPROCESS
;
168 typedef struct _KTHREAD
*PKTHREAD
, *PRKTHREAD
;
169 typedef struct _CONTEXT
*PCONTEXT
;
171 #if defined(USE_DMA_MACROS) && !defined(_NTHAL_)
172 typedef struct _DMA_ADAPTER
*PADAPTER_OBJECT
;
173 #elif defined(_WDM_INCLUDED_)
174 typedef struct _DMA_ADAPTER
*PADAPTER_OBJECT
;
176 typedef struct _ADAPTER_OBJECT
*PADAPTER_OBJECT
;
179 #ifndef DEFINE_GUIDEX
181 #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
183 #define DEFINE_GUIDEX(name) EXTERN_C const GUID name
185 #endif /* DEFINE_GUIDEX */
188 #define STATICGUIDOF(guid) STATIC_##guid
191 /* GUID Comparison */
192 #ifndef __IID_ALIGNED__
193 #define __IID_ALIGNED__
195 inline int IsEqualGUIDAligned(REFGUID guid1
, REFGUID guid2
)
197 return ( (*(PLONGLONG
)(&guid1
) == *(PLONGLONG
)(&guid2
)) &&
198 (*((PLONGLONG
)(&guid1
) + 1) == *((PLONGLONG
)(&guid2
) + 1)) );
201 #define IsEqualGUIDAligned(guid1, guid2) \
202 ( (*(PLONGLONG)(guid1) == *(PLONGLONG)(guid2)) && \
203 (*((PLONGLONG)(guid1) + 1) == *((PLONGLONG)(guid2) + 1)) )
204 #endif /* __cplusplus */
205 #endif /* !__IID_ALIGNED__ */
209 $
include (interlocked
.h
)
210 $
include (rtltypes
.h
)
220 $
include (wmitypes
.h
)
222 $
include (rtlfuncs
.h
)
232 $
include (wmifuncs
.h
)
234 $
include (halfuncs
.h
)
242 #endif /* !_WDMDDK_ */