4 * Windows NT WDM Driver Developer Kit
6 * This file is part of the ReactOS DDK package.
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 /* Included via ntddk.h? */
31 #define _WDM_INCLUDED_
33 #define NO_INTERLOCKED_INTRINSICS
50 #endif /* _INC_STRING */
56 typedef GUID UOW
, *PUOW
;
61 #if (NTDDI_VERSION >= NTDDI_WINXP)
71 #if !defined(_NTHALDLL_) && !defined(_BLDR_)
72 #define NTHALAPI DECLSPEC_IMPORT
78 #if !defined(_NTOSKRNL_) && !defined(_BLDR_)
79 #define NTKERNELAPI DECLSPEC_IMPORT
84 #if defined(_X86_) && !defined(_NTHAL_)
85 #define _DECL_HAL_KE_IMPORT DECLSPEC_IMPORT
87 #define _DECL_HAL_KE_IMPORT
89 #define _DECL_HAL_KE_IMPORT NTKERNELAPI
93 #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
95 #define POINTER_ALIGNMENT
98 /* Helper macro to enable gcc's extension. */
99 #ifndef __GNU_EXTENSION
101 #define __GNU_EXTENSION __extension__
103 #define __GNU_EXTENSION
107 #if defined(_MSC_VER)
109 /* Disable some warnings */
110 #pragma warning(disable:4115) /* Named type definition in parentheses */
111 #pragma warning(disable:4201) /* Nameless unions and structs */
112 #pragma warning(disable:4214) /* Bit fields of other types than int */
113 #pragma warning(disable:4820) /* Padding added, due to alignemnet requirement */
115 /* Indicate if #pragma alloc_text() is supported */
116 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
117 #define ALLOC_PRAGMA 1
120 /* Indicate if #pragma data_seg() is supported */
121 #if defined(_M_IX86) || defined(_M_AMD64)
122 #define ALLOC_DATA_PRAGMA 1
127 /* Forward declarations */
134 struct _DEVICE_OBJECT
;
135 struct _DRIVER_OBJECT
;
136 struct _IO_STATUS_BLOCK
;
137 struct _DEVICE_DESCRIPTION
;
138 struct _SCATTER_GATHER_LIST
;
139 struct _DRIVE_LAYOUT_INFORMATION
;
140 struct _COMPRESSED_DATA_INFO
;
141 struct _IO_RESOURCE_DESCRIPTOR
;
143 /* Structures not exposed to drivers */
144 typedef struct _OBJECT_TYPE
*POBJECT_TYPE
;
145 typedef struct _HAL_DISPATCH_TABLE
*PHAL_DISPATCH_TABLE
;
146 typedef struct _HAL_PRIVATE_DISPATCH_TABLE
*PHAL_PRIVATE_DISPATCH_TABLE
;
147 typedef struct _CALLBACK_OBJECT
*PCALLBACK_OBJECT
;
148 typedef struct _EPROCESS
*PEPROCESS
;
149 typedef struct _ETHREAD
*PETHREAD
;
150 typedef struct _IO_TIMER
*PIO_TIMER
;
151 typedef struct _KINTERRUPT
*PKINTERRUPT
;
152 typedef struct _KPROCESS
*PKPROCESS
;
153 typedef struct _KTHREAD
*PKTHREAD
, *PRKTHREAD
;
154 typedef struct _CONTEXT
*PCONTEXT
;
156 #if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && ( defined(_NTDDK_) || defined(_NTDRIVER_) || defined(_NTOSP_))
157 typedef struct _DMA_ADAPTER
*PADAPTER_OBJECT
;
158 #elif defined(_WDM_INCLUDED_)
159 typedef struct _DMA_ADAPTER
*PADAPTER_OBJECT
;
161 typedef struct _ADAPTER_OBJECT
*PADAPTER_OBJECT
;
164 #ifndef DEFINE_GUIDEX
166 #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
168 #define DEFINE_GUIDEX(name) EXTERN_C const GUID name
170 #endif /* DEFINE_GUIDEX */
173 #define STATICGUIDOF(guid) STATIC_##guid
176 /* GUID Comparison */
177 #ifndef __IID_ALIGNED__
178 #define __IID_ALIGNED__
180 inline int IsEqualGUIDAligned(REFGUID guid1
, REFGUID guid2
)
182 return ( (*(PLONGLONG
)(&guid1
) == *(PLONGLONG
)(&guid2
)) &&
183 (*((PLONGLONG
)(&guid1
) + 1) == *((PLONGLONG
)(&guid2
) + 1)) );
186 #define IsEqualGUIDAligned(guid1, guid2) \
187 ( (*(PLONGLONG)(guid1) == *(PLONGLONG)(guid2)) && \
188 (*((PLONGLONG)(guid1) + 1) == *((PLONGLONG)(guid2) + 1)) )
189 #endif /* __cplusplus */
190 #endif /* !__IID_ALIGNED__ */
194 $
include (interlocked
.h
)
195 $
include (rtltypes
.h
)
205 $
include (wmitypes
.h
)
209 #elif defined(_M_AMD64)
211 #elif defined(_M_IA64)
213 #elif defined(_M_PPC)
215 #elif defined(_M_MIPS)
217 #elif defined(_M_ARM)
220 #error Unknown Architecture
223 $
include (rtlfuncs
.h
)
233 $
include (wmifuncs
.h
)
235 $
include (halfuncs
.h
)
243 #endif /* !_WDMDDK_ */