ReactOS 0.4.15-dev-7958-gcd0bb1a
wdm.template.h
Go to the documentation of this file.
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#include <suppress.h>
47
48#ifndef GUID_DEFINED
49#include <guiddef.h>
50#endif
51
52#ifdef _MAC
53#ifndef _INC_STRING
54#include <string.h>
55#endif /* _INC_STRING */
56#else
57#include <string.h>
58#endif /* _MAC */
59
60#ifndef _KTMTYPES_
61typedef GUID UOW, *PUOW;
62#endif
63
64typedef GUID *PGUID;
65
66#if (NTDDI_VERSION >= NTDDI_WINXP)
67#include <dpfilter.h>
68#endif
69
70#include "intrin.h"
71
73__drv_Mode_impl(WDM_INCLUDED)
74
75#ifdef __cplusplus
76extern "C" {
77#endif
78
82
83#if !defined(_NTHALDLL_) && !defined(_BLDR_)
84#define NTHALAPI DECLSPEC_IMPORT
85#else
86#define NTHALAPI
87#endif
88
89/* For ReactOS */
90#if !defined(_NTOSKRNL_) && !defined(_BLDR_) && !defined(_NTSYSTEM_)
91#define NTKERNELAPI DECLSPEC_IMPORT
92#else
93#define NTKERNELAPI
94#endif
95
96/* For statically-linked ntoskrnl_vista library */
97#if defined(NTKRNLVISTA)
98#define NTKRNLVISTAAPI
99#else
100#define NTKRNLVISTAAPI NTKERNELAPI
101#endif
102
103#if defined(_X86_) && !defined(_NTHAL_)
104#define _DECL_HAL_KE_IMPORT DECLSPEC_IMPORT
105#elif defined(_X86_)
106#define _DECL_HAL_KE_IMPORT
107#else
108#define _DECL_HAL_KE_IMPORT NTKERNELAPI
109#endif
110
111#if defined(_WIN64)
112#define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
113#else
114#define POINTER_ALIGNMENT
115#endif
116
117/* Helper macro to enable gcc's extension */
118#ifndef __GNU_EXTENSION
119#ifdef __GNUC__
120#define __GNU_EXTENSION __extension__
121#else
122#define __GNU_EXTENSION
123#endif
124#endif
125
126#if defined(_MSC_VER)
127
128/* Disable some warnings */
129#pragma warning(disable:4115) /* Named type definition in parentheses */
130#pragma warning(disable:4201) /* Nameless unions and structs */
131#pragma warning(disable:4214) /* Bit fields of other types than int */
132#pragma warning(disable:4820) /* Padding added, due to alignment requirement */
133
134/* Indicate if #pragma alloc_text() is supported */
135#if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
136#define ALLOC_PRAGMA 1
137#endif
138
139/* Indicate if #pragma data_seg() is supported */
140#if defined(_M_IX86) || defined(_M_AMD64)
141#define ALLOC_DATA_PRAGMA 1
142#endif
143
144#endif /* _MSC_VER */
145
146/* These macros are used to create aliases for imported data. We need to do
147 this to have declarations that are compatible with MS DDK */
148#ifdef _M_IX86
149#define __SYMBOL(_Name) "_"#_Name
150#define __IMPORTSYMBOL(_Name) "__imp__"#_Name
151#define __IMPORTNAME(_Name) __imp__##_Name
152#else
153#define __SYMBOL(_Name) #_Name
154#define __IMPORTSYMBOL(_Name) "__imp_"#_Name
155#define __IMPORTNAME(_Name) __imp_##_Name
156#endif
157#if defined(_MSC_VER) && !defined(__clang__)
158#define __CREATE_NTOS_DATA_IMPORT_ALIAS(_Name) \
159 __pragma(comment(linker, "/alternatename:"__SYMBOL(_Name) "=" __IMPORTSYMBOL(_Name)))
160#else /* !_MSC_VER */
161#ifndef __STRINGIFY
162#define __STRINGIFY(_exp) #_exp
163#endif
164#define _Pragma_redefine_extname(_Name, _Target) _Pragma(__STRINGIFY(redefine_extname _Name _Target))
165#define __CREATE_NTOS_DATA_IMPORT_ALIAS(_Name) \
166 _Pragma_redefine_extname(_Name,__IMPORTNAME(_Name))
167#endif
168
169#if defined(_WIN64)
170#if !defined(USE_DMA_MACROS) && !defined(_NTHAL_)
171#define USE_DMA_MACROS
172#endif
173#if !defined(NO_LEGACY_DRIVERS) && !defined(__REACTOS__)
174#define NO_LEGACY_DRIVERS
175#endif
176#endif /* defined(_WIN64) */
177
178/* Forward declarations */
179struct _IRP;
180struct _MDL;
181struct _KAPC;
182struct _KDPC;
183struct _FILE_OBJECT;
184struct _DMA_ADAPTER;
185struct _DEVICE_OBJECT;
186struct _DRIVER_OBJECT;
187struct _IO_STATUS_BLOCK;
189struct _SCATTER_GATHER_LIST;
193
194/* Structures not exposed to drivers */
197typedef struct _EPROCESS *PEPROCESS;
198typedef struct _ETHREAD *PETHREAD;
199typedef struct _IO_TIMER *PIO_TIMER;
200typedef struct _KINTERRUPT *PKINTERRUPT;
201typedef struct _KPROCESS *PKPROCESS;
202typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
203typedef struct _CONTEXT *PCONTEXT;
204
205#if defined(USE_DMA_MACROS) && !defined(_NTHAL_)
206typedef struct _DMA_ADAPTER *PADAPTER_OBJECT;
207#elif defined(_WDM_INCLUDED_)
209#else
210typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT;
211#endif
212
213#ifndef DEFINE_GUIDEX
214#ifdef _MSC_VER
215#define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
216#else
217#define DEFINE_GUIDEX(name) EXTERN_C const GUID name
218#endif
219#endif /* DEFINE_GUIDEX */
220
221#ifndef STATICGUIDOF
222#define STATICGUIDOF(guid) STATIC_##guid
223#endif
224
225/* GUID Comparison */
226#ifndef __IID_ALIGNED__
227#define __IID_ALIGNED__
228#ifdef __cplusplus
229inline int IsEqualGUIDAligned(REFGUID guid1, REFGUID guid2)
230{
231 return ( (*(PLONGLONG)(&guid1) == *(PLONGLONG)(&guid2)) &&
232 (*((PLONGLONG)(&guid1) + 1) == *((PLONGLONG)(&guid2) + 1)) );
233}
234#else
235#define IsEqualGUIDAligned(guid1, guid2) \
236 ( (*(PLONGLONG)(guid1) == *(PLONGLONG)(guid2)) && \
237 (*((PLONGLONG)(guid1) + 1) == *((PLONGLONG)(guid2) + 1)) )
238#endif /* __cplusplus */
239#endif /* !__IID_ALIGNED__ */
240
241
243$include (interlocked.h)
244$include (rtltypes.h)
245$include (ketypes.h)
246$include (mmtypes.h)
247$include (extypes.h)
248$include (setypes.h)
249$include (potypes.h)
250$include (cmtypes.h)
251$include (iotypes.h)
252$include (obtypes.h)
253$include (pstypes.h)
254$include (wmitypes.h)
255
256$include (kdfuncs.h)
257$include (kefuncs.h)
258$include (rtlfuncs.h)
259$include (mmfuncs.h)
260$include (sefuncs.h)
261$include (cmfuncs.h)
262$include (iofuncs.h)
263$include (pofuncs.h)
265$include (obfuncs.h)
266$include (psfuncs.h)
267$include (wmifuncs.h)
268$include (halfuncs.h)
269$include (nttmapi.h)
270$include (zwfuncs.h)
271
272#ifdef __cplusplus
273}
274#endif
275
276#endif /* !_WDMDDK_ */
LOCAL ex_t * exfuncs
Definition: comerr.c:50
#define __internal_kernel_driver
Definition: driverspecs.h:336
#define __drv_Mode_impl(x)
Definition: driverspecs.h:294
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
static GUID guid2
Definition: devinst.c:42
__GNU_EXTENSION typedef __int64 * PLONGLONG
Definition: ntbasedef.h:382
$define(_NTDDK_) $include(extypes.h) $include(cmtypes.h) $include(iotypes.h) $include(haltypes.h) $include(ketypes.h) $include(kdtypes.h) $include(mmtypes.h) $include(pstypes.h) $include(rtltypes.h) $include(setypes.h) $include(exfuncs.h) $include(halfuncs.h) $include(iofuncs.h) $include(kdfuncs.h) $include(kefuncs.h) $include(mmfuncs.h) $include(psfuncs.h) $include(rtlfuncs.h) $include(sefuncs.h) $include(zwfuncs.h) NTSYSAPI ULONGLONG NTAPI VerSetConditionMask(IN ULONGLONG ConditionMask
$include(setypes.h) $include(obtypes.h) $include(rtltypes.h) $include(rtlfuncs.h) _IRQL_requires_max_(PASSIVE_LEVEL) __kernel_entry NTSYSCALLAPI NTSTATUS NTAPI NtQueryObject(_In_opt_ HANDLE Handle
unsigned short USHORT
Definition: pedump.c:61
Definition: scsiwmi.h:51
Definition: ketypes.h:547
Definition: ketypes.h:699
uint32_t ULONG
Definition: typedefs.h:59
struct _KTHREAD * PRKTHREAD
Definition: wdm.template.h:202
struct _KTHREAD * PKTHREAD
Definition: wdm.template.h:202
GUID * PUOW
Definition: wdm.template.h:61
struct _CONTEXT * PCONTEXT
Definition: wdm.template.h:203
struct _CALLBACK_OBJECT * PCALLBACK_OBJECT
Definition: wdm.template.h:196
struct _KINTERRUPT * PKINTERRUPT
Definition: wdm.template.h:200
#define _WDMDDK_
Definition: wdm.template.h:26
GUID * PGUID
Definition: wdm.template.h:64
GUID UOW
Definition: wdm.template.h:61
struct _EPROCESS * PEPROCESS
Definition: wdm.template.h:197
struct _DMA_ADAPTER * PADAPTER_OBJECT
Definition: wdm.template.h:208
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
struct _KPROCESS * PKPROCESS
Definition: wdm.template.h:201
struct _OBJECT_TYPE * POBJECT_TYPE
Definition: wdm.template.h:195
struct _ETHREAD * PETHREAD
Definition: wdm.template.h:198
struct _IO_TIMER * PIO_TIMER
Definition: wdm.template.h:199
unsigned char UCHAR
Definition: xmlstorage.h:181