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
43 #if (NTDDI_VERSION >= NTDDI_WINXP)
53 #if !defined(_NTHALDLL_) && !defined(_BLDR_)
54 #define NTHALAPI DECLSPEC_IMPORT
60 #if !defined(_NTOSKRNL_) && !defined(_BLDR_)
61 #define NTKERNELAPI DECLSPEC_IMPORT
66 #if defined(_X86_) && !defined(_NTHAL_)
67 #define _DECL_HAL_KE_IMPORT DECLSPEC_IMPORT
69 #define _DECL_HAL_KE_IMPORT
71 #define _DECL_HAL_KE_IMPORT NTKERNELAPI
75 #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
77 #define POINTER_ALIGNMENT
80 /* Helper macro to enable gcc's extension. */
81 #ifndef __GNU_EXTENSION
83 #define __GNU_EXTENSION __extension__
85 #define __GNU_EXTENSION
91 /* Indicate if #pragma alloc_text() is supported */
92 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
93 #define ALLOC_PRAGMA 1
96 /* Indicate if #pragma data_seg() is supported */
97 #if defined(_M_IX86) || defined(_M_AMD64)
98 #define ALLOC_DATA_PRAGMA 1
103 /* Forward declarations */
110 struct _DEVICE_OBJECT
;
111 struct _DRIVER_OBJECT
;
112 struct _IO_STATUS_BLOCK
;
113 struct _DEVICE_DESCRIPTION
;
114 struct _SCATTER_GATHER_LIST
;
115 struct _DRIVE_LAYOUT_INFORMATION
;
116 struct _COMPRESSED_DATA_INFO
;
117 struct _IO_RESOURCE_DESCRIPTOR
;
119 /* Structures not exposed to drivers */
120 typedef struct _OBJECT_TYPE
*POBJECT_TYPE
;
121 typedef struct _HAL_DISPATCH_TABLE
*PHAL_DISPATCH_TABLE
;
122 typedef struct _HAL_PRIVATE_DISPATCH_TABLE
*PHAL_PRIVATE_DISPATCH_TABLE
;
123 typedef struct _ADAPTER_OBJECT
*PADAPTER_OBJECT
;
124 typedef struct _CALLBACK_OBJECT
*PCALLBACK_OBJECT
;
125 typedef struct _EPROCESS
*PEPROCESS
;
126 typedef struct _ETHREAD
*PETHREAD
;
127 typedef struct _IO_TIMER
*PIO_TIMER
;
128 typedef struct _KINTERRUPT
*PKINTERRUPT
;
129 typedef struct _KPROCESS
*PKPROCESS
;
130 typedef struct _KTHREAD
*PKTHREAD
, *PRKTHREAD
;
131 typedef struct _CONTEXT
*PCONTEXT
;
135 $
include (interlocked
.h
)
136 $
include (rtltypes
.h
)
149 #elif defined(_M_AMD64)
151 #elif defined(_M_IA64)
153 #elif defined(_M_PPC)
155 #elif defined(_M_MIPS)
157 #elif defined(_M_ARM)
160 #error Unknown Architecture
163 $
include (rtlfuncs
.h
)
173 $
include (wmifuncs
.h
)
175 $
include (halfuncs
.h
)
179 /******************************************************************************
181 ******************************************************************************/
193 /* GUID Comparison */
194 #ifndef __IID_ALIGNED__
195 #define __IID_ALIGNED__
197 inline int IsEqualGUIDAligned(REFGUID guid1
, REFGUID guid2
)
199 return ( (*(PLONGLONG
)(&guid1
) == *(PLONGLONG
)(&guid2
)) &&
200 (*((PLONGLONG
)(&guid1
) + 1) == *((PLONGLONG
)(&guid2
) + 1)) );
203 #define IsEqualGUIDAligned(guid1, guid2) \
204 ( (*(PLONGLONG)(guid1) == *(PLONGLONG)(guid2)) && \
205 (*((PLONGLONG)(guid1) + 1) == *((PLONGLONG)(guid2) + 1)) )
206 #endif /* __cplusplus */
207 #endif /* !__IID_ALIGNED__ */
209 #define MAXIMUM_SUSPEND_COUNT MAXCHAR
211 #define MAXIMUM_FILENAME_LENGTH 256
213 #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
215 #define OBJECT_TYPE_CREATE (0x0001)
216 #define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
218 #define DIRECTORY_QUERY (0x0001)
219 #define DIRECTORY_TRAVERSE (0x0002)
220 #define DIRECTORY_CREATE_OBJECT (0x0004)
221 #define DIRECTORY_CREATE_SUBDIRECTORY (0x0008)
222 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
224 #define EVENT_QUERY_STATE (0x0001)
225 #define EVENT_MODIFY_STATE (0x0002)
226 #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
228 #define SEMAPHORE_QUERY_STATE (0x0001)
229 #define SEMAPHORE_MODIFY_STATE (0x0002)
230 #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
232 #define SYMBOLIC_LINK_QUERY 0x0001
233 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
235 #define DUPLICATE_CLOSE_SOURCE 0x00000001
236 #define DUPLICATE_SAME_ACCESS 0x00000002
237 #define DUPLICATE_SAME_ATTRIBUTES 0x00000004
239 /* Global debug flag */
240 extern ULONG NtGlobalFlag
;
242 #ifndef _TRACEHANDLE_DEFINED
243 #define _TRACEHANDLE_DEFINED
244 typedef ULONG64 TRACEHANDLE
, *PTRACEHANDLE
;
253 #endif /* !_WDMDDK_ */