[CSRSRV]: Fix two DPRINTs.
[reactos.git] / reactos / include / xdk / wdm.template.h
1 /*
2 * wdm.h
3 *
4 * Windows NT WDM Driver Developer Kit
5 *
6 * This file is part of the ReactOS DDK package.
7 *
8 * Contributors:
9 * Amine Khaldi (amine.khaldi@reactos.org)
10 * Timo Kreuzer (timo.kreuzer@reactos.org)
11 *
12 * THIS SOFTWARE IS NOT COPYRIGHTED
13 *
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
16 *
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.
21 *
22 */
23 #pragma once
24
25 #ifndef _WDMDDK_
26 #define _WDMDDK_
27
28 #define WDM_MAJORVERSION 0x06
29 #define WDM_MINORVERSION 0x00
30
31 /* Included via ntddk.h? */
32 #ifndef _NTDDK_
33 #define _NTDDK_
34 #define _WDM_INCLUDED_
35 #define _DDK_DRIVER_
36 #define NO_INTERLOCKED_INTRINSICS
37 #endif /* _NTDDK_ */
38
39 /* Dependencies */
40 #define NT_INCLUDED
41 #include <excpt.h>
42 #include <ntdef.h>
43 #include <ntstatus.h>
44 #include <kernelspecs.h>
45 #include <ntiologc.h>
46
47 #ifndef GUID_DEFINED
48 #include <guiddef.h>
49 #endif
50
51 #ifdef _MAC
52 #ifndef _INC_STRING
53 #include <string.h>
54 #endif /* _INC_STRING */
55 #else
56 #include <string.h>
57 #endif /* _MAC */
58
59 #ifndef _KTMTYPES_
60 typedef GUID UOW, *PUOW;
61 #endif
62
63 typedef GUID *PGUID;
64
65 #if (NTDDI_VERSION >= NTDDI_WINXP)
66 #include <dpfilter.h>
67 #endif
68
69 #include "intrin.h"
70
71 __internal_kernel_driver
72 __drv_Mode_impl(WDM_INCLUDED)
73
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77
78 #if !defined(_NTHALDLL_) && !defined(_BLDR_)
79 #define NTHALAPI DECLSPEC_IMPORT
80 #else
81 #define NTHALAPI
82 #endif
83
84 /* For ReactOS */
85 #if !defined(_NTOSKRNL_) && !defined(_BLDR_)
86 #define NTKERNELAPI DECLSPEC_IMPORT
87 #else
88 #define NTKERNELAPI
89 #endif
90
91 #if defined(_X86_) && !defined(_NTHAL_)
92 #define _DECL_HAL_KE_IMPORT DECLSPEC_IMPORT
93 #elif defined(_X86_)
94 #define _DECL_HAL_KE_IMPORT
95 #else
96 #define _DECL_HAL_KE_IMPORT NTKERNELAPI
97 #endif
98
99 #if defined(_WIN64)
100 #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
101 #else
102 #define POINTER_ALIGNMENT
103 #endif
104
105 /* Helper macro to enable gcc's extension. */
106 #ifndef __GNU_EXTENSION
107 #ifdef __GNUC__
108 #define __GNU_EXTENSION __extension__
109 #else
110 #define __GNU_EXTENSION
111 #endif
112 #endif
113
114 #if defined(_MSC_VER)
115
116 /* Disable some warnings */
117 #pragma warning(disable:4115) /* Named type definition in parentheses */
118 #pragma warning(disable:4201) /* Nameless unions and structs */
119 #pragma warning(disable:4214) /* Bit fields of other types than int */
120 #pragma warning(disable:4820) /* Padding added, due to alignment requirement */
121
122 /* Indicate if #pragma alloc_text() is supported */
123 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
124 #define ALLOC_PRAGMA 1
125 #endif
126
127 /* Indicate if #pragma data_seg() is supported */
128 #if defined(_M_IX86) || defined(_M_AMD64)
129 #define ALLOC_DATA_PRAGMA 1
130 #endif
131
132 #endif
133
134 #if defined(_WIN64)
135 #if !defined(USE_DMA_MACROS) && !defined(_NTHAL_)
136 #define USE_DMA_MACROS
137 #endif
138 #if !defined(NO_LEGACY_DRIVERS) && !defined(__REACTOS__)
139 #define NO_LEGACY_DRIVERS
140 #endif
141 #endif /* defined(_WIN64) */
142
143 /* Forward declarations */
144 struct _IRP;
145 struct _MDL;
146 struct _KAPC;
147 struct _KDPC;
148 struct _FILE_OBJECT;
149 struct _DMA_ADAPTER;
150 struct _DEVICE_OBJECT;
151 struct _DRIVER_OBJECT;
152 struct _IO_STATUS_BLOCK;
153 struct _DEVICE_DESCRIPTION;
154 struct _SCATTER_GATHER_LIST;
155 struct _DRIVE_LAYOUT_INFORMATION;
156 struct _COMPRESSED_DATA_INFO;
157 struct _IO_RESOURCE_DESCRIPTOR;
158
159 /* Structures not exposed to drivers */
160 typedef struct _OBJECT_TYPE *POBJECT_TYPE;
161 typedef struct _HAL_DISPATCH_TABLE *PHAL_DISPATCH_TABLE;
162 typedef struct _HAL_PRIVATE_DISPATCH_TABLE *PHAL_PRIVATE_DISPATCH_TABLE;
163 typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT;
164 typedef struct _EPROCESS *PEPROCESS;
165 typedef struct _ETHREAD *PETHREAD;
166 typedef struct _IO_TIMER *PIO_TIMER;
167 typedef struct _KINTERRUPT *PKINTERRUPT;
168 typedef struct _KPROCESS *PKPROCESS;
169 typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
170 typedef struct _CONTEXT *PCONTEXT;
171
172 #if defined(USE_DMA_MACROS) && !defined(_NTHAL_)
173 typedef struct _DMA_ADAPTER *PADAPTER_OBJECT;
174 #elif defined(_WDM_INCLUDED_)
175 typedef struct _DMA_ADAPTER *PADAPTER_OBJECT;
176 #else
177 typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT;
178 #endif
179
180 #ifndef DEFINE_GUIDEX
181 #ifdef _MSC_VER
182 #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
183 #else
184 #define DEFINE_GUIDEX(name) EXTERN_C const GUID name
185 #endif
186 #endif /* DEFINE_GUIDEX */
187
188 #ifndef STATICGUIDOF
189 #define STATICGUIDOF(guid) STATIC_##guid
190 #endif
191
192 /* GUID Comparison */
193 #ifndef __IID_ALIGNED__
194 #define __IID_ALIGNED__
195 #ifdef __cplusplus
196 inline int IsEqualGUIDAligned(REFGUID guid1, REFGUID guid2)
197 {
198 return ( (*(PLONGLONG)(&guid1) == *(PLONGLONG)(&guid2)) &&
199 (*((PLONGLONG)(&guid1) + 1) == *((PLONGLONG)(&guid2) + 1)) );
200 }
201 #else
202 #define IsEqualGUIDAligned(guid1, guid2) \
203 ( (*(PLONGLONG)(guid1) == *(PLONGLONG)(guid2)) && \
204 (*((PLONGLONG)(guid1) + 1) == *((PLONGLONG)(guid2) + 1)) )
205 #endif /* __cplusplus */
206 #endif /* !__IID_ALIGNED__ */
207
208
209 $define (_WDMDDK_)
210 $include (interlocked.h)
211 $include (rtltypes.h)
212 $include (ketypes.h)
213 $include (mmtypes.h)
214 $include (extypes.h)
215 $include (setypes.h)
216 $include (potypes.h)
217 $include (cmtypes.h)
218 $include (iotypes.h)
219 $include (obtypes.h)
220 $include (pstypes.h)
221 $include (wmitypes.h)
222
223 $include (kefuncs.h)
224 $include (rtlfuncs.h)
225 $include (mmfuncs.h)
226 $include (sefuncs.h)
227 $include (cmfuncs.h)
228 $include (iofuncs.h)
229 $include (pofuncs.h)
230 $include (exfuncs.h)
231 $include (obfuncs.h)
232 $include (psfuncs.h)
233 $include (wmifuncs.h)
234 $include (kdfuncs.h)
235 $include (halfuncs.h)
236 $include (nttmapi.h)
237 $include (zwfuncs.h)
238
239 #ifdef __cplusplus
240 }
241 #endif
242
243 #endif /* !_WDMDDK_ */