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
44 #endif /* GUID_DEFINED */
46 #if (NTDDI_VERSION >= NTDDI_WINXP)
56 #if !defined(_NTHALDLL_) && !defined(_BLDR_)
57 #define NTHALAPI DECLSPEC_IMPORT
63 #if !defined(_NTOSKRNL_) && !defined(_BLDR_)
64 #define NTKERNELAPI DECLSPEC_IMPORT
69 #if defined(_X86_) && !defined(_NTHAL_)
70 #define _DECL_HAL_KE_IMPORT DECLSPEC_IMPORT
72 #define _DECL_HAL_KE_IMPORT
74 #define _DECL_HAL_KE_IMPORT NTKERNELAPI
78 #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
80 #define POINTER_ALIGNMENT
83 /* Helper macro to enable gcc's extension. */
84 #ifndef __GNU_EXTENSION
86 #define __GNU_EXTENSION __extension__
88 #define __GNU_EXTENSION
94 /* Indicate if #pragma alloc_text() is supported */
95 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
96 #define ALLOC_PRAGMA 1
99 /* Indicate if #pragma data_seg() is supported */
100 #if defined(_M_IX86) || defined(_M_AMD64)
101 #define ALLOC_DATA_PRAGMA 1
106 /* Forward declarations */
113 struct _DEVICE_OBJECT
;
114 struct _DRIVER_OBJECT
;
115 struct _IO_STATUS_BLOCK
;
116 struct _DEVICE_DESCRIPTION
;
117 struct _SCATTER_GATHER_LIST
;
118 struct _DRIVE_LAYOUT_INFORMATION
;
119 struct _COMPRESSED_DATA_INFO
;
120 struct _IO_RESOURCE_DESCRIPTOR
;
122 /* Structures not exposed to drivers */
123 typedef struct _OBJECT_TYPE
*POBJECT_TYPE
;
124 typedef struct _HAL_DISPATCH_TABLE
*PHAL_DISPATCH_TABLE
;
125 typedef struct _HAL_PRIVATE_DISPATCH_TABLE
*PHAL_PRIVATE_DISPATCH_TABLE
;
126 typedef struct _DEVICE_HANDLER_OBJECT
*PDEVICE_HANDLER_OBJECT
;
127 typedef struct _ADAPTER_OBJECT
*PADAPTER_OBJECT
;
128 typedef struct _CALLBACK_OBJECT
*PCALLBACK_OBJECT
;
129 typedef struct _ETHREAD
*PETHREAD
;
130 typedef struct _EPROCESS
*PEPROCESS
;
131 typedef struct _IO_TIMER
*PIO_TIMER
;
132 typedef struct _KINTERRUPT
*PKINTERRUPT
;
133 typedef struct _KPROCESS
*PKPROCESS
;
134 typedef struct _KTHREAD
*PKTHREAD
, *PRKTHREAD
;
135 typedef struct _CONTEXT
*PCONTEXT
;
139 $
include (interlocked
.h
)
140 $
include (rtltypes
.h
)
153 #elif defined(_M_AMD64)
155 #elif defined(_M_IA64)
157 #elif defined(_M_PPC)
159 #elif defined(_M_MIPS)
161 #elif defined(_M_ARM)
164 #error Unknown Architecture
167 $
include (rtlfuncs
.h
)
177 $
include (wmifuncs
.h
)
179 $
include (halfuncs
.h
)
183 /******************************************************************************
185 ******************************************************************************/
187 /* GUID Comparison */
188 #ifndef __IID_ALIGNED__
189 #define __IID_ALIGNED__
191 inline int IsEqualGUIDAligned(REFGUID guid1
, REFGUID guid2
)
193 return ( (*(PLONGLONG
)(&guid1
) == *(PLONGLONG
)(&guid2
)) &&
194 (*((PLONGLONG
)(&guid1
) + 1) == *((PLONGLONG
)(&guid2
) + 1)) );
197 #define IsEqualGUIDAligned(guid1, guid2) \
198 ( (*(PLONGLONG)(guid1) == *(PLONGLONG)(guid2)) && \
199 (*((PLONGLONG)(guid1) + 1) == *((PLONGLONG)(guid2) + 1)) )
200 #endif /* __cplusplus */
201 #endif /* !__IID_ALIGNED__ */
208 #define MAXIMUM_SUSPEND_COUNT MAXCHAR
210 #define MAXIMUM_FILENAME_LENGTH 256
212 #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
214 #define OBJECT_TYPE_CREATE (0x0001)
215 #define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
217 #define DIRECTORY_QUERY (0x0001)
218 #define DIRECTORY_TRAVERSE (0x0002)
219 #define DIRECTORY_CREATE_OBJECT (0x0004)
220 #define DIRECTORY_CREATE_SUBDIRECTORY (0x0008)
221 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
223 #define EVENT_QUERY_STATE (0x0001)
224 #define EVENT_MODIFY_STATE (0x0002)
225 #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
227 #define SEMAPHORE_QUERY_STATE (0x0001)
228 #define SEMAPHORE_MODIFY_STATE (0x0002)
229 #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
231 #define SYMBOLIC_LINK_QUERY 0x0001
232 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
234 #define DUPLICATE_CLOSE_SOURCE 0x00000001
235 #define DUPLICATE_SAME_ACCESS 0x00000002
236 #define DUPLICATE_SAME_ATTRIBUTES 0x00000004
238 /* Global debug flag */
239 extern ULONG NtGlobalFlag
;
241 /* Service Start Types */
242 #define SERVICE_BOOT_START 0x00000000
243 #define SERVICE_SYSTEM_START 0x00000001
244 #define SERVICE_AUTO_START 0x00000002
245 #define SERVICE_DEMAND_START 0x00000003
246 #define SERVICE_DISABLED 0x00000004
248 #ifndef _TRACEHANDLE_DEFINED
249 #define _TRACEHANDLE_DEFINED
250 typedef ULONG64 TRACEHANDLE
, *PTRACEHANDLE
;
259 #endif /* !_WDMDDK_ */