revert r46561
[reactos.git] / reactos / include / ddk / wdm.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
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 /* Included via ntddk.h? */
29 #ifndef _NTDDK_
30 #define _NTDDK_
31 #define _WDM_INCLUDED_
32 #define _DDK_DRIVER_
33 #define NO_INTERLOCKED_INTRINSICS
34 #endif /* _NTDDK_ */
35
36 /* Dependencies */
37 #define NT_INCLUDED
38 #include <excpt.h>
39 #include <ntdef.h>
40 #include <ntstatus.h>
41
42 #ifndef GUID_DEFINED
43 #include <guiddef.h>
44 #endif /* GUID_DEFINED */
45
46 #ifndef _KTMTYPES_
47 typedef GUID UOW, *PUOW;
48 #endif
49
50 #if (NTDDI_VERSION >= NTDDI_WINXP)
51 #include <dpfilter.h>
52 #endif
53
54 #include "intrin.h"
55
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59
60 #if !defined(_NTHALDLL_) && !defined(_BLDR_)
61 #define NTHALAPI DECLSPEC_IMPORT
62 #else
63 #define NTHALAPI
64 #endif
65
66 /* For ReactOS */
67 #if !defined(_NTOSKRNL_) && !defined(_BLDR_)
68 #define NTKERNELAPI DECLSPEC_IMPORT
69 #else
70 #define NTKERNELAPI
71 #endif
72
73 #if defined(_X86_) && !defined(_NTHAL_)
74 #define _DECL_HAL_KE_IMPORT DECLSPEC_IMPORT
75 #elif defined(_X86_)
76 #define _DECL_HAL_KE_IMPORT
77 #else
78 #define _DECL_HAL_KE_IMPORT NTKERNELAPI
79 #endif
80
81 #if defined(_WIN64)
82 #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
83 #else
84 #define POINTER_ALIGNMENT
85 #endif
86
87 /* Helper macro to enable gcc's extension. */
88 #ifndef __GNU_EXTENSION
89 #ifdef __GNUC__
90 #define __GNU_EXTENSION __extension__
91 #else
92 #define __GNU_EXTENSION
93 #endif
94 #endif
95
96 #if defined(_MSC_VER)
97
98 /* Indicate if #pragma alloc_text() is supported */
99 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
100 #define ALLOC_PRAGMA 1
101 #endif
102
103 /* Indicate if #pragma data_seg() is supported */
104 #if defined(_M_IX86) || defined(_M_AMD64)
105 #define ALLOC_DATA_PRAGMA 1
106 #endif
107
108 #endif
109
110 /* Forward declarations */
111 struct _IRP;
112 struct _MDL;
113 struct _KAPC;
114 struct _KDPC;
115 struct _FILE_OBJECT;
116 struct _DMA_ADAPTER;
117 struct _DEVICE_OBJECT;
118 struct _DRIVER_OBJECT;
119 struct _IO_STATUS_BLOCK;
120 struct _DEVICE_DESCRIPTION;
121 struct _SCATTER_GATHER_LIST;
122 struct _DRIVE_LAYOUT_INFORMATION;
123 struct _COMPRESSED_DATA_INFO;
124 struct _IO_RESOURCE_DESCRIPTOR;
125
126 /* Structures not exposed to drivers */
127 typedef struct _OBJECT_TYPE *POBJECT_TYPE;
128 typedef struct _HAL_DISPATCH_TABLE *PHAL_DISPATCH_TABLE;
129 typedef struct _HAL_PRIVATE_DISPATCH_TABLE *PHAL_PRIVATE_DISPATCH_TABLE;
130 typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT;
131 typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT;
132 typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT;
133 typedef struct _ETHREAD *PETHREAD;
134 typedef struct _EPROCESS *PEPROCESS;
135 typedef struct _IO_TIMER *PIO_TIMER;
136 typedef struct _KINTERRUPT *PKINTERRUPT;
137 typedef struct _KPROCESS *PKPROCESS;
138 typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
139 typedef struct _CONTEXT *PCONTEXT;
140
141
142 /******************************************************************************
143 * INTERLOCKED Functions *
144 ******************************************************************************/
145 //
146 // Intrinsics (note: taken from our winnt.h)
147 // FIXME: 64-bit
148 //
149 #if defined(__GNUC__)
150
151 static __inline__ BOOLEAN
152 InterlockedBitTestAndSet(IN LONG volatile *Base,
153 IN LONG Bit)
154 {
155 #if defined(_M_IX86)
156 LONG OldBit;
157 __asm__ __volatile__("lock "
158 "btsl %2,%1\n\t"
159 "sbbl %0,%0\n\t"
160 :"=r" (OldBit),"+m" (*Base)
161 :"Ir" (Bit)
162 : "memory");
163 return OldBit;
164 #else
165 return (_InterlockedOr(Base, 1 << Bit) >> Bit) & 1;
166 #endif
167 }
168
169 static __inline__ BOOLEAN
170 InterlockedBitTestAndReset(IN LONG volatile *Base,
171 IN LONG Bit)
172 {
173 #if defined(_M_IX86)
174 LONG OldBit;
175 __asm__ __volatile__("lock "
176 "btrl %2,%1\n\t"
177 "sbbl %0,%0\n\t"
178 :"=r" (OldBit),"+m" (*Base)
179 :"Ir" (Bit)
180 : "memory");
181 return OldBit;
182 #else
183 return (_InterlockedAnd(Base, ~(1 << Bit)) >> Bit) & 1;
184 #endif
185 }
186
187 #endif
188
189 #define BitScanForward _BitScanForward
190 #define BitScanReverse _BitScanReverse
191 #define BitTest _bittest
192 #define BitTestAndComplement _bittestandcomplement
193 #define BitTestAndSet _bittestandset
194 #define BitTestAndReset _bittestandreset
195 #define InterlockedBitTestAndSet _interlockedbittestandset
196 #define InterlockedBitTestAndReset _interlockedbittestandreset
197
198 #ifdef _M_AMD64
199 #define InterlockedBitTestAndSet64 _interlockedbittestandset64
200 #define InterlockedBitTestAndReset64 _interlockedbittestandreset64
201 #endif
202
203 #if !defined(__INTERLOCKED_DECLARED)
204 #define __INTERLOCKED_DECLARED
205
206 #if defined (_X86_)
207 #if defined(NO_INTERLOCKED_INTRINSICS)
208 NTKERNELAPI
209 LONG
210 FASTCALL
211 InterlockedIncrement(
212 IN OUT LONG volatile *Addend);
213
214 NTKERNELAPI
215 LONG
216 FASTCALL
217 InterlockedDecrement(
218 IN OUT LONG volatile *Addend);
219
220 NTKERNELAPI
221 LONG
222 FASTCALL
223 InterlockedCompareExchange(
224 IN OUT LONG volatile *Destination,
225 IN LONG Exchange,
226 IN LONG Comparand);
227
228 NTKERNELAPI
229 LONG
230 FASTCALL
231 InterlockedExchange(
232 IN OUT LONG volatile *Destination,
233 IN LONG Value);
234
235 NTKERNELAPI
236 LONG
237 FASTCALL
238 InterlockedExchangeAdd(
239 IN OUT LONG volatile *Addend,
240 IN LONG Value);
241
242 #else // !defined(NO_INTERLOCKED_INTRINSICS)
243
244 #define InterlockedExchange _InterlockedExchange
245 #define InterlockedIncrement _InterlockedIncrement
246 #define InterlockedDecrement _InterlockedDecrement
247 #define InterlockedExchangeAdd _InterlockedExchangeAdd
248 #define InterlockedCompareExchange _InterlockedCompareExchange
249 #define InterlockedOr _InterlockedOr
250 #define InterlockedAnd _InterlockedAnd
251 #define InterlockedXor _InterlockedXor
252
253 #endif // !defined(NO_INTERLOCKED_INTRINSICS)
254
255 #endif // defined (_X86_)
256
257 #if !defined (_WIN64)
258 /*
259 * PVOID
260 * InterlockedExchangePointer(
261 * IN OUT PVOID volatile *Target,
262 * IN PVOID Value)
263 */
264 #define InterlockedExchangePointer(Target, Value) \
265 ((PVOID) InterlockedExchange((PLONG) Target, (LONG) Value))
266
267 /*
268 * PVOID
269 * InterlockedCompareExchangePointer(
270 * IN OUT PVOID *Destination,
271 * IN PVOID Exchange,
272 * IN PVOID Comparand)
273 */
274 #define InterlockedCompareExchangePointer(Destination, Exchange, Comparand) \
275 ((PVOID) InterlockedCompareExchange((PLONG) Destination, (LONG) Exchange, (LONG) Comparand))
276
277 #define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd((LONG *)a, b)
278 #define InterlockedIncrementSizeT(a) InterlockedIncrement((LONG *)a)
279 #define InterlockedDecrementSizeT(a) InterlockedDecrement((LONG *)a)
280
281 #endif // !defined (_WIN64)
282
283 #if defined (_M_AMD64)
284
285 #define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONGLONG *)a, (LONGLONG)b)
286 #define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONGLONG *)a)
287 #define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONGLONG *)a)
288 #define InterlockedAnd _InterlockedAnd
289 #define InterlockedOr _InterlockedOr
290 #define InterlockedXor _InterlockedXor
291 #define InterlockedIncrement _InterlockedIncrement
292 #define InterlockedDecrement _InterlockedDecrement
293 #define InterlockedAdd _InterlockedAdd
294 #define InterlockedExchange _InterlockedExchange
295 #define InterlockedExchangeAdd _InterlockedExchangeAdd
296 #define InterlockedCompareExchange _InterlockedCompareExchange
297 #define InterlockedAnd64 _InterlockedAnd64
298 #define InterlockedOr64 _InterlockedOr64
299 #define InterlockedXor64 _InterlockedXor64
300 #define InterlockedIncrement64 _InterlockedIncrement64
301 #define InterlockedDecrement64 _InterlockedDecrement64
302 #define InterlockedAdd64 _InterlockedAdd64
303 #define InterlockedExchange64 _InterlockedExchange64
304 #define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
305 #define InterlockedCompareExchange64 _InterlockedCompareExchange64
306 #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
307 #define InterlockedExchangePointer _InterlockedExchangePointer
308 #define InterlockedBitTestAndSet64 _interlockedbittestandset64
309 #define InterlockedBitTestAndReset64 _interlockedbittestandreset64
310
311 #endif // _M_AMD64
312
313 #if defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS)
314 //#if !defined(_X86AMD64_) // FIXME: what's _X86AMD64_ used for?
315 FORCEINLINE
316 LONG64
317 InterlockedAdd64(
318 IN OUT LONG64 volatile *Addend,
319 IN LONG64 Value)
320 {
321 return InterlockedExchangeAdd64(Addend, Value) + Value;
322 }
323 //#endif
324 #endif
325
326 #endif /* !__INTERLOCKED_DECLARED */
327
328
329 /******************************************************************************
330 * Runtime Library Types *
331 ******************************************************************************/
332
333 #define RTL_REGISTRY_ABSOLUTE 0
334 #define RTL_REGISTRY_SERVICES 1
335 #define RTL_REGISTRY_CONTROL 2
336 #define RTL_REGISTRY_WINDOWS_NT 3
337 #define RTL_REGISTRY_DEVICEMAP 4
338 #define RTL_REGISTRY_USER 5
339 #define RTL_REGISTRY_MAXIMUM 6
340 #define RTL_REGISTRY_HANDLE 0x40000000
341 #define RTL_REGISTRY_OPTIONAL 0x80000000
342
343 /* RTL_QUERY_REGISTRY_TABLE.Flags */
344 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
345 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
346 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
347 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
348 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
349 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
350 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
351
352 #define HASH_STRING_ALGORITHM_DEFAULT 0
353 #define HASH_STRING_ALGORITHM_X65599 1
354 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff
355
356 typedef struct _RTL_BITMAP {
357 ULONG SizeOfBitMap;
358 PULONG Buffer;
359 } RTL_BITMAP, *PRTL_BITMAP;
360
361 typedef struct _RTL_BITMAP_RUN {
362 ULONG StartingIndex;
363 ULONG NumberOfBits;
364 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
365
366 typedef NTSTATUS
367 (DDKAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
368 IN PWSTR ValueName,
369 IN ULONG ValueType,
370 IN PVOID ValueData,
371 IN ULONG ValueLength,
372 IN PVOID Context,
373 IN PVOID EntryContext);
374
375 typedef struct _RTL_QUERY_REGISTRY_TABLE {
376 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
377 ULONG Flags;
378 PCWSTR Name;
379 PVOID EntryContext;
380 ULONG DefaultType;
381 PVOID DefaultData;
382 ULONG DefaultLength;
383 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
384
385 typedef struct _TIME_FIELDS {
386 CSHORT Year;
387 CSHORT Month;
388 CSHORT Day;
389 CSHORT Hour;
390 CSHORT Minute;
391 CSHORT Second;
392 CSHORT Milliseconds;
393 CSHORT Weekday;
394 } TIME_FIELDS, *PTIME_FIELDS;
395
396 /* Slist Header */
397 #ifndef _SLIST_HEADER_
398 #define _SLIST_HEADER_
399
400 #if defined(_WIN64)
401 typedef struct DECLSPEC_ALIGN(16) _SLIST_ENTRY *PSLIST_ENTRY;
402 typedef struct DECLSPEC_ALIGN(16) _SLIST_ENTRY {
403 PSLIST_ENTRY Next;
404 } SLIST_ENTRY;
405 typedef union DECLSPEC_ALIGN(16) _SLIST_HEADER {
406 struct {
407 ULONGLONG Alignment;
408 ULONGLONG Region;
409 } DUMMYSTRUCTNAME;
410 struct {
411 ULONGLONG Depth:16;
412 ULONGLONG Sequence:9;
413 ULONGLONG NextEntry:39;
414 ULONGLONG HeaderType:1;
415 ULONGLONG Init:1;
416 ULONGLONG Reserved:59;
417 ULONGLONG Region:3;
418 } Header8;
419 struct {
420 ULONGLONG Depth:16;
421 ULONGLONG Sequence:48;
422 ULONGLONG HeaderType:1;
423 ULONGLONG Init:1;
424 ULONGLONG Reserved:2;
425 ULONGLONG NextEntry:60;
426 } Header16;
427 } SLIST_HEADER, *PSLIST_HEADER;
428 #else
429 #define SLIST_ENTRY SINGLE_LIST_ENTRY
430 #define _SLIST_ENTRY _SINGLE_LIST_ENTRY
431 #define PSLIST_ENTRY PSINGLE_LIST_ENTRY
432 typedef union _SLIST_HEADER {
433 ULONGLONG Alignment;
434 struct {
435 SLIST_ENTRY Next;
436 USHORT Depth;
437 USHORT Sequence;
438 } DUMMYSTRUCTNAME;
439 } SLIST_HEADER, *PSLIST_HEADER;
440 #endif
441
442 #endif /* _SLIST_HEADER_ */
443
444
445 /* HACK HACK HACK - GCC (or perhaps LD) is messing this up */
446 #if defined(_NTSYSTEM_) || defined(__GNUC__)
447 #define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
448 #define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
449 #else
450 #define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag)
451 #define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag)
452 #endif /* _NT_SYSTEM */
453 extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG;
454 extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
455
456
457 /******************************************************************************
458 * Kernel Types *
459 ******************************************************************************/
460
461 typedef UCHAR KIRQL, *PKIRQL;
462 typedef CCHAR KPROCESSOR_MODE;
463 typedef LONG KPRIORITY;
464
465 typedef ULONG EXECUTION_STATE;
466
467 typedef enum _MODE {
468 KernelMode,
469 UserMode,
470 MaximumMode
471 } MODE;
472
473 #if (NTDDI_VERSION < NTDDI_WIN7) || defined(_X86_) || !defined(NT_PROCESSOR_GROUPS)
474 #define SINGLE_GROUP_LEGACY_API 1
475 #endif
476
477 /* Processor features */
478 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
479 #define PF_FLOATING_POINT_EMULATED 1
480 #define PF_COMPARE_EXCHANGE_DOUBLE 2
481 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
482 #define PF_PPC_MOVEMEM_64BIT_OK 4
483 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
484 #define PF_XMMI_INSTRUCTIONS_AVAILABLE 6
485 #define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7
486 #define PF_RDTSC_INSTRUCTION_AVAILABLE 8
487 #define PF_PAE_ENABLED 9
488 #define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10
489 #define PF_SSE_DAZ_MODE_AVAILABLE 11
490 #define PF_NX_ENABLED 12
491 #define PF_SSE3_INSTRUCTIONS_AVAILABLE 13
492 #define PF_COMPARE_EXCHANGE128 14
493 #define PF_COMPARE64_EXCHANGE128 15
494 #define PF_CHANNELS_ENABLED 16
495 #define PF_XSAVE_ENABLED 17
496
497 #define MAXIMUM_SUPPORTED_EXTENSION 512
498 #define MAXIMUM_WAIT_OBJECTS 64
499
500 #define ASSERT_APC(Object) \
501 ASSERT((Object)->Type == ApcObject)
502
503 #define ASSERT_DPC(Object) \
504 ASSERT(((Object)->Type == 0) || \
505 ((Object)->Type == DpcObject) || \
506 ((Object)->Type == ThreadedDpcObject))
507
508 #define ASSERT_GATE(object) \
509 ASSERT((((object)->Header.Type & KOBJECT_TYPE_MASK) == GateObject) || \
510 (((object)->Header.Type & KOBJECT_TYPE_MASK) == EventSynchronizationObject))
511
512 #define ASSERT_DEVICE_QUEUE(Object) \
513 ASSERT((Object)->Type == DeviceQueueObject)
514
515 #define ASSERT_TIMER(E) \
516 ASSERT(((E)->Header.Type == TimerNotificationObject) || \
517 ((E)->Header.Type == TimerSynchronizationObject))
518
519 #define ASSERT_MUTANT(E) \
520 ASSERT((E)->Header.Type == MutantObject)
521
522 #define ASSERT_SEMAPHORE(E) \
523 ASSERT((E)->Header.Type == SemaphoreObject)
524
525 #define ASSERT_EVENT(E) \
526 ASSERT(((E)->Header.Type == NotificationEvent) || \
527 ((E)->Header.Type == SynchronizationEvent))
528
529 #define DPC_NORMAL 0
530 #define DPC_THREADED 1
531
532 #define GM_LOCK_BIT 0x1
533 #define GM_LOCK_BIT_V 0x0
534 #define GM_LOCK_WAITER_WOKEN 0x2
535 #define GM_LOCK_WAITER_INC 0x4
536
537 #define LOCK_QUEUE_WAIT 1
538 #define LOCK_QUEUE_OWNER 2
539 #define LOCK_QUEUE_TIMER_LOCK_SHIFT 4
540 #define LOCK_QUEUE_TIMER_TABLE_LOCKS (1 << (8 - LOCK_QUEUE_TIMER_LOCK_SHIFT))
541
542 #define PROCESSOR_FEATURE_MAX 64
543
544 #define DBG_STATUS_CONTROL_C 1
545 #define DBG_STATUS_SYSRQ 2
546 #define DBG_STATUS_BUGCHECK_FIRST 3
547 #define DBG_STATUS_BUGCHECK_SECOND 4
548 #define DBG_STATUS_FATAL 5
549 #define DBG_STATUS_DEBUG_CONTROL 6
550 #define DBG_STATUS_WORKER 7
551
552 #if defined(_WIN64)
553 #define MAXIMUM_PROC_PER_GROUP 64
554 #else
555 #define MAXIMUM_PROC_PER_GROUP 32
556 #endif
557 #define MAXIMUM_PROCESSORS MAXIMUM_PROC_PER_GROUP
558
559 /* Exception Records */
560 #define EXCEPTION_NONCONTINUABLE 1
561 #define EXCEPTION_MAXIMUM_PARAMETERS 15
562
563 typedef struct _EXCEPTION_RECORD {
564 NTSTATUS ExceptionCode;
565 ULONG ExceptionFlags;
566 struct _EXCEPTION_RECORD *ExceptionRecord;
567 PVOID ExceptionAddress;
568 ULONG NumberParameters;
569 ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
570 } EXCEPTION_RECORD, *PEXCEPTION_RECORD;
571
572 typedef struct _EXCEPTION_RECORD32 {
573 NTSTATUS ExceptionCode;
574 ULONG ExceptionFlags;
575 ULONG ExceptionRecord;
576 ULONG ExceptionAddress;
577 ULONG NumberParameters;
578 ULONG ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
579 } EXCEPTION_RECORD32, *PEXCEPTION_RECORD32;
580
581 typedef struct _EXCEPTION_RECORD64 {
582 NTSTATUS ExceptionCode;
583 ULONG ExceptionFlags;
584 ULONG64 ExceptionRecord;
585 ULONG64 ExceptionAddress;
586 ULONG NumberParameters;
587 ULONG __unusedAlignment;
588 ULONG64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
589 } EXCEPTION_RECORD64, *PEXCEPTION_RECORD64;
590
591 typedef struct _EXCEPTION_POINTERS {
592 PEXCEPTION_RECORD ExceptionRecord;
593 PCONTEXT ContextRecord;
594 } EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
595
596
597 typedef enum _KBUGCHECK_CALLBACK_REASON {
598 KbCallbackInvalid,
599 KbCallbackReserved1,
600 KbCallbackSecondaryDumpData,
601 KbCallbackDumpIo,
602 KbCallbackAddPages
603 } KBUGCHECK_CALLBACK_REASON;
604
605 struct _KBUGCHECK_REASON_CALLBACK_RECORD;
606
607 typedef VOID
608 (DDKAPI *PKBUGCHECK_REASON_CALLBACK_ROUTINE)(
609 IN KBUGCHECK_CALLBACK_REASON Reason,
610 IN struct _KBUGCHECK_REASON_CALLBACK_RECORD *Record,
611 IN OUT PVOID ReasonSpecificData,
612 IN ULONG ReasonSpecificDataLength);
613
614 typedef struct _KBUGCHECK_REASON_CALLBACK_RECORD {
615 LIST_ENTRY Entry;
616 PKBUGCHECK_REASON_CALLBACK_ROUTINE CallbackRoutine;
617 PUCHAR Component;
618 ULONG_PTR Checksum;
619 KBUGCHECK_CALLBACK_REASON Reason;
620 UCHAR State;
621 } KBUGCHECK_REASON_CALLBACK_RECORD, *PKBUGCHECK_REASON_CALLBACK_RECORD;
622
623 typedef enum _KBUGCHECK_BUFFER_DUMP_STATE {
624 BufferEmpty,
625 BufferInserted,
626 BufferStarted,
627 BufferFinished,
628 BufferIncomplete
629 } KBUGCHECK_BUFFER_DUMP_STATE;
630
631 typedef VOID
632 (DDKAPI *PKBUGCHECK_CALLBACK_ROUTINE)(
633 IN PVOID Buffer,
634 IN ULONG Length);
635
636 typedef struct _KBUGCHECK_CALLBACK_RECORD {
637 LIST_ENTRY Entry;
638 PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine;
639 PVOID Buffer;
640 ULONG Length;
641 PUCHAR Component;
642 ULONG_PTR Checksum;
643 UCHAR State;
644 } KBUGCHECK_CALLBACK_RECORD, *PKBUGCHECK_CALLBACK_RECORD;
645
646 typedef BOOLEAN
647 (DDKAPI *PNMI_CALLBACK)(
648 IN PVOID Context,
649 IN BOOLEAN Handled);
650
651 typedef enum _TRACE_INFORMATION_CLASS {
652 TraceIdClass,
653 TraceHandleClass,
654 TraceEnableFlagsClass,
655 TraceEnableLevelClass,
656 GlobalLoggerHandleClass,
657 EventLoggerHandleClass,
658 AllLoggerHandlesClass,
659 TraceHandleByNameClass,
660 LoggerEventsLostClass,
661 TraceSessionSettingsClass,
662 LoggerEventsLoggedClass,
663 MaxTraceInformationClass
664 } TRACE_INFORMATION_CLASS;
665
666 typedef enum _KINTERRUPT_POLARITY {
667 InterruptPolarityUnknown,
668 InterruptActiveHigh,
669 InterruptActiveLow
670 } KINTERRUPT_POLARITY, *PKINTERRUPT_POLARITY;
671
672 typedef enum _KPROFILE_SOURCE {
673 ProfileTime,
674 ProfileAlignmentFixup,
675 ProfileTotalIssues,
676 ProfilePipelineDry,
677 ProfileLoadInstructions,
678 ProfilePipelineFrozen,
679 ProfileBranchInstructions,
680 ProfileTotalNonissues,
681 ProfileDcacheMisses,
682 ProfileIcacheMisses,
683 ProfileCacheMisses,
684 ProfileBranchMispredictions,
685 ProfileStoreInstructions,
686 ProfileFpInstructions,
687 ProfileIntegerInstructions,
688 Profile2Issue,
689 Profile3Issue,
690 Profile4Issue,
691 ProfileSpecialInstructions,
692 ProfileTotalCycles,
693 ProfileIcacheIssues,
694 ProfileDcacheAccesses,
695 ProfileMemoryBarrierCycles,
696 ProfileLoadLinkedIssues,
697 ProfileMaximum
698 } KPROFILE_SOURCE;
699
700 typedef enum _KWAIT_REASON {
701 Executive,
702 FreePage,
703 PageIn,
704 PoolAllocation,
705 DelayExecution,
706 Suspended,
707 UserRequest,
708 WrExecutive,
709 WrFreePage,
710 WrPageIn,
711 WrPoolAllocation,
712 WrDelayExecution,
713 WrSuspended,
714 WrUserRequest,
715 WrEventPair,
716 WrQueue,
717 WrLpcReceive,
718 WrLpcReply,
719 WrVirtualMemory,
720 WrPageOut,
721 WrRendezvous,
722 WrKeyedEvent,
723 WrTerminated,
724 WrProcessInSwap,
725 WrCpuRateControl,
726 WrCalloutStack,
727 WrKernel,
728 WrResource,
729 WrPushLock,
730 WrMutex,
731 WrQuantumEnd,
732 WrDispatchInt,
733 WrPreempted,
734 WrYieldExecution,
735 WrFastMutex,
736 WrGuardedMutex,
737 WrRundown,
738 MaximumWaitReason
739 } KWAIT_REASON;
740
741 typedef struct _KWAIT_BLOCK {
742 LIST_ENTRY WaitListEntry;
743 struct _KTHREAD *Thread;
744 PVOID Object;
745 struct _KWAIT_BLOCK *NextWaitBlock;
746 USHORT WaitKey;
747 UCHAR WaitType;
748 volatile UCHAR BlockState;
749 #if defined(_WIN64)
750 LONG SpareLong;
751 #endif
752 } KWAIT_BLOCK, *PKWAIT_BLOCK, *PRKWAIT_BLOCK;
753
754 typedef enum _KINTERRUPT_MODE {
755 LevelSensitive,
756 Latched
757 } KINTERRUPT_MODE;
758
759 #define THREAD_WAIT_OBJECTS 3
760
761 typedef VOID
762 (DDKAPI *PKINTERRUPT_ROUTINE)(
763 VOID);
764
765 typedef enum _KD_OPTION {
766 KD_OPTION_SET_BLOCK_ENABLE,
767 } KD_OPTION;
768
769 typedef enum _INTERFACE_TYPE {
770 InterfaceTypeUndefined = -1,
771 Internal,
772 Isa,
773 Eisa,
774 MicroChannel,
775 TurboChannel,
776 PCIBus,
777 VMEBus,
778 NuBus,
779 PCMCIABus,
780 CBus,
781 MPIBus,
782 MPSABus,
783 ProcessorInternal,
784 InternalPowerBus,
785 PNPISABus,
786 PNPBus,
787 Vmcs,
788 MaximumInterfaceType
789 } INTERFACE_TYPE, *PINTERFACE_TYPE;
790
791 typedef VOID
792 (DDKAPI *PKNORMAL_ROUTINE)(
793 IN PVOID NormalContext,
794 IN PVOID SystemArgument1,
795 IN PVOID SystemArgument2);
796
797 typedef VOID
798 (DDKAPI *PKRUNDOWN_ROUTINE)(
799 IN struct _KAPC *Apc);
800
801 typedef VOID
802 (DDKAPI *PKKERNEL_ROUTINE)(
803 IN struct _KAPC *Apc,
804 IN OUT PKNORMAL_ROUTINE *NormalRoutine,
805 IN OUT PVOID *NormalContext,
806 IN OUT PVOID *SystemArgument1,
807 IN OUT PVOID *SystemArgument2);
808
809 typedef struct _KAPC
810 {
811 UCHAR Type;
812 UCHAR SpareByte0;
813 UCHAR Size;
814 UCHAR SpareByte1;
815 ULONG SpareLong0;
816 struct _KTHREAD *Thread;
817 LIST_ENTRY ApcListEntry;
818 PKKERNEL_ROUTINE KernelRoutine;
819 PKRUNDOWN_ROUTINE RundownRoutine;
820 PKNORMAL_ROUTINE NormalRoutine;
821 PVOID NormalContext;
822 PVOID SystemArgument1;
823 PVOID SystemArgument2;
824 CCHAR ApcStateIndex;
825 KPROCESSOR_MODE ApcMode;
826 BOOLEAN Inserted;
827 } KAPC, *PKAPC, *RESTRICTED_POINTER PRKAPC;
828
829 typedef struct _KDEVICE_QUEUE_ENTRY {
830 LIST_ENTRY DeviceListEntry;
831 ULONG SortKey;
832 BOOLEAN Inserted;
833 } KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY,
834 *RESTRICTED_POINTER PRKDEVICE_QUEUE_ENTRY;
835
836 typedef PVOID PKIPI_CONTEXT;
837
838 typedef
839 VOID
840 (NTAPI *PKIPI_WORKER)(
841 IN PKIPI_CONTEXT PacketContext,
842 IN PVOID Parameter1,
843 IN PVOID Parameter2,
844 IN PVOID Parameter3);
845
846 typedef
847 ULONG_PTR
848 (NTAPI *PKIPI_BROADCAST_WORKER)(
849 IN ULONG_PTR Argument);
850
851 typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
852
853 typedef struct _KSPIN_LOCK_QUEUE {
854 struct _KSPIN_LOCK_QUEUE *volatile Next;
855 PKSPIN_LOCK volatile Lock;
856 } KSPIN_LOCK_QUEUE, *PKSPIN_LOCK_QUEUE;
857
858 typedef struct _KLOCK_QUEUE_HANDLE {
859 KSPIN_LOCK_QUEUE LockQueue;
860 KIRQL OldIrql;
861 } KLOCK_QUEUE_HANDLE, *PKLOCK_QUEUE_HANDLE;
862
863 #if defined(_AMD64_)
864
865 typedef ULONG64 KSPIN_LOCK_QUEUE_NUMBER;
866
867 #define LockQueueDispatcherLock 0
868 #define LockQueueExpansionLock 1
869 #define LockQueuePfnLock 2
870 #define LockQueueSystemSpaceLock 3
871 #define LockQueueVacbLock 4
872 #define LockQueueMasterLock 5
873 #define LockQueueNonPagedPoolLock 6
874 #define LockQueueIoCancelLock 7
875 #define LockQueueWorkQueueLock 8
876 #define LockQueueIoVpbLock 9
877 #define LockQueueIoDatabaseLock 10
878 #define LockQueueIoCompletionLock 11
879 #define LockQueueNtfsStructLock 12
880 #define LockQueueAfdWorkQueueLock 13
881 #define LockQueueBcbLock 14
882 #define LockQueueMmNonPagedPoolLock 15
883 #define LockQueueUnusedSpare16 16
884 #define LockQueueTimerTableLock 17
885 #define LockQueueMaximumLock (LockQueueTimerTableLock + LOCK_QUEUE_TIMER_TABLE_LOCKS)
886
887 #else
888
889 typedef enum _KSPIN_LOCK_QUEUE_NUMBER {
890 LockQueueDispatcherLock,
891 LockQueueExpansionLock,
892 LockQueuePfnLock,
893 LockQueueSystemSpaceLock,
894 LockQueueVacbLock,
895 LockQueueMasterLock,
896 LockQueueNonPagedPoolLock,
897 LockQueueIoCancelLock,
898 LockQueueWorkQueueLock,
899 LockQueueIoVpbLock,
900 LockQueueIoDatabaseLock,
901 LockQueueIoCompletionLock,
902 LockQueueNtfsStructLock,
903 LockQueueAfdWorkQueueLock,
904 LockQueueBcbLock,
905 LockQueueMmNonPagedPoolLock,
906 LockQueueUnusedSpare16,
907 LockQueueTimerTableLock,
908 LockQueueMaximumLock = LockQueueTimerTableLock + LOCK_QUEUE_TIMER_TABLE_LOCKS
909 } KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER;
910
911 #endif
912
913 typedef VOID
914 (DDKAPI *PKDEFERRED_ROUTINE)(
915 IN struct _KDPC *Dpc,
916 IN PVOID DeferredContext,
917 IN PVOID SystemArgument1,
918 IN PVOID SystemArgument2);
919
920 typedef enum _KDPC_IMPORTANCE {
921 LowImportance,
922 MediumImportance,
923 HighImportance,
924 MediumHighImportance
925 } KDPC_IMPORTANCE;
926
927 typedef struct _KDPC
928 {
929 UCHAR Type;
930 UCHAR Importance;
931 volatile USHORT Number;
932 LIST_ENTRY DpcListEntry;
933 PKDEFERRED_ROUTINE DeferredRoutine;
934 PVOID DeferredContext;
935 PVOID SystemArgument1;
936 PVOID SystemArgument2;
937 volatile PVOID DpcData;
938 } KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC;
939
940 typedef struct _KDPC_WATCHDOG_INFORMATION {
941 ULONG DpcTimeLimit;
942 ULONG DpcTimeCount;
943 ULONG DpcWatchdogLimit;
944 ULONG DpcWatchdogCount;
945 ULONG Reserved;
946 } KDPC_WATCHDOG_INFORMATION, *PKDPC_WATCHDOG_INFORMATION;
947
948 typedef struct _KDEVICE_QUEUE {
949 CSHORT Type;
950 CSHORT Size;
951 LIST_ENTRY DeviceListHead;
952 KSPIN_LOCK Lock;
953 #if defined(_AMD64_)
954 union {
955 BOOLEAN Busy;
956 struct {
957 LONG64 Reserved : 8;
958 LONG64 Hint : 56;
959 };
960 };
961 #else
962 BOOLEAN Busy;
963 #endif
964
965 } KDEVICE_QUEUE, *PKDEVICE_QUEUE, *RESTRICTED_POINTER PRKDEVICE_QUEUE;
966
967 #define TIMER_EXPIRED_INDEX_BITS 6
968 #define TIMER_PROCESSOR_INDEX_BITS 5
969 typedef struct _DISPATCHER_HEADER {
970 _ANONYMOUS_UNION union {
971 _ANONYMOUS_STRUCT struct {
972 UCHAR Type;
973 _ANONYMOUS_UNION union {
974 _ANONYMOUS_UNION union {
975 UCHAR TimerControlFlags;
976 _ANONYMOUS_STRUCT struct {
977 UCHAR Absolute:1;
978 UCHAR Coalescable:1;
979 UCHAR KeepShifting:1;
980 UCHAR EncodedTolerableDelay:5;
981 } DUMMYSTRUCTNAME;
982 } DUMMYUNIONNAME;
983 UCHAR Abandoned;
984 #if (NTDDI_VERSION < NTDDI_WIN7)
985 UCHAR NpxIrql;
986 #endif
987 BOOLEAN Signalling;
988 } DUMMYUNIONNAME;
989 _ANONYMOUS_UNION union {
990 _ANONYMOUS_UNION union {
991 UCHAR ThreadControlFlags;
992 _ANONYMOUS_STRUCT struct {
993 UCHAR CpuThrottled:1;
994 UCHAR CycleProfiling:1;
995 UCHAR CounterProfiling:1;
996 UCHAR Reserved:5;
997 } DUMMYSTRUCTNAME;
998 } DUMMYUNIONNAME;
999 UCHAR Size;
1000 UCHAR Hand;
1001 } DUMMYUNIONNAME2;
1002 _ANONYMOUS_UNION union {
1003 #if (NTDDI_VERSION >= NTDDI_WIN7)
1004 _ANONYMOUS_UNION union {
1005 UCHAR TimerMiscFlags;
1006 _ANONYMOUS_STRUCT struct {
1007 #if !defined(_X86_)
1008 UCHAR Index:TIMER_EXPIRED_INDEX_BITS;
1009 #else
1010 UCHAR Index:1;
1011 UCHAR Processor:TIMER_PROCESSOR_INDEX_BITS;
1012 #endif
1013 UCHAR Inserted:1;
1014 volatile UCHAR Expired:1;
1015 } DUMMYSTRUCTNAME;
1016 } DUMMYUNIONNAME;
1017 #else
1018 /* Pre Win7 compatibility fix to latest WDK */
1019 UCHAR Inserted;
1020 #endif
1021 _ANONYMOUS_UNION union {
1022 BOOLEAN DebugActive;
1023 _ANONYMOUS_STRUCT struct {
1024 BOOLEAN ActiveDR7:1;
1025 BOOLEAN Instrumented:1;
1026 BOOLEAN Reserved2:4;
1027 BOOLEAN UmsScheduled:1;
1028 BOOLEAN UmsPrimary:1;
1029 } DUMMYSTRUCTNAME;
1030 } DUMMYUNIONNAME; /* should probably be DUMMYUNIONNAME2, but this is what WDK says */
1031 BOOLEAN DpcActive;
1032 } DUMMYUNIONNAME3;
1033 } DUMMYSTRUCTNAME;
1034 volatile LONG Lock;
1035 } DUMMYUNIONNAME;
1036 LONG SignalState;
1037 LIST_ENTRY WaitListHead;
1038 } DISPATCHER_HEADER, *PDISPATCHER_HEADER;
1039
1040 typedef struct _KEVENT {
1041 DISPATCHER_HEADER Header;
1042 } KEVENT, *PKEVENT, *RESTRICTED_POINTER PRKEVENT;
1043
1044 typedef struct _KSEMAPHORE {
1045 DISPATCHER_HEADER Header;
1046 LONG Limit;
1047 } KSEMAPHORE, *PKSEMAPHORE, *RESTRICTED_POINTER PRKSEMAPHORE;
1048
1049 typedef struct _KGATE
1050 {
1051 DISPATCHER_HEADER Header;
1052 } KGATE, *PKGATE, *RESTRICTED_POINTER PRKGATE;
1053
1054 typedef struct _KGUARDED_MUTEX
1055 {
1056 volatile LONG Count;
1057 PKTHREAD Owner;
1058 ULONG Contention;
1059 KGATE Gate;
1060 __GNU_EXTENSION union
1061 {
1062 __GNU_EXTENSION struct
1063 {
1064 SHORT KernelApcDisable;
1065 SHORT SpecialApcDisable;
1066 };
1067 ULONG CombinedApcDisable;
1068 };
1069 } KGUARDED_MUTEX, *PKGUARDED_MUTEX;
1070
1071 typedef struct _KMUTANT {
1072 DISPATCHER_HEADER Header;
1073 LIST_ENTRY MutantListEntry;
1074 struct _KTHREAD *RESTRICTED_POINTER OwnerThread;
1075 BOOLEAN Abandoned;
1076 UCHAR ApcDisable;
1077 } KMUTANT, *PKMUTANT, *RESTRICTED_POINTER PRKMUTANT, KMUTEX, *PKMUTEX, *RESTRICTED_POINTER PRKMUTEX;
1078
1079 #define TIMER_TABLE_SIZE 512
1080 #define TIMER_TABLE_SHIFT 9
1081
1082 typedef struct _KTIMER {
1083 DISPATCHER_HEADER Header;
1084 ULARGE_INTEGER DueTime;
1085 LIST_ENTRY TimerListEntry;
1086 struct _KDPC *Dpc;
1087 #if !defined(_X86_)
1088 ULONG Processor;
1089 #endif
1090 ULONG Period;
1091 } KTIMER, *PKTIMER, *RESTRICTED_POINTER PRKTIMER;
1092
1093 typedef BOOLEAN
1094 (DDKAPI *PKSYNCHRONIZE_ROUTINE)(
1095 IN PVOID SynchronizeContext);
1096
1097 typedef enum _POOL_TYPE {
1098 NonPagedPool,
1099 PagedPool,
1100 NonPagedPoolMustSucceed,
1101 DontUseThisType,
1102 NonPagedPoolCacheAligned,
1103 PagedPoolCacheAligned,
1104 NonPagedPoolCacheAlignedMustS,
1105 MaxPoolType,
1106 NonPagedPoolSession = 32,
1107 PagedPoolSession,
1108 NonPagedPoolMustSucceedSession,
1109 DontUseThisTypeSession,
1110 NonPagedPoolCacheAlignedSession,
1111 PagedPoolCacheAlignedSession,
1112 NonPagedPoolCacheAlignedMustSSession
1113 } POOL_TYPE;
1114
1115 typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
1116 {
1117 StandardDesign,
1118 NEC98x86,
1119 EndAlternatives
1120 } ALTERNATIVE_ARCHITECTURE_TYPE;
1121
1122 typedef struct _KSYSTEM_TIME
1123 {
1124 ULONG LowPart;
1125 LONG High1Time;
1126 LONG High2Time;
1127 } KSYSTEM_TIME, *PKSYSTEM_TIME;
1128
1129 typedef struct _PNP_BUS_INFORMATION {
1130 GUID BusTypeGuid;
1131 INTERFACE_TYPE LegacyBusType;
1132 ULONG BusNumber;
1133 } PNP_BUS_INFORMATION, *PPNP_BUS_INFORMATION;
1134
1135 typedef struct DECLSPEC_ALIGN(16) _M128A {
1136 ULONGLONG Low;
1137 LONGLONG High;
1138 } M128A, *PM128A;
1139
1140 typedef struct DECLSPEC_ALIGN(16) _XSAVE_FORMAT {
1141 USHORT ControlWord;
1142 USHORT StatusWord;
1143 UCHAR TagWord;
1144 UCHAR Reserved1;
1145 USHORT ErrorOpcode;
1146 ULONG ErrorOffset;
1147 USHORT ErrorSelector;
1148 USHORT Reserved2;
1149 ULONG DataOffset;
1150 USHORT DataSelector;
1151 USHORT Reserved3;
1152 ULONG MxCsr;
1153 ULONG MxCsr_Mask;
1154 M128A FloatRegisters[8];
1155 #if defined(_WIN64)
1156 M128A XmmRegisters[16];
1157 UCHAR Reserved4[96];
1158 #else
1159 M128A XmmRegisters[8];
1160 UCHAR Reserved4[192];
1161 ULONG StackControl[7];
1162 ULONG Cr0NpxState;
1163 #endif
1164 } XSAVE_FORMAT, *PXSAVE_FORMAT;
1165
1166
1167
1168 /******************************************************************************
1169 * Memory manager Types *
1170 ******************************************************************************/
1171
1172 #define MM_DONT_ZERO_ALLOCATION 0x00000001
1173 #define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002
1174 #define MM_ALLOCATE_FULLY_REQUIRED 0x00000004
1175 #define MM_ALLOCATE_NO_WAIT 0x00000008
1176 #define MM_ALLOCATE_PREFER_CONTIGUOUS 0x00000010
1177 #define MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS 0x00000020
1178
1179 #define MDL_MAPPED_TO_SYSTEM_VA 0x0001
1180 #define MDL_PAGES_LOCKED 0x0002
1181 #define MDL_SOURCE_IS_NONPAGED_POOL 0x0004
1182 #define MDL_ALLOCATED_FIXED_SIZE 0x0008
1183 #define MDL_PARTIAL 0x0010
1184 #define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020
1185 #define MDL_IO_PAGE_READ 0x0040
1186 #define MDL_WRITE_OPERATION 0x0080
1187 #define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100
1188 #define MDL_FREE_EXTRA_PTES 0x0200
1189 #define MDL_DESCRIBES_AWE 0x0400
1190 #define MDL_IO_SPACE 0x0800
1191 #define MDL_NETWORK_HEADER 0x1000
1192 #define MDL_MAPPING_CAN_FAIL 0x2000
1193 #define MDL_ALLOCATED_MUST_SUCCEED 0x4000
1194 #define MDL_INTERNAL 0x8000
1195
1196 #define MDL_MAPPING_FLAGS ( \
1197 MDL_MAPPED_TO_SYSTEM_VA | \
1198 MDL_PAGES_LOCKED | \
1199 MDL_SOURCE_IS_NONPAGED_POOL | \
1200 MDL_PARTIAL_HAS_BEEN_MAPPED | \
1201 MDL_PARENT_MAPPED_SYSTEM_VA | \
1202 MDL_SYSTEM_VA | \
1203 MDL_IO_SPACE)
1204
1205 #define FLUSH_MULTIPLE_MAXIMUM 32
1206
1207 /* Section access rights */
1208 #define SECTION_QUERY 0x0001
1209 #define SECTION_MAP_WRITE 0x0002
1210 #define SECTION_MAP_READ 0x0004
1211 #define SECTION_MAP_EXECUTE 0x0008
1212 #define SECTION_EXTEND_SIZE 0x0010
1213 #define SECTION_MAP_EXECUTE_EXPLICIT 0x0020
1214
1215 #define SECTION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SECTION_QUERY|\
1216 SECTION_MAP_WRITE | \
1217 SECTION_MAP_READ | \
1218 SECTION_MAP_EXECUTE | \
1219 SECTION_EXTEND_SIZE)
1220
1221 #define SESSION_QUERY_ACCESS 0x0001
1222 #define SESSION_MODIFY_ACCESS 0x0002
1223
1224 #define SESSION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
1225 SESSION_QUERY_ACCESS | \
1226 SESSION_MODIFY_ACCESS)
1227
1228 #define SEGMENT_ALL_ACCESS SECTION_ALL_ACCESS
1229
1230 #define PAGE_NOACCESS 0x01
1231 #define PAGE_READONLY 0x02
1232 #define PAGE_READWRITE 0x04
1233 #define PAGE_WRITECOPY 0x08
1234 #define PAGE_EXECUTE 0x10
1235 #define PAGE_EXECUTE_READ 0x20
1236 #define PAGE_EXECUTE_READWRITE 0x40
1237 #define PAGE_EXECUTE_WRITECOPY 0x80
1238 #define PAGE_GUARD 0x100
1239 #define PAGE_NOCACHE 0x200
1240 #define PAGE_WRITECOMBINE 0x400
1241
1242 #define MEM_COMMIT 0x1000
1243 #define MEM_RESERVE 0x2000
1244 #define MEM_DECOMMIT 0x4000
1245 #define MEM_RELEASE 0x8000
1246 #define MEM_FREE 0x10000
1247 #define MEM_PRIVATE 0x20000
1248 #define MEM_MAPPED 0x40000
1249 #define MEM_RESET 0x80000
1250 #define MEM_TOP_DOWN 0x100000
1251 #define MEM_LARGE_PAGES 0x20000000
1252 #define MEM_4MB_PAGES 0x80000000
1253
1254 #define SEC_RESERVE 0x4000000
1255 #define SEC_COMMIT 0x8000000
1256 #define SEC_LARGE_PAGES 0x80000000
1257
1258 /* Section map options */
1259 typedef enum _SECTION_INHERIT {
1260 ViewShare = 1,
1261 ViewUnmap = 2
1262 } SECTION_INHERIT;
1263
1264 typedef ULONG PFN_COUNT;
1265 typedef LONG_PTR SPFN_NUMBER, *PSPFN_NUMBER;
1266 typedef ULONG_PTR PFN_NUMBER, *PPFN_NUMBER;
1267
1268 typedef struct _MDL {
1269 struct _MDL *Next;
1270 CSHORT Size;
1271 CSHORT MdlFlags;
1272 struct _EPROCESS *Process;
1273 PVOID MappedSystemVa;
1274 PVOID StartVa;
1275 ULONG ByteCount;
1276 ULONG ByteOffset;
1277 } MDL, *PMDL;
1278 typedef MDL *PMDLX;
1279
1280 typedef enum _MEMORY_CACHING_TYPE_ORIG {
1281 MmFrameBufferCached = 2
1282 } MEMORY_CACHING_TYPE_ORIG;
1283
1284 typedef enum _MEMORY_CACHING_TYPE {
1285 MmNonCached = FALSE,
1286 MmCached = TRUE,
1287 MmWriteCombined = MmFrameBufferCached,
1288 MmHardwareCoherentCached,
1289 MmNonCachedUnordered,
1290 MmUSWCCached,
1291 MmMaximumCacheType
1292 } MEMORY_CACHING_TYPE;
1293
1294 typedef enum _MM_PAGE_PRIORITY {
1295 LowPagePriority,
1296 NormalPagePriority = 16,
1297 HighPagePriority = 32
1298 } MM_PAGE_PRIORITY;
1299
1300 typedef enum _LOCK_OPERATION {
1301 IoReadAccess,
1302 IoWriteAccess,
1303 IoModifyAccess
1304 } LOCK_OPERATION;
1305
1306 typedef enum _MM_SYSTEM_SIZE {
1307 MmSmallSystem,
1308 MmMediumSystem,
1309 MmLargeSystem
1310 } MM_SYSTEMSIZE;
1311
1312
1313 /******************************************************************************
1314 * Executive Types *
1315 ******************************************************************************/
1316
1317 #define EX_RUNDOWN_ACTIVE 0x1
1318 #define EX_RUNDOWN_COUNT_SHIFT 0x1
1319 #define EX_RUNDOWN_COUNT_INC (1 << EX_RUNDOWN_COUNT_SHIFT)
1320
1321 #ifdef _WIN64
1322 #define PORT_MAXIMUM_MESSAGE_LENGTH 512
1323 #else
1324 #define PORT_MAXIMUM_MESSAGE_LENGTH 256
1325 #endif
1326
1327 typedef struct _FAST_MUTEX {
1328 volatile LONG Count;
1329 PKTHREAD Owner;
1330 ULONG Contention;
1331 KEVENT Event;
1332 ULONG OldIrql;
1333 } FAST_MUTEX, *PFAST_MUTEX;
1334
1335 typedef enum _SUITE_TYPE {
1336 SmallBusiness,
1337 Enterprise,
1338 BackOffice,
1339 CommunicationServer,
1340 TerminalServer,
1341 SmallBusinessRestricted,
1342 EmbeddedNT,
1343 DataCenter,
1344 SingleUserTS,
1345 Personal,
1346 Blade,
1347 EmbeddedRestricted,
1348 SecurityAppliance,
1349 StorageServer,
1350 ComputeServer,
1351 WHServer,
1352 MaxSuiteType
1353 } SUITE_TYPE;
1354
1355 typedef enum _EX_POOL_PRIORITY {
1356 LowPoolPriority,
1357 LowPoolPrioritySpecialPoolOverrun = 8,
1358 LowPoolPrioritySpecialPoolUnderrun = 9,
1359 NormalPoolPriority = 16,
1360 NormalPoolPrioritySpecialPoolOverrun = 24,
1361 NormalPoolPrioritySpecialPoolUnderrun = 25,
1362 HighPoolPriority = 32,
1363 HighPoolPrioritySpecialPoolOverrun = 40,
1364 HighPoolPrioritySpecialPoolUnderrun = 41
1365 } EX_POOL_PRIORITY;
1366
1367 #if !defined(_WIN64) && (defined(_NTDDK_) || defined(_NTIFS_) || defined(_NDIS_))
1368 #define LOOKASIDE_ALIGN
1369 #else
1370 #define LOOKASIDE_ALIGN /* FIXME: DECLSPEC_CACHEALIGN */
1371 #endif
1372
1373 typedef struct _LOOKASIDE_LIST_EX *PLOOKASIDE_LIST_EX;
1374
1375 typedef PVOID
1376 (DDKAPI *PALLOCATE_FUNCTION)(
1377 IN POOL_TYPE PoolType,
1378 IN SIZE_T NumberOfBytes,
1379 IN ULONG Tag);
1380
1381 typedef PVOID
1382 (DDKAPI *PALLOCATE_FUNCTION_EX)(
1383 IN POOL_TYPE PoolType,
1384 IN SIZE_T NumberOfBytes,
1385 IN ULONG Tag,
1386 IN OUT PLOOKASIDE_LIST_EX Lookaside);
1387
1388 typedef VOID
1389 (DDKAPI *PFREE_FUNCTION)(
1390 IN PVOID Buffer);
1391
1392 typedef VOID
1393 (DDKAPI *PFREE_FUNCTION_EX)(
1394 IN PVOID Buffer,
1395 IN OUT PLOOKASIDE_LIST_EX Lookaside);
1396
1397 typedef VOID
1398 (DDKAPI *PCALLBACK_FUNCTION)(
1399 IN PVOID CallbackContext,
1400 IN PVOID Argument1,
1401 IN PVOID Argument2);
1402
1403 #define GENERAL_LOOKASIDE_LAYOUT \
1404 union { \
1405 SLIST_HEADER ListHead; \
1406 SINGLE_LIST_ENTRY SingleListHead; \
1407 } DUMMYUNIONNAME; \
1408 USHORT Depth; \
1409 USHORT MaximumDepth; \
1410 ULONG TotalAllocates; \
1411 union { \
1412 ULONG AllocateMisses; \
1413 ULONG AllocateHits; \
1414 } DUMMYUNIONNAME2; \
1415 \
1416 ULONG TotalFrees; \
1417 union { \
1418 ULONG FreeMisses; \
1419 ULONG FreeHits; \
1420 } DUMMYUNIONNAME3; \
1421 \
1422 POOL_TYPE Type; \
1423 ULONG Tag; \
1424 ULONG Size; \
1425 union { \
1426 PALLOCATE_FUNCTION_EX AllocateEx; \
1427 PALLOCATE_FUNCTION Allocate; \
1428 } DUMMYUNIONNAME4; \
1429 \
1430 union { \
1431 PFREE_FUNCTION_EX FreeEx; \
1432 PFREE_FUNCTION Free; \
1433 } DUMMYUNIONNAME5; \
1434 \
1435 LIST_ENTRY ListEntry; \
1436 ULONG LastTotalAllocates; \
1437 union { \
1438 ULONG LastAllocateMisses; \
1439 ULONG LastAllocateHits; \
1440 } DUMMYUNIONNAME6; \
1441 ULONG Future[2];
1442
1443 typedef struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE {
1444 GENERAL_LOOKASIDE_LAYOUT
1445 } GENERAL_LOOKASIDE, *PGENERAL_LOOKASIDE;
1446
1447 typedef struct _GENERAL_LOOKASIDE_POOL {
1448 GENERAL_LOOKASIDE_LAYOUT
1449 } GENERAL_LOOKASIDE_POOL, *PGENERAL_LOOKASIDE_POOL;
1450
1451 typedef struct _PAGED_LOOKASIDE_LIST {
1452 GENERAL_LOOKASIDE L;
1453 #if !defined(_AMD64_) && !defined(_IA64_)
1454 FAST_MUTEX Lock__ObsoleteButDoNotDelete;
1455 #endif
1456 } PAGED_LOOKASIDE_LIST, *PPAGED_LOOKASIDE_LIST;
1457
1458 typedef struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST {
1459 GENERAL_LOOKASIDE L;
1460 #if !defined(_AMD64_) && !defined(_IA64_)
1461 KSPIN_LOCK Lock__ObsoleteButDoNotDelete;
1462 #endif
1463 } NPAGED_LOOKASIDE_LIST, *PNPAGED_LOOKASIDE_LIST;
1464
1465 typedef struct _LOOKASIDE_LIST_EX {
1466 GENERAL_LOOKASIDE_POOL L;
1467 } LOOKASIDE_LIST_EX;
1468
1469 typedef struct _EX_RUNDOWN_REF {
1470 __GNU_EXTENSION union {
1471 volatile ULONG_PTR Count;
1472 volatile PVOID Ptr;
1473 };
1474 } EX_RUNDOWN_REF, *PEX_RUNDOWN_REF;
1475
1476 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE *PEX_RUNDOWN_REF_CACHE_AWARE;
1477
1478 typedef VOID
1479 (DDKAPI *PWORKER_THREAD_ROUTINE)(
1480 IN PVOID Parameter);
1481
1482 typedef struct _WORK_QUEUE_ITEM {
1483 LIST_ENTRY List;
1484 PWORKER_THREAD_ROUTINE WorkerRoutine;
1485 volatile PVOID Parameter;
1486 } WORK_QUEUE_ITEM, *PWORK_QUEUE_ITEM;
1487
1488
1489 /******************************************************************************
1490 * Security Manager Types *
1491 ******************************************************************************/
1492
1493 /* Simple types */
1494 typedef PVOID PSECURITY_DESCRIPTOR;
1495 typedef ULONG SECURITY_INFORMATION, *PSECURITY_INFORMATION;
1496 typedef ULONG ACCESS_MASK, *PACCESS_MASK;
1497 typedef PVOID PACCESS_TOKEN;
1498 typedef PVOID PSID;
1499
1500 #define DELETE 0x00010000L
1501 #define READ_CONTROL 0x00020000L
1502 #define WRITE_DAC 0x00040000L
1503 #define WRITE_OWNER 0x00080000L
1504 #define SYNCHRONIZE 0x00100000L
1505 #define STANDARD_RIGHTS_REQUIRED 0x000F0000L
1506 #define STANDARD_RIGHTS_READ READ_CONTROL
1507 #define STANDARD_RIGHTS_WRITE READ_CONTROL
1508 #define STANDARD_RIGHTS_EXECUTE READ_CONTROL
1509 #define STANDARD_RIGHTS_ALL 0x001F0000L
1510 #define SPECIFIC_RIGHTS_ALL 0x0000FFFFL
1511 #define ACCESS_SYSTEM_SECURITY 0x01000000L
1512 #define MAXIMUM_ALLOWED 0x02000000L
1513 #define GENERIC_READ 0x80000000L
1514 #define GENERIC_WRITE 0x40000000L
1515 #define GENERIC_EXECUTE 0x20000000L
1516 #define GENERIC_ALL 0x10000000L
1517
1518 typedef struct _GENERIC_MAPPING {
1519 ACCESS_MASK GenericRead;
1520 ACCESS_MASK GenericWrite;
1521 ACCESS_MASK GenericExecute;
1522 ACCESS_MASK GenericAll;
1523 } GENERIC_MAPPING, *PGENERIC_MAPPING;
1524
1525 #define ACL_REVISION 2
1526 #define ACL_REVISION_DS 4
1527
1528 #define ACL_REVISION1 1
1529 #define ACL_REVISION2 2
1530 #define ACL_REVISION3 3
1531 #define ACL_REVISION4 4
1532 #define MIN_ACL_REVISION ACL_REVISION2
1533 #define MAX_ACL_REVISION ACL_REVISION4
1534
1535 typedef struct _ACL {
1536 UCHAR AclRevision;
1537 UCHAR Sbz1;
1538 USHORT AclSize;
1539 USHORT AceCount;
1540 USHORT Sbz2;
1541 } ACL, *PACL;
1542
1543 /* Current security descriptor revision value */
1544 #define SECURITY_DESCRIPTOR_REVISION (1)
1545 #define SECURITY_DESCRIPTOR_REVISION1 (1)
1546
1547 /* Privilege attributes */
1548 #define SE_PRIVILEGE_ENABLED_BY_DEFAULT (0x00000001L)
1549 #define SE_PRIVILEGE_ENABLED (0x00000002L)
1550 #define SE_PRIVILEGE_REMOVED (0X00000004L)
1551 #define SE_PRIVILEGE_USED_FOR_ACCESS (0x80000000L)
1552
1553 #define SE_PRIVILEGE_VALID_ATTRIBUTES (SE_PRIVILEGE_ENABLED_BY_DEFAULT | \
1554 SE_PRIVILEGE_ENABLED | \
1555 SE_PRIVILEGE_REMOVED | \
1556 SE_PRIVILEGE_USED_FOR_ACCESS)
1557
1558 #include <pshpack4.h>
1559 typedef struct _LUID_AND_ATTRIBUTES {
1560 LUID Luid;
1561 ULONG Attributes;
1562 } LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES;
1563 #include <poppack.h>
1564
1565 typedef LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
1566 typedef LUID_AND_ATTRIBUTES_ARRAY *PLUID_AND_ATTRIBUTES_ARRAY;
1567
1568 /* Privilege sets */
1569 #define PRIVILEGE_SET_ALL_NECESSARY (1)
1570
1571 typedef struct _PRIVILEGE_SET {
1572 ULONG PrivilegeCount;
1573 ULONG Control;
1574 LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
1575 } PRIVILEGE_SET,*PPRIVILEGE_SET;
1576
1577 typedef enum _SECURITY_IMPERSONATION_LEVEL {
1578 SecurityAnonymous,
1579 SecurityIdentification,
1580 SecurityImpersonation,
1581 SecurityDelegation
1582 } SECURITY_IMPERSONATION_LEVEL, * PSECURITY_IMPERSONATION_LEVEL;
1583
1584 #define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation
1585 #define SECURITY_MIN_IMPERSONATION_LEVEL SecurityAnonymous
1586 #define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation
1587 #define VALID_IMPERSONATION_LEVEL(Level) (((Level) >= SECURITY_MIN_IMPERSONATION_LEVEL) && ((Level) <= SECURITY_MAX_IMPERSONATION_LEVEL))
1588
1589 #define SECURITY_DYNAMIC_TRACKING (TRUE)
1590 #define SECURITY_STATIC_TRACKING (FALSE)
1591
1592 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, *PSECURITY_CONTEXT_TRACKING_MODE;
1593
1594 typedef struct _SECURITY_QUALITY_OF_SERVICE {
1595 ULONG Length;
1596 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
1597 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
1598 BOOLEAN EffectiveOnly;
1599 } SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE;
1600
1601 typedef struct _SE_IMPERSONATION_STATE {
1602 PACCESS_TOKEN Token;
1603 BOOLEAN CopyOnOpen;
1604 BOOLEAN EffectiveOnly;
1605 SECURITY_IMPERSONATION_LEVEL Level;
1606 } SE_IMPERSONATION_STATE, *PSE_IMPERSONATION_STATE;
1607
1608 #define OWNER_SECURITY_INFORMATION (0x00000001L)
1609 #define GROUP_SECURITY_INFORMATION (0x00000002L)
1610 #define DACL_SECURITY_INFORMATION (0x00000004L)
1611 #define SACL_SECURITY_INFORMATION (0x00000008L)
1612 #define LABEL_SECURITY_INFORMATION (0x00000010L)
1613
1614 #define PROTECTED_DACL_SECURITY_INFORMATION (0x80000000L)
1615 #define PROTECTED_SACL_SECURITY_INFORMATION (0x40000000L)
1616 #define UNPROTECTED_DACL_SECURITY_INFORMATION (0x20000000L)
1617 #define UNPROTECTED_SACL_SECURITY_INFORMATION (0x10000000L)
1618
1619 typedef enum _SECURITY_OPERATION_CODE {
1620 SetSecurityDescriptor,
1621 QuerySecurityDescriptor,
1622 DeleteSecurityDescriptor,
1623 AssignSecurityDescriptor
1624 } SECURITY_OPERATION_CODE, *PSECURITY_OPERATION_CODE;
1625
1626 #define INITIAL_PRIVILEGE_COUNT 3
1627
1628 typedef struct _INITIAL_PRIVILEGE_SET {
1629 ULONG PrivilegeCount;
1630 ULONG Control;
1631 LUID_AND_ATTRIBUTES Privilege[INITIAL_PRIVILEGE_COUNT];
1632 } INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET;
1633
1634 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2
1635 #define SE_CREATE_TOKEN_PRIVILEGE 2
1636 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3
1637 #define SE_LOCK_MEMORY_PRIVILEGE 4
1638 #define SE_INCREASE_QUOTA_PRIVILEGE 5
1639 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6
1640 #define SE_TCB_PRIVILEGE 7
1641 #define SE_SECURITY_PRIVILEGE 8
1642 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9
1643 #define SE_LOAD_DRIVER_PRIVILEGE 10
1644 #define SE_SYSTEM_PROFILE_PRIVILEGE 11
1645 #define SE_SYSTEMTIME_PRIVILEGE 12
1646 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13
1647 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14
1648 #define SE_CREATE_PAGEFILE_PRIVILEGE 15
1649 #define SE_CREATE_PERMANENT_PRIVILEGE 16
1650 #define SE_BACKUP_PRIVILEGE 17
1651 #define SE_RESTORE_PRIVILEGE 18
1652 #define SE_SHUTDOWN_PRIVILEGE 19
1653 #define SE_DEBUG_PRIVILEGE 20
1654 #define SE_AUDIT_PRIVILEGE 21
1655 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22
1656 #define SE_CHANGE_NOTIFY_PRIVILEGE 23
1657 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24
1658 #define SE_UNDOCK_PRIVILEGE 25
1659 #define SE_SYNC_AGENT_PRIVILEGE 26
1660 #define SE_ENABLE_DELEGATION_PRIVILEGE 27
1661 #define SE_MANAGE_VOLUME_PRIVILEGE 28
1662 #define SE_IMPERSONATE_PRIVILEGE 29
1663 #define SE_CREATE_GLOBAL_PRIVILEGE 30
1664 #define SE_TRUSTED_CREDMAN_ACCESS_PRIVILEGE 31
1665 #define SE_RELABEL_PRIVILEGE 32
1666 #define SE_INC_WORKING_SET_PRIVILEGE 33
1667 #define SE_TIME_ZONE_PRIVILEGE 34
1668 #define SE_CREATE_SYMBOLIC_LINK_PRIVILEGE 35
1669 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_SYMBOLIC_LINK_PRIVILEGE
1670
1671 typedef struct _SECURITY_SUBJECT_CONTEXT {
1672 PACCESS_TOKEN ClientToken;
1673 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
1674 PACCESS_TOKEN PrimaryToken;
1675 PVOID ProcessAuditId;
1676 } SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT;
1677
1678 typedef struct _ACCESS_STATE {
1679 LUID OperationID;
1680 BOOLEAN SecurityEvaluated;
1681 BOOLEAN GenerateAudit;
1682 BOOLEAN GenerateOnClose;
1683 BOOLEAN PrivilegesAllocated;
1684 ULONG Flags;
1685 ACCESS_MASK RemainingDesiredAccess;
1686 ACCESS_MASK PreviouslyGrantedAccess;
1687 ACCESS_MASK OriginalDesiredAccess;
1688 SECURITY_SUBJECT_CONTEXT SubjectSecurityContext;
1689 PSECURITY_DESCRIPTOR SecurityDescriptor;
1690 PVOID AuxData;
1691 union {
1692 INITIAL_PRIVILEGE_SET InitialPrivilegeSet;
1693 PRIVILEGE_SET PrivilegeSet;
1694 } Privileges;
1695
1696 BOOLEAN AuditPrivileges;
1697 UNICODE_STRING ObjectName;
1698 UNICODE_STRING ObjectTypeName;
1699 } ACCESS_STATE, *PACCESS_STATE;
1700
1701
1702 #ifndef _NTLSA_IFS_
1703
1704 #ifndef _NTLSA_AUDIT_
1705 #define _NTLSA_AUDIT_
1706
1707 #define SE_MAX_AUDIT_PARAMETERS 32
1708 #define SE_MAX_GENERIC_AUDIT_PARAMETERS 28
1709
1710 #define SE_ADT_OBJECT_ONLY 0x1
1711
1712 #define SE_ADT_PARAMETERS_SELF_RELATIVE 0x00000001
1713 #define SE_ADT_PARAMETERS_SEND_TO_LSA 0x00000002
1714 #define SE_ADT_PARAMETER_EXTENSIBLE_AUDIT 0x00000004
1715 #define SE_ADT_PARAMETER_GENERIC_AUDIT 0x00000008
1716 #define SE_ADT_PARAMETER_WRITE_SYNCHRONOUS 0x00000010
1717
1718 #define LSAP_SE_ADT_PARAMETER_ARRAY_TRUE_SIZE(Parameters) \
1719 ( sizeof(SE_ADT_PARAMETER_ARRAY) - sizeof(SE_ADT_PARAMETER_ARRAY_ENTRY) * \
1720 (SE_MAX_AUDIT_PARAMETERS - Parameters->ParameterCount) )
1721
1722 typedef enum _SE_ADT_PARAMETER_TYPE {
1723 SeAdtParmTypeNone = 0,
1724 SeAdtParmTypeString,
1725 SeAdtParmTypeFileSpec,
1726 SeAdtParmTypeUlong,
1727 SeAdtParmTypeSid,
1728 SeAdtParmTypeLogonId,
1729 SeAdtParmTypeNoLogonId,
1730 SeAdtParmTypeAccessMask,
1731 SeAdtParmTypePrivs,
1732 SeAdtParmTypeObjectTypes,
1733 SeAdtParmTypeHexUlong,
1734 SeAdtParmTypePtr,
1735 SeAdtParmTypeTime,
1736 SeAdtParmTypeGuid,
1737 SeAdtParmTypeLuid,
1738 SeAdtParmTypeHexInt64,
1739 SeAdtParmTypeStringList,
1740 SeAdtParmTypeSidList,
1741 SeAdtParmTypeDuration,
1742 SeAdtParmTypeUserAccountControl,
1743 SeAdtParmTypeNoUac,
1744 SeAdtParmTypeMessage,
1745 SeAdtParmTypeDateTime,
1746 SeAdtParmTypeSockAddr,
1747 SeAdtParmTypeSD,
1748 SeAdtParmTypeLogonHours,
1749 SeAdtParmTypeLogonIdNoSid,
1750 SeAdtParmTypeUlongNoConv,
1751 SeAdtParmTypeSockAddrNoPort,
1752 SeAdtParmTypeAccessReason
1753 } SE_ADT_PARAMETER_TYPE, *PSE_ADT_PARAMETER_TYPE;
1754
1755 typedef struct _SE_ADT_OBJECT_TYPE {
1756 GUID ObjectType;
1757 USHORT Flags;
1758 USHORT Level;
1759 ACCESS_MASK AccessMask;
1760 } SE_ADT_OBJECT_TYPE, *PSE_ADT_OBJECT_TYPE;
1761
1762 typedef struct _SE_ADT_PARAMETER_ARRAY_ENTRY {
1763 SE_ADT_PARAMETER_TYPE Type;
1764 ULONG Length;
1765 ULONG_PTR Data[2];
1766 PVOID Address;
1767 } SE_ADT_PARAMETER_ARRAY_ENTRY, *PSE_ADT_PARAMETER_ARRAY_ENTRY;
1768
1769 typedef struct _SE_ADT_ACCESS_REASON {
1770 ACCESS_MASK AccessMask;
1771 ULONG AccessReasons[32];
1772 ULONG ObjectTypeIndex;
1773 ULONG AccessGranted;
1774 PSECURITY_DESCRIPTOR SecurityDescriptor;
1775 } SE_ADT_ACCESS_REASON, *PSE_ADT_ACCESS_REASON;
1776
1777 typedef struct _SE_ADT_PARAMETER_ARRAY {
1778 ULONG CategoryId;
1779 ULONG AuditId;
1780 ULONG ParameterCount;
1781 ULONG Length;
1782 USHORT FlatSubCategoryId;
1783 USHORT Type;
1784 ULONG Flags;
1785 SE_ADT_PARAMETER_ARRAY_ENTRY Parameters[ SE_MAX_AUDIT_PARAMETERS ];
1786 } SE_ADT_PARAMETER_ARRAY, *PSE_ADT_PARAMETER_ARRAY;
1787
1788 #endif /* !_NTLSA_AUDIT_ */
1789 #endif /* !_NTLSA_IFS_ */
1790
1791
1792 /******************************************************************************
1793 * Power Management Support Types *
1794 ******************************************************************************/
1795
1796 #ifndef _PO_DDK_
1797 #define _PO_DDK_
1798
1799 /* Power States/Levels */
1800 typedef enum _SYSTEM_POWER_STATE {
1801 PowerSystemUnspecified,
1802 PowerSystemWorking,
1803 PowerSystemSleeping1,
1804 PowerSystemSleeping2,
1805 PowerSystemSleeping3,
1806 PowerSystemHibernate,
1807 PowerSystemShutdown,
1808 PowerSystemMaximum
1809 } SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE;
1810
1811 #define POWER_SYSTEM_MAXIMUM PowerSystemMaximum
1812
1813 typedef enum _POWER_INFORMATION_LEVEL {
1814 SystemPowerPolicyAc,
1815 SystemPowerPolicyDc,
1816 VerifySystemPolicyAc,
1817 VerifySystemPolicyDc,
1818 SystemPowerCapabilities,
1819 SystemBatteryState,
1820 SystemPowerStateHandler,
1821 ProcessorStateHandler,
1822 SystemPowerPolicyCurrent,
1823 AdministratorPowerPolicy,
1824 SystemReserveHiberFile,
1825 ProcessorInformation,
1826 SystemPowerInformation,
1827 ProcessorStateHandler2,
1828 LastWakeTime,
1829 LastSleepTime,
1830 SystemExecutionState,
1831 SystemPowerStateNotifyHandler,
1832 ProcessorPowerPolicyAc,
1833 ProcessorPowerPolicyDc,
1834 VerifyProcessorPowerPolicyAc,
1835 VerifyProcessorPowerPolicyDc,
1836 ProcessorPowerPolicyCurrent,
1837 SystemPowerStateLogging,
1838 SystemPowerLoggingEntry,
1839 SetPowerSettingValue,
1840 NotifyUserPowerSetting,
1841 PowerInformationLevelUnused0,
1842 PowerInformationLevelUnused1,
1843 SystemVideoState,
1844 TraceApplicationPowerMessage,
1845 TraceApplicationPowerMessageEnd,
1846 ProcessorPerfStates,
1847 ProcessorIdleStates,
1848 ProcessorCap,
1849 SystemWakeSource,
1850 SystemHiberFileInformation,
1851 TraceServicePowerMessage,
1852 ProcessorLoad,
1853 PowerShutdownNotification,
1854 MonitorCapabilities,
1855 SessionPowerInit,
1856 SessionDisplayState,
1857 PowerRequestCreate,
1858 PowerRequestAction,
1859 GetPowerRequestList,
1860 ProcessorInformationEx,
1861 NotifyUserModeLegacyPowerEvent,
1862 GroupPark,
1863 ProcessorIdleDomains,
1864 WakeTimerList,
1865 SystemHiberFileSize,
1866 PowerInformationLevelMaximum
1867 } POWER_INFORMATION_LEVEL;
1868
1869 typedef enum {
1870 PowerActionNone,
1871 PowerActionReserved,
1872 PowerActionSleep,
1873 PowerActionHibernate,
1874 PowerActionShutdown,
1875 PowerActionShutdownReset,
1876 PowerActionShutdownOff,
1877 PowerActionWarmEject
1878 } POWER_ACTION, *PPOWER_ACTION;
1879
1880 typedef enum _DEVICE_POWER_STATE {
1881 PowerDeviceUnspecified,
1882 PowerDeviceD0,
1883 PowerDeviceD1,
1884 PowerDeviceD2,
1885 PowerDeviceD3,
1886 PowerDeviceMaximum
1887 } DEVICE_POWER_STATE, *PDEVICE_POWER_STATE;
1888
1889 typedef union _POWER_STATE {
1890 SYSTEM_POWER_STATE SystemState;
1891 DEVICE_POWER_STATE DeviceState;
1892 } POWER_STATE, *PPOWER_STATE;
1893
1894 typedef enum _POWER_STATE_TYPE {
1895 SystemPowerState = 0,
1896 DevicePowerState
1897 } POWER_STATE_TYPE, *PPOWER_STATE_TYPE;
1898
1899 #if (NTDDI_VERSION >= NTDDI_WINXP) || !defined(_BATCLASS_)
1900 typedef struct {
1901 ULONG Granularity;
1902 ULONG Capacity;
1903 } BATTERY_REPORTING_SCALE, *PBATTERY_REPORTING_SCALE;
1904 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) || !defined(_BATCLASS_) */
1905
1906 #endif /* !_PO_DDK_ */
1907
1908 typedef VOID
1909 (DDKAPI *PREQUEST_POWER_COMPLETE)(
1910 IN struct _DEVICE_OBJECT *DeviceObject,
1911 IN UCHAR MinorFunction,
1912 IN POWER_STATE PowerState,
1913 IN PVOID Context,
1914 IN struct _IO_STATUS_BLOCK *IoStatus);
1915
1916 typedef
1917 NTSTATUS
1918 (DDKAPI POWER_SETTING_CALLBACK)(
1919 IN LPCGUID SettingGuid,
1920 IN PVOID Value,
1921 IN ULONG ValueLength,
1922 IN OUT PVOID Context OPTIONAL);
1923
1924 typedef POWER_SETTING_CALLBACK *PPOWER_SETTING_CALLBACK;
1925
1926 #define PO_CB_SYSTEM_POWER_POLICY 0
1927 #define PO_CB_AC_STATUS 1
1928 #define PO_CB_BUTTON_COLLISION 2
1929 #define PO_CB_SYSTEM_STATE_LOCK 3
1930 #define PO_CB_LID_SWITCH_STATE 4
1931 #define PO_CB_PROCESSOR_POWER_POLICY 5
1932
1933 /******************************************************************************
1934 * Configuration Manager Types *
1935 ******************************************************************************/
1936
1937 /* Resource list definitions */
1938 typedef int CM_RESOURCE_TYPE;
1939
1940 #define CmResourceTypeNull 0
1941 #define CmResourceTypePort 1
1942 #define CmResourceTypeInterrupt 2
1943 #define CmResourceTypeMemory 3
1944 #define CmResourceTypeDma 4
1945 #define CmResourceTypeDeviceSpecific 5
1946 #define CmResourceTypeBusNumber 6
1947 #define CmResourceTypeNonArbitrated 128
1948 #define CmResourceTypeConfigData 128
1949 #define CmResourceTypeDevicePrivate 129
1950 #define CmResourceTypePcCardConfig 130
1951 #define CmResourceTypeMfCardConfig 131
1952
1953 /* KEY_VALUE_Xxx.Type */
1954 #define REG_NONE 0
1955 #define REG_SZ 1
1956 #define REG_EXPAND_SZ 2
1957 #define REG_BINARY 3
1958 #define REG_DWORD 4
1959 #define REG_DWORD_LITTLE_ENDIAN 4
1960 #define REG_DWORD_BIG_ENDIAN 5
1961 #define REG_LINK 6
1962 #define REG_MULTI_SZ 7
1963 #define REG_RESOURCE_LIST 8
1964 #define REG_FULL_RESOURCE_DESCRIPTOR 9
1965 #define REG_RESOURCE_REQUIREMENTS_LIST 10
1966 #define REG_QWORD 11
1967 #define REG_QWORD_LITTLE_ENDIAN 11
1968
1969 /* Registry Access Rights */
1970 #define KEY_QUERY_VALUE (0x0001)
1971 #define KEY_SET_VALUE (0x0002)
1972 #define KEY_CREATE_SUB_KEY (0x0004)
1973 #define KEY_ENUMERATE_SUB_KEYS (0x0008)
1974 #define KEY_NOTIFY (0x0010)
1975 #define KEY_CREATE_LINK (0x0020)
1976 #define KEY_WOW64_32KEY (0x0200)
1977 #define KEY_WOW64_64KEY (0x0100)
1978 #define KEY_WOW64_RES (0x0300)
1979
1980 #define KEY_READ ((STANDARD_RIGHTS_READ |\
1981 KEY_QUERY_VALUE |\
1982 KEY_ENUMERATE_SUB_KEYS |\
1983 KEY_NOTIFY) \
1984 & \
1985 (~SYNCHRONIZE))
1986
1987 #define KEY_WRITE ((STANDARD_RIGHTS_WRITE |\
1988 KEY_SET_VALUE |\
1989 KEY_CREATE_SUB_KEY) \
1990 & \
1991 (~SYNCHRONIZE))
1992
1993 #define KEY_EXECUTE ((KEY_READ) \
1994 & \
1995 (~SYNCHRONIZE))
1996
1997 #define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL |\
1998 KEY_QUERY_VALUE |\
1999 KEY_SET_VALUE |\
2000 KEY_CREATE_SUB_KEY |\
2001 KEY_ENUMERATE_SUB_KEYS |\
2002 KEY_NOTIFY |\
2003 KEY_CREATE_LINK) \
2004 & \
2005 (~SYNCHRONIZE))
2006
2007 /* Registry Open/Create Options */
2008 #define REG_OPTION_RESERVED (0x00000000L)
2009 #define REG_OPTION_NON_VOLATILE (0x00000000L)
2010 #define REG_OPTION_VOLATILE (0x00000001L)
2011 #define REG_OPTION_CREATE_LINK (0x00000002L)
2012 #define REG_OPTION_BACKUP_RESTORE (0x00000004L)
2013 #define REG_OPTION_OPEN_LINK (0x00000008L)
2014
2015 #define REG_LEGAL_OPTION \
2016 (REG_OPTION_RESERVED |\
2017 REG_OPTION_NON_VOLATILE |\
2018 REG_OPTION_VOLATILE |\
2019 REG_OPTION_CREATE_LINK |\
2020 REG_OPTION_BACKUP_RESTORE |\
2021 REG_OPTION_OPEN_LINK)
2022
2023 /* Key creation/open disposition */
2024 #define REG_CREATED_NEW_KEY (0x00000001L)
2025 #define REG_OPENED_EXISTING_KEY (0x00000002L)
2026
2027 /* Key restore & hive load flags */
2028 #define REG_WHOLE_HIVE_VOLATILE (0x00000001L)
2029 #define REG_REFRESH_HIVE (0x00000002L)
2030 #define REG_NO_LAZY_FLUSH (0x00000004L)
2031 #define REG_FORCE_RESTORE (0x00000008L)
2032 #define REG_APP_HIVE (0x00000010L)
2033 #define REG_PROCESS_PRIVATE (0x00000020L)
2034 #define REG_START_JOURNAL (0x00000040L)
2035 #define REG_HIVE_EXACT_FILE_GROWTH (0x00000080L)
2036 #define REG_HIVE_NO_RM (0x00000100L)
2037 #define REG_HIVE_SINGLE_LOG (0x00000200L)
2038
2039 /* Unload Flags */
2040 #define REG_FORCE_UNLOAD 1
2041
2042 /* Notify Filter Values */
2043 #define REG_NOTIFY_CHANGE_NAME (0x00000001L)
2044 #define REG_NOTIFY_CHANGE_ATTRIBUTES (0x00000002L)
2045 #define REG_NOTIFY_CHANGE_LAST_SET (0x00000004L)
2046 #define REG_NOTIFY_CHANGE_SECURITY (0x00000008L)
2047
2048 #define REG_LEGAL_CHANGE_FILTER \
2049 (REG_NOTIFY_CHANGE_NAME |\
2050 REG_NOTIFY_CHANGE_ATTRIBUTES |\
2051 REG_NOTIFY_CHANGE_LAST_SET |\
2052 REG_NOTIFY_CHANGE_SECURITY)
2053
2054 typedef struct _CM_FLOPPY_DEVICE_DATA {
2055 USHORT Version;
2056 USHORT Revision;
2057 CHAR Size[8];
2058 ULONG MaxDensity;
2059 ULONG MountDensity;
2060 UCHAR StepRateHeadUnloadTime;
2061 UCHAR HeadLoadTime;
2062 UCHAR MotorOffTime;
2063 UCHAR SectorLengthCode;
2064 UCHAR SectorPerTrack;
2065 UCHAR ReadWriteGapLength;
2066 UCHAR DataTransferLength;
2067 UCHAR FormatGapLength;
2068 UCHAR FormatFillCharacter;
2069 UCHAR HeadSettleTime;
2070 UCHAR MotorSettleTime;
2071 UCHAR MaximumTrackValue;
2072 UCHAR DataTransferRate;
2073 } CM_FLOPPY_DEVICE_DATA, *PCM_FLOPPY_DEVICE_DATA;
2074
2075 #include <pshpack4.h>
2076 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
2077 UCHAR Type;
2078 UCHAR ShareDisposition;
2079 USHORT Flags;
2080 union {
2081 struct {
2082 PHYSICAL_ADDRESS Start;
2083 ULONG Length;
2084 } Generic;
2085 struct {
2086 PHYSICAL_ADDRESS Start;
2087 ULONG Length;
2088 } Port;
2089 struct {
2090 #if defined(NT_PROCESSOR_GROUPS)
2091 USHORT Level;
2092 USHORT Group;
2093 #else
2094 ULONG Level;
2095 #endif
2096 ULONG Vector;
2097 KAFFINITY Affinity;
2098 } Interrupt;
2099 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
2100 struct {
2101 __GNU_EXTENSION union {
2102 struct {
2103 #if defined(NT_PROCESSOR_GROUPS)
2104 USHORT Group;
2105 #else
2106 USHORT Reserved;
2107 #endif
2108 USHORT MessageCount;
2109 ULONG Vector;
2110 KAFFINITY Affinity;
2111 } Raw;
2112 struct {
2113 #if defined(NT_PROCESSOR_GROUPS)
2114 USHORT Level;
2115 USHORT Group;
2116 #else
2117 ULONG Level;
2118 #endif
2119 ULONG Vector;
2120 KAFFINITY Affinity;
2121 } Translated;
2122 } DUMMYUNIONNAME;
2123 } MessageInterrupt;
2124 #endif
2125 struct {
2126 PHYSICAL_ADDRESS Start;
2127 ULONG Length;
2128 } Memory;
2129 struct {
2130 ULONG Channel;
2131 ULONG Port;
2132 ULONG Reserved1;
2133 } Dma;
2134 struct {
2135 ULONG Data[3];
2136 } DevicePrivate;
2137 struct {
2138 ULONG Start;
2139 ULONG Length;
2140 ULONG Reserved;
2141 } BusNumber;
2142 struct {
2143 ULONG DataSize;
2144 ULONG Reserved1;
2145 ULONG Reserved2;
2146 } DeviceSpecificData;
2147 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
2148 struct {
2149 PHYSICAL_ADDRESS Start;
2150 ULONG Length40;
2151 } Memory40;
2152 struct {
2153 PHYSICAL_ADDRESS Start;
2154 ULONG Length48;
2155 } Memory48;
2156 struct {
2157 PHYSICAL_ADDRESS Start;
2158 ULONG Length64;
2159 } Memory64;
2160 #endif
2161 } u;
2162 } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
2163 #include <poppack.h>
2164
2165 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Type */
2166 #define CmResourceTypeNull 0
2167 #define CmResourceTypePort 1
2168 #define CmResourceTypeInterrupt 2
2169 #define CmResourceTypeMemory 3
2170 #define CmResourceTypeDma 4
2171 #define CmResourceTypeDeviceSpecific 5
2172 #define CmResourceTypeBusNumber 6
2173 #define CmResourceTypeMemoryLarge 7
2174 #define CmResourceTypeNonArbitrated 128
2175 #define CmResourceTypeConfigData 128
2176 #define CmResourceTypeDevicePrivate 129
2177 #define CmResourceTypePcCardConfig 130
2178 #define CmResourceTypeMfCardConfig 131
2179
2180 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.ShareDisposition */
2181 typedef enum _CM_SHARE_DISPOSITION {
2182 CmResourceShareUndetermined,
2183 CmResourceShareDeviceExclusive,
2184 CmResourceShareDriverExclusive,
2185 CmResourceShareShared
2186 } CM_SHARE_DISPOSITION;
2187
2188 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypePort */
2189 #define CM_RESOURCE_PORT_MEMORY 0x0000
2190 #define CM_RESOURCE_PORT_IO 0x0001
2191 #define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004
2192 #define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008
2193 #define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010
2194 #define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020
2195 #define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040
2196 #define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080
2197 #define CM_RESOURCE_PORT_BAR 0x0100
2198
2199 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeInterrupt */
2200 #define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0x0000
2201 #define CM_RESOURCE_INTERRUPT_LATCHED 0x0001
2202 #define CM_RESOURCE_INTERRUPT_MESSAGE 0x0002
2203 #define CM_RESOURCE_INTERRUPT_POLICY_INCLUDED 0x0004
2204
2205 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeMemory */
2206 #define CM_RESOURCE_MEMORY_READ_WRITE 0x0000
2207 #define CM_RESOURCE_MEMORY_READ_ONLY 0x0001
2208 #define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002
2209 #define CM_RESOURCE_MEMORY_WRITEABILITY_MASK 0x0003
2210 #define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004
2211 #define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008
2212 #define CM_RESOURCE_MEMORY_24 0x0010
2213 #define CM_RESOURCE_MEMORY_CACHEABLE 0x0020
2214 #define CM_RESOURCE_MEMORY_WINDOW_DECODE 0x0040
2215 #define CM_RESOURCE_MEMORY_BAR 0x0080
2216 #define CM_RESOURCE_MEMORY_COMPAT_FOR_INACCESSIBLE_RANGE 0x0100
2217
2218 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeDma */
2219 #define CM_RESOURCE_DMA_8 0x0000
2220 #define CM_RESOURCE_DMA_16 0x0001
2221 #define CM_RESOURCE_DMA_32 0x0002
2222 #define CM_RESOURCE_DMA_8_AND_16 0x0004
2223 #define CM_RESOURCE_DMA_BUS_MASTER 0x0008
2224 #define CM_RESOURCE_DMA_TYPE_A 0x0010
2225 #define CM_RESOURCE_DMA_TYPE_B 0x0020
2226 #define CM_RESOURCE_DMA_TYPE_F 0x0040
2227
2228 typedef struct _CM_PARTIAL_RESOURCE_LIST {
2229 USHORT Version;
2230 USHORT Revision;
2231 ULONG Count;
2232 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
2233 } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
2234
2235 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR {
2236 INTERFACE_TYPE InterfaceType;
2237 ULONG BusNumber;
2238 CM_PARTIAL_RESOURCE_LIST PartialResourceList;
2239 } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
2240
2241 typedef struct _CM_RESOURCE_LIST {
2242 ULONG Count;
2243 CM_FULL_RESOURCE_DESCRIPTOR List[1];
2244 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
2245
2246 #include <pshpack1.h>
2247 typedef struct _CM_INT13_DRIVE_PARAMETER {
2248 USHORT DriveSelect;
2249 ULONG MaxCylinders;
2250 USHORT SectorsPerTrack;
2251 USHORT MaxHeads;
2252 USHORT NumberDrives;
2253 } CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER;
2254
2255 typedef struct _CM_PNP_BIOS_DEVICE_NODE {
2256 USHORT Size;
2257 UCHAR Node;
2258 ULONG ProductId;
2259 UCHAR DeviceType[3];
2260 USHORT DeviceAttributes;
2261 } CM_PNP_BIOS_DEVICE_NODE,*PCM_PNP_BIOS_DEVICE_NODE;
2262
2263 typedef struct _CM_PNP_BIOS_INSTALLATION_CHECK {
2264 UCHAR Signature[4];
2265 UCHAR Revision;
2266 UCHAR Length;
2267 USHORT ControlField;
2268 UCHAR Checksum;
2269 ULONG EventFlagAddress;
2270 USHORT RealModeEntryOffset;
2271 USHORT RealModeEntrySegment;
2272 USHORT ProtectedModeEntryOffset;
2273 ULONG ProtectedModeCodeBaseAddress;
2274 ULONG OemDeviceId;
2275 USHORT RealModeDataBaseAddress;
2276 ULONG ProtectedModeDataBaseAddress;
2277 } CM_PNP_BIOS_INSTALLATION_CHECK, *PCM_PNP_BIOS_INSTALLATION_CHECK;
2278 #include <poppack.h>
2279
2280 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA {
2281 ULONG BytesPerSector;
2282 ULONG NumberOfCylinders;
2283 ULONG SectorsPerTrack;
2284 ULONG NumberOfHeads;
2285 } CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA;
2286
2287 typedef struct _CM_KEYBOARD_DEVICE_DATA {
2288 USHORT Version;
2289 USHORT Revision;
2290 UCHAR Type;
2291 UCHAR Subtype;
2292 USHORT KeyboardFlags;
2293 } CM_KEYBOARD_DEVICE_DATA, *PCM_KEYBOARD_DEVICE_DATA;
2294
2295 typedef struct _CM_MCA_POS_DATA {
2296 USHORT AdapterId;
2297 UCHAR PosData1;
2298 UCHAR PosData2;
2299 UCHAR PosData3;
2300 UCHAR PosData4;
2301 } CM_MCA_POS_DATA, *PCM_MCA_POS_DATA;
2302
2303 #if (NTDDI_VERSION >= NTDDI_WINXP)
2304 typedef struct CM_Power_Data_s {
2305 ULONG PD_Size;
2306 DEVICE_POWER_STATE PD_MostRecentPowerState;
2307 ULONG PD_Capabilities;
2308 ULONG PD_D1Latency;
2309 ULONG PD_D2Latency;
2310 ULONG PD_D3Latency;
2311 DEVICE_POWER_STATE PD_PowerStateMapping[PowerSystemMaximum];
2312 SYSTEM_POWER_STATE PD_DeepestSystemWake;
2313 } CM_POWER_DATA, *PCM_POWER_DATA;
2314
2315 #define PDCAP_D0_SUPPORTED 0x00000001
2316 #define PDCAP_D1_SUPPORTED 0x00000002
2317 #define PDCAP_D2_SUPPORTED 0x00000004
2318 #define PDCAP_D3_SUPPORTED 0x00000008
2319 #define PDCAP_WAKE_FROM_D0_SUPPORTED 0x00000010
2320 #define PDCAP_WAKE_FROM_D1_SUPPORTED 0x00000020
2321 #define PDCAP_WAKE_FROM_D2_SUPPORTED 0x00000040
2322 #define PDCAP_WAKE_FROM_D3_SUPPORTED 0x00000080
2323 #define PDCAP_WARM_EJECT_SUPPORTED 0x00000100
2324
2325 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
2326
2327 typedef struct _CM_SCSI_DEVICE_DATA {
2328 USHORT Version;
2329 USHORT Revision;
2330 UCHAR HostIdentifier;
2331 } CM_SCSI_DEVICE_DATA, *PCM_SCSI_DEVICE_DATA;
2332
2333 typedef struct _CM_SERIAL_DEVICE_DATA {
2334 USHORT Version;
2335 USHORT Revision;
2336 ULONG BaudClock;
2337 } CM_SERIAL_DEVICE_DATA, *PCM_SERIAL_DEVICE_DATA;
2338
2339 typedef enum _KEY_INFORMATION_CLASS {
2340 KeyBasicInformation,
2341 KeyNodeInformation,
2342 KeyFullInformation,
2343 KeyNameInformation,
2344 KeyCachedInformation,
2345 KeyFlagsInformation
2346 } KEY_INFORMATION_CLASS;
2347
2348 typedef struct _KEY_BASIC_INFORMATION {
2349 LARGE_INTEGER LastWriteTime;
2350 ULONG TitleIndex;
2351 ULONG NameLength;
2352 WCHAR Name[1];
2353 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
2354
2355 typedef struct _KEY_FULL_INFORMATION {
2356 LARGE_INTEGER LastWriteTime;
2357 ULONG TitleIndex;
2358 ULONG ClassOffset;
2359 ULONG ClassLength;
2360 ULONG SubKeys;
2361 ULONG MaxNameLen;
2362 ULONG MaxClassLen;
2363 ULONG Values;
2364 ULONG MaxValueNameLen;
2365 ULONG MaxValueDataLen;
2366 WCHAR Class[1];
2367 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
2368
2369 typedef struct _KEY_NODE_INFORMATION {
2370 LARGE_INTEGER LastWriteTime;
2371 ULONG TitleIndex;
2372 ULONG ClassOffset;
2373 ULONG ClassLength;
2374 ULONG NameLength;
2375 WCHAR Name[1];
2376 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
2377
2378 typedef struct _KEY_VALUE_BASIC_INFORMATION {
2379 ULONG TitleIndex;
2380 ULONG Type;
2381 ULONG NameLength;
2382 WCHAR Name[1];
2383 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
2384
2385 typedef struct _KEY_VALUE_FULL_INFORMATION {
2386 ULONG TitleIndex;
2387 ULONG Type;
2388 ULONG DataOffset;
2389 ULONG DataLength;
2390 ULONG NameLength;
2391 WCHAR Name[1];
2392 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
2393
2394 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
2395 ULONG TitleIndex;
2396 ULONG Type;
2397 ULONG DataLength;
2398 UCHAR Data[1];
2399 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
2400
2401 typedef struct _KEY_VALUE_PARTIAL_INFORMATION_ALIGN64 {
2402 ULONG Type;
2403 ULONG DataLength;
2404 UCHAR Data[1];
2405 } KEY_VALUE_PARTIAL_INFORMATION_ALIGN64, *PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64;
2406
2407 typedef struct _KEY_VALUE_ENTRY {
2408 PUNICODE_STRING ValueName;
2409 ULONG DataLength;
2410 ULONG DataOffset;
2411 ULONG Type;
2412 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
2413
2414 typedef enum _KEY_VALUE_INFORMATION_CLASS {
2415 KeyValueBasicInformation,
2416 KeyValueFullInformation,
2417 KeyValuePartialInformation,
2418 KeyValueFullInformationAlign64,
2419 KeyValuePartialInformationAlign64
2420 } KEY_VALUE_INFORMATION_CLASS;
2421
2422 typedef struct _KEY_WRITE_TIME_INFORMATION {
2423 LARGE_INTEGER LastWriteTime;
2424 } KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION;
2425
2426 typedef enum _KEY_SET_INFORMATION_CLASS {
2427 KeyWriteTimeInformation,
2428 KeyWow64FlagsInformation,
2429 KeyControlFlagsInformation,
2430 KeySetVirtualizationInformation,
2431 KeySetDebugInformation,
2432 KeySetHandleTagsInformation,
2433 MaxKeySetInfoClass
2434 } KEY_SET_INFORMATION_CLASS;
2435
2436 typedef enum _REG_NOTIFY_CLASS {
2437 RegNtDeleteKey,
2438 RegNtPreDeleteKey = RegNtDeleteKey,
2439 RegNtSetValueKey,
2440 RegNtPreSetValueKey = RegNtSetValueKey,
2441 RegNtDeleteValueKey,
2442 RegNtPreDeleteValueKey = RegNtDeleteValueKey,
2443 RegNtSetInformationKey,
2444 RegNtPreSetInformationKey = RegNtSetInformationKey,
2445 RegNtRenameKey,
2446 RegNtPreRenameKey = RegNtRenameKey,
2447 RegNtEnumerateKey,
2448 RegNtPreEnumerateKey = RegNtEnumerateKey,
2449 RegNtEnumerateValueKey,
2450 RegNtPreEnumerateValueKey = RegNtEnumerateValueKey,
2451 RegNtQueryKey,
2452 RegNtPreQueryKey = RegNtQueryKey,
2453 RegNtQueryValueKey,
2454 RegNtPreQueryValueKey = RegNtQueryValueKey,
2455 RegNtQueryMultipleValueKey,
2456 RegNtPreQueryMultipleValueKey = RegNtQueryMultipleValueKey,
2457 RegNtPreCreateKey,
2458 RegNtPostCreateKey,
2459 RegNtPreOpenKey,
2460 RegNtPostOpenKey,
2461 RegNtKeyHandleClose,
2462 RegNtPreKeyHandleClose = RegNtKeyHandleClose,
2463 RegNtPostDeleteKey,
2464 RegNtPostSetValueKey,
2465 RegNtPostDeleteValueKey,
2466 RegNtPostSetInformationKey,
2467 RegNtPostRenameKey,
2468 RegNtPostEnumerateKey,
2469 RegNtPostEnumerateValueKey,
2470 RegNtPostQueryKey,
2471 RegNtPostQueryValueKey,
2472 RegNtPostQueryMultipleValueKey,
2473 RegNtPostKeyHandleClose,
2474 RegNtPreCreateKeyEx,
2475 RegNtPostCreateKeyEx,
2476 RegNtPreOpenKeyEx,
2477 RegNtPostOpenKeyEx,
2478 RegNtPreFlushKey,
2479 RegNtPostFlushKey,
2480 RegNtPreLoadKey,
2481 RegNtPostLoadKey,
2482 RegNtPreUnLoadKey,
2483 RegNtPostUnLoadKey,
2484 RegNtPreQueryKeySecurity,
2485 RegNtPostQueryKeySecurity,
2486 RegNtPreSetKeySecurity,
2487 RegNtPostSetKeySecurity,
2488 RegNtCallbackObjectContextCleanup,
2489 RegNtPreRestoreKey,
2490 RegNtPostRestoreKey,
2491 RegNtPreSaveKey,
2492 RegNtPostSaveKey,
2493 RegNtPreReplaceKey,
2494 RegNtPostReplaceKey,
2495 MaxRegNtNotifyClass
2496 } REG_NOTIFY_CLASS, *PREG_NOTIFY_CLASS;
2497
2498 typedef NTSTATUS
2499 (NTAPI *PEX_CALLBACK_FUNCTION)(
2500 IN PVOID CallbackContext,
2501 IN PVOID Argument1,
2502 IN PVOID Argument2
2503 );
2504
2505 typedef struct _REG_DELETE_KEY_INFORMATION {
2506 PVOID Object;
2507 PVOID CallContext;
2508 PVOID ObjectContext;
2509 PVOID Reserved;
2510 } REG_DELETE_KEY_INFORMATION, *PREG_DELETE_KEY_INFORMATION
2511 #if (NTDDI_VERSION >= NTDDI_VISTA)
2512 , REG_FLUSH_KEY_INFORMATION, *PREG_FLUSH_KEY_INFORMATION
2513 #endif
2514 ;
2515
2516 typedef struct _REG_SET_VALUE_KEY_INFORMATION {
2517 PVOID Object;
2518 PUNICODE_STRING ValueName;
2519 ULONG TitleIndex;
2520 ULONG Type;
2521 PVOID Data;
2522 ULONG DataSize;
2523 PVOID CallContext;
2524 PVOID ObjectContext;
2525 PVOID Reserved;
2526 } REG_SET_VALUE_KEY_INFORMATION, *PREG_SET_VALUE_KEY_INFORMATION;
2527
2528 typedef struct _REG_DELETE_VALUE_KEY_INFORMATION {
2529 PVOID Object;
2530 PUNICODE_STRING ValueName;
2531 PVOID CallContext;
2532 PVOID ObjectContext;
2533 PVOID Reserved;
2534 } REG_DELETE_VALUE_KEY_INFORMATION, *PREG_DELETE_VALUE_KEY_INFORMATION;
2535
2536 typedef struct _REG_SET_INFORMATION_KEY_INFORMATION {
2537 PVOID Object;
2538 KEY_SET_INFORMATION_CLASS KeySetInformationClass;
2539 PVOID KeySetInformation;
2540 ULONG KeySetInformationLength;
2541 PVOID CallContext;
2542 PVOID ObjectContext;
2543 PVOID Reserved;
2544 } REG_SET_INFORMATION_KEY_INFORMATION, *PREG_SET_INFORMATION_KEY_INFORMATION;
2545
2546 typedef struct _REG_ENUMERATE_KEY_INFORMATION {
2547 PVOID Object;
2548 ULONG Index;
2549 KEY_INFORMATION_CLASS KeyInformationClass;
2550 PVOID KeyInformation;
2551 ULONG Length;
2552 PULONG ResultLength;
2553 PVOID CallContext;
2554 PVOID ObjectContext;
2555 PVOID Reserved;
2556 } REG_ENUMERATE_KEY_INFORMATION, *PREG_ENUMERATE_KEY_INFORMATION;
2557
2558 typedef struct _REG_ENUMERATE_VALUE_KEY_INFORMATION {
2559 PVOID Object;
2560 ULONG Index;
2561 KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass;
2562 PVOID KeyValueInformation;
2563 ULONG Length;
2564 PULONG ResultLength;
2565 PVOID CallContext;
2566 PVOID ObjectContext;
2567 PVOID Reserved;
2568 } REG_ENUMERATE_VALUE_KEY_INFORMATION, *PREG_ENUMERATE_VALUE_KEY_INFORMATION;
2569
2570 typedef struct _REG_QUERY_KEY_INFORMATION {
2571 PVOID Object;
2572 KEY_INFORMATION_CLASS KeyInformationClass;
2573 PVOID KeyInformation;
2574 ULONG Length;
2575 PULONG ResultLength;
2576 PVOID CallContext;
2577 PVOID ObjectContext;
2578 PVOID Reserved;
2579 } REG_QUERY_KEY_INFORMATION, *PREG_QUERY_KEY_INFORMATION;
2580
2581 typedef struct _REG_QUERY_VALUE_KEY_INFORMATION {
2582 PVOID Object;
2583 PUNICODE_STRING ValueName;
2584 KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass;
2585 PVOID KeyValueInformation;
2586 ULONG Length;
2587 PULONG ResultLength;
2588 PVOID CallContext;
2589 PVOID ObjectContext;
2590 PVOID Reserved;
2591 } REG_QUERY_VALUE_KEY_INFORMATION, *PREG_QUERY_VALUE_KEY_INFORMATION;
2592
2593 typedef struct _REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION {
2594 PVOID Object;
2595 PKEY_VALUE_ENTRY ValueEntries;
2596 ULONG EntryCount;
2597 PVOID ValueBuffer;
2598 PULONG BufferLength;
2599 PULONG RequiredBufferLength;
2600 PVOID CallContext;
2601 PVOID ObjectContext;
2602 PVOID Reserved;
2603 } REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION, *PREG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION;
2604
2605 typedef struct _REG_PRE_CREATE_KEY_INFORMATION {
2606 PUNICODE_STRING CompleteName;
2607 } REG_PRE_CREATE_KEY_INFORMATION, REG_PRE_OPEN_KEY_INFORMATION,*PREG_PRE_CREATE_KEY_INFORMATION, *PREG_PRE_OPEN_KEY_INFORMATION;;
2608
2609 typedef struct _REG_POST_CREATE_KEY_INFORMATION {
2610 PUNICODE_STRING CompleteName;
2611 PVOID Object;
2612 NTSTATUS Status;
2613 } REG_POST_CREATE_KEY_INFORMATION,REG_POST_OPEN_KEY_INFORMATION, *PREG_POST_CREATE_KEY_INFORMATION, *PREG_POST_OPEN_KEY_INFORMATION;
2614
2615 typedef struct _REG_POST_OPERATION_INFORMATION {
2616 PVOID Object;
2617 NTSTATUS Status;
2618 PVOID PreInformation;
2619 NTSTATUS ReturnStatus;
2620 PVOID CallContext;
2621 PVOID ObjectContext;
2622 PVOID Reserved;
2623 } REG_POST_OPERATION_INFORMATION,*PREG_POST_OPERATION_INFORMATION;
2624
2625 typedef struct _REG_KEY_HANDLE_CLOSE_INFORMATION {
2626 PVOID Object;
2627 PVOID CallContext;
2628 PVOID ObjectContext;
2629 PVOID Reserved;
2630 } REG_KEY_HANDLE_CLOSE_INFORMATION, *PREG_KEY_HANDLE_CLOSE_INFORMATION;
2631
2632 /******************************************************************************
2633 * I/O Manager Types *
2634 ******************************************************************************/
2635
2636 /* PCI_COMMON_CONFIG.Command */
2637 #define PCI_ENABLE_IO_SPACE 0x0001
2638 #define PCI_ENABLE_MEMORY_SPACE 0x0002
2639 #define PCI_ENABLE_BUS_MASTER 0x0004
2640 #define PCI_ENABLE_SPECIAL_CYCLES 0x0008
2641 #define PCI_ENABLE_WRITE_AND_INVALIDATE 0x0010
2642 #define PCI_ENABLE_VGA_COMPATIBLE_PALETTE 0x0020
2643 #define PCI_ENABLE_PARITY 0x0040
2644 #define PCI_ENABLE_WAIT_CYCLE 0x0080
2645 #define PCI_ENABLE_SERR 0x0100
2646 #define PCI_ENABLE_FAST_BACK_TO_BACK 0x0200
2647 #define PCI_DISABLE_LEVEL_INTERRUPT 0x0400
2648
2649 /* PCI_COMMON_CONFIG.Status */
2650 #define PCI_STATUS_INTERRUPT_PENDING 0x0008
2651 #define PCI_STATUS_CAPABILITIES_LIST 0x0010
2652 #define PCI_STATUS_66MHZ_CAPABLE 0x0020
2653 #define PCI_STATUS_UDF_SUPPORTED 0x0040
2654 #define PCI_STATUS_FAST_BACK_TO_BACK 0x0080
2655 #define PCI_STATUS_DATA_PARITY_DETECTED 0x0100
2656 #define PCI_STATUS_DEVSEL 0x0600
2657 #define PCI_STATUS_SIGNALED_TARGET_ABORT 0x0800
2658 #define PCI_STATUS_RECEIVED_TARGET_ABORT 0x1000
2659 #define PCI_STATUS_RECEIVED_MASTER_ABORT 0x2000
2660 #define PCI_STATUS_SIGNALED_SYSTEM_ERROR 0x4000
2661 #define PCI_STATUS_DETECTED_PARITY_ERROR 0x8000
2662
2663 /* PCI_COMMON_CONFIG.HeaderType */
2664 #define PCI_MULTIFUNCTION 0x80
2665 #define PCI_DEVICE_TYPE 0x00
2666 #define PCI_BRIDGE_TYPE 0x01
2667 #define PCI_CARDBUS_BRIDGE_TYPE 0x02
2668
2669 #define PCI_CONFIGURATION_TYPE(PciData) \
2670 (((PPCI_COMMON_CONFIG) (PciData))->HeaderType & ~PCI_MULTIFUNCTION)
2671
2672 #define PCI_MULTIFUNCTION_DEVICE(PciData) \
2673 ((((PPCI_COMMON_CONFIG) (PciData))->HeaderType & PCI_MULTIFUNCTION) != 0)
2674
2675 /* PCI device classes */
2676 #define PCI_CLASS_PRE_20 0x00
2677 #define PCI_CLASS_MASS_STORAGE_CTLR 0x01
2678 #define PCI_CLASS_NETWORK_CTLR 0x02
2679 #define PCI_CLASS_DISPLAY_CTLR 0x03
2680 #define PCI_CLASS_MULTIMEDIA_DEV 0x04
2681 #define PCI_CLASS_MEMORY_CTLR 0x05
2682 #define PCI_CLASS_BRIDGE_DEV 0x06
2683 #define PCI_CLASS_SIMPLE_COMMS_CTLR 0x07
2684 #define PCI_CLASS_BASE_SYSTEM_DEV 0x08
2685 #define PCI_CLASS_INPUT_DEV 0x09
2686 #define PCI_CLASS_DOCKING_STATION 0x0a
2687 #define PCI_CLASS_PROCESSOR 0x0b
2688 #define PCI_CLASS_SERIAL_BUS_CTLR 0x0c
2689 #define PCI_CLASS_WIRELESS_CTLR 0x0d
2690 #define PCI_CLASS_INTELLIGENT_IO_CTLR 0x0e
2691 #define PCI_CLASS_SATELLITE_COMMS_CTLR 0x0f
2692 #define PCI_CLASS_ENCRYPTION_DECRYPTION 0x10
2693 #define PCI_CLASS_DATA_ACQ_SIGNAL_PROC 0x11
2694
2695 /* PCI device subclasses for class 0 */
2696 #define PCI_SUBCLASS_PRE_20_NON_VGA 0x00
2697 #define PCI_SUBCLASS_PRE_20_VGA 0x01
2698
2699 /* PCI device subclasses for class 1 (mass storage controllers)*/
2700 #define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00
2701 #define PCI_SUBCLASS_MSC_IDE_CTLR 0x01
2702 #define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02
2703 #define PCI_SUBCLASS_MSC_IPI_CTLR 0x03
2704 #define PCI_SUBCLASS_MSC_RAID_CTLR 0x04
2705 #define PCI_SUBCLASS_MSC_OTHER 0x80
2706
2707 /* PCI device subclasses for class 2 (network controllers)*/
2708 #define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00
2709 #define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01
2710 #define PCI_SUBCLASS_NET_FDDI_CTLR 0x02
2711 #define PCI_SUBCLASS_NET_ATM_CTLR 0x03
2712 #define PCI_SUBCLASS_NET_ISDN_CTLR 0x04
2713 #define PCI_SUBCLASS_NET_OTHER 0x80
2714
2715 /* PCI device subclasses for class 3 (display controllers)*/
2716 #define PCI_SUBCLASS_VID_VGA_CTLR 0x00
2717 #define PCI_SUBCLASS_VID_XGA_CTLR 0x01
2718 #define PCI_SUBCLASS_VID_3D_CTLR 0x02
2719 #define PCI_SUBCLASS_VID_OTHER 0x80
2720
2721 /* PCI device subclasses for class 4 (multimedia device)*/
2722 #define PCI_SUBCLASS_MM_VIDEO_DEV 0x00
2723 #define PCI_SUBCLASS_MM_AUDIO_DEV 0x01
2724 #define PCI_SUBCLASS_MM_TELEPHONY_DEV 0x02
2725 #define PCI_SUBCLASS_MM_OTHER 0x80
2726
2727 /* PCI device subclasses for class 5 (memory controller)*/
2728 #define PCI_SUBCLASS_MEM_RAM 0x00
2729 #define PCI_SUBCLASS_MEM_FLASH 0x01
2730 #define PCI_SUBCLASS_MEM_OTHER 0x80
2731
2732 /* PCI device subclasses for class 6 (bridge device)*/
2733 #define PCI_SUBCLASS_BR_HOST 0x00
2734 #define PCI_SUBCLASS_BR_ISA 0x01
2735 #define PCI_SUBCLASS_BR_EISA 0x02
2736 #define PCI_SUBCLASS_BR_MCA 0x03
2737 #define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04
2738 #define PCI_SUBCLASS_BR_PCMCIA 0x05
2739 #define PCI_SUBCLASS_BR_NUBUS 0x06
2740 #define PCI_SUBCLASS_BR_CARDBUS 0x07
2741 #define PCI_SUBCLASS_BR_RACEWAY 0x08
2742 #define PCI_SUBCLASS_BR_OTHER 0x80
2743
2744 /* PCI device subclasses for class C (serial bus controller)*/
2745 #define PCI_SUBCLASS_SB_IEEE1394 0x00
2746 #define PCI_SUBCLASS_SB_ACCESS 0x01
2747 #define PCI_SUBCLASS_SB_SSA 0x02
2748 #define PCI_SUBCLASS_SB_USB 0x03
2749 #define PCI_SUBCLASS_SB_FIBRE_CHANNEL 0x04
2750 #define PCI_SUBCLASS_SB_SMBUS 0x05
2751
2752 #define PCI_MAX_DEVICES 32
2753 #define PCI_MAX_FUNCTION 8
2754 #define PCI_MAX_BRIDGE_NUMBER 0xFF
2755 #define PCI_INVALID_VENDORID 0xFFFF
2756 #define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET(PCI_COMMON_CONFIG, DeviceSpecific))
2757
2758 #define PCI_ADDRESS_IO_SPACE 0x00000001
2759 #define PCI_ADDRESS_MEMORY_TYPE_MASK 0x00000006
2760 #define PCI_ADDRESS_MEMORY_PREFETCHABLE 0x00000008
2761 #define PCI_ADDRESS_IO_ADDRESS_MASK 0xfffffffc
2762 #define PCI_ADDRESS_MEMORY_ADDRESS_MASK 0xfffffff0
2763 #define PCI_ADDRESS_ROM_ADDRESS_MASK 0xfffff800
2764
2765 #define PCI_TYPE_32BIT 0
2766 #define PCI_TYPE_20BIT 2
2767 #define PCI_TYPE_64BIT 4
2768
2769 #define POOL_COLD_ALLOCATION 256
2770 #define POOL_QUOTA_FAIL_INSTEAD_OF_RAISE 8
2771 #define POOL_RAISE_IF_ALLOCATION_FAILURE 16
2772
2773 #define PCI_TYPE0_ADDRESSES 6
2774 #define PCI_TYPE1_ADDRESSES 2
2775 #define PCI_TYPE2_ADDRESSES 5
2776
2777 #define IO_TYPE_ADAPTER 1
2778 #define IO_TYPE_CONTROLLER 2
2779 #define IO_TYPE_DEVICE 3
2780 #define IO_TYPE_DRIVER 4
2781 #define IO_TYPE_FILE 5
2782 #define IO_TYPE_IRP 6
2783 #define IO_TYPE_MASTER_ADAPTER 7
2784 #define IO_TYPE_OPEN_PACKET 8
2785 #define IO_TYPE_TIMER 9
2786 #define IO_TYPE_VPB 10
2787 #define IO_TYPE_ERROR_LOG 11
2788 #define IO_TYPE_ERROR_MESSAGE 12
2789 #define IO_TYPE_DEVICE_OBJECT_EXTENSION 13
2790
2791 #define IO_TYPE_CSQ_IRP_CONTEXT 1
2792 #define IO_TYPE_CSQ 2
2793 #define IO_TYPE_CSQ_EX 3
2794
2795 /* IO_RESOURCE_DESCRIPTOR.Option */
2796 #define IO_RESOURCE_PREFERRED 0x01
2797 #define IO_RESOURCE_DEFAULT 0x02
2798 #define IO_RESOURCE_ALTERNATIVE 0x08
2799
2800 /* DEVICE_OBJECT.Flags */
2801 #define DO_VERIFY_VOLUME 0x00000002
2802 #define DO_BUFFERED_IO 0x00000004
2803 #define DO_EXCLUSIVE 0x00000008
2804 #define DO_DIRECT_IO 0x00000010
2805 #define DO_MAP_IO_BUFFER 0x00000020
2806 #define DO_DEVICE_INITIALIZING 0x00000080
2807 #define DO_SHUTDOWN_REGISTERED 0x00000800
2808 #define DO_BUS_ENUMERATED_DEVICE 0x00001000
2809 #define DO_POWER_PAGABLE 0x00002000
2810 #define DO_POWER_INRUSH 0x00004000
2811
2812 /* DEVICE_OBJECT.Characteristics */
2813 #define FILE_REMOVABLE_MEDIA 0x00000001
2814 #define FILE_READ_ONLY_DEVICE 0x00000002
2815 #define FILE_FLOPPY_DISKETTE 0x00000004
2816 #define FILE_WRITE_ONCE_MEDIA 0x00000008
2817 #define FILE_REMOTE_DEVICE 0x00000010
2818 #define FILE_DEVICE_IS_MOUNTED 0x00000020
2819 #define FILE_VIRTUAL_VOLUME 0x00000040
2820 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
2821 #define FILE_DEVICE_SECURE_OPEN 0x00000100
2822 #define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800
2823 #define FILE_CHARACTERISTIC_TS_DEVICE 0x00001000
2824 #define FILE_CHARACTERISTIC_WEBDAV_DEVICE 0x00002000
2825
2826 /* DEVICE_OBJECT.AlignmentRequirement */
2827 #define FILE_BYTE_ALIGNMENT 0x00000000
2828 #define FILE_WORD_ALIGNMENT 0x00000001
2829 #define FILE_LONG_ALIGNMENT 0x00000003
2830 #define FILE_QUAD_ALIGNMENT 0x00000007
2831 #define FILE_OCTA_ALIGNMENT 0x0000000f
2832 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
2833 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
2834 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
2835 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
2836 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
2837
2838 /* DEVICE_OBJECT.DeviceType */
2839 #define DEVICE_TYPE ULONG
2840
2841 #define FILE_DEVICE_BEEP 0x00000001
2842 #define FILE_DEVICE_CD_ROM 0x00000002
2843 #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
2844 #define FILE_DEVICE_CONTROLLER 0x00000004
2845 #define FILE_DEVICE_DATALINK 0x00000005
2846 #define FILE_DEVICE_DFS 0x00000006
2847 #define FILE_DEVICE_DISK 0x00000007
2848 #define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
2849 #define FILE_DEVICE_FILE_SYSTEM 0x00000009
2850 #define FILE_DEVICE_INPORT_PORT 0x0000000a
2851 #define FILE_DEVICE_KEYBOARD 0x0000000b
2852 #define FILE_DEVICE_MAILSLOT 0x0000000c
2853 #define FILE_DEVICE_MIDI_IN 0x0000000d
2854 #define FILE_DEVICE_MIDI_OUT 0x0000000e
2855 #define FILE_DEVICE_MOUSE 0x0000000f
2856 #define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
2857 #define FILE_DEVICE_NAMED_PIPE 0x00000011
2858 #define FILE_DEVICE_NETWORK 0x00000012
2859 #define FILE_DEVICE_NETWORK_BROWSER 0x00000013
2860 #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
2861 #define FILE_DEVICE_NULL 0x00000015
2862 #define FILE_DEVICE_PARALLEL_PORT 0x00000016
2863 #define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
2864 #define FILE_DEVICE_PRINTER 0x00000018
2865 #define FILE_DEVICE_SCANNER 0x00000019
2866 #define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
2867 #define FILE_DEVICE_SERIAL_PORT 0x0000001b
2868 #define FILE_DEVICE_SCREEN 0x0000001c
2869 #define FILE_DEVICE_SOUND 0x0000001d
2870 #define FILE_DEVICE_STREAMS 0x0000001e
2871 #define FILE_DEVICE_TAPE 0x0000001f
2872 #define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
2873 #define FILE_DEVICE_TRANSPORT 0x00000021
2874 #define FILE_DEVICE_UNKNOWN 0x00000022
2875 #define FILE_DEVICE_VIDEO 0x00000023
2876 #define FILE_DEVICE_VIRTUAL_DISK 0x00000024
2877 #define FILE_DEVICE_WAVE_IN 0x00000025
2878 #define FILE_DEVICE_WAVE_OUT 0x00000026
2879 #define FILE_DEVICE_8042_PORT 0x00000027
2880 #define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
2881 #define FILE_DEVICE_BATTERY 0x00000029
2882 #define FILE_DEVICE_BUS_EXTENDER 0x0000002a
2883 #define FILE_DEVICE_MODEM 0x0000002b
2884 #define FILE_DEVICE_VDM 0x0000002c
2885 #define FILE_DEVICE_MASS_STORAGE 0x0000002d
2886 #define FILE_DEVICE_SMB 0x0000002e
2887 #define FILE_DEVICE_KS 0x0000002f
2888 #define FILE_DEVICE_CHANGER 0x00000030
2889 #define FILE_DEVICE_SMARTCARD 0x00000031
2890 #define FILE_DEVICE_ACPI 0x00000032
2891 #define FILE_DEVICE_DVD 0x00000033
2892 #define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034
2893 #define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035
2894 #define FILE_DEVICE_DFS_VOLUME 0x00000036
2895 #define FILE_DEVICE_SERENUM 0x00000037
2896 #define FILE_DEVICE_TERMSRV 0x00000038
2897 #define FILE_DEVICE_KSEC 0x00000039
2898 #define FILE_DEVICE_FIPS 0x0000003A
2899 #define FILE_DEVICE_INFINIBAND 0x0000003B
2900 #define FILE_DEVICE_VMBUS 0x0000003E
2901 #define FILE_DEVICE_CRYPT_PROVIDER 0x0000003F
2902 #define FILE_DEVICE_WPD 0x00000040
2903 #define FILE_DEVICE_BLUETOOTH 0x00000041
2904 #define FILE_DEVICE_MT_COMPOSITE 0x00000042
2905 #define FILE_DEVICE_MT_TRANSPORT 0x00000043
2906 #define FILE_DEVICE_BIOMETRIC 0x00000044
2907 #define FILE_DEVICE_PMI 0x00000045
2908
2909 #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR))
2910
2911 typedef struct _OBJECT_HANDLE_INFORMATION {
2912 ULONG HandleAttributes;
2913 ACCESS_MASK GrantedAccess;
2914 } OBJECT_HANDLE_INFORMATION, *POBJECT_HANDLE_INFORMATION;
2915
2916 typedef struct _CLIENT_ID {
2917 HANDLE UniqueProcess;
2918 HANDLE UniqueThread;
2919 } CLIENT_ID, *PCLIENT_ID;
2920
2921 typedef VOID
2922 (DDKAPI *PKSTART_ROUTINE)(
2923 IN PVOID StartContext);
2924
2925 typedef struct _VPB {
2926 CSHORT Type;
2927 CSHORT Size;
2928 USHORT Flags;
2929 USHORT VolumeLabelLength;
2930 struct _DEVICE_OBJECT *DeviceObject;
2931 struct _DEVICE_OBJECT *RealDevice;
2932 ULONG SerialNumber;
2933 ULONG ReferenceCount;
2934 WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)];
2935 } VPB, *PVPB;
2936
2937 typedef enum _IO_ALLOCATION_ACTION {
2938 KeepObject = 1,
2939 DeallocateObject,
2940 DeallocateObjectKeepRegisters
2941 } IO_ALLOCATION_ACTION, *PIO_ALLOCATION_ACTION;
2942
2943 typedef IO_ALLOCATION_ACTION
2944 (DDKAPI *PDRIVER_CONTROL)(
2945 IN struct _DEVICE_OBJECT *DeviceObject,
2946 IN struct _IRP *Irp,
2947 IN PVOID MapRegisterBase,
2948 IN PVOID Context);
2949
2950 typedef struct _WAIT_CONTEXT_BLOCK {
2951 KDEVICE_QUEUE_ENTRY WaitQueueEntry;
2952 PDRIVER_CONTROL DeviceRoutine;
2953 PVOID DeviceContext;
2954 ULONG NumberOfMapRegisters;
2955 PVOID DeviceObject;
2956 PVOID CurrentIrp;
2957 PKDPC BufferChainingDpc;
2958 } WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK;
2959
2960 typedef struct _DEVICE_OBJECT {
2961 CSHORT Type;
2962 USHORT Size;
2963 LONG ReferenceCount;
2964 struct _DRIVER_OBJECT *DriverObject;
2965 struct _DEVICE_OBJECT *NextDevice;
2966 struct _DEVICE_OBJECT *AttachedDevice;
2967 struct _IRP *CurrentIrp;
2968 PIO_TIMER Timer;
2969 ULONG Flags;
2970 ULONG Characteristics;
2971 volatile PVPB Vpb;
2972 PVOID DeviceExtension;
2973 DEVICE_TYPE DeviceType;
2974 CCHAR StackSize;
2975 union {
2976 LIST_ENTRY ListEntry;
2977 WAIT_CONTEXT_BLOCK Wcb;
2978 } Queue;
2979 ULONG AlignmentRequirement;
2980 KDEVICE_QUEUE DeviceQueue;
2981 KDPC Dpc;
2982 ULONG ActiveThreadCount;
2983 PSECURITY_DESCRIPTOR SecurityDescriptor;
2984 KEVENT DeviceLock;
2985 USHORT SectorSize;
2986 USHORT Spare1;
2987 struct _DEVOBJ_EXTENSION *DeviceObjectExtension;
2988 PVOID Reserved;
2989 } DEVICE_OBJECT, *PDEVICE_OBJECT;
2990
2991 typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK * PIO_REMOVE_LOCK_TRACKING_BLOCK;
2992
2993 typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK {
2994 BOOLEAN Removed;
2995 BOOLEAN Reserved[3];
2996 volatile LONG IoCount;
2997 KEVENT RemoveEvent;
2998 } IO_REMOVE_LOCK_COMMON_BLOCK;
2999
3000 typedef struct _IO_REMOVE_LOCK_DBG_BLOCK {
3001 LONG Signature;
3002 LONG HighWatermark;
3003 LONGLONG MaxLockedTicks;
3004 LONG AllocateTag;
3005 LIST_ENTRY LockList;
3006 KSPIN_LOCK Spin;
3007 volatile LONG LowMemoryCount;
3008 ULONG Reserved1[4];
3009 PVOID Reserved2;
3010 PIO_REMOVE_LOCK_TRACKING_BLOCK Blocks;
3011 } IO_REMOVE_LOCK_DBG_BLOCK;
3012
3013 typedef struct _IO_REMOVE_LOCK {
3014 IO_REMOVE_LOCK_COMMON_BLOCK Common;
3015 #if DBG
3016 IO_REMOVE_LOCK_DBG_BLOCK Dbg;
3017 #endif
3018 } IO_REMOVE_LOCK, *PIO_REMOVE_LOCK;
3019
3020 typedef struct _IO_WORKITEM *PIO_WORKITEM;
3021
3022 typedef VOID
3023 (DDKAPI IO_WORKITEM_ROUTINE)(
3024 IN PDEVICE_OBJECT DeviceObject,
3025 IN PVOID Context);
3026 typedef IO_WORKITEM_ROUTINE *PIO_WORKITEM_ROUTINE;
3027
3028 typedef struct _SHARE_ACCESS {
3029 ULONG OpenCount;
3030 ULONG Readers;
3031 ULONG Writers;
3032 ULONG Deleters;
3033 ULONG SharedRead;
3034 ULONG SharedWrite;
3035 ULONG SharedDelete;
3036 } SHARE_ACCESS, *PSHARE_ACCESS;
3037
3038 /* While MS WDK uses inheritance in C++, we cannot do this with gcc, as
3039 inheritance, even from a struct renders the type non-POD. So we use
3040 this hack */
3041 #define PCI_COMMON_HEADER_LAYOUT \
3042 USHORT VendorID; \
3043 USHORT DeviceID; \
3044 USHORT Command; \
3045 USHORT Status; \
3046 UCHAR RevisionID; \
3047 UCHAR ProgIf; \
3048 UCHAR SubClass; \
3049 UCHAR BaseClass; \
3050 UCHAR CacheLineSize; \
3051 UCHAR LatencyTimer; \
3052 UCHAR HeaderType; \
3053 UCHAR BIST; \
3054 union { \
3055 struct _PCI_HEADER_TYPE_0 { \
3056 ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; \
3057 ULONG CIS; \
3058 USHORT SubVendorID; \
3059 USHORT SubSystemID; \
3060 ULONG ROMBaseAddress; \
3061 UCHAR CapabilitiesPtr; \
3062 UCHAR Reserved1[3]; \
3063 ULONG Reserved2; \
3064 UCHAR InterruptLine; \
3065 UCHAR InterruptPin; \
3066 UCHAR MinimumGrant; \
3067 UCHAR MaximumLatency; \
3068 } type0; \
3069 struct _PCI_HEADER_TYPE_1 { \
3070 ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; \
3071 UCHAR PrimaryBus; \
3072 UCHAR SecondaryBus; \
3073 UCHAR SubordinateBus; \
3074 UCHAR SecondaryLatency; \
3075 UCHAR IOBase; \
3076 UCHAR IOLimit; \
3077 USHORT SecondaryStatus; \
3078 USHORT MemoryBase; \
3079 USHORT MemoryLimit; \
3080 USHORT PrefetchBase; \
3081 USHORT PrefetchLimit; \
3082 ULONG PrefetchBaseUpper32; \
3083 ULONG PrefetchLimitUpper32; \
3084 USHORT IOBaseUpper16; \
3085 USHORT IOLimitUpper16; \
3086 UCHAR CapabilitiesPtr; \
3087 UCHAR Reserved1[3]; \
3088 ULONG ROMBaseAddress; \
3089 UCHAR InterruptLine; \
3090 UCHAR InterruptPin; \
3091 USHORT BridgeControl; \
3092 } type1; \
3093 struct _PCI_HEADER_TYPE_2 { \
3094 ULONG SocketRegistersBaseAddress; \
3095 UCHAR CapabilitiesPtr; \
3096 UCHAR Reserved; \
3097 USHORT SecondaryStatus; \
3098 UCHAR PrimaryBus; \
3099 UCHAR SecondaryBus; \
3100 UCHAR SubordinateBus; \
3101 UCHAR SecondaryLatency; \
3102 struct { \
3103 ULONG Base; \
3104 ULONG Limit; \
3105 } Range[PCI_TYPE2_ADDRESSES-1]; \
3106 UCHAR InterruptLine; \
3107 UCHAR InterruptPin; \
3108 USHORT BridgeControl; \
3109 } type2; \
3110 } u;
3111
3112 typedef struct _PCI_COMMON_HEADER {
3113 PCI_COMMON_HEADER_LAYOUT
3114 } PCI_COMMON_HEADER, *PPCI_COMMON_HEADER;
3115
3116 #ifdef __cplusplus
3117 typedef struct _PCI_COMMON_CONFIG {
3118 PCI_COMMON_HEADER_LAYOUT
3119 UCHAR DeviceSpecific[192];
3120 } PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG;
3121 #else
3122 typedef struct _PCI_COMMON_CONFIG {
3123 PCI_COMMON_HEADER DUMMYSTRUCTNAME;
3124 UCHAR DeviceSpecific[192];
3125 } PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG;
3126 #endif
3127
3128 typedef enum _CREATE_FILE_TYPE {
3129 CreateFileTypeNone,
3130 CreateFileTypeNamedPipe,
3131 CreateFileTypeMailslot
3132 } CREATE_FILE_TYPE;
3133
3134 #define IO_FORCE_ACCESS_CHECK 0x001
3135 #define IO_NO_PARAMETER_CHECKING 0x100
3136
3137 #define IO_REPARSE 0x0
3138 #define IO_REMOUNT 0x1
3139
3140 typedef struct _IO_STATUS_BLOCK {
3141 _ANONYMOUS_UNION union {
3142 NTSTATUS Status;
3143 PVOID Pointer;
3144 } DUMMYUNIONNAME;
3145 ULONG_PTR Information;
3146 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
3147
3148 typedef struct _PCI_SLOT_NUMBER {
3149 union {
3150 struct {
3151 ULONG DeviceNumber : 5;
3152 ULONG FunctionNumber : 3;
3153 ULONG Reserved : 24;
3154 } bits;
3155 ULONG AsULONG;
3156 } u;
3157 } PCI_SLOT_NUMBER, *PPCI_SLOT_NUMBER;
3158
3159 typedef VOID
3160 (DDKAPI *PIO_APC_ROUTINE)(
3161 IN PVOID ApcContext,
3162 IN PIO_STATUS_BLOCK IoStatusBlock,
3163 IN ULONG Reserved);
3164
3165 typedef VOID
3166 (DDKAPI *WMI_NOTIFICATION_CALLBACK)(
3167 PVOID Wnode,
3168 PVOID Context);
3169
3170 #define WMIREG_ACTION_REGISTER 1
3171 #define WMIREG_ACTION_DEREGISTER 2
3172 #define WMIREG_ACTION_REREGISTER 3
3173 #define WMIREG_ACTION_UPDATE_GUIDS 4
3174 #define WMIREG_ACTION_BLOCK_IRPS 5
3175
3176 #define EVENT_INCREMENT 1
3177 #define IO_NO_INCREMENT 0
3178 #define IO_CD_ROM_INCREMENT 1
3179 #define IO_DISK_INCREMENT 1
3180 #define IO_KEYBOARD_INCREMENT 6
3181 #define IO_MAILSLOT_INCREMENT 2
3182 #define IO_MOUSE_INCREMENT 6
3183 #define IO_NAMED_PIPE_INCREMENT 2
3184 #define IO_NETWORK_INCREMENT 2
3185 #define IO_PARALLEL_INCREMENT 1
3186 #define IO_SERIAL_INCREMENT 2
3187 #define IO_SOUND_INCREMENT 8
3188 #define IO_VIDEO_INCREMENT 1
3189 #define SEMAPHORE_INCREMENT 1
3190
3191 #define MM_MAXIMUM_DISK_IO_SIZE (0x10000)
3192
3193 typedef struct _BOOTDISK_INFORMATION {
3194 LONGLONG BootPartitionOffset;
3195 LONGLONG SystemPartitionOffset;
3196 ULONG BootDeviceSignature;
3197 ULONG SystemDeviceSignature;
3198 } BOOTDISK_INFORMATION, *PBOOTDISK_INFORMATION;
3199
3200 typedef struct _BOOTDISK_INFORMATION_EX {
3201 LONGLONG BootPartitionOffset;
3202 LONGLONG SystemPartitionOffset;
3203 ULONG BootDeviceSignature;
3204 ULONG SystemDeviceSignature;
3205 GUID BootDeviceGuid;
3206 GUID SystemDeviceGuid;
3207 BOOLEAN BootDeviceIsGpt;
3208 BOOLEAN SystemDeviceIsGpt;
3209 } BOOTDISK_INFORMATION_EX, *PBOOTDISK_INFORMATION_EX;
3210
3211 typedef struct _EISA_MEMORY_TYPE {
3212 UCHAR ReadWrite : 1;
3213 UCHAR Cached : 1;
3214 UCHAR Reserved0 : 1;
3215 UCHAR Type : 2;
3216 UCHAR Shared : 1;
3217 UCHAR Reserved1 : 1;
3218 UCHAR MoreEntries : 1;
3219 } EISA_MEMORY_TYPE, *PEISA_MEMORY_TYPE;
3220
3221 #include <pshpack1.h>
3222 typedef struct _EISA_MEMORY_CONFIGURATION {
3223 EISA_MEMORY_TYPE ConfigurationByte;
3224 UCHAR DataSize;
3225 USHORT AddressLowWord;
3226 UCHAR AddressHighByte;
3227 USHORT MemorySize;
3228 } EISA_MEMORY_CONFIGURATION, *PEISA_MEMORY_CONFIGURATION;
3229 #include <poppack.h>
3230
3231 typedef struct _EISA_IRQ_DESCRIPTOR {
3232 UCHAR Interrupt : 4;
3233 UCHAR Reserved : 1;
3234 UCHAR LevelTriggered : 1;
3235 UCHAR Shared : 1;
3236 UCHAR MoreEntries : 1;
3237 } EISA_IRQ_DESCRIPTOR, *PEISA_IRQ_DESCRIPTOR;
3238
3239 typedef struct _EISA_IRQ_CONFIGURATION {
3240 EISA_IRQ_DESCRIPTOR ConfigurationByte;
3241 UCHAR Reserved;
3242 } EISA_IRQ_CONFIGURATION, *PEISA_IRQ_CONFIGURATION;
3243
3244 typedef struct _DMA_CONFIGURATION_BYTE0 {
3245 UCHAR Channel : 3;
3246 UCHAR Reserved : 3;
3247 UCHAR Shared : 1;
3248 UCHAR MoreEntries : 1;
3249 } DMA_CONFIGURATION_BYTE0;
3250
3251 typedef struct _DMA_CONFIGURATION_BYTE1 {
3252 UCHAR Reserved0 : 2;
3253 UCHAR TransferSize : 2;
3254 UCHAR Timing : 2;
3255 UCHAR Reserved1 : 2;
3256 } DMA_CONFIGURATION_BYTE1;
3257
3258 typedef struct _EISA_DMA_CONFIGURATION {
3259 DMA_CONFIGURATION_BYTE0 ConfigurationByte0;
3260 DMA_CONFIGURATION_BYTE1 ConfigurationByte1;
3261 } EISA_DMA_CONFIGURATION, *PEISA_DMA_CONFIGURATION;
3262
3263 #include <pshpack1.h>
3264 typedef struct _EISA_PORT_DESCRIPTOR {
3265 UCHAR NumberPorts : 5;
3266 UCHAR Reserved : 1;
3267 UCHAR Shared : 1;
3268 UCHAR MoreEntries : 1;
3269 } EISA_PORT_DESCRIPTOR, *PEISA_PORT_DESCRIPTOR;
3270
3271 typedef struct _EISA_PORT_CONFIGURATION {
3272 EISA_PORT_DESCRIPTOR Configuration;
3273 USHORT PortAddress;
3274 } EISA_PORT_CONFIGURATION, *PEISA_PORT_CONFIGURATION;
3275 #include <poppack.h>
3276
3277 typedef struct _CM_EISA_FUNCTION_INFORMATION {
3278 ULONG CompressedId;
3279 UCHAR IdSlotFlags1;
3280 UCHAR IdSlotFlags2;
3281 UCHAR MinorRevision;
3282 UCHAR MajorRevision;
3283 UCHAR Selections[26];
3284 UCHAR FunctionFlags;
3285 UCHAR TypeString[80];
3286 EISA_MEMORY_CONFIGURATION EisaMemory[9];
3287 EISA_IRQ_CONFIGURATION EisaIrq[7];
3288 EISA_DMA_CONFIGURATION EisaDma[4];
3289 EISA_PORT_CONFIGURATION EisaPort[20];
3290 UCHAR InitializationData[60];
3291 } CM_EISA_FUNCTION_INFORMATION, *PCM_EISA_FUNCTION_INFORMATION;
3292
3293 /* CM_EISA_FUNCTION_INFORMATION.FunctionFlags */
3294
3295 #define EISA_FUNCTION_ENABLED 0x80
3296 #define EISA_FREE_FORM_DATA 0x40
3297 #define EISA_HAS_PORT_INIT_ENTRY 0x20
3298 #define EISA_HAS_PORT_RANGE 0x10
3299 #define EISA_HAS_DMA_ENTRY 0x08
3300 #define EISA_HAS_IRQ_ENTRY 0x04
3301 #define EISA_HAS_MEMORY_ENTRY 0x02
3302 #define EISA_HAS_TYPE_ENTRY 0x01
3303 #define EISA_HAS_INFORMATION \
3304 (EISA_HAS_PORT_RANGE + EISA_HAS_DMA_ENTRY + EISA_HAS_IRQ_ENTRY \
3305 + EISA_HAS_MEMORY_ENTRY + EISA_HAS_TYPE_ENTRY)
3306
3307 typedef struct _CM_EISA_SLOT_INFORMATION {
3308 UCHAR ReturnCode;
3309 UCHAR ReturnFlags;
3310 UCHAR MajorRevision;
3311 UCHAR MinorRevision;
3312 USHORT Checksum;
3313 UCHAR NumberFunctions;
3314 UCHAR FunctionInformation;
3315 ULONG CompressedId;
3316 } CM_EISA_SLOT_INFORMATION, *PCM_EISA_SLOT_INFORMATION;
3317
3318 /* CM_EISA_SLOT_INFORMATION.ReturnCode */
3319
3320 #define EISA_INVALID_SLOT 0x80
3321 #define EISA_INVALID_FUNCTION 0x81
3322 #define EISA_INVALID_CONFIGURATION 0x82
3323 #define EISA_EMPTY_SLOT 0x83
3324 #define EISA_INVALID_BIOS_CALL 0x86
3325
3326 /*
3327 ** Plug and Play structures
3328 */
3329
3330 typedef VOID
3331 (DDKAPI *PINTERFACE_REFERENCE)(
3332 PVOID Context);
3333
3334 typedef VOID
3335 (DDKAPI *PINTERFACE_DEREFERENCE)(
3336 PVOID Context);
3337
3338 typedef BOOLEAN
3339 (DDKAPI *PTRANSLATE_BUS_ADDRESS)(
3340 IN PVOID Context,
3341 IN PHYSICAL_ADDRESS BusAddress,
3342 IN ULONG Length,
3343 IN OUT PULONG AddressSpace,
3344 OUT PPHYSICAL_ADDRESS TranslatedAddress);
3345
3346 typedef struct _DMA_ADAPTER*
3347 (DDKAPI *PGET_DMA_ADAPTER)(
3348 IN PVOID Context,
3349 IN struct _DEVICE_DESCRIPTION *DeviceDescriptor,
3350 OUT PULONG NumberOfMapRegisters);
3351
3352 typedef ULONG
3353 (DDKAPI *PGET_SET_DEVICE_DATA)(
3354 IN PVOID Context,
3355 IN ULONG DataType,
3356 IN PVOID Buffer,
3357 IN ULONG Offset,
3358 IN ULONG Length);
3359
3360 /* PCI_DEVICE_PRESENCE_PARAMETERS.Flags */
3361 #define PCI_USE_SUBSYSTEM_IDS 0x00000001
3362 #define PCI_USE_REVISION 0x00000002
3363 #define PCI_USE_VENDEV_IDS 0x00000004
3364 #define PCI_USE_CLASS_SUBCLASS 0x00000008
3365 #define PCI_USE_PROGIF 0x00000010
3366 #define PCI_USE_LOCAL_BUS 0x00000020
3367 #define PCI_USE_LOCAL_DEVICE 0x00000040
3368
3369 typedef struct _PCI_DEVICE_PRESENCE_PARAMETERS {
3370 ULONG Size;
3371 ULONG Flags;
3372 USHORT VendorID;
3373 USHORT DeviceID;
3374 UCHAR RevisionID;
3375 USHORT SubVendorID;
3376 USHORT SubSystemID;
3377 UCHAR BaseClass;
3378 UCHAR SubClass;
3379 UCHAR ProgIf;
3380 } PCI_DEVICE_PRESENCE_PARAMETERS, *PPCI_DEVICE_PRESENCE_PARAMETERS;
3381
3382 typedef BOOLEAN
3383 (DDKAPI *PPCI_IS_DEVICE_PRESENT)(
3384 IN USHORT VendorID,
3385 IN USHORT DeviceID,
3386 IN UCHAR RevisionID,
3387 IN USHORT SubVendorID,
3388 IN USHORT SubSystemID,
3389 IN ULONG Flags);
3390
3391 typedef BOOLEAN
3392 (DDKAPI *PPCI_IS_DEVICE_PRESENT_EX)(
3393 IN PVOID Context,
3394 IN PPCI_DEVICE_PRESENCE_PARAMETERS Parameters);
3395
3396 typedef struct _BUS_INTERFACE_STANDARD {
3397 USHORT Size;
3398 USHORT Version;
3399 PVOID Context;
3400 PINTERFACE_REFERENCE InterfaceReference;
3401 PINTERFACE_DEREFERENCE InterfaceDereference;
3402 PTRANSLATE_BUS_ADDRESS TranslateBusAddress;
3403 PGET_DMA_ADAPTER GetDmaAdapter;
3404 PGET_SET_DEVICE_DATA SetBusData;
3405 PGET_SET_DEVICE_DATA GetBusData;
3406 } BUS_INTERFACE_STANDARD, *PBUS_INTERFACE_STANDARD;
3407
3408 typedef struct _PCI_DEVICE_PRESENT_INTERFACE {
3409 USHORT Size;
3410 USHORT Version;
3411 PVOID Context;
3412 PINTERFACE_REFERENCE InterfaceReference;
3413 PINTERFACE_DEREFERENCE InterfaceDereference;
3414 PPCI_IS_DEVICE_PRESENT IsDevicePresent;
3415 PPCI_IS_DEVICE_PRESENT_EX IsDevicePresentEx;
3416 } PCI_DEVICE_PRESENT_INTERFACE, *PPCI_DEVICE_PRESENT_INTERFACE;
3417
3418 typedef
3419 BOOLEAN
3420 (*PGPE_SERVICE_ROUTINE2)(
3421 PVOID ObjectContext,
3422 PVOID ServiceContext
3423 );
3424
3425 typedef
3426 NTSTATUS
3427 (*PGPE_CONNECT_VECTOR2)(
3428 PVOID Context,
3429 ULONG GpeNumber,
3430 KINTERRUPT_MODE Mode,
3431 BOOLEAN Shareable,
3432 PGPE_SERVICE_ROUTINE2 ServiceRoutine,
3433 PVOID ServiceContext,
3434 PVOID *ObjectContext
3435 );
3436
3437 typedef
3438 NTSTATUS
3439 (*PGPE_DISCONNECT_VECTOR2)(
3440 PVOID Context,
3441 PVOID ObjectContext
3442 );
3443
3444 typedef
3445 NTSTATUS
3446 (*PGPE_ENABLE_EVENT2)(
3447 PVOID Context,
3448 PVOID ObjectContext
3449 );
3450
3451 typedef
3452 NTSTATUS
3453 (*PGPE_DISABLE_EVENT2)(
3454 PVOID Context,
3455 PVOID ObjectContext
3456 );
3457
3458 typedef
3459 NTSTATUS
3460 (*PGPE_CLEAR_STATUS2)(
3461 PVOID Context,
3462 PVOID ObjectContext
3463 );
3464
3465 typedef
3466 VOID
3467 (*PDEVICE_NOTIFY_CALLBACK2)(
3468 PVOID NotificationContext,
3469 ULONG NotifyCode
3470 );
3471
3472 typedef
3473 NTSTATUS
3474 (*PREGISTER_FOR_DEVICE_NOTIFICATIONS2)(
3475 PVOID Context,
3476 PDEVICE_NOTIFY_CALLBACK2 NotificationHandler,
3477 PVOID NotificationContext
3478 );
3479
3480 typedef
3481 VOID
3482 (*PUNREGISTER_FOR_DEVICE_NOTIFICATIONS2)(
3483 PVOID Context
3484 );
3485
3486 typedef struct
3487 {
3488 USHORT Size;
3489 USHORT Version;
3490 PVOID Context;
3491 PINTERFACE_REFERENCE InterfaceReference;
3492 PINTERFACE_DEREFERENCE InterfaceDereference;
3493 PGPE_CONNECT_VECTOR2 GpeConnectVector;
3494 PGPE_DISCONNECT_VECTOR2 GpeDisconnectVector;
3495 PGPE_ENABLE_EVENT2 GpeEnableEvent;
3496 PGPE_DISABLE_EVENT2 GpeDisableEvent;
3497 PGPE_CLEAR_STATUS2 GpeClearStatus;
3498 PREGISTER_FOR_DEVICE_NOTIFICATIONS2 RegisterForDeviceNotifications;
3499 PUNREGISTER_FOR_DEVICE_NOTIFICATIONS2 UnregisterForDeviceNotifications;
3500 } ACPI_INTERFACE_STANDARD2, *PACPI_INTERFACE_STANDARD2;
3501
3502 typedef
3503 BOOLEAN
3504 (*PGPE_SERVICE_ROUTINE)(
3505 PDEVICE_OBJECT ObjectContext,
3506 PVOID ServiceContext
3507 );
3508
3509 typedef
3510 NTSTATUS
3511 (*PGPE_CONNECT_VECTOR)(
3512 PDEVICE_OBJECT Context,
3513 ULONG GpeNumber,
3514 KINTERRUPT_MODE Mode,
3515 BOOLEAN Shareable,
3516 PGPE_SERVICE_ROUTINE ServiceRoutine,
3517 PVOID ServiceContext,
3518 PVOID *ObjectContext
3519 );
3520
3521 typedef
3522 NTSTATUS
3523 (*PGPE_DISCONNECT_VECTOR)(
3524 PDEVICE_OBJECT Context,
3525 PVOID ObjectContext
3526 );
3527
3528 typedef
3529 NTSTATUS
3530 (*PGPE_ENABLE_EVENT)(
3531 PDEVICE_OBJECT Context,
3532 PVOID ObjectContext
3533 );
3534
3535 typedef
3536 NTSTATUS
3537 (*PGPE_DISABLE_EVENT)(
3538 PDEVICE_OBJECT Context,
3539 PVOID ObjectContext
3540 );
3541
3542 typedef
3543 NTSTATUS
3544 (*PGPE_CLEAR_STATUS)(
3545 PDEVICE_OBJECT Context,
3546 PVOID ObjectContext
3547 );
3548
3549 typedef
3550 VOID
3551 (*PDEVICE_NOTIFY_CALLBACK)(
3552 PVOID NotificationContext,
3553 ULONG NotifyCode
3554 );
3555
3556 typedef
3557 NTSTATUS
3558 (*PREGISTER_FOR_DEVICE_NOTIFICATIONS)(
3559 PDEVICE_OBJECT Context,
3560 PDEVICE_NOTIFY_CALLBACK NotificationHandler,
3561 PVOID NotificationContext
3562 );
3563
3564 typedef
3565 VOID
3566 (*PUNREGISTER_FOR_DEVICE_NOTIFICATIONS)(
3567 PDEVICE_OBJECT Context,
3568 PDEVICE_NOTIFY_CALLBACK NotificationHandler
3569 );
3570
3571 typedef struct
3572 {
3573 USHORT Size;
3574 USHORT Version;
3575 PVOID Context;
3576 PINTERFACE_REFERENCE InterfaceReference;
3577 PINTERFACE_DEREFERENCE InterfaceDereference;
3578 PGPE_CONNECT_VECTOR GpeConnectVector;
3579 PGPE_DISCONNECT_VECTOR GpeDisconnectVector;
3580 PGPE_ENABLE_EVENT GpeEnableEvent;
3581 PGPE_DISABLE_EVENT GpeDisableEvent;
3582 PGPE_CLEAR_STATUS GpeClearStatus;
3583 PREGISTER_FOR_DEVICE_NOTIFICATIONS RegisterForDeviceNotifications;
3584 PUNREGISTER_FOR_DEVICE_NOTIFICATIONS UnregisterForDeviceNotifications;
3585 } ACPI_INTERFACE_STANDARD, *PACPI_INTERFACE_STANDARD;
3586
3587 typedef struct _DEVICE_CAPABILITIES {
3588 USHORT Size;
3589 USHORT Version;
3590 ULONG DeviceD1 : 1;
3591 ULONG DeviceD2 : 1;
3592 ULONG LockSupported : 1;
3593 ULONG EjectSupported : 1;
3594 ULONG Removable : 1;
3595 ULONG DockDevice : 1;
3596 ULONG UniqueID : 1;
3597 ULONG SilentInstall : 1;
3598 ULONG RawDeviceOK : 1;
3599 ULONG SurpriseRemovalOK : 1;
3600 ULONG WakeFromD0 : 1;
3601 ULONG WakeFromD1 : 1;
3602 ULONG WakeFromD2 : 1;
3603 ULONG WakeFromD3 : 1;
3604 ULONG HardwareDisabled : 1;
3605 ULONG NonDynamic : 1;
3606 ULONG WarmEjectSupported : 1;
3607 ULONG NoDisplayInUI : 1;
3608 ULONG Reserved : 14;
3609 ULONG Address;
3610 ULONG UINumber;
3611 DEVICE_POWER_STATE DeviceState[PowerSystemMaximum];
3612 SYSTEM_POWER_STATE SystemWake;
3613 DEVICE_POWER_STATE DeviceWake;
3614 ULONG D1Latency;
3615 ULONG D2Latency;
3616 ULONG D3Latency;
3617 } DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES;
3618
3619 typedef struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION {
3620 USHORT Version;
3621 USHORT Size;
3622 GUID Event;
3623 GUID InterfaceClassGuid;
3624 PUNICODE_STRING SymbolicLinkName;
3625 } DEVICE_INTERFACE_CHANGE_NOTIFICATION, *PDEVICE_INTERFACE_CHANGE_NOTIFICATION;
3626
3627 typedef struct _HWPROFILE_CHANGE_NOTIFICATION {
3628 USHORT Version;
3629 USHORT Size;
3630 GUID Event;
3631 } HWPROFILE_CHANGE_NOTIFICATION, *PHWPROFILE_CHANGE_NOTIFICATION;
3632
3633 #undef INTERFACE
3634
3635 typedef struct _INTERFACE {
3636 USHORT Size;
3637 USHORT Version;
3638 PVOID Context;
3639 PINTERFACE_REFERENCE InterfaceReference;
3640 PINTERFACE_DEREFERENCE InterfaceDereference;
3641 } INTERFACE, *PINTERFACE;
3642
3643 typedef struct _PLUGPLAY_NOTIFICATION_HEADER {
3644 USHORT Version;
3645 USHORT Size;
3646 GUID Event;
3647 } PLUGPLAY_NOTIFICATION_HEADER, *PPLUGPLAY_NOTIFICATION_HEADER;
3648
3649 typedef ULONG PNP_DEVICE_STATE, *PPNP_DEVICE_STATE;
3650
3651 /* PNP_DEVICE_STATE */
3652
3653 #define PNP_DEVICE_DISABLED 0x00000001
3654 #define PNP_DEVICE_DONT_DISPLAY_IN_UI 0x00000002
3655 #define PNP_DEVICE_FAILED 0x00000004
3656 #define PNP_DEVICE_REMOVED 0x00000008
3657 #define PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED 0x00000010
3658 #define PNP_DEVICE_NOT_DISABLEABLE 0x00000020
3659
3660 typedef struct _TARGET_DEVICE_CUSTOM_NOTIFICATION {
3661 USHORT Version;
3662 USHORT Size;
3663 GUID Event;
3664 struct _FILE_OBJECT *FileObject;
3665 LONG NameBufferOffset;
3666 UCHAR CustomDataBuffer[1];
3667 } TARGET_DEVICE_CUSTOM_NOTIFICATION, *PTARGET_DEVICE_CUSTOM_NOTIFICATION;
3668
3669 typedef struct _TARGET_DEVICE_REMOVAL_NOTIFICATION {
3670 USHORT Version;
3671 USHORT Size;
3672 GUID Event;
3673 struct _FILE_OBJECT *FileObject;
3674 } TARGET_DEVICE_REMOVAL_NOTIFICATION, *PTARGET_DEVICE_REMOVAL_NOTIFICATION;
3675
3676 typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE {
3677 DeviceUsageTypeUndefined,
3678 DeviceUsageTypePaging,
3679 DeviceUsageTypeHibernation,
3680 DeviceUsageTypeDumpFile
3681 } DEVICE_USAGE_NOTIFICATION_TYPE;
3682
3683 typedef struct _POWER_SEQUENCE {
3684 ULONG SequenceD1;
3685 ULONG SequenceD2;
3686 ULONG SequenceD3;
3687 } POWER_SEQUENCE, *PPOWER_SEQUENCE;
3688
3689 typedef enum {
3690 DevicePropertyDeviceDescription = 0x0,
3691 DevicePropertyHardwareID = 0x1,
3692 DevicePropertyCompatibleIDs = 0x2,
3693 DevicePropertyBootConfiguration = 0x3,
3694 DevicePropertyBootConfigurationTranslated = 0x4,
3695 DevicePropertyClassName = 0x5,
3696 DevicePropertyClassGuid = 0x6,
3697 DevicePropertyDriverKeyName = 0x7,
3698 DevicePropertyManufacturer = 0x8,
3699 DevicePropertyFriendlyName = 0x9,
3700 DevicePropertyLocationInformation = 0xa,
3701 DevicePropertyPhysicalDeviceObjectName = 0xb,
3702 DevicePropertyBusTypeGuid = 0xc,
3703 DevicePropertyLegacyBusType = 0xd,
3704 DevicePropertyBusNumber = 0xe,
3705 DevicePropertyEnumeratorName = 0xf,
3706 DevicePropertyAddress = 0x10,
3707 DevicePropertyUINumber = 0x11,
3708 DevicePropertyInstallState = 0x12,
3709 DevicePropertyRemovalPolicy = 0x13,
3710 DevicePropertyResourceRequirements = 0x14,
3711 DevicePropertyAllocatedResources = 0x15,
3712 DevicePropertyContainerID = 0x16
3713 } DEVICE_REGISTRY_PROPERTY;
3714
3715 typedef enum _IO_NOTIFICATION_EVENT_CATEGORY {
3716 EventCategoryReserved,
3717 EventCategoryHardwareProfileChange,
3718 EventCategoryDeviceInterfaceChange,
3719 EventCategoryTargetDeviceChange
3720 } IO_NOTIFICATION_EVENT_CATEGORY;
3721
3722 #define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES 0x00000001
3723
3724 typedef NTSTATUS
3725 (DDKAPI *PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)(
3726 IN PVOID NotificationStructure,
3727 IN PVOID Context);
3728
3729 typedef VOID
3730 (DDKAPI *PDEVICE_CHANGE_COMPLETE_CALLBACK)(
3731 IN PVOID Context);
3732
3733 typedef enum _FILE_INFORMATION_CLASS {
3734 FileDirectoryInformation = 1,
3735 FileFullDirectoryInformation,
3736 FileBothDirectoryInformation,
3737 FileBasicInformation,
3738 FileStandardInformation,
3739 FileInternalInformation,
3740 FileEaInformation,
3741 FileAccessInformation,
3742 FileNameInformation,
3743 FileRenameInformation,
3744 FileLinkInformation,
3745 FileNamesInformation,
3746 FileDispositionInformation,
3747 FilePositionInformation,
3748 FileFullEaInformation,
3749 FileModeInformation,
3750 FileAlignmentInformation,
3751 FileAllInformation,
3752 FileAllocationInformation,
3753 FileEndOfFileInformation,
3754 FileAlternateNameInformation,
3755 FileStreamInformation,
3756 FilePipeInformation,
3757 FilePipeLocalInformation,
3758 FilePipeRemoteInformation,
3759 FileMailslotQueryInformation,
3760 FileMailslotSetInformation,
3761 FileCompressionInformation,
3762 FileObjectIdInformation,
3763 FileCompletionInformation,
3764 FileMoveClusterInformation,
3765 FileQuotaInformation,
3766 FileReparsePointInformation,
3767 FileNetworkOpenInformation,
3768 FileAttributeTagInformation,
3769 FileTrackingInformation,
3770 FileIdBothDirectoryInformation,
3771 FileIdFullDirectoryInformation,
3772 FileValidDataLengthInformation,
3773 FileShortNameInformation,
3774 FileIoCompletionNotificationInformation,
3775 FileIoStatusBlockRangeInformation,
3776 FileIoPriorityHintInformation,
3777 FileSfioReserveInformation,
3778 FileSfioVolumeInformation,
3779 FileHardLinkInformation,