wine.inf: Add Winlogon keys.
[wine.git] / include / ddk / wdm.h
blobb4325cec6c78b0ae7ac51617798b6f295e4aa3ae
1 /*
2 * Copyright 2004-2005 Ivan Leo Puoti
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef _WDMDDK_
20 #define _WDMDDK_
21 #define _NTDDK_
23 #include <ntstatus.h>
25 #ifdef _WIN64
26 #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
27 #else
28 #define POINTER_ALIGNMENT
29 #endif
31 /* FIXME: We suppose that page size is 4096 */
32 #undef PAGE_SIZE
33 #define PAGE_SIZE 0x1000
34 #define PAGE_SHIFT 12
36 #define BYTE_OFFSET(va) ((ULONG)((ULONG_PTR)(va) & (PAGE_SIZE - 1)))
37 #define PAGE_ALIGN(va) ((PVOID)((ULONG_PTR)(va) & ~(PAGE_SIZE - 1)))
38 #define ADDRESS_AND_SIZE_TO_SPAN_PAGES(va, length) \
39 ((BYTE_OFFSET(va) + ((SIZE_T)(length)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT)
41 typedef LONG KPRIORITY;
43 typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
45 typedef ULONG_PTR ERESOURCE_THREAD;
46 typedef ERESOURCE_THREAD *PERESOURCE_THREAD;
47 typedef struct _FILE_GET_QUOTA_INFORMATION *PFILE_GET_QUOTA_INFORMATION;
49 struct _KDPC;
50 struct _KAPC;
51 struct _IRP;
52 struct _DEVICE_OBJECT;
53 struct _DRIVER_OBJECT;
55 typedef VOID (WINAPI *PKDEFERRED_ROUTINE)(struct _KDPC *, PVOID, PVOID, PVOID);
56 typedef VOID (WINAPI *PKSTART_ROUTINE)(PVOID);
58 typedef NTSTATUS (WINAPI *PDRIVER_INITIALIZE)(struct _DRIVER_OBJECT *, PUNICODE_STRING);
59 typedef NTSTATUS (WINAPI *PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *, struct _IRP *);
60 typedef void (WINAPI *PDRIVER_STARTIO)(struct _DEVICE_OBJECT *, struct _IRP *);
61 typedef void (WINAPI *PDRIVER_UNLOAD)(struct _DRIVER_OBJECT *);
62 typedef NTSTATUS (WINAPI *PDRIVER_ADD_DEVICE)(struct _DRIVER_OBJECT *, struct _DEVICE_OBJECT *);
64 typedef struct _DISPATCHER_HEADER {
65 UCHAR Type;
66 UCHAR Absolute;
67 UCHAR Size;
68 UCHAR Inserted;
69 LONG SignalState;
70 LIST_ENTRY WaitListHead;
71 } DISPATCHER_HEADER, *PDISPATCHER_HEADER;
73 typedef struct _KEVENT {
74 DISPATCHER_HEADER Header;
75 } KEVENT, *PKEVENT, *RESTRICTED_POINTER PRKEVENT;
77 typedef struct _KSEMAPHORE {
78 DISPATCHER_HEADER Header;
79 LONG Limit;
80 } KSEMAPHORE, *PKSEMAPHORE, *PRKSEMAPHORE;
82 typedef struct _KDPC {
83 CSHORT Type;
84 UCHAR Number;
85 UCHAR Importance;
86 LIST_ENTRY DpcListEntry;
87 PKDEFERRED_ROUTINE DeferredRoutine;
88 PVOID DeferredContext;
89 PVOID SystemArgument1;
90 PVOID SystemArgument2;
91 PULONG_PTR Lock;
92 } KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC;
94 typedef enum _KDPC_IMPORTANCE {
95 LowImportance,
96 MediumImportance,
97 HighImportance,
98 MediumHighImportance
99 } KDPC_IMPORTANCE;
101 typedef struct _KDEVICE_QUEUE_ENTRY {
102 LIST_ENTRY DeviceListEntry;
103 ULONG SortKey;
104 BOOLEAN Inserted;
105 } KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY,
106 *RESTRICTED_POINTER PRKDEVICE_QUEUE_ENTRY;
108 typedef struct _KDEVICE_QUEUE {
109 CSHORT Type;
110 CSHORT Size;
111 LIST_ENTRY DeviceListHead;
112 KSPIN_LOCK Lock;
113 BOOLEAN Busy;
114 } KDEVICE_QUEUE, *PKDEVICE_QUEUE, *RESTRICTED_POINTER PRKDEVICE_QUEUE;
116 typedef struct _KMUTANT {
117 DISPATCHER_HEADER Header;
118 LIST_ENTRY MutantListEntry;
119 struct _KTHREAD *RESTRICTED_POINTER OwnerThread;
120 BOOLEAN Abandoned;
121 UCHAR ApcDisable;
122 } KMUTANT, *PKMUTANT, *RESTRICTED_POINTER PRKMUTANT, KMUTEX, *PKMUTEX, *RESTRICTED_POINTER PRKMUTEX;
124 typedef enum _KWAIT_REASON
126 Executive,
127 FreePage,
128 PageIn,
129 PoolAllocation,
130 DelayExecution,
131 Suspended,
132 UserRequest,
133 WrExecutive,
134 WrFreePage,
135 WrPageIn,
136 WrDelayExecution,
137 WrSuspended,
138 WrUserRequest,
139 WrQueue,
140 WrLpcReceive,
141 WrLpcReply,
142 WrVirtualMemory,
143 WrPageOut,
144 WrRendezvous,
145 Spare2,
146 Spare3,
147 Spare4,
148 Spare5,
149 Spare6,
150 WrKernel,
151 MaximumWaitReason,
152 } KWAIT_REASON;
154 typedef struct _KWAIT_BLOCK {
155 LIST_ENTRY WaitListEntry;
156 struct _KTHREAD *RESTRICTED_POINTER Thread;
157 PVOID Object;
158 struct _KWAIT_BLOCK *RESTRICTED_POINTER NextWaitBlock;
159 USHORT WaitKey;
160 USHORT WaitType;
161 } KWAIT_BLOCK, *PKWAIT_BLOCK, *RESTRICTED_POINTER PRKWAIT_BLOCK;
163 typedef struct _OWNER_ENTRY
165 ERESOURCE_THREAD OwnerThread;
166 union
168 struct
170 ULONG IoPriorityBoosted : 1;
171 ULONG OwnerReferenced : 1;
172 ULONG IoQoSPriorityBoosted : 1;
173 ULONG OwnerCount : 29;
175 ULONG TableSize;
177 } OWNER_ENTRY, *POWNER_ENTRY;
179 #define ResourceNeverExclusive 0x0010
180 #define ResourceReleaseByOtherThread 0x0020
181 #define ResourceOwnedExclusive 0x0080
183 typedef struct _ERESOURCE
185 LIST_ENTRY SystemResourcesList;
186 OWNER_ENTRY *OwnerTable;
187 SHORT ActiveCount;
188 union
190 USHORT Flag;
191 struct
193 UCHAR ReservedLowFlags;
194 UCHAR WaiterPriority;
197 KSEMAPHORE *SharedWaiters;
198 KEVENT *ExclusiveWaiters;
199 OWNER_ENTRY OwnerEntry;
200 ULONG ActiveEntries;
201 ULONG ContentionCount;
202 ULONG NumberOfSharedWaiters;
203 ULONG NumberOfExclusiveWaiters;
204 #ifdef _WIN64
205 void *Reserved2;
206 #endif
207 union
209 void *Address;
210 ULONG_PTR CreatorBackTraceIndex;
212 KSPIN_LOCK SpinLock;
213 } ERESOURCE, *PERESOURCE;
215 typedef struct _IO_TIMER *PIO_TIMER;
216 typedef struct _IO_TIMER_ROUTINE *PIO_TIMER_ROUTINE;
217 typedef struct _ETHREAD *PETHREAD;
218 typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
219 typedef struct _EPROCESS *PEPROCESS;
220 typedef struct _IO_WORKITEM *PIO_WORKITEM;
221 typedef struct _OBJECT_TYPE *POBJECT_TYPE;
222 typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION;
223 typedef struct _ZONE_HEADER *PZONE_HEADER;
224 typedef struct _LOOKASIDE_LIST_EX *PLOOKASIDE_LIST_EX;
226 #define FM_LOCK_BIT 0x1
228 typedef struct _FAST_MUTEX
230 LONG Count;
231 PKTHREAD Owner;
232 ULONG Contention;
233 KEVENT Event;
234 ULONG OldIrql;
235 } FAST_MUTEX, *PFAST_MUTEX;
237 #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR))
239 typedef struct _VPB {
240 CSHORT Type;
241 CSHORT Size;
242 USHORT Flags;
243 USHORT VolumeLabelLength;
244 struct _DEVICE_OBJECT *DeviceObject;
245 struct _DEVICE_OBJECT *RealDevice;
246 ULONG SerialNumber;
247 ULONG ReferenceCount;
248 WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)];
249 } VPB, *PVPB;
251 #define POOL_QUOTA_FAIL_INSTEAD_OF_RAISE 0x0008
252 #define POOL_RAISE_IF_ALLOCATION_FAILURE 0x0010
253 #define POOL_COLD_ALLOCATION 0x0100
254 #define POOL_NX_ALLOCATION 0x0200
256 typedef enum _POOL_TYPE {
257 NonPagedPool,
258 PagedPool,
259 NonPagedPoolMustSucceed,
260 DontUseThisType,
261 NonPagedPoolCacheAligned,
262 PagedPoolCacheAligned,
263 NonPagedPoolCacheAlignedMustS,
264 MaxPoolType
265 } POOL_TYPE;
267 typedef struct _WAIT_CONTEXT_BLOCK {
268 KDEVICE_QUEUE_ENTRY WaitQueueEntry;
269 struct _DRIVER_CONTROL *DeviceRoutine;
270 PVOID DeviceContext;
271 ULONG NumberOfMapRegisters;
272 PVOID DeviceObject;
273 PVOID CurrentIrp;
274 PKDPC BufferChainingDpc;
275 } WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK;
277 #define DO_BUFFERED_IO 0x00000004
278 #define DO_EXCLUSIVE 0x00000008
279 #define DO_DIRECT_IO 0x00000010
280 #define DO_MAP_IO_BUFFER 0x00000020
281 #define DO_DEVICE_INITIALIZING 0x00000080
282 #define DO_SHUTDOWN_REGISTERED 0x00000800
283 #define DO_BUS_ENUMERATED_DEVICE 0x00001000
284 #define DO_POWER_PAGABLE 0x00002000
285 #define DO_POWER_INRUSH 0x00004000
287 #define IO_NO_INCREMENT 0
288 #define IO_CD_ROM_INCREMENT 1
289 #define IO_DISK_INCREMENT 1
290 #define IO_KEYBOARD_INCREMENT 6
291 #define IO_MAILSLOT_INCREMENT 2
292 #define IO_MOUSE_INCREMENT 6
293 #define IO_NAMED_PIPE_INCREMENT 2
294 #define IO_NETWORK_INCREMENT 2
295 #define IO_PARALLEL_INCREMENT 1
296 #define IO_SERIAL_INCREMENT 2
297 #define IO_SOUND_INCREMENT 8
298 #define IO_VIDEO_INCREMENT 1
300 #ifndef DEVICE_TYPE
301 #define DEVICE_TYPE ULONG
302 #endif
303 #define IRP_MJ_MAXIMUM_FUNCTION 0x1b
304 #define IRP_MJ_CREATE 0x00
305 #define IRP_MJ_CREATE_NAMED_PIPE 0x01
306 #define IRP_MJ_CLOSE 0x02
307 #define IRP_MJ_READ 0x03
308 #define IRP_MJ_WRITE 0x04
309 #define IRP_MJ_QUERY_INFORMATION 0x05
310 #define IRP_MJ_SET_INFORMATION 0x06
311 #define IRP_MJ_QUERY_EA 0x07
312 #define IRP_MJ_SET_EA 0x08
313 #define IRP_MJ_FLUSH_BUFFERS 0x09
314 #define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a
315 #define IRP_MJ_SET_VOLUME_INFORMATION 0x0b
316 #define IRP_MJ_DIRECTORY_CONTROL 0x0c
317 #define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d
318 #define IRP_MJ_DEVICE_CONTROL 0x0e
319 #define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f
320 #define IRP_MJ_SHUTDOWN 0x10
321 #define IRP_MJ_LOCK_CONTROL 0x11
322 #define IRP_MJ_CLEANUP 0x12
323 #define IRP_MJ_CREATE_MAILSLOT 0x13
324 #define IRP_MJ_QUERY_SECURITY 0x14
325 #define IRP_MJ_SET_SECURITY 0x15
326 #define IRP_MJ_POWER 0x16
327 #define IRP_MJ_SYSTEM_CONTROL 0x17
328 #define IRP_MJ_DEVICE_CHANGE 0x18
329 #define IRP_MJ_QUERY_QUOTA 0x19
330 #define IRP_MJ_SET_QUOTA 0x1a
331 #define IRP_MJ_PNP 0x1b
333 #define IRP_MN_START_DEVICE 0x00
334 #define IRP_MN_QUERY_REMOVE_DEVICE 0x01
335 #define IRP_MN_REMOVE_DEVICE 0x02
336 #define IRP_MN_CANCEL_REMOVE_DEVICE 0x03
337 #define IRP_MN_STOP_DEVICE 0x04
338 #define IRP_MN_QUERY_STOP_DEVICE 0x05
339 #define IRP_MN_CANCEL_STOP_DEVICE 0x06
340 #define IRP_MN_QUERY_DEVICE_RELATIONS 0x07
341 #define IRP_MN_QUERY_INTERFACE 0x08
342 #define IRP_MN_QUERY_CAPABILITIES 0x09
343 #define IRP_MN_QUERY_RESOURCES 0x0A
344 #define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B
345 #define IRP_MN_QUERY_DEVICE_TEXT 0x0C
346 #define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
347 #define IRP_MN_READ_CONFIG 0x0F
348 #define IRP_MN_WRITE_CONFIG 0x10
349 #define IRP_MN_EJECT 0x11
350 #define IRP_MN_SET_LOCK 0x12
351 #define IRP_MN_QUERY_ID 0x13
352 #define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14
353 #define IRP_MN_QUERY_BUS_INFORMATION 0x15
354 #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16
355 #define IRP_MN_SURPRISE_REMOVAL 0x17
356 #define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
358 #define IRP_MN_WAIT_WAKE 0x00
359 #define IRP_MN_POWER_SEQUENCE 0x01
360 #define IRP_MN_SET_POWER 0x02
361 #define IRP_MN_QUERY_POWER 0x03
363 #define IRP_QUOTA_CHARGED 0x01
364 #define IRP_ALLOCATED_MUST_SUCCEED 0x02
365 #define IRP_ALLOCATED_FIXED_SIZE 0x04
366 #define IRP_LOOKASIDE_ALLOCATION 0x08
368 #define IO_TYPE_ADAPTER 0x01
369 #define IO_TYPE_CONTROLLER 0x02
370 #define IO_TYPE_DEVICE 0x03
371 #define IO_TYPE_DRIVER 0x04
372 #define IO_TYPE_FILE 0x05
373 #define IO_TYPE_IRP 0x06
374 #define IO_TYPE_MASTER_ADAPTER 0x07
375 #define IO_TYPE_OPEN_PACKET 0x08
376 #define IO_TYPE_TIMER 0x09
377 #define IO_TYPE_VPB 0x0a
378 #define IO_TYPE_ERROR_LOG 0x0b
379 #define IO_TYPE_ERROR_MESSAGE 0x0c
380 #define IO_TYPE_DEVICE_OBJECT_EXTENSION 0x0d
382 typedef struct _DEVICE_OBJECT {
383 CSHORT Type;
384 USHORT Size;
385 LONG ReferenceCount;
386 struct _DRIVER_OBJECT *DriverObject;
387 struct _DEVICE_OBJECT *NextDevice;
388 struct _DEVICE_OBJECT *AttachedDevice;
389 struct _IRP *CurrentIrp;
390 PIO_TIMER Timer;
391 ULONG Flags;
392 ULONG Characteristics;
393 PVPB Vpb;
394 PVOID DeviceExtension;
395 DEVICE_TYPE DeviceType;
396 CCHAR StackSize;
397 union {
398 LIST_ENTRY ListEntry;
399 WAIT_CONTEXT_BLOCK Wcb;
400 } Queue;
401 ULONG AlignmentRequirement;
402 KDEVICE_QUEUE DeviceQueue;
403 KDPC Dpc;
404 ULONG ActiveThreadCount;
405 PSECURITY_DESCRIPTOR SecurityDescriptor;
406 KEVENT DeviceLock;
407 USHORT SectorSize;
408 USHORT Spare1;
409 struct _DEVOBJ_EXTENSION *DeviceObjectExtension;
410 PVOID Reserved;
411 } DEVICE_OBJECT;
412 typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
414 typedef struct _DEVICE_RELATIONS {
415 ULONG Count;
416 PDEVICE_OBJECT Objects[1];
417 } DEVICE_RELATIONS;
418 typedef struct _DEVICE_RELATIONS *PDEVICE_RELATIONS;
420 typedef struct _DRIVER_EXTENSION {
421 struct _DRIVER_OBJECT *DriverObject;
422 PDRIVER_ADD_DEVICE AddDevice;
423 ULONG Count;
424 UNICODE_STRING ServiceKeyName;
425 } DRIVER_EXTENSION, *PDRIVER_EXTENSION;
427 typedef struct _DRIVER_OBJECT {
428 CSHORT Type;
429 CSHORT Size;
430 PDEVICE_OBJECT DeviceObject;
431 ULONG Flags;
432 PVOID DriverStart;
433 ULONG DriverSize;
434 PVOID DriverSection;
435 PDRIVER_EXTENSION DriverExtension;
436 UNICODE_STRING DriverName;
437 PUNICODE_STRING HardwareDatabase;
438 PVOID FastIoDispatch;
439 PDRIVER_INITIALIZE DriverInit;
440 PDRIVER_STARTIO DriverStartIo;
441 PDRIVER_UNLOAD DriverUnload;
442 PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1];
443 } DRIVER_OBJECT;
444 typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
446 /* Irp definitions */
447 typedef UCHAR KIRQL, *PKIRQL;
448 typedef CCHAR KPROCESSOR_MODE;
450 typedef VOID (WINAPI *PDRIVER_CANCEL)(
451 IN struct _DEVICE_OBJECT *DeviceObject,
452 IN struct _IRP *Irp);
454 typedef VOID (WINAPI *PKNORMAL_ROUTINE)(
455 IN PVOID NormalContext,
456 IN PVOID SystemArgument1,
457 IN PVOID SystemArgument2);
459 typedef VOID (WINAPI *PKKERNEL_ROUTINE)(
460 IN struct _KAPC *Apc,
461 IN OUT PKNORMAL_ROUTINE *NormalRoutine,
462 IN OUT PVOID *NormalContext,
463 IN OUT PVOID *SystemArgument1,
464 IN OUT PVOID *SystemArgument2);
466 typedef VOID (WINAPI *PKRUNDOWN_ROUTINE)(
467 IN struct _KAPC *Apc);
469 typedef struct _KAPC {
470 CSHORT Type;
471 CSHORT Size;
472 ULONG Spare0;
473 struct _KTHREAD *Thread;
474 LIST_ENTRY ApcListEntry;
475 PKKERNEL_ROUTINE KernelRoutine;
476 PKRUNDOWN_ROUTINE RundownRoutine;
477 PKNORMAL_ROUTINE NormalRoutine;
478 PVOID NormalContext;
479 PVOID SystemArgument1;
480 PVOID SystemArgument2;
481 CCHAR ApcStateIndex;
482 KPROCESSOR_MODE ApcMode;
483 BOOLEAN Inserted;
484 } KAPC, *PKAPC, *RESTRICTED_POINTER PRKAPC;
486 typedef struct _IRP {
487 CSHORT Type;
488 USHORT Size;
489 struct _MDL *MdlAddress;
490 ULONG Flags;
491 union {
492 struct _IRP *MasterIrp;
493 LONG IrpCount;
494 PVOID SystemBuffer;
495 } AssociatedIrp;
496 LIST_ENTRY ThreadListEntry;
497 IO_STATUS_BLOCK IoStatus;
498 KPROCESSOR_MODE RequestorMode;
499 BOOLEAN PendingReturned;
500 CHAR StackCount;
501 CHAR CurrentLocation;
502 BOOLEAN Cancel;
503 KIRQL CancelIrql;
504 CCHAR ApcEnvironment;
505 UCHAR AllocationFlags;
506 PIO_STATUS_BLOCK UserIosb;
507 PKEVENT UserEvent;
508 union {
509 struct {
510 PIO_APC_ROUTINE UserApcRoutine;
511 PVOID UserApcContext;
512 } AsynchronousParameters;
513 LARGE_INTEGER AllocationSize;
514 } Overlay;
515 PDRIVER_CANCEL CancelRoutine;
516 PVOID UserBuffer;
517 union {
518 struct {
519 union {
520 KDEVICE_QUEUE_ENTRY DeviceQueueEntry;
521 struct {
522 PVOID DriverContext[4];
523 } DUMMYSTRUCTNAME;
524 } DUMMYUNIONNAME1;
525 PETHREAD Thread;
526 PCHAR AuxiliaryBuffer;
527 struct {
528 LIST_ENTRY ListEntry;
529 union {
530 struct _IO_STACK_LOCATION *CurrentStackLocation;
531 ULONG PacketType;
532 } DUMMYUNIONNAME2;
533 } DUMMYSTRUCTNAME;
534 struct _FILE_OBJECT *OriginalFileObject;
535 } Overlay;
536 KAPC Apc;
537 PVOID CompletionKey;
538 } Tail;
539 } IRP;
540 typedef struct _IRP *PIRP;
542 #define IRP_NOCACHE 0x0001
543 #define IRP_PAGING_IO 0x0002
544 #define IRP_MOUNT_COMPLETION 0x0002
545 #define IRP_SYNCHRONOUS_API 0x0004
546 #define IRP_ASSOCIATED_IRP 0x0008
547 #define IRP_BUFFERED_IO 0x0010
548 #define IRP_DEALLOCATE_BUFFER 0x0020
549 #define IRP_INPUT_OPERATION 0x0040
550 #define IRP_SYNCHRONOUS_PAGING_IO 0x0040
551 #define IRP_CREATE_OPERATION 0x0080
552 #define IRP_READ_OPERATION 0x0100
553 #define IRP_WRITE_OPERATION 0x0200
554 #define IRP_CLOSE_OPERATION 0x0400
555 #define IRP_DEFER_IO_COMPLETION 0x0800
556 #define IRP_OB_QUERY_NAME 0x1000
557 #define IRP_HOLD_DEVICE_QUEUE 0x2000
559 typedef VOID (WINAPI *PINTERFACE_REFERENCE)(
560 PVOID Context);
562 typedef VOID (WINAPI *PINTERFACE_DEREFERENCE)(
563 PVOID Context);
565 typedef struct _INTERFACE {
566 USHORT Size;
567 USHORT Version;
568 PVOID Context;
569 PINTERFACE_REFERENCE InterfaceReference;
570 PINTERFACE_DEREFERENCE InterfaceDereference;
571 } INTERFACE, *PINTERFACE;
573 typedef struct _SECTION_OBJECT_POINTERS {
574 PVOID DataSectionObject;
575 PVOID SharedCacheMap;
576 PVOID ImageSectionObject;
577 } SECTION_OBJECT_POINTERS, *PSECTION_OBJECT_POINTERS;
579 typedef struct _IO_COMPLETION_CONTEXT {
580 PVOID Port;
581 PVOID Key;
582 } IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT;
584 typedef enum _DEVICE_RELATION_TYPE {
585 BusRelations,
586 EjectionRelations,
587 PowerRelations,
588 RemovalRelations,
589 TargetDeviceRelation,
590 SingleBusRelations
591 } DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE;
593 typedef struct _FILE_OBJECT {
594 CSHORT Type;
595 CSHORT Size;
596 PDEVICE_OBJECT DeviceObject;
597 PVPB Vpb;
598 PVOID FsContext;
599 PVOID FsContext2;
600 PSECTION_OBJECT_POINTERS SectionObjectPointer;
601 PVOID PrivateCacheMap;
602 NTSTATUS FinalStatus;
603 struct _FILE_OBJECT *RelatedFileObject;
604 BOOLEAN LockOperation;
605 BOOLEAN DeletePending;
606 BOOLEAN ReadAccess;
607 BOOLEAN WriteAccess;
608 BOOLEAN DeleteAccess;
609 BOOLEAN SharedRead;
610 BOOLEAN SharedWrite;
611 BOOLEAN SharedDelete;
612 ULONG Flags;
613 UNICODE_STRING FileName;
614 LARGE_INTEGER CurrentByteOffset;
615 ULONG Waiters;
616 ULONG Busy;
617 PVOID LastLock;
618 KEVENT Lock;
619 KEVENT Event;
620 PIO_COMPLETION_CONTEXT CompletionContext;
621 } FILE_OBJECT;
622 typedef struct _FILE_OBJECT *PFILE_OBJECT;
624 #define INITIAL_PRIVILEGE_COUNT 3
626 typedef struct _INITIAL_PRIVILEGE_SET {
627 ULONG PrivilegeCount;
628 ULONG Control;
629 LUID_AND_ATTRIBUTES Privilege[INITIAL_PRIVILEGE_COUNT];
630 } INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET;
632 typedef struct _SECURITY_SUBJECT_CONTEXT {
633 PACCESS_TOKEN ClientToken;
634 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
635 PACCESS_TOKEN PrimaryToken;
636 PVOID ProcessAuditId;
637 } SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT;
639 typedef struct _ACCESS_STATE {
640 LUID OperationID;
641 BOOLEAN SecurityEvaluated;
642 BOOLEAN GenerateAudit;
643 BOOLEAN GenerateOnClose;
644 BOOLEAN PrivilegesAllocated;
645 ULONG Flags;
646 ACCESS_MASK RemainingDesiredAccess;
647 ACCESS_MASK PreviouslyGrantedAccess;
648 ACCESS_MASK OriginalDesiredAccess;
649 SECURITY_SUBJECT_CONTEXT SubjectSecurityContext;
650 PSECURITY_DESCRIPTOR SecurityDescriptor;
651 PVOID AuxData;
652 union {
653 INITIAL_PRIVILEGE_SET InitialPrivilegeSet;
654 PRIVILEGE_SET PrivilegeSet;
655 } Privileges;
657 BOOLEAN AuditPrivileges;
658 UNICODE_STRING ObjectName;
659 UNICODE_STRING ObjectTypeName;
660 } ACCESS_STATE, *PACCESS_STATE;
662 typedef struct _IO_SECURITY_CONTEXT {
663 PSECURITY_QUALITY_OF_SERVICE SecurityQos;
664 PACCESS_STATE AccessState;
665 ACCESS_MASK DesiredAccess;
666 ULONG FullCreateOptions;
667 } IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT;
669 typedef struct _DEVICE_CAPABILITIES {
670 USHORT Size;
671 USHORT Version;
672 ULONG DeviceD1 : 1;
673 ULONG DeviceD2 : 1;
674 ULONG LockSupported : 1;
675 ULONG EjectSupported : 1;
676 ULONG Removable : 1;
677 ULONG DockDevice : 1;
678 ULONG UniqueID : 1;
679 ULONG SilentInstall : 1;
680 ULONG RawDeviceOK : 1;
681 ULONG SurpriseRemovalOK : 1;
682 ULONG WakeFromD0 : 1;
683 ULONG WakeFromD1 : 1;
684 ULONG WakeFromD2 : 1;
685 ULONG WakeFromD3 : 1;
686 ULONG HardwareDisabled : 1;
687 ULONG NonDynamic : 1;
688 ULONG WarmEjectSupported : 1;
689 ULONG NoDisplayInUI : 1;
690 ULONG Reserved : 14;
691 ULONG Address;
692 ULONG UINumber;
693 DEVICE_POWER_STATE DeviceState[PowerSystemMaximum];
694 SYSTEM_POWER_STATE SystemWake;
695 DEVICE_POWER_STATE DeviceWake;
696 ULONG D1Latency;
697 ULONG D2Latency;
698 ULONG D3Latency;
699 } DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES;
701 typedef struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION {
702 USHORT Version;
703 USHORT Size;
704 GUID Event;
705 GUID InterfaceClassGuid;
706 PUNICODE_STRING SymbolicLinkName;
707 } DEVICE_INTERFACE_CHANGE_NOTIFICATION, *PDEVICE_INTERFACE_CHANGE_NOTIFICATION;
709 typedef enum _INTERFACE_TYPE {
710 InterfaceTypeUndefined = -1,
711 Internal,
712 Isa,
713 Eisa,
714 MicroChannel,
715 TurboChannel,
716 PCIBus,
717 VMEBus,
718 NuBus,
719 PCMCIABus,
720 CBus,
721 MPIBus,
722 MPSABus,
723 ProcessorInternal,
724 InternalPowerBus,
725 PNPISABus,
726 PNPBus,
727 MaximumInterfaceType
728 } INTERFACE_TYPE, *PINTERFACE_TYPE;
730 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
732 #define IO_RESOURCE_PREFERRED 0x01
733 #define IO_RESOURCE_DEFAULT 0x02
734 #define IO_RESOURCE_ALTERNATIVE 0x08
736 typedef struct _IO_RESOURCE_DESCRIPTOR {
737 UCHAR Option;
738 UCHAR Type;
739 UCHAR ShareDisposition;
740 UCHAR Spare1;
741 USHORT Flags;
742 USHORT Spare2;
743 union {
744 struct {
745 ULONG Length;
746 ULONG Alignment;
747 PHYSICAL_ADDRESS MinimumAddress;
748 PHYSICAL_ADDRESS MaximumAddress;
749 } Port;
750 struct {
751 ULONG Length;
752 ULONG Alignment;
753 PHYSICAL_ADDRESS MinimumAddress;
754 PHYSICAL_ADDRESS MaximumAddress;
755 } Memory;
756 struct {
757 ULONG MinimumVector;
758 ULONG MaximumVector;
759 } Interrupt;
760 struct {
761 ULONG MinimumChannel;
762 ULONG MaximumChannel;
763 } Dma;
764 struct {
765 ULONG Length;
766 ULONG Alignment;
767 PHYSICAL_ADDRESS MinimumAddress;
768 PHYSICAL_ADDRESS MaximumAddress;
769 } Generic;
770 struct {
771 ULONG Data[3];
772 } DevicePrivate;
773 struct {
774 ULONG Length;
775 ULONG MinBusNumber;
776 ULONG MaxBusNumber;
777 ULONG Reserved;
778 } BusNumber;
779 struct {
780 ULONG Priority;
781 ULONG Reserved1;
782 ULONG Reserved2;
783 } ConfigData;
784 } u;
785 } IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR;
787 typedef struct _IO_RESOURCE_LIST {
788 USHORT Version;
789 USHORT Revision;
790 ULONG Count;
791 IO_RESOURCE_DESCRIPTOR Descriptors[1];
792 } IO_RESOURCE_LIST, *PIO_RESOURCE_LIST;
794 typedef struct _IO_RESOURCE_REQUIREMENTS_LIST {
795 ULONG ListSize;
796 INTERFACE_TYPE InterfaceType;
797 ULONG BusNumber;
798 ULONG SlotNumber;
799 ULONG Reserved[3];
800 ULONG AlternativeLists;
801 IO_RESOURCE_LIST List[1];
802 } IO_RESOURCE_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST;
804 typedef enum _BUS_QUERY_ID_TYPE {
805 BusQueryDeviceID,
806 BusQueryHardwareIDs,
807 BusQueryCompatibleIDs,
808 BusQueryInstanceID,
809 BusQueryDeviceSerialNumber
810 } BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE;
812 typedef enum _CREATE_FILE_TYPE {
813 CreateFileTypeNone,
814 CreateFileTypeNamedPipe,
815 CreateFileTypeMailslot
816 } CREATE_FILE_TYPE;
818 typedef enum {
819 DevicePropertyDeviceDescription,
820 DevicePropertyHardwareID,
821 DevicePropertyCompatibleIDs,
822 DevicePropertyBootConfiguration,
823 DevicePropertyBootConfigurationTranslated,
824 DevicePropertyClassName,
825 DevicePropertyClassGuid,
826 DevicePropertyDriverKeyName,
827 DevicePropertyManufacturer,
828 DevicePropertyFriendlyName,
829 DevicePropertyLocationInformation,
830 DevicePropertyPhysicalDeviceObjectName,
831 DevicePropertyBusTypeGuid,
832 DevicePropertyLegacyBusType,
833 DevicePropertyBusNumber,
834 DevicePropertyEnumeratorName,
835 DevicePropertyAddress,
836 DevicePropertyUINumber,
837 DevicePropertyInstallState,
838 DevicePropertyRemovalPolicy
839 } DEVICE_REGISTRY_PROPERTY;
841 typedef enum _DEVICE_TEXT_TYPE {
842 DeviceTextDescription,
843 DeviceTextLocationInformation
844 } DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE;
846 typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE {
847 DeviceUsageTypeUndefined,
848 DeviceUsageTypePaging,
849 DeviceUsageTypeHibernation,
850 DeviceUsageTypeDumpFile
851 } DEVICE_USAGE_NOTIFICATION_TYPE;
853 typedef struct _POWER_SEQUENCE {
854 ULONG SequenceD1;
855 ULONG SequenceD2;
856 ULONG SequenceD3;
857 } POWER_SEQUENCE, *PPOWER_SEQUENCE;
859 typedef enum _POWER_STATE_TYPE {
860 SystemPowerState,
861 DevicePowerState
862 } POWER_STATE_TYPE, *PPOWER_STATE_TYPE;
864 typedef union _POWER_STATE {
865 SYSTEM_POWER_STATE SystemState;
866 DEVICE_POWER_STATE DeviceState;
867 } POWER_STATE, *PPOWER_STATE;
869 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
870 UCHAR Type;
871 UCHAR ShareDisposition;
872 USHORT Flags;
873 union {
874 struct {
875 PHYSICAL_ADDRESS Start;
876 ULONG Length;
877 } Generic;
878 struct {
879 PHYSICAL_ADDRESS Start;
880 ULONG Length;
881 } Port;
882 struct {
883 ULONG Level;
884 ULONG Vector;
885 ULONG Affinity;
886 } Interrupt;
887 struct {
888 PHYSICAL_ADDRESS Start;
889 ULONG Length;
890 } Memory;
891 struct {
892 ULONG Channel;
893 ULONG Port;
894 ULONG Reserved1;
895 } Dma;
896 struct {
897 ULONG Data[3];
898 } DevicePrivate;
899 struct {
900 ULONG Start;
901 ULONG Length;
902 ULONG Reserved;
903 } BusNumber;
904 struct {
905 ULONG DataSize;
906 ULONG Reserved1;
907 ULONG Reserved2;
908 } DeviceSpecificData;
909 } u;
910 } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
912 typedef struct _CM_PARTIAL_RESOURCE_LIST {
913 USHORT Version;
914 USHORT Revision;
915 ULONG Count;
916 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
917 } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
919 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR {
920 INTERFACE_TYPE InterfaceType;
921 ULONG BusNumber;
922 CM_PARTIAL_RESOURCE_LIST PartialResourceList;
923 } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
925 typedef struct _CM_RESOURCE_LIST {
926 ULONG Count;
927 CM_FULL_RESOURCE_DESCRIPTOR List[1];
928 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
930 typedef NTSTATUS (WINAPI *PIO_COMPLETION_ROUTINE)(
931 IN struct _DEVICE_OBJECT *DeviceObject,
932 IN struct _IRP *Irp,
933 IN PVOID Context);
935 #define SL_PENDING_RETURNED 0x01
936 #define SL_INVOKE_ON_CANCEL 0x20
937 #define SL_INVOKE_ON_SUCCESS 0x40
938 #define SL_INVOKE_ON_ERROR 0x80
940 #if !defined(_WIN64)
941 #include <pshpack4.h>
942 #endif
943 typedef struct _IO_STACK_LOCATION {
944 UCHAR MajorFunction;
945 UCHAR MinorFunction;
946 UCHAR Flags;
947 UCHAR Control;
948 union {
949 struct {
950 PIO_SECURITY_CONTEXT SecurityContext;
951 ULONG Options;
952 USHORT POINTER_ALIGNMENT FileAttributes;
953 USHORT ShareAccess;
954 ULONG POINTER_ALIGNMENT EaLength;
955 } Create;
956 struct {
957 ULONG Length;
958 ULONG POINTER_ALIGNMENT Key;
959 LARGE_INTEGER ByteOffset;
960 } Read;
961 struct {
962 ULONG Length;
963 ULONG POINTER_ALIGNMENT Key;
964 LARGE_INTEGER ByteOffset;
965 } Write;
966 struct {
967 ULONG Length;
968 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
969 } QueryFile;
970 struct {
971 ULONG Length;
972 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
973 PFILE_OBJECT FileObject;
974 union {
975 struct {
976 BOOLEAN ReplaceIfExists;
977 BOOLEAN AdvanceOnly;
978 } DUMMYSTRUCTNAME;
979 ULONG ClusterCount;
980 HANDLE DeleteHandle;
981 } DUMMYUNIONNAME;
982 } SetFile;
983 struct {
984 ULONG Length;
985 FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass;
986 } QueryVolume;
987 struct {
988 ULONG OutputBufferLength;
989 ULONG POINTER_ALIGNMENT InputBufferLength;
990 ULONG POINTER_ALIGNMENT IoControlCode;
991 PVOID Type3InputBuffer;
992 } DeviceIoControl;
993 struct {
994 SECURITY_INFORMATION SecurityInformation;
995 ULONG POINTER_ALIGNMENT Length;
996 } QuerySecurity;
997 struct {
998 SECURITY_INFORMATION SecurityInformation;
999 PSECURITY_DESCRIPTOR SecurityDescriptor;
1000 } SetSecurity;
1001 struct {
1002 PVPB Vpb;
1003 PDEVICE_OBJECT DeviceObject;
1004 } MountVolume;
1005 struct {
1006 PVPB Vpb;
1007 PDEVICE_OBJECT DeviceObject;
1008 } VerifyVolume;
1009 struct {
1010 struct _SCSI_REQUEST_BLOCK *Srb;
1011 } Scsi;
1012 struct {
1013 DEVICE_RELATION_TYPE Type;
1014 } QueryDeviceRelations;
1015 struct {
1016 const GUID *InterfaceType;
1017 USHORT Size;
1018 USHORT Version;
1019 PINTERFACE Interface;
1020 PVOID InterfaceSpecificData;
1021 } QueryInterface;
1022 struct {
1023 PDEVICE_CAPABILITIES Capabilities;
1024 } DeviceCapabilities;
1025 struct {
1026 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
1027 } FilterResourceRequirements;
1028 struct {
1029 ULONG WhichSpace;
1030 PVOID Buffer;
1031 ULONG Offset;
1032 ULONG POINTER_ALIGNMENT Length;
1033 } ReadWriteConfig;
1034 struct {
1035 BOOLEAN Lock;
1036 } SetLock;
1037 struct {
1038 BUS_QUERY_ID_TYPE IdType;
1039 } QueryId;
1040 struct {
1041 DEVICE_TEXT_TYPE DeviceTextType;
1042 LCID POINTER_ALIGNMENT LocaleId;
1043 } QueryDeviceText;
1044 struct {
1045 BOOLEAN InPath;
1046 BOOLEAN Reserved[3];
1047 DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type;
1048 } UsageNotification;
1049 struct {
1050 SYSTEM_POWER_STATE PowerState;
1051 } WaitWake;
1052 struct {
1053 PPOWER_SEQUENCE PowerSequence;
1054 } PowerSequence;
1055 struct {
1056 ULONG SystemContext;
1057 POWER_STATE_TYPE POINTER_ALIGNMENT Type;
1058 POWER_STATE POINTER_ALIGNMENT State;
1059 POWER_ACTION POINTER_ALIGNMENT ShutdownType;
1060 } Power;
1061 struct {
1062 PCM_RESOURCE_LIST AllocatedResources;
1063 PCM_RESOURCE_LIST AllocatedResourcesTranslated;
1064 } StartDevice;
1065 struct {
1066 ULONG_PTR ProviderId;
1067 PVOID DataPath;
1068 ULONG BufferSize;
1069 PVOID Buffer;
1070 } WMI;
1071 struct {
1072 PVOID Argument1;
1073 PVOID Argument2;
1074 PVOID Argument3;
1075 PVOID Argument4;
1076 } Others;
1077 } Parameters;
1078 PDEVICE_OBJECT DeviceObject;
1079 PFILE_OBJECT FileObject;
1080 PIO_COMPLETION_ROUTINE CompletionRoutine;
1081 PVOID Context;
1082 } IO_STACK_LOCATION, *PIO_STACK_LOCATION;
1083 #if !defined(_WIN64)
1084 #include <poppack.h>
1085 #endif
1087 /* MDL definitions */
1089 #define MDL_MAPPED_TO_SYSTEM_VA 0x0001
1090 #define MDL_PAGES_LOCKED 0x0002
1091 #define MDL_SOURCE_IS_NONPAGED_POOL 0x0004
1092 #define MDL_ALLOCATED_FIXED_SIZE 0x0008
1093 #define MDL_PARTIAL 0x0010
1094 #define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020
1095 #define MDL_IO_PAGE_READ 0x0040
1096 #define MDL_WRITE_OPERATION 0x0080
1097 #define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100
1098 #define MDL_FREE_EXTRA_PTES 0x0200
1099 #define MDL_DESCRIBES_AWE 0x0400
1100 #define MDL_IO_SPACE 0x0800
1101 #define MDL_NETWORK_HEADER 0x1000
1102 #define MDL_MAPPING_CAN_FAIL 0x2000
1103 #define MDL_ALLOCATED_MUST_SUCCEED 0x4000
1104 #define MDL_INTERNAL 0x8000
1106 #define MDL_MAPPING_FLAGS (MDL_MAPPED_TO_SYSTEM_VA | \
1107 MDL_PAGES_LOCKED | \
1108 MDL_SOURCE_IS_NONPAGED_POOL | \
1109 MDL_PARTIAL_HAS_BEEN_MAPPED | \
1110 MDL_PARENT_MAPPED_SYSTEM_VA | \
1111 MDL_SYSTEM_VA | \
1112 MDL_IO_SPACE )
1114 typedef struct _MDL {
1115 struct _MDL *Next;
1116 CSHORT Size;
1117 CSHORT MdlFlags;
1118 struct _EPROCESS *Process;
1119 PVOID MappedSystemVa;
1120 PVOID StartVa;
1121 ULONG ByteCount;
1122 ULONG ByteOffset;
1123 } MDL, *PMDL;
1125 typedef MDL *PMDLX;
1126 typedef ULONG PFN_NUMBER, *PPFN_NUMBER;
1128 static inline void MmInitializeMdl(MDL *mdl, void *va, SIZE_T length)
1130 mdl->Next = NULL;
1131 mdl->Size = sizeof(MDL) + sizeof(PFN_NUMBER) * ADDRESS_AND_SIZE_TO_SPAN_PAGES(va, length);
1132 mdl->MdlFlags = 0;
1133 mdl->StartVa = (void *)PAGE_ALIGN(va);
1134 mdl->ByteOffset = BYTE_OFFSET(va);
1135 mdl->ByteCount = length;
1138 typedef struct _KTIMER {
1139 DISPATCHER_HEADER Header;
1140 ULARGE_INTEGER DueTime;
1141 LIST_ENTRY TimerListEntry;
1142 struct _KDPC *Dpc;
1143 LONG Period;
1144 } KTIMER, *PKTIMER;
1146 typedef struct _KSYSTEM_TIME {
1147 ULONG LowPart;
1148 LONG High1Time;
1149 LONG High2Time;
1150 } KSYSTEM_TIME, *PKSYSTEM_TIME;
1152 typedef enum _NT_PRODUCT_TYPE {
1153 NtProductWinNt = 1,
1154 NtProductLanManNt,
1155 NtProductServer
1156 } NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
1158 #define PROCESSOR_FEATURE_MAX 64
1160 typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
1162 StandardDesign,
1163 NEC98x86,
1164 EndAlternatives
1165 } ALTERNATIVE_ARCHITECTURE_TYPE;
1167 #define NX_SUPPORT_POLICY_ALWAYSOFF 0
1168 #define NX_SUPPORT_POLICY_ALWAYSON 1
1169 #define NX_SUPPORT_POLICY_OPTIN 2
1170 #define NX_SUPPORT_POLICY_OPTOUT 3
1172 #define MAX_WOW64_SHARED_ENTRIES 16
1174 typedef struct _KUSER_SHARED_DATA {
1175 ULONG TickCountLowDeprecated;
1176 ULONG TickCountMultiplier;
1177 volatile KSYSTEM_TIME InterruptTime;
1178 volatile KSYSTEM_TIME SystemTime;
1179 volatile KSYSTEM_TIME TimeZoneBias;
1180 USHORT ImageNumberLow;
1181 USHORT ImageNumberHigh;
1182 WCHAR NtSystemRoot[260];
1183 ULONG MaxStackTraceDepth;
1184 ULONG CryptoExponent;
1185 ULONG TimeZoneId;
1186 ULONG LargePageMinimum;
1187 ULONG Reserved2[7];
1188 NT_PRODUCT_TYPE NtProductType;
1189 BOOLEAN ProductTypeIsValid;
1190 ULONG NtMajorVersion;
1191 ULONG NtMinorVersion;
1192 BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
1193 ULONG Reserved1;
1194 ULONG Reserved3;
1195 volatile ULONG TimeSlip;
1196 ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
1197 LARGE_INTEGER SystemExpirationDate;
1198 ULONG SuiteMask;
1199 BOOLEAN KdDebuggerEnabled;
1200 UCHAR NXSupportPolicy;
1201 volatile ULONG ActiveConsoleId;
1202 volatile ULONG DismountCount;
1203 ULONG ComPlusPackage;
1204 ULONG LastSystemRITEventTickCount;
1205 ULONG NumberOfPhysicalPages;
1206 BOOLEAN SafeBootMode;
1207 ULONG TraceLogging;
1208 ULONGLONG TestRetInstruction;
1209 ULONG SystemCall;
1210 ULONG SystemCallReturn;
1211 ULONGLONG SystemCallPad[3];
1212 union {
1213 volatile KSYSTEM_TIME TickCount;
1214 volatile ULONG64 TickCountQuad;
1215 } DUMMYUNIONNAME;
1216 ULONG Cookie;
1217 ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES];
1218 } KSHARED_USER_DATA, *PKSHARED_USER_DATA;
1220 typedef enum _MEMORY_CACHING_TYPE {
1221 MmNonCached = 0,
1222 MmCached = 1,
1223 MmWriteCombined = 2,
1224 MmHardwareCoherentCached = 3,
1225 MmNonCachedUnordered = 4,
1226 MmUSWCCached = 5,
1227 MmMaximumCacheType = 6
1228 } MEMORY_CACHING_TYPE;
1230 typedef enum _MM_PAGE_PRIORITY {
1231 LowPagePriority,
1232 NormalPagePriority = 16,
1233 HighPagePriority = 32
1234 } MM_PAGE_PRIORITY;
1236 typedef enum _MM_SYSTEM_SIZE
1238 MmSmallSystem,
1239 MmMediumSystem,
1240 MmLargeSystem
1241 } MM_SYSTEMSIZE;
1243 typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK {
1244 BOOLEAN Removed;
1245 BOOLEAN Reserved[3];
1246 LONG IoCount;
1247 KEVENT RemoveEvent;
1248 } IO_REMOVE_LOCK_COMMON_BLOCK;
1250 typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK *PIO_REMOVE_LOCK_TRACKING_BLOCK;
1252 typedef struct _IO_REMOVE_LOCK_DBG_BLOCK {
1253 LONG Signature;
1254 LONG HighWatermark;
1255 LONGLONG MaxLockedTicks;
1256 LONG AllocateTag;
1257 LIST_ENTRY LockList;
1258 KSPIN_LOCK Spin;
1259 LONG LowMemoryCount;
1260 ULONG Reserved1[4];
1261 PVOID Reserved2;
1262 PIO_REMOVE_LOCK_TRACKING_BLOCK Blocks;
1263 } IO_REMOVE_LOCK_DBG_BLOCK;
1265 typedef struct _IO_REMOVE_LOCK {
1266 IO_REMOVE_LOCK_COMMON_BLOCK Common;
1267 IO_REMOVE_LOCK_DBG_BLOCK Dbg;
1268 } IO_REMOVE_LOCK, *PIO_REMOVE_LOCK;
1270 typedef enum {
1271 IoReadAccess,
1272 IoWriteAccess,
1273 IoModifyAccess
1274 } LOCK_OPERATION;
1276 typedef struct _CALLBACK_OBJECT
1278 ULONG Signature;
1279 KSPIN_LOCK Lock;
1280 LIST_ENTRY RegisteredCallbacks;
1281 BOOLEAN AllowMultipleCallbacks;
1282 UCHAR reserved[3];
1283 } CALLBACK_OBJECT, *PCALLBACK_OBJECT;
1285 typedef struct _KSPIN_LOCK_QUEUE {
1286 struct _KSPIN_LOCK_QUEUE * volatile Next;
1287 volatile PKSPIN_LOCK Lock;
1288 } KSPIN_LOCK_QUEUE, *PKSPIN_LOCK_QUEUE;
1290 typedef struct _KLOCK_QUEUE_HANDLE {
1291 KSPIN_LOCK_QUEUE LockQueue;
1292 KIRQL OldIrql;
1293 } KLOCK_QUEUE_HANDLE, *PKLOCK_QUEUE_HANDLE;
1295 typedef void * (NTAPI *PALLOCATE_FUNCTION)(POOL_TYPE, SIZE_T, ULONG);
1296 typedef void * (NTAPI *PALLOCATE_FUNCTION_EX)(POOL_TYPE, SIZE_T, ULONG, PLOOKASIDE_LIST_EX);
1297 typedef void (NTAPI *PFREE_FUNCTION)(void *);
1298 typedef void (NTAPI *PFREE_FUNCTION_EX)(void *, PLOOKASIDE_LIST_EX);
1300 #ifdef _WIN64
1301 #define LOOKASIDE_ALIGN DECLSPEC_CACHEALIGN
1302 #else
1303 #define LOOKASIDE_ALIGN
1304 #endif
1306 #define LOOKASIDE_MINIMUM_BLOCK_SIZE (RTL_SIZEOF_THROUGH_FIELD(SLIST_ENTRY, Next))
1308 #define GENERAL_LOOKASIDE_LAYOUT \
1309 union \
1311 SLIST_HEADER ListHead; \
1312 SINGLE_LIST_ENTRY SingleListHead; \
1313 } DUMMYUNIONNAME; \
1314 USHORT Depth; \
1315 USHORT MaximumDepth; \
1316 ULONG TotalAllocates; \
1317 union \
1319 ULONG AllocateMisses; \
1320 ULONG AllocateHits; \
1321 } DUMMYUNIONNAME2; \
1322 ULONG TotalFrees; \
1323 union \
1325 ULONG FreeMisses; \
1326 ULONG FreeHits; \
1327 } DUMMYUNIONNAME3; \
1328 POOL_TYPE Type; \
1329 ULONG Tag; \
1330 ULONG Size; \
1331 union \
1333 PALLOCATE_FUNCTION_EX AllocateEx; \
1334 PALLOCATE_FUNCTION Allocate; \
1335 } DUMMYUNIONNAME4; \
1336 union \
1338 PFREE_FUNCTION_EX FreeEx; \
1339 PFREE_FUNCTION Free; \
1340 } DUMMYUNIONNAME5; \
1341 LIST_ENTRY ListEntry; \
1342 ULONG LastTotalAllocates; \
1343 union \
1345 ULONG LastAllocateMisses; \
1346 ULONG LastAllocateHits; \
1347 } DUMMYUNIONNAME6; \
1348 ULONG Future[2];
1350 typedef struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE
1352 GENERAL_LOOKASIDE_LAYOUT
1353 } GENERAL_LOOKASIDE;
1355 typedef struct _GENERAL_LOOKASIDE_POOL
1357 GENERAL_LOOKASIDE_LAYOUT
1358 } GENERAL_LOOKASIDE_POOL, *PGENERAL_LOOKASIDE_POOL;
1360 typedef struct _LOOKASIDE_LIST_EX
1362 GENERAL_LOOKASIDE_POOL L;
1363 } LOOKASIDE_LIST_EX;
1365 typedef struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST
1367 GENERAL_LOOKASIDE L;
1368 #if defined(__i386__)
1369 KSPIN_LOCK Lock__ObsoleteButDoNotDelete;
1370 #endif
1371 } NPAGED_LOOKASIDE_LIST, *PNPAGED_LOOKASIDE_LIST;
1373 typedef struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST
1375 GENERAL_LOOKASIDE L;
1376 #if defined(__i386__)
1377 FAST_MUTEX Lock__ObsoleteButDoNotDelete;
1378 #endif
1379 } PAGED_LOOKASIDE_LIST, *PPAGED_LOOKASIDE_LIST;
1381 typedef NTSTATUS (NTAPI EX_CALLBACK_FUNCTION)(void *CallbackContext, void *Argument1, void *Argument2);
1382 typedef EX_CALLBACK_FUNCTION *PEX_CALLBACK_FUNCTION;
1384 typedef ULONG OB_OPERATION;
1386 typedef struct _OB_PRE_CREATE_HANDLE_INFORMATION {
1387 ACCESS_MASK DesiredAccess;
1388 ACCESS_MASK OriginalDesiredAccess;
1389 } OB_PRE_CREATE_HANDLE_INFORMATION, *POB_PRE_CREATE_HANDLE_INFORMATION;
1391 typedef struct _OB_PRE_DUPLICATE_HANDLE_INFORMATION {
1392 ACCESS_MASK DesiredAccess;
1393 ACCESS_MASK OriginalDesiredAccess;
1394 PVOID SourceProcess;
1395 PVOID TargetProcess;
1396 } OB_PRE_DUPLICATE_HANDLE_INFORMATION, *POB_PRE_DUPLICATE_HANDLE_INFORMATION;
1398 typedef union _OB_PRE_OPERATION_PARAMETERS {
1399 OB_PRE_CREATE_HANDLE_INFORMATION CreateHandleInformation;
1400 OB_PRE_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation;
1401 } OB_PRE_OPERATION_PARAMETERS, *POB_PRE_OPERATION_PARAMETERS;
1403 typedef struct _OB_PRE_OPERATION_INFORMATION {
1404 OB_OPERATION Operation;
1405 union {
1406 ULONG Flags;
1407 struct {
1408 ULONG KernelHandle:1;
1409 ULONG Reserved:31;
1410 } DUMMYSTRUCTNAME;
1411 } DUMMYUNIONNAME;
1412 PVOID Object;
1413 POBJECT_TYPE ObjectType;
1414 PVOID CallContext;
1415 POB_PRE_OPERATION_PARAMETERS Parameters;
1416 } OB_PRE_OPERATION_INFORMATION, *POB_PRE_OPERATION_INFORMATION;
1418 typedef struct _OB_POST_CREATE_HANDLE_INFORMATION {
1419 ACCESS_MASK GrantedAccess;
1420 } OB_POST_CREATE_HANDLE_INFORMATION, *POB_POST_CREATE_HANDLE_INFORMATION;
1422 typedef struct _OB_POST_DUPLICATE_HANDLE_INFORMATION {
1423 ACCESS_MASK GrantedAccess;
1424 } OB_POST_DUPLICATE_HANDLE_INFORMATION, *POB_POST_DUPLICATE_HANDLE_INFORMATION;
1426 typedef union _OB_POST_OPERATION_PARAMETERS {
1427 OB_POST_CREATE_HANDLE_INFORMATION CreateHandleInformation;
1428 OB_POST_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation;
1429 } OB_POST_OPERATION_PARAMETERS, *POB_POST_OPERATION_PARAMETERS;
1431 typedef struct _OB_POST_OPERATION_INFORMATION {
1432 OB_OPERATION Operation;
1433 union {
1434 ULONG Flags;
1435 struct {
1436 ULONG KernelHandle:1;
1437 ULONG Reserved:31;
1438 } DUMMYSTRUCTNAME;
1439 } DUMMYUNIONNAME;
1440 PVOID Object;
1441 POBJECT_TYPE ObjectType;
1442 PVOID CallContext;
1443 NTSTATUS ReturnStatus;
1444 POB_POST_OPERATION_PARAMETERS Parameters;
1445 } OB_POST_OPERATION_INFORMATION,*POB_POST_OPERATION_INFORMATION;
1447 typedef enum _OB_PREOP_CALLBACK_STATUS {
1448 OB_PREOP_SUCCESS
1449 } OB_PREOP_CALLBACK_STATUS, *POB_PREOP_CALLBACK_STATUS;
1451 typedef OB_PREOP_CALLBACK_STATUS (WINAPI *POB_PRE_OPERATION_CALLBACK)(void *context, POB_PRE_OPERATION_INFORMATION information);
1452 typedef void (WINAPI *POB_POST_OPERATION_CALLBACK)(void *context, POB_POST_OPERATION_INFORMATION information);
1454 typedef struct _OB_OPERATION_REGISTRATION {
1455 POBJECT_TYPE *ObjectType;
1456 OB_OPERATION Operations;
1457 POB_PRE_OPERATION_CALLBACK PreOperation;
1458 POB_POST_OPERATION_CALLBACK PostOperation;
1459 } OB_OPERATION_REGISTRATION, *POB_OPERATION_REGISTRATION;
1461 typedef struct _OB_CALLBACK_REGISTRATION {
1462 USHORT Version;
1463 USHORT OperationRegistrationCount;
1464 UNICODE_STRING Altitude;
1465 PVOID RegistrationContext;
1466 OB_OPERATION_REGISTRATION *OperationRegistration;
1467 } OB_CALLBACK_REGISTRATION, *POB_CALLBACK_REGISTRATION;
1469 #define OB_FLT_REGISTRATION_VERSION_0100 0x0100
1470 #define OB_FLT_REGISTRATION_VERSION OB_FLT_REGISTRATION_VERSION_0100
1472 typedef enum _DIRECTORY_NOTIFY_INFORMATION_CLASS {
1473 DirectoryNotifyInformation = 1,
1474 DirectoryNotifyExtendedInformation
1475 } DIRECTORY_NOTIFY_INFORMATION_CLASS, *PDIRECTORY_NOTIFY_INFORMATION_CLASS;
1477 typedef enum _WORK_QUEUE_TYPE {
1478 CriticalWorkQueue,
1479 DelayedWorkQueue,
1480 HyperCriticalWorkQueue,
1481 MaximumWorkQueue
1482 } WORK_QUEUE_TYPE;
1484 typedef void (WINAPI *PIO_WORKITEM_ROUTINE)(PDEVICE_OBJECT,void*);
1486 NTSTATUS WINAPI ObCloseHandle(IN HANDLE handle);
1488 #ifdef NONAMELESSUNION
1489 # ifdef NONAMELESSSTRUCT
1490 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.u2.CurrentStackLocation)
1491 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.u2.CurrentStackLocation - 1)
1492 static inline void IoSkipCurrentIrpStackLocation(IRP *irp) {irp->Tail.Overlay.s.u2.CurrentStackLocation++; irp->CurrentLocation++;}
1493 # else
1494 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.u2.CurrentStackLocation)
1495 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.u2.CurrentStackLocation - 1)
1496 static inline void IoSkipCurrentIrpStackLocation(IRP *irp) {irp->Tail.Overlay.u2.CurrentStackLocation++; irp->CurrentLocation++;}
1497 # endif
1498 #else
1499 # ifdef NONAMELESSSTRUCT
1500 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.CurrentStackLocation)
1501 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.CurrentStackLocation - 1)
1502 static inline void IoSkipCurrentIrpStackLocation(IRP *irp) {irp->Tail.Overlay.s.CurrentStackLocation++; irp->CurrentLocation++;}
1503 # else
1504 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.CurrentStackLocation)
1505 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.CurrentStackLocation - 1)
1506 static inline void IoSkipCurrentIrpStackLocation(IRP *irp) {irp->Tail.Overlay.CurrentStackLocation++; irp->CurrentLocation++;}
1507 # endif
1508 #endif
1510 #define IoSetCancelRoutine(irp, routine) \
1511 ((PDRIVER_CANCEL)InterlockedExchangePointer((void **)&(irp)->CancelRoutine, routine))
1513 static inline void IoSetCompletionRoutine(IRP *irp, PIO_COMPLETION_ROUTINE routine, void *context,
1514 BOOLEAN on_success, BOOLEAN on_error, BOOLEAN on_cancel)
1516 IO_STACK_LOCATION *irpsp = IoGetNextIrpStackLocation(irp);
1517 irpsp->CompletionRoutine = routine;
1518 irpsp->Context = context;
1519 irpsp->Control = 0;
1520 if (on_success) irpsp->Control |= SL_INVOKE_ON_SUCCESS;
1521 if (on_error) irpsp->Control |= SL_INVOKE_ON_ERROR;
1522 if (on_cancel) irpsp->Control |= SL_INVOKE_ON_CANCEL;
1525 static inline void IoMarkIrpPending(IRP *irp)
1527 IoGetCurrentIrpStackLocation(irp)->Control |= SL_PENDING_RETURNED;
1530 #define KernelMode 0
1531 #define UserMode 1
1533 /* directory object access rights */
1534 #define DIRECTORY_QUERY 0x0001
1535 #define DIRECTORY_TRAVERSE 0x0002
1536 #define DIRECTORY_CREATE_OBJECT 0x0004
1537 #define DIRECTORY_CREATE_SUBDIRECTORY 0x0008
1538 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
1540 /* symbolic link access rights */
1541 #define SYMBOLIC_LINK_QUERY 0x0001
1542 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
1544 NTSTATUS WINAPI DbgQueryDebugFilterState(ULONG, ULONG);
1545 void FASTCALL ExAcquireFastMutexUnsafe(PFAST_MUTEX);
1546 BOOLEAN WINAPI ExAcquireResourceExclusiveLite(ERESOURCE*,BOOLEAN);
1547 BOOLEAN WINAPI ExAcquireResourceSharedLite(ERESOURCE*,BOOLEAN);
1548 BOOLEAN WINAPI ExAcquireSharedStarveExclusive(ERESOURCE*,BOOLEAN);
1549 BOOLEAN WINAPI ExAcquireSharedWaitForExclusive(ERESOURCE*,BOOLEAN);
1550 PVOID WINAPI ExAllocatePool(POOL_TYPE,SIZE_T);
1551 PVOID WINAPI ExAllocatePoolWithQuota(POOL_TYPE,SIZE_T);
1552 PVOID WINAPI ExAllocatePoolWithTag(POOL_TYPE,SIZE_T,ULONG);
1553 PVOID WINAPI ExAllocatePoolWithQuotaTag(POOL_TYPE,SIZE_T,ULONG);
1554 void WINAPI ExDeleteNPagedLookasideList(PNPAGED_LOOKASIDE_LIST);
1555 void WINAPI ExDeletePagedLookasideList(PPAGED_LOOKASIDE_LIST);
1556 NTSTATUS WINAPI ExDeleteResourceLite(ERESOURCE*);
1557 void WINAPI ExFreePool(PVOID);
1558 void WINAPI ExFreePoolWithTag(PVOID,ULONG);
1559 ULONG WINAPI ExGetExclusiveWaiterCount(ERESOURCE*);
1560 ULONG WINAPI ExGetSharedWaiterCount(ERESOURCE*);
1561 void WINAPI ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST,PALLOCATE_FUNCTION,PFREE_FUNCTION,ULONG,SIZE_T,ULONG,USHORT);
1562 void WINAPI ExInitializePagedLookasideList(PPAGED_LOOKASIDE_LIST,PALLOCATE_FUNCTION,PFREE_FUNCTION,ULONG,SIZE_T,ULONG,USHORT);
1563 NTSTATUS WINAPI ExInitializeResourceLite(ERESOURCE*);
1564 PSLIST_ENTRY WINAPI ExInterlockedFlushSList(PSLIST_HEADER);
1565 PSLIST_ENTRY WINAPI ExInterlockedPopEntrySList(PSLIST_HEADER,PKSPIN_LOCK);
1566 PSLIST_ENTRY WINAPI ExInterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY,PKSPIN_LOCK);
1567 LIST_ENTRY * WINAPI ExInterlockedRemoveHeadList(LIST_ENTRY*,KSPIN_LOCK*);
1568 BOOLEAN WINAPI ExIsResourceAcquiredExclusiveLite(ERESOURCE*);
1569 ULONG WINAPI ExIsResourceAcquiredSharedLite(ERESOURCE*);
1570 void FASTCALL ExReleaseFastMutexUnsafe(PFAST_MUTEX);
1571 void WINAPI ExReleaseResourceForThreadLite(ERESOURCE*,ERESOURCE_THREAD);
1572 ULONG WINAPI ExSetTimerResolution(ULONG,BOOLEAN);
1574 void WINAPI IoAcquireCancelSpinLock(KIRQL*);
1575 NTSTATUS WINAPI IoAcquireRemoveLockEx(IO_REMOVE_LOCK*,void*,const char*,ULONG, ULONG);
1576 NTSTATUS WINAPI IoAllocateDriverObjectExtension(PDRIVER_OBJECT,PVOID,ULONG,PVOID*);
1577 PVOID WINAPI IoAllocateErrorLogEntry(PVOID,UCHAR);
1578 PIRP WINAPI IoAllocateIrp(CCHAR,BOOLEAN);
1579 PMDL WINAPI IoAllocateMdl(PVOID,ULONG,BOOLEAN,BOOLEAN,IRP*);
1580 PIO_WORKITEM WINAPI IoAllocateWorkItem(PDEVICE_OBJECT);
1581 void WINAPI IoDetachDevice(PDEVICE_OBJECT);
1582 PDEVICE_OBJECT WINAPI IoAttachDeviceToDeviceStack(PDEVICE_OBJECT,PDEVICE_OBJECT);
1583 PIRP WINAPI IoBuildAsynchronousFsdRequest(ULONG,DEVICE_OBJECT*,void*,ULONG,LARGE_INTEGER*,IO_STATUS_BLOCK*);
1584 PIRP WINAPI IoBuildDeviceIoControlRequest(ULONG,DEVICE_OBJECT*,PVOID,ULONG,PVOID,ULONG,BOOLEAN,PKEVENT,IO_STATUS_BLOCK*);
1585 PIRP WINAPI IoBuildSynchronousFsdRequest(ULONG,DEVICE_OBJECT*,PVOID,ULONG,PLARGE_INTEGER,PKEVENT,IO_STATUS_BLOCK*);
1586 NTSTATUS WINAPI IoCallDriver(DEVICE_OBJECT*,IRP*);
1587 BOOLEAN WINAPI IoCancelIrp(IRP*);
1588 VOID WINAPI IoCompleteRequest(IRP*,UCHAR);
1589 NTSTATUS WINAPI IoCreateDevice(DRIVER_OBJECT*,ULONG,UNICODE_STRING*,DEVICE_TYPE,ULONG,BOOLEAN,DEVICE_OBJECT**);
1590 NTSTATUS WINAPI IoCreateDriver(UNICODE_STRING*,PDRIVER_INITIALIZE);
1591 NTSTATUS WINAPI IoCreateSymbolicLink(UNICODE_STRING*,UNICODE_STRING*);
1592 PKEVENT WINAPI IoCreateSynchronizationEvent(UNICODE_STRING*,HANDLE*);
1593 void WINAPI IoDeleteDevice(DEVICE_OBJECT*);
1594 void WINAPI IoDeleteDriver(DRIVER_OBJECT*);
1595 NTSTATUS WINAPI IoDeleteSymbolicLink(UNICODE_STRING*);
1596 void WINAPI IoFreeIrp(IRP*);
1597 void WINAPI IoFreeMdl(MDL*);
1598 void WINAPI IoFreeWorkItem(PIO_WORKITEM);
1599 DEVICE_OBJECT * WINAPI IoGetAttachedDeviceReference(DEVICE_OBJECT*);
1600 PEPROCESS WINAPI IoGetCurrentProcess(void);
1601 NTSTATUS WINAPI IoGetDeviceInterfaces(const GUID*,PDEVICE_OBJECT,ULONG,PWSTR*);
1602 NTSTATUS WINAPI IoGetDeviceObjectPointer(UNICODE_STRING*,ACCESS_MASK,PFILE_OBJECT*,PDEVICE_OBJECT*);
1603 NTSTATUS WINAPI IoGetDeviceProperty(PDEVICE_OBJECT,DEVICE_REGISTRY_PROPERTY,ULONG,PVOID,PULONG);
1604 PVOID WINAPI IoGetDriverObjectExtension(PDRIVER_OBJECT,PVOID);
1605 PDEVICE_OBJECT WINAPI IoGetRelatedDeviceObject(PFILE_OBJECT);
1606 void WINAPI IoGetStackLimits(ULONG_PTR*,ULONG_PTR*);
1607 void WINAPI IoInitializeIrp(IRP*,USHORT,CCHAR);
1608 VOID WINAPI IoInitializeRemoveLockEx(PIO_REMOVE_LOCK,ULONG,ULONG,ULONG,ULONG);
1609 void WINAPI IoInvalidateDeviceRelations(PDEVICE_OBJECT,DEVICE_RELATION_TYPE);
1610 NTSTATUS WINAPI IoOpenDeviceRegistryKey(DEVICE_OBJECT*,ULONG,ACCESS_MASK,HANDLE*);
1611 void WINAPI IoQueueWorkItem(PIO_WORKITEM,PIO_WORKITEM_ROUTINE,WORK_QUEUE_TYPE,void*);
1612 NTSTATUS WINAPI IoRegisterDeviceInterface(PDEVICE_OBJECT,const GUID*,PUNICODE_STRING,PUNICODE_STRING);
1613 void WINAPI IoReleaseCancelSpinLock(KIRQL);
1614 void WINAPI IoReleaseRemoveLockAndWaitEx(IO_REMOVE_LOCK*,void*,ULONG);
1615 void WINAPI IoReleaseRemoveLockEx(IO_REMOVE_LOCK*,void*,ULONG);
1616 NTSTATUS WINAPI IoSetDeviceInterfaceState(UNICODE_STRING*,BOOLEAN);
1617 NTSTATUS WINAPI IoWMIRegistrationControl(PDEVICE_OBJECT,ULONG);
1619 void FASTCALL KeAcquireInStackQueuedSpinLockAtDpcLevel(KSPIN_LOCK*,KLOCK_QUEUE_HANDLE*);
1620 #ifdef __i386__
1621 void WINAPI KeAcquireSpinLock(KSPIN_LOCK*,KIRQL*);
1622 #else
1623 #define KeAcquireSpinLock( lock, irql ) *(irql) = KeAcquireSpinLockRaiseToDpc( lock )
1624 KIRQL WINAPI KeAcquireSpinLockRaiseToDpc(KSPIN_LOCK*);
1625 #endif
1626 void WINAPI KeAcquireSpinLockAtDpcLevel(KSPIN_LOCK*);
1627 void WINAPI DECLSPEC_NORETURN KeBugCheckEx(ULONG,ULONG_PTR,ULONG_PTR,ULONG_PTR,ULONG_PTR);
1628 BOOLEAN WINAPI KeCancelTimer(KTIMER*);
1629 void WINAPI KeClearEvent(PRKEVENT);
1630 NTSTATUS WINAPI KeDelayExecutionThread(KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*);
1631 void WINAPI KeEnterCriticalRegion(void);
1632 PKTHREAD WINAPI KeGetCurrentThread(void);
1633 void WINAPI KeInitializeEvent(PRKEVENT,EVENT_TYPE,BOOLEAN);
1634 void WINAPI KeInitializeMutex(PRKMUTEX,ULONG);
1635 void WINAPI KeInitializeSemaphore(PRKSEMAPHORE,LONG,LONG);
1636 void WINAPI KeInitializeSpinLock(KSPIN_LOCK*);
1637 void WINAPI KeInitializeTimerEx(PKTIMER,TIMER_TYPE);
1638 void WINAPI KeInitializeTimer(KTIMER*);
1639 void WINAPI KeLeaveCriticalRegion(void);
1640 void WINAPI KeQuerySystemTime(LARGE_INTEGER*);
1641 void WINAPI KeQueryTickCount(LARGE_INTEGER*);
1642 ULONG WINAPI KeQueryTimeIncrement(void);
1643 void FASTCALL KeReleaseInStackQueuedSpinLockFromDpcLevel(KLOCK_QUEUE_HANDLE*);
1644 LONG WINAPI KeReleaseMutex(PRKMUTEX,BOOLEAN);
1645 LONG WINAPI KeReleaseSemaphore(PRKSEMAPHORE,KPRIORITY,LONG,BOOLEAN);
1646 void WINAPI KeReleaseSpinLock(KSPIN_LOCK*,KIRQL);
1647 void WINAPI KeReleaseSpinLockFromDpcLevel(KSPIN_LOCK*);
1648 LONG WINAPI KeResetEvent(PRKEVENT);
1649 void WINAPI KeRevertToUserAffinityThread(void);
1650 LONG WINAPI KeSetEvent(PRKEVENT,KPRIORITY,BOOLEAN);
1651 KPRIORITY WINAPI KeSetPriorityThread(PKTHREAD,KPRIORITY);
1652 void WINAPI KeSetSystemAffinityThread(KAFFINITY);
1653 BOOLEAN WINAPI KeSetTimerEx(KTIMER*,LARGE_INTEGER,LONG,KDPC*);
1654 NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG,void*[],WAIT_TYPE,KWAIT_REASON,KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*,KWAIT_BLOCK*);
1655 NTSTATUS WINAPI KeWaitForSingleObject(void*,KWAIT_REASON,KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*);
1657 PVOID WINAPI MmAllocateContiguousMemory(SIZE_T,PHYSICAL_ADDRESS);
1658 PVOID WINAPI MmAllocateNonCachedMemory(SIZE_T);
1659 PMDL WINAPI MmAllocatePagesForMdl(PHYSICAL_ADDRESS,PHYSICAL_ADDRESS,PHYSICAL_ADDRESS,SIZE_T);
1660 void WINAPI MmBuildMdlForNonPagedPool(MDL*);
1661 void WINAPI MmFreeNonCachedMemory(PVOID,SIZE_T);
1662 void * WINAPI MmGetSystemRoutineAddress(UNICODE_STRING*);
1663 PVOID WINAPI MmMapLockedPagesSpecifyCache(PMDL,KPROCESSOR_MODE,MEMORY_CACHING_TYPE,PVOID,ULONG,ULONG);
1664 MM_SYSTEMSIZE WINAPI MmQuerySystemSize(void);
1665 void WINAPI MmProbeAndLockPages(PMDLX, KPROCESSOR_MODE, LOCK_OPERATION);
1666 void WINAPI MmUnmapLockedPages(void*, PMDL);
1668 static inline void *MmGetSystemAddressForMdlSafe(MDL *mdl, ULONG priority)
1670 if (mdl->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA | MDL_SOURCE_IS_NONPAGED_POOL))
1671 return mdl->MappedSystemVa;
1672 else
1673 return MmMapLockedPagesSpecifyCache(mdl, KernelMode, MmCached, NULL, FALSE, priority);
1676 void FASTCALL ObfReferenceObject(void*);
1677 void WINAPI ObDereferenceObject(void*);
1678 USHORT WINAPI ObGetFilterVersion(void);
1679 NTSTATUS WINAPI ObRegisterCallbacks(POB_CALLBACK_REGISTRATION*, void**);
1680 NTSTATUS WINAPI ObReferenceObjectByHandle(HANDLE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,PVOID*,POBJECT_HANDLE_INFORMATION);
1681 NTSTATUS WINAPI ObReferenceObjectByName(UNICODE_STRING*,ULONG,ACCESS_STATE*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,void*,void**);
1682 NTSTATUS WINAPI ObReferenceObjectByPointer(void*,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE);
1683 void WINAPI ObUnRegisterCallbacks(void*);
1685 NTSTATUS WINAPI PoCallDriver(DEVICE_OBJECT*,IRP*);
1686 POWER_STATE WINAPI PoSetPowerState(PDEVICE_OBJECT,POWER_STATE_TYPE,POWER_STATE);
1687 void WINAPI PoStartNextPowerIrp(IRP*);
1689 NTSTATUS WINAPI PsCreateSystemThread(PHANDLE,ULONG,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PKSTART_ROUTINE,PVOID);
1690 #define PsGetCurrentProcess() IoGetCurrentProcess()
1691 #define PsGetCurrentThread() ((PETHREAD)KeGetCurrentThread())
1692 HANDLE WINAPI PsGetCurrentProcessId(void);
1693 HANDLE WINAPI PsGetCurrentThreadId(void);
1694 HANDLE WINAPI PsGetProcessInheritedFromUniqueProcessId(PEPROCESS);
1695 BOOLEAN WINAPI PsGetVersion(ULONG*,ULONG*,ULONG*,UNICODE_STRING*);
1696 NTSTATUS WINAPI PsTerminateSystemThread(NTSTATUS);
1698 BOOLEAN WINAPI RtlIsNtDdiVersionAvailable(ULONG);
1700 NTSTATUS WINAPI ZwAddBootEntry(PUNICODE_STRING,PUNICODE_STRING);
1701 NTSTATUS WINAPI ZwAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN);
1702 NTSTATUS WINAPI ZwAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1703 NTSTATUS WINAPI ZwAlertThread(HANDLE ThreadHandle);
1704 NTSTATUS WINAPI ZwAllocateVirtualMemory(HANDLE,PVOID*,ULONG,SIZE_T*,ULONG,ULONG);
1705 NTSTATUS WINAPI ZwCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
1706 NTSTATUS WINAPI ZwCancelTimer(HANDLE, BOOLEAN*);
1707 NTSTATUS WINAPI ZwClearEvent(HANDLE);
1708 NTSTATUS WINAPI ZwClose(HANDLE);
1709 NTSTATUS WINAPI ZwCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
1710 NTSTATUS WINAPI ZwConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
1711 NTSTATUS WINAPI ZwCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1712 NTSTATUS WINAPI ZwCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1713 NTSTATUS WINAPI ZwCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
1714 NTSTATUS WINAPI ZwCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1715 NTSTATUS WINAPI ZwCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
1716 NTSTATUS WINAPI ZwCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
1717 NTSTATUS WINAPI ZwCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
1718 NTSTATUS WINAPI ZwDeleteAtom(RTL_ATOM);
1719 NTSTATUS WINAPI ZwDeleteFile(POBJECT_ATTRIBUTES);
1720 NTSTATUS WINAPI ZwDeleteKey(HANDLE);
1721 NTSTATUS WINAPI ZwDeleteValueKey(HANDLE,const UNICODE_STRING *);
1722 NTSTATUS WINAPI ZwDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1723 NTSTATUS WINAPI ZwDisplayString(PUNICODE_STRING);
1724 NTSTATUS WINAPI ZwDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
1725 NTSTATUS WINAPI ZwDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
1726 NTSTATUS WINAPI ZwEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1727 NTSTATUS WINAPI ZwEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1728 NTSTATUS WINAPI ZwFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
1729 NTSTATUS WINAPI ZwFlushKey(HANDLE);
1730 NTSTATUS WINAPI ZwFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
1731 NTSTATUS WINAPI ZwFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1732 NTSTATUS WINAPI ZwFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1733 NTSTATUS WINAPI ZwInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
1734 NTSTATUS WINAPI ZwLoadDriver(const UNICODE_STRING *);
1735 NTSTATUS WINAPI ZwLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
1736 NTSTATUS WINAPI ZwLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1737 NTSTATUS WINAPI ZwMakeTemporaryObject(HANDLE);
1738 NTSTATUS WINAPI ZwMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
1739 NTSTATUS WINAPI ZwNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
1740 NTSTATUS WINAPI ZwOpenDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1741 NTSTATUS WINAPI ZwOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1742 NTSTATUS WINAPI ZwOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
1743 NTSTATUS WINAPI ZwOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1744 NTSTATUS WINAPI ZwOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1745 NTSTATUS WINAPI ZwOpenProcessToken(HANDLE,DWORD,HANDLE *);
1746 NTSTATUS WINAPI ZwOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1747 NTSTATUS WINAPI ZwOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1748 NTSTATUS WINAPI ZwOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1749 NTSTATUS WINAPI ZwOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
1750 NTSTATUS WINAPI ZwOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
1751 NTSTATUS WINAPI ZwPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
1752 NTSTATUS WINAPI ZwPulseEvent(HANDLE,PULONG);
1753 NTSTATUS WINAPI ZwQueryDefaultLocale(BOOLEAN,LCID*);
1754 NTSTATUS WINAPI ZwQueryDefaultUILanguage(LANGID*);
1755 NTSTATUS WINAPI ZwQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
1756 NTSTATUS WINAPI ZwQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
1757 NTSTATUS WINAPI ZwQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN);
1758 NTSTATUS WINAPI ZwQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
1759 NTSTATUS WINAPI ZwQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
1760 NTSTATUS WINAPI ZwQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1761 NTSTATUS WINAPI ZwQueryInformationToken(HANDLE,DWORD,PVOID,DWORD,LPDWORD);
1762 NTSTATUS WINAPI ZwQueryInstallUILanguage(LANGID*);
1763 NTSTATUS WINAPI ZwQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1764 NTSTATUS WINAPI ZwQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
1765 NTSTATUS WINAPI ZwQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1766 NTSTATUS WINAPI ZwQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1767 NTSTATUS WINAPI ZwQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
1768 NTSTATUS WINAPI ZwQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1769 NTSTATUS WINAPI ZwQueryTimerResolution(PULONG,PULONG,PULONG);
1770 NTSTATUS WINAPI ZwQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
1771 NTSTATUS WINAPI ZwQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1772 NTSTATUS WINAPI ZwReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
1773 NTSTATUS WINAPI ZwReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
1774 NTSTATUS WINAPI ZwRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
1775 NTSTATUS WINAPI ZwResetEvent(HANDLE,PULONG);
1776 NTSTATUS WINAPI ZwRestoreKey(HANDLE,HANDLE,ULONG);
1777 NTSTATUS WINAPI ZwSaveKey(HANDLE,HANDLE);
1778 NTSTATUS WINAPI ZwSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
1779 NTSTATUS WINAPI ZwSetDefaultLocale(BOOLEAN,LCID);
1780 NTSTATUS WINAPI ZwSetDefaultUILanguage(LANGID);
1781 NTSTATUS WINAPI ZwSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
1782 NTSTATUS WINAPI ZwSetEvent(HANDLE,PULONG);
1783 NTSTATUS WINAPI ZwSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
1784 NTSTATUS WINAPI ZwSetInformationKey(HANDLE,const int,PVOID,ULONG);
1785 NTSTATUS WINAPI ZwSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
1786 NTSTATUS WINAPI ZwSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
1787 NTSTATUS WINAPI ZwSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
1788 NTSTATUS WINAPI ZwSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG);
1789 NTSTATUS WINAPI ZwSetLdtEntries(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
1790 NTSTATUS WINAPI ZwSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1791 NTSTATUS WINAPI ZwSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
1792 NTSTATUS WINAPI ZwSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
1793 NTSTATUS WINAPI ZwSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
1794 NTSTATUS WINAPI ZwSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
1795 NTSTATUS WINAPI ZwSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1796 NTSTATUS WINAPI ZwSuspendThread(HANDLE,PULONG);
1797 NTSTATUS WINAPI ZwTerminateProcess(HANDLE,LONG);
1798 NTSTATUS WINAPI ZwUnloadDriver(const UNICODE_STRING *);
1799 NTSTATUS WINAPI ZwUnloadKey(HANDLE);
1800 NTSTATUS WINAPI ZwUnmapViewOfSection(HANDLE,PVOID);
1801 NTSTATUS WINAPI ZwWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1802 NTSTATUS WINAPI ZwWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
1803 NTSTATUS WINAPI ZwWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
1804 NTSTATUS WINAPI ZwYieldExecution(void);
1806 static inline void ExInitializeFastMutex( FAST_MUTEX *mutex )
1808 mutex->Count = FM_LOCK_BIT;
1809 mutex->Owner = NULL;
1810 mutex->Contention = 0;
1811 KeInitializeEvent( &mutex->Event, SynchronizationEvent, FALSE );
1814 #endif