ReactOS 0.4.16-dev-2491-g3dc6630
ntddk.template.h
Go to the documentation of this file.
1/*
2 * ntddk.h
3 *
4 * Windows NT Device Driver Kit
5 *
6 * This file is part of the ReactOS DDK package.
7 *
8 * Contributors:
9 * Amine Khaldi
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
24#pragma once
25
26#define _NTDDK_
27
28#if !defined(_NTHAL_) && !defined(_NTIFS_)
29#define _NTDDK_INCLUDED_
30#define _DDK_DRIVER_
31#endif
32
33/* Dependencies */
34
35#define NT_INCLUDED
36#define _CTYPE_DISABLE_MACROS
37
38#include <wdm.h>
39#include <excpt.h>
40#include <ntdef.h>
41#include <ntstatus.h>
42#include <mce.h>
43#include <bugcodes.h>
44#include <ntiologc.h>
45
46#include <stdarg.h> // FIXME
47#include <basetyps.h> // FIXME
48
49
50#ifdef __cplusplus
51extern "C" {
52#endif
53
54/* GUID and UUID */
55#ifndef _NTLSA_IFS_
56#ifndef _NTLSA_AUDIT_
57#define _NTLSA_AUDIT_
58
59#ifndef GUID_DEFINED
60#include <guiddef.h>
61#endif
62
63#endif /* _NTLSA_AUDIT_ */
64#endif /* _NTLSA_IFS_ */
65
66typedef GUID UUID;
67
68/* Forward declarations */
70struct _CREATE_DISK;
71struct _DRIVE_LAYOUT_INFORMATION_EX;
72struct _SET_PARTITION_INFORMATION_EX;
74
75/* Structures not exposed to drivers */
76typedef struct _BUS_HANDLER *PBUS_HANDLER;
77typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT;
78#if defined(_NTHAL_INCLUDED_) || defined(__REACTOS__)
79typedef struct _KAFFINITY_EX *PKAFFINITY_EX;
80#endif
81typedef struct _PEB *PPEB;
82
83#ifndef _NTIMAGE_
84
87
88#ifdef _WIN64
90#else
92#endif
93
94#endif /* _NTIMAGE_ */
95
97$include (extypes.h)
98$include (cmtypes.h)
99$include (iotypes.h)
100$include (haltypes.h)
101$include (ketypes.h)
102$include (kdtypes.h)
103$include (mmtypes.h)
104$include (pstypes.h)
105$include (rtltypes.h)
106$include (setypes.h)
107$include (wheatypes.h)
108
109#if defined(_M_IX86)
110$include(x86/ke.h)
111$include(x86/mm.h)
112#elif defined(_M_AMD64)
113$include(amd64/ke.h)
114$include(amd64/mm.h)
115#elif defined(_M_IA64)
116$include(ia64/ke.h)
117#elif defined(_M_PPC)
118$include(ppc/ke.h)
119#elif defined(_M_MIPS)
120$include(mips/ke.h)
121#elif defined(_M_ARM)
122$include(arm/ke.h)
123$include(arm/mm.h)
124#elif defined(_M_ARM64)
125$include(arm64/ke.h)
126#else
127#error Unknown Architecture
128#endif
129
131$include (halfuncs.h)
132$include (iofuncs.h)
133$include (kdfuncs.h)
134$include (kefuncs.h)
135$include (mmfuncs.h)
136$include (psfuncs.h)
137$include (rtlfuncs.h)
138$include (sefuncs.h)
139$include (zwfuncs.h)
140
141
142/* UNSORTED */
143
144#define VER_SET_CONDITION(ConditionMask, TypeBitMask, ComparisonType) \
145 ((ConditionMask) = VerSetConditionMask((ConditionMask), \
146 (TypeBitMask), (ComparisonType)))
147
148#if (NTDDI_VERSION >= NTDDI_WIN2K)
151NTAPI
156#endif
157
158typedef struct _KERNEL_USER_TIMES {
164
165/* NtXxx Functions */
166
171
179
180typedef NTSTATUS
181(__cdecl *PFNFTH)(
182 _Inout_ PSYSTEM_FIRMWARE_TABLE_INFORMATION SystemFirmwareTableInfo);
183
190
194
199
200#define DRIVER_VERIFIER_SPECIAL_POOLING 0x0001
201#define DRIVER_VERIFIER_FORCE_IRQL_CHECKING 0x0002
202#define DRIVER_VERIFIER_INJECT_ALLOCATION_FAILURES 0x0004
203#define DRIVER_VERIFIER_TRACK_POOL_ALLOCATIONS 0x0008
204#define DRIVER_VERIFIER_IO_CHECKING 0x0010
205
206#define SHARED_GLOBAL_FLAGS_ERROR_PORT_V 0x0
207#define SHARED_GLOBAL_FLAGS_ERROR_PORT (1UL << SHARED_GLOBAL_FLAGS_ERROR_PORT_V)
208
209#define SHARED_GLOBAL_FLAGS_ELEVATION_ENABLED_V 0x1
210#define SHARED_GLOBAL_FLAGS_ELEVATION_ENABLED (1UL << SHARED_GLOBAL_FLAGS_ELEVATION_ENABLED_V)
211
212#define SHARED_GLOBAL_FLAGS_VIRT_ENABLED_V 0x2
213#define SHARED_GLOBAL_FLAGS_VIRT_ENABLED (1UL << SHARED_GLOBAL_FLAGS_VIRT_ENABLED_V)
214
215#define SHARED_GLOBAL_FLAGS_INSTALLER_DETECT_ENABLED_V 0x3
216#define SHARED_GLOBAL_FLAGS_INSTALLER_DETECT_ENABLED \
217 (1UL << SHARED_GLOBAL_FLAGS_INSTALLER_DETECT_ENABLED_V)
218
219#define SHARED_GLOBAL_FLAGS_SPARE_V 0x4
220#define SHARED_GLOBAL_FLAGS_SPARE \
221 (1UL << SHARED_GLOBAL_FLAGS_SPARE_V)
222
223#define SHARED_GLOBAL_FLAGS_DYNAMIC_PROC_ENABLED_V 0x5
224#define SHARED_GLOBAL_FLAGS_DYNAMIC_PROC_ENABLED \
225 (1UL << SHARED_GLOBAL_FLAGS_DYNAMIC_PROC_ENABLED_V)
226
227#define SHARED_GLOBAL_FLAGS_SEH_VALIDATION_ENABLED_V 0x6
228#define SHARED_GLOBAL_FLAGS_SEH_VALIDATION_ENABLED \
229 (1UL << SHARED_GLOBAL_FLAGS_SEH_VALIDATION_ENABLED_V)
230
231#define EX_INIT_BITS(Flags, Bit) \
232 *((Flags)) |= (Bit) // Safe to use before concurrently accessible
233
234#define EX_TEST_SET_BIT(Flags, Bit) \
235 InterlockedBitTestAndSet ((PLONG)(Flags), (Bit))
236
237#define EX_TEST_CLEAR_BIT(Flags, Bit) \
238 InterlockedBitTestAndReset ((PLONG)(Flags), (Bit))
239
240#define PCCARD_MAP_ERROR 0x01
241#define PCCARD_DEVICE_PCI 0x10
242
243#define PCCARD_SCAN_DISABLED 0x01
244#define PCCARD_MAP_ZERO 0x02
245#define PCCARD_NO_TIMER 0x03
246#define PCCARD_NO_PIC 0x04
247#define PCCARD_NO_LEGACY_BASE 0x05
248#define PCCARD_DUP_LEGACY_BASE 0x06
249#define PCCARD_NO_CONTROLLERS 0x07
250
251#define MAXIMUM_EXPANSION_SIZE (KERNEL_LARGE_STACK_SIZE - (PAGE_SIZE / 2))
252
253/* Filesystem runtime library routines */
254
255#if (NTDDI_VERSION >= NTDDI_WIN2K)
259NTAPI
262#endif
263
264#ifdef __cplusplus
265}
266#endif
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
#define NTSYSAPI
Definition: ntoskrnl.h:12
LOCAL ex_t * exfuncs
Definition: comerr.c:50
#define NTSTATUS
Definition: precomp.h:19
#define __cdecl
Definition: corecrt.h:121
#define ULONG_PTR
Definition: config.h:101
Status
Definition: gdiplustypes.h:25
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
_In_ ULONG _In_ ULONGLONG ConditionMask
Definition: rtlfuncs.h:4679
#define _Inout_
Definition: no_sal2.h:162
#define _Must_inspect_result_
Definition: no_sal2.h:62
#define _In_
Definition: no_sal2.h:158
struct _SYSTEM_FIRMWARE_TABLE_HANDLER * PSYSTEM_FIRMWARE_TABLE_HANDLER
struct _SYSTEM_FIRMWARE_TABLE_INFORMATION * PSYSTEM_FIRMWARE_TABLE_INFORMATION
ULONG_PTR(NTAPI * PDRIVER_VERIFIER_THUNK_ROUTINE)(_In_ PVOID Context)
struct _PEB * PPEB
$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(wheatypes.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
GUID UUID
NTSTATUS(__cdecl * PFNFTH)(_Inout_ PSYSTEM_FIRMWARE_TABLE_INFORMATION SystemFirmwareTableInfo)
struct _DEVICE_HANDLER_OBJECT * PDEVICE_HANDLER_OBJECT
struct _KERNEL_USER_TIMES KERNEL_USER_TIMES
#define _NTDDK_
@ SystemFirmwareTable_Enumerate
@ SystemFirmwareTable_Get
enum _SYSTEM_FIRMWARE_TABLE_ACTION SYSTEM_FIRMWARE_TABLE_ACTION
IN ULONG TypeMask
IN ULONG IN UCHAR Condition
PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS
struct _KERNEL_USER_TIMES * PKERNEL_USER_TIMES
struct _BUS_HANDLER * PBUS_HANDLER
struct _IMAGE_NT_HEADERS64 * PIMAGE_NT_HEADERS64
_Must_inspect_result_ NTKERNELAPI BOOLEAN NTAPI FsRtlIsTotalDeviceFailure(_In_ NTSTATUS Status)
struct _DRIVER_VERIFIER_THUNK_PAIRS DRIVER_VERIFIER_THUNK_PAIRS
struct _DRIVER_VERIFIER_THUNK_PAIRS * PDRIVER_VERIFIER_THUNK_PAIRS
struct _SYSTEM_FIRMWARE_TABLE_HANDLER SYSTEM_FIRMWARE_TABLE_HANDLER
struct _IMAGE_NT_HEADERS * PIMAGE_NT_HEADERS32
struct _SYSTEM_FIRMWARE_TABLE_INFORMATION SYSTEM_FIRMWARE_TABLE_INFORMATION
$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
@ arm
Definition: optimize.h:109
ULONGLONG NTAPI VerSetConditionMask(IN ULONGLONG ConditionMask, IN ULONG TypeMask, IN UCHAR Condition)
Definition: version.c:262
_In_ PVOID Context
Definition: storport.h:2269
PDRIVER_VERIFIER_THUNK_ROUTINE NewRoutine
PDRIVER_VERIFIER_THUNK_ROUTINE PristineRoutine
LARGE_INTEGER UserTime
Definition: winternl.h:2377
LARGE_INTEGER CreateTime
Definition: winternl.h:2374
LARGE_INTEGER KernelTime
Definition: winternl.h:2376
LARGE_INTEGER ExitTime
Definition: winternl.h:2375
SYSTEM_FIRMWARE_TABLE_ACTION Action
Definition: winternl.h:3224
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define NTKERNELAPI
_SYSTEM_FIRMWARE_TABLE_ACTION
Definition: winternl.h:3214
enum _SYSTEM_FIRMWARE_TABLE_ACTION SYSTEM_FIRMWARE_TABLE_ACTION
unsigned char UCHAR
Definition: xmlstorage.h:181