push 38a8c0aff9170390b5a3ded41e7cf5b02f3a73d8
[wine/hacks.git] / include / ddk / wdm.h
blob3bc7238c04a9d1c4bd164187615cceb935232dff
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 typedef LONG KPRIORITY;
33 typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
35 struct _KDPC;
36 struct _KAPC;
37 struct _IRP;
38 struct _DEVICE_OBJECT;
39 struct _DRIVER_OBJECT;
41 typedef VOID (WINAPI *PKDEFERRED_ROUTINE)(struct _KDPC *, PVOID, PVOID, PVOID);
42 typedef VOID (WINAPI *PKSTART_ROUTINE)(PVOID);
44 typedef NTSTATUS (WINAPI *PDRIVER_INITIALIZE)(struct _DRIVER_OBJECT *, PUNICODE_STRING);
45 typedef NTSTATUS (WINAPI *PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *, struct _IRP *);
46 typedef void (WINAPI *PDRIVER_STARTIO)(struct _DEVICE_OBJECT *, struct _IRP *);
47 typedef void (WINAPI *PDRIVER_UNLOAD)(struct _DRIVER_OBJECT *);
49 typedef struct _DISPATCHER_HEADER {
50 UCHAR Type;
51 UCHAR Absolute;
52 UCHAR Size;
53 UCHAR Inserted;
54 LONG SignalState;
55 LIST_ENTRY WaitListHead;
56 } DISPATCHER_HEADER, *PDISPATCHER_HEADER;
58 typedef struct _KEVENT {
59 DISPATCHER_HEADER Header;
60 } KEVENT, *PKEVENT, *RESTRICTED_POINTER PRKEVENT;
62 typedef struct _KDPC {
63 CSHORT Type;
64 UCHAR Number;
65 UCHAR Importance;
66 LIST_ENTRY DpcListEntry;
67 PKDEFERRED_ROUTINE DeferredRoutine;
68 PVOID DeferredContext;
69 PVOID SystemArgument1;
70 PVOID SystemArgument2;
71 PULONG_PTR Lock;
72 } KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC;
74 typedef struct _KDEVICE_QUEUE_ENTRY {
75 LIST_ENTRY DeviceListEntry;
76 ULONG SortKey;
77 BOOLEAN Inserted;
78 } KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY,
79 *RESTRICTED_POINTER PRKDEVICE_QUEUE_ENTRY;
81 typedef struct _KDEVICE_QUEUE {
82 CSHORT Type;
83 CSHORT Size;
84 LIST_ENTRY DeviceListHead;
85 KSPIN_LOCK Lock;
86 BOOLEAN Busy;
87 } KDEVICE_QUEUE, *PKDEVICE_QUEUE, *RESTRICTED_POINTER PRKDEVICE_QUEUE;
89 typedef struct _KMUTANT {
90 DISPATCHER_HEADER Header;
91 LIST_ENTRY MutantListEntry;
92 struct _KTHREAD *RESTRICTED_POINTER OwnerThread;
93 BOOLEAN Abandoned;
94 UCHAR ApcDisable;
95 } KMUTANT, *PKMUTANT, *RESTRICTED_POINTER PRKMUTANT, KMUTEX, *PKMUTEX, *RESTRICTED_POINTER PRKMUTEX;
97 typedef enum _KWAIT_REASON
99 Executive,
100 FreePage,
101 PageIn,
102 PoolAllocation,
103 DelayExecution,
104 Suspended,
105 UserRequest,
106 WrExecutive,
107 WrFreePage,
108 WrPageIn,
109 WrDelayExecution,
110 WrSuspended,
111 WrUserRequest,
112 WrQueue,
113 WrLpcReceive,
114 WrLpcReply,
115 WrVirtualMemory,
116 WrPageOut,
117 WrRendezvous,
118 Spare2,
119 Spare3,
120 Spare4,
121 Spare5,
122 Spare6,
123 WrKernel,
124 MaximumWaitReason,
125 } KWAIT_REASON;
127 typedef struct _ALLOCATE_FUNCTION *PALLOCATE_FUNCTION;
128 typedef struct _IO_TIMER *PIO_TIMER;
129 typedef struct _IO_TIMER_ROUTINE *PIO_TIMER_ROUTINE;
130 typedef struct _ETHREAD *PETHREAD;
131 typedef struct _FREE_FUNCTION *PFREE_FUNCTION;
132 typedef struct _KTHREAD *PKTHREAD;
133 typedef struct _EPROCESS *PEPROCESS;
134 typedef struct _ERESOURCE *PERESOURCE;
135 typedef struct _IO_WORKITEM *PIO_WORKITEM;
136 typedef struct _NPAGED_LOOKASIDE_LIST *PNPAGED_LOOKASIDE_LIST;
137 typedef struct _OBJECT_TYPE *POBJECT_TYPE;
138 typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION;
139 typedef struct _ZONE_HEADER *PZONE_HEADER;
141 typedef struct _FAST_MUTEX
143 LONG Count;
144 PKTHREAD Owner;
145 ULONG Contention;
146 KEVENT Gate;
147 ULONG OldIrql;
148 } FAST_MUTEX, *PFAST_MUTEX;
150 #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR))
152 typedef struct _VPB {
153 CSHORT Type;
154 CSHORT Size;
155 USHORT Flags;
156 USHORT VolumeLabelLength;
157 struct _DEVICE_OBJECT *DeviceObject;
158 struct _DEVICE_OBJECT *RealDevice;
159 ULONG SerialNumber;
160 ULONG ReferenceCount;
161 WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)];
162 } VPB, *PVPB;
164 typedef enum _POOL_TYPE {
165 NonPagedPool,
166 PagedPool,
167 NonPagedPoolMustSucceed,
168 UnkownType,
169 NonPagedPoolCacheAligned,
170 PagedPoolCacheAligned,
171 NonPagedPoolCacheAlignedMustS,
172 MaxPoolType
173 } POOL_TYPE;
175 typedef struct _WAIT_CONTEXT_BLOCK {
176 KDEVICE_QUEUE_ENTRY WaitQueueEntry;
177 struct _DRIVER_CONTROL *DeviceRoutine;
178 PVOID DeviceContext;
179 ULONG NumberOfMapRegisters;
180 PVOID DeviceObject;
181 PVOID CurrentIrp;
182 PKDPC BufferChainingDpc;
183 } WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK;
185 #define DO_BUFFERED_IO 0x00000004
186 #define DO_EXCLUSIVE 0x00000008
187 #define DO_DIRECT_IO 0x00000010
188 #define DO_MAP_IO_BUFFER 0x00000020
189 #define DO_DEVICE_INITIALIZING 0x00000080
190 #define DO_SHUTDOWN_REGISTERED 0x00000800
191 #define DO_BUS_ENUMERATED_DEVICE 0x00001000
192 #define DO_POWER_PAGABLE 0x00002000
193 #define DO_POWER_INRUSH 0x00004000
195 #define IO_NO_INCREMENT 0
196 #define IO_CD_ROM_INCREMENT 1
197 #define IO_DISK_INCREMENT 1
198 #define IO_KEYBOARD_INCREMENT 6
199 #define IO_MAILSLOT_INCREMENT 2
200 #define IO_MOUSE_INCREMENT 6
201 #define IO_NAMED_PIPE_INCREMENT 2
202 #define IO_NETWORK_INCREMENT 2
203 #define IO_PARALLEL_INCREMENT 1
204 #define IO_SERIAL_INCREMENT 2
205 #define IO_SOUND_INCREMENT 8
206 #define IO_VIDEO_INCREMENT 1
208 #ifndef DEVICE_TYPE
209 #define DEVICE_TYPE ULONG
210 #endif
211 #define IRP_MJ_MAXIMUM_FUNCTION 0x1b
212 #define IRP_MJ_CREATE 0x00
213 #define IRP_MJ_CREATE_NAMED_PIPE 0x01
214 #define IRP_MJ_CLOSE 0x02
215 #define IRP_MJ_READ 0x03
216 #define IRP_MJ_WRITE 0x04
217 #define IRP_MJ_QUERY_INFORMATION 0x05
218 #define IRP_MJ_SET_INFORMATION 0x06
219 #define IRP_MJ_QUERY_EA 0x07
220 #define IRP_MJ_SET_EA 0x08
221 #define IRP_MJ_FLUSH_BUFFERS 0x09
222 #define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a
223 #define IRP_MJ_SET_VOLUME_INFORMATION 0x0b
224 #define IRP_MJ_DIRECTORY_CONTROL 0x0c
225 #define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d
226 #define IRP_MJ_DEVICE_CONTROL 0x0e
227 #define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f
228 #define IRP_MJ_SHUTDOWN 0x10
229 #define IRP_MJ_LOCK_CONTROL 0x11
230 #define IRP_MJ_CLEANUP 0x12
231 #define IRP_MJ_CREATE_MAILSLOT 0x13
232 #define IRP_MJ_QUERY_SECURITY 0x14
233 #define IRP_MJ_SET_SECURITY 0x15
234 #define IRP_MJ_POWER 0x16
235 #define IRP_MJ_SYSTEM_CONTROL 0x17
236 #define IRP_MJ_DEVICE_CHANGE 0x18
237 #define IRP_MJ_QUERY_QUOTA 0x19
238 #define IRP_MJ_SET_QUOTA 0x1a
239 #define IRP_MJ_PNP 0x1b
241 #define IRP_MN_START_DEVICE 0x00
242 #define IRP_MN_QUERY_REMOVE_DEVICE 0x01
243 #define IRP_MN_REMOVE_DEVICE 0x02
244 #define IRP_MN_CANCEL_REMOVE_DEVICE 0x03
245 #define IRP_MN_STOP_DEVICE 0x04
246 #define IRP_MN_QUERY_STOP_DEVICE 0x05
247 #define IRP_MN_CANCEL_STOP_DEVICE 0x06
248 #define IRP_MN_QUERY_DEVICE_RELATIONS 0x07
249 #define IRP_MN_QUERY_INTERFACE 0x08
250 #define IRP_MN_QUERY_CAPABILITIES 0x09
251 #define IRP_MN_QUERY_RESOURCES 0x0A
252 #define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B
253 #define IRP_MN_QUERY_DEVICE_TEXT 0x0C
254 #define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
255 #define IRP_MN_READ_CONFIG 0x0F
256 #define IRP_MN_WRITE_CONFIG 0x10
257 #define IRP_MN_EJECT 0x11
258 #define IRP_MN_SET_LOCK 0x12
259 #define IRP_MN_QUERY_ID 0x13
260 #define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14
261 #define IRP_MN_QUERY_BUS_INFORMATION 0x15
262 #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16
263 #define IRP_MN_SURPRISE_REMOVAL 0x17
265 #define IRP_QUOTA_CHARGED 0x01
266 #define IRP_ALLOCATED_MUST_SUCCEED 0x02
267 #define IRP_ALLOCATED_FIXED_SIZE 0x04
268 #define IRP_LOOKASIDE_ALLOCATION 0x08
270 #define IO_TYPE_ADAPTER 0x01
271 #define IO_TYPE_CONTROLLER 0x02
272 #define IO_TYPE_DEVICE 0x03
273 #define IO_TYPE_DRIVER 0x04
274 #define IO_TYPE_FILE 0x05
275 #define IO_TYPE_IRP 0x06
276 #define IO_TYPE_MASTER_ADAPTER 0x07
277 #define IO_TYPE_OPEN_PACKET 0x08
278 #define IO_TYPE_TIMER 0x09
279 #define IO_TYPE_VPB 0x0a
280 #define IO_TYPE_ERROR_LOG 0x0b
281 #define IO_TYPE_ERROR_MESSAGE 0x0c
282 #define IO_TYPE_DEVICE_OBJECT_EXTENSION 0x0d
284 typedef struct _DEVICE_OBJECT {
285 CSHORT Type;
286 USHORT Size;
287 LONG ReferenceCount;
288 struct _DRIVER_OBJECT *DriverObject;
289 struct _DEVICE_OBJECT *NextDevice;
290 struct _DEVICE_OBJECT *AttachedDevice;
291 struct _IRP *CurrentIrp;
292 PIO_TIMER Timer;
293 ULONG Flags;
294 ULONG Characteristics;
295 PVPB Vpb;
296 PVOID DeviceExtension;
297 DEVICE_TYPE DeviceType;
298 CCHAR StackSize;
299 union {
300 LIST_ENTRY ListEntry;
301 WAIT_CONTEXT_BLOCK Wcb;
302 } Queue;
303 ULONG AlignmentRequirement;
304 KDEVICE_QUEUE DeviceQueue;
305 KDPC Dpc;
306 ULONG ActiveThreadCount;
307 PSECURITY_DESCRIPTOR SecurityDescriptor;
308 KEVENT DeviceLock;
309 USHORT SectorSize;
310 USHORT Spare1;
311 struct _DEVOBJ_EXTENSION *DeviceObjectExtension;
312 PVOID Reserved;
313 } DEVICE_OBJECT;
314 typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
316 typedef struct _DRIVER_EXTENSION {
317 struct _DRIVER_OBJECT *DriverObject;
318 PVOID AddDevice;
319 ULONG Count;
320 UNICODE_STRING ServiceKeyName;
321 } DRIVER_EXTENSION, *PDRIVER_EXTENSION;
323 typedef struct _DRIVER_OBJECT {
324 CSHORT Type;
325 CSHORT Size;
326 PDEVICE_OBJECT DeviceObject;
327 ULONG Flags;
328 PVOID DriverStart;
329 ULONG DriverSize;
330 PVOID DriverSection;
331 PDRIVER_EXTENSION DriverExtension;
332 UNICODE_STRING DriverName;
333 PUNICODE_STRING HardwareDatabase;
334 PVOID FastIoDispatch;
335 PDRIVER_INITIALIZE DriverInit;
336 PDRIVER_STARTIO DriverStartIo;
337 PDRIVER_UNLOAD DriverUnload;
338 PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1];
339 } DRIVER_OBJECT;
340 typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
342 /* Irp definitions */
343 typedef UCHAR KIRQL, *PKIRQL;
344 typedef CCHAR KPROCESSOR_MODE;
346 typedef VOID (WINAPI *PDRIVER_CANCEL)(
347 IN struct _DEVICE_OBJECT *DeviceObject,
348 IN struct _IRP *Irp);
350 typedef VOID (WINAPI *PKNORMAL_ROUTINE)(
351 IN PVOID NormalContext,
352 IN PVOID SystemArgument1,
353 IN PVOID SystemArgument2);
355 typedef VOID (WINAPI *PKKERNEL_ROUTINE)(
356 IN struct _KAPC *Apc,
357 IN OUT PKNORMAL_ROUTINE *NormalRoutine,
358 IN OUT PVOID *NormalContext,
359 IN OUT PVOID *SystemArgument1,
360 IN OUT PVOID *SystemArgument2);
362 typedef VOID (WINAPI *PKRUNDOWN_ROUTINE)(
363 IN struct _KAPC *Apc);
365 typedef struct _KAPC {
366 CSHORT Type;
367 CSHORT Size;
368 ULONG Spare0;
369 struct _KTHREAD *Thread;
370 LIST_ENTRY ApcListEntry;
371 PKKERNEL_ROUTINE KernelRoutine;
372 PKRUNDOWN_ROUTINE RundownRoutine;
373 PKNORMAL_ROUTINE NormalRoutine;
374 PVOID NormalContext;
375 PVOID SystemArgument1;
376 PVOID SystemArgument2;
377 CCHAR ApcStateIndex;
378 KPROCESSOR_MODE ApcMode;
379 BOOLEAN Inserted;
380 } KAPC, *PKAPC, *RESTRICTED_POINTER PRKAPC;
382 #include <pshpack1.h>
383 typedef struct _IRP {
384 CSHORT Type;
385 USHORT Size;
386 struct _MDL *MdlAddress;
387 ULONG Flags;
388 union {
389 struct _IRP *MasterIrp;
390 LONG IrpCount;
391 PVOID SystemBuffer;
392 } AssociatedIrp;
393 LIST_ENTRY ThreadListEntry;
394 IO_STATUS_BLOCK IoStatus;
395 KPROCESSOR_MODE RequestorMode;
396 BOOLEAN PendingReturned;
397 CHAR StackCount;
398 CHAR CurrentLocation;
399 BOOLEAN Cancel;
400 KIRQL CancelIrql;
401 CCHAR ApcEnvironment;
402 UCHAR AllocationFlags;
403 PIO_STATUS_BLOCK UserIosb;
404 PKEVENT UserEvent;
405 union {
406 struct {
407 PIO_APC_ROUTINE UserApcRoutine;
408 PVOID UserApcContext;
409 } AsynchronousParameters;
410 LARGE_INTEGER AllocationSize;
411 } Overlay;
412 PDRIVER_CANCEL CancelRoutine;
413 PVOID UserBuffer;
414 union {
415 struct {
416 union {
417 KDEVICE_QUEUE_ENTRY DeviceQueueEntry;
418 struct {
419 PVOID DriverContext[4];
420 } DUMMYSTRUCTNAME;
421 } DUMMYUNIONNAME;
422 PETHREAD Thread;
423 PCHAR AuxiliaryBuffer;
424 struct {
425 LIST_ENTRY ListEntry;
426 union {
427 struct _IO_STACK_LOCATION *CurrentStackLocation;
428 ULONG PacketType;
429 } DUMMYUNIONNAME;
430 } DUMMYSTRUCTNAME;
431 struct _FILE_OBJECT *OriginalFileObject;
432 } Overlay;
433 KAPC Apc;
434 PVOID CompletionKey;
435 } Tail;
436 } IRP;
437 typedef struct _IRP *PIRP;
438 #include <poppack.h>
440 /* MDL definitions */
442 typedef VOID (WINAPI *PINTERFACE_REFERENCE)(
443 PVOID Context);
445 typedef VOID (WINAPI *PINTERFACE_DEREFERENCE)(
446 PVOID Context);
448 typedef struct _INTERFACE {
449 USHORT Size;
450 USHORT Version;
451 PVOID Context;
452 PINTERFACE_REFERENCE InterfaceReference;
453 PINTERFACE_DEREFERENCE InterfaceDereference;
454 } INTERFACE, *PINTERFACE;
456 typedef struct _SECTION_OBJECT_POINTERS {
457 PVOID DataSectionObject;
458 PVOID SharedCacheMap;
459 PVOID ImageSectionObject;
460 } SECTION_OBJECT_POINTERS, *PSECTION_OBJECT_POINTERS;
462 typedef struct _IO_COMPLETION_CONTEXT {
463 PVOID Port;
464 PVOID Key;
465 } IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT;
467 typedef enum _DEVICE_RELATION_TYPE {
468 BusRelations,
469 EjectionRelations,
470 PowerRelations,
471 RemovalRelations,
472 TargetDeviceRelation,
473 SingleBusRelations
474 } DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE;
476 typedef struct _FILE_OBJECT {
477 CSHORT Type;
478 CSHORT Size;
479 PDEVICE_OBJECT DeviceObject;
480 PVPB Vpb;
481 PVOID FsContext;
482 PVOID FsContext2;
483 PSECTION_OBJECT_POINTERS SectionObjectPointer;
484 PVOID PrivateCacheMap;
485 NTSTATUS FinalStatus;
486 struct _FILE_OBJECT *RelatedFileObject;
487 BOOLEAN LockOperation;
488 BOOLEAN DeletePending;
489 BOOLEAN ReadAccess;
490 BOOLEAN WriteAccess;
491 BOOLEAN DeleteAccess;
492 BOOLEAN SharedRead;
493 BOOLEAN SharedWrite;
494 BOOLEAN SharedDelete;
495 ULONG Flags;
496 UNICODE_STRING FileName;
497 LARGE_INTEGER CurrentByteOffset;
498 ULONG Waiters;
499 ULONG Busy;
500 PVOID LastLock;
501 KEVENT Lock;
502 KEVENT Event;
503 PIO_COMPLETION_CONTEXT CompletionContext;
504 } FILE_OBJECT;
505 typedef struct _FILE_OBJECT *PFILE_OBJECT;
507 #define INITIAL_PRIVILEGE_COUNT 3
509 typedef struct _INITIAL_PRIVILEGE_SET {
510 ULONG PrivilegeCount;
511 ULONG Control;
512 LUID_AND_ATTRIBUTES Privilege[INITIAL_PRIVILEGE_COUNT];
513 } INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET;
515 typedef struct _SECURITY_SUBJECT_CONTEXT {
516 PACCESS_TOKEN ClientToken;
517 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
518 PACCESS_TOKEN PrimaryToken;
519 PVOID ProcessAuditId;
520 } SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT;
522 typedef struct _ACCESS_STATE {
523 LUID OperationID;
524 BOOLEAN SecurityEvaluated;
525 BOOLEAN GenerateAudit;
526 BOOLEAN GenerateOnClose;
527 BOOLEAN PrivilegesAllocated;
528 ULONG Flags;
529 ACCESS_MASK RemainingDesiredAccess;
530 ACCESS_MASK PreviouslyGrantedAccess;
531 ACCESS_MASK OriginalDesiredAccess;
532 SECURITY_SUBJECT_CONTEXT SubjectSecurityContext;
533 PSECURITY_DESCRIPTOR SecurityDescriptor;
534 PVOID AuxData;
535 union {
536 INITIAL_PRIVILEGE_SET InitialPrivilegeSet;
537 PRIVILEGE_SET PrivilegeSet;
538 } Privileges;
540 BOOLEAN AuditPrivileges;
541 UNICODE_STRING ObjectName;
542 UNICODE_STRING ObjectTypeName;
543 } ACCESS_STATE, *PACCESS_STATE;
545 typedef struct _IO_SECURITY_CONTEXT {
546 PSECURITY_QUALITY_OF_SERVICE SecurityQos;
547 PACCESS_STATE AccessState;
548 ACCESS_MASK DesiredAccess;
549 ULONG FullCreateOptions;
550 } IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT;
552 typedef struct _DEVICE_CAPABILITIES {
553 USHORT Size;
554 USHORT Version;
555 ULONG DeviceD1 : 1;
556 ULONG DeviceD2 : 1;
557 ULONG LockSupported : 1;
558 ULONG EjectSupported : 1;
559 ULONG Removable : 1;
560 ULONG DockDevice : 1;
561 ULONG UniqueID : 1;
562 ULONG SilentInstall : 1;
563 ULONG RawDeviceOK : 1;
564 ULONG SurpriseRemovalOK : 1;
565 ULONG WakeFromD0 : 1;
566 ULONG WakeFromD1 : 1;
567 ULONG WakeFromD2 : 1;
568 ULONG WakeFromD3 : 1;
569 ULONG HardwareDisabled : 1;
570 ULONG NonDynamic : 1;
571 ULONG WarmEjectSupported : 1;
572 ULONG NoDisplayInUI : 1;
573 ULONG Reserved : 14;
574 ULONG Address;
575 ULONG UINumber;
576 DEVICE_POWER_STATE DeviceState[PowerSystemMaximum];
577 SYSTEM_POWER_STATE SystemWake;
578 DEVICE_POWER_STATE DeviceWake;
579 ULONG D1Latency;
580 ULONG D2Latency;
581 ULONG D3Latency;
582 } DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES;
584 typedef enum _INTERFACE_TYPE {
585 InterfaceTypeUndefined = -1,
586 Internal,
587 Isa,
588 Eisa,
589 MicroChannel,
590 TurboChannel,
591 PCIBus,
592 VMEBus,
593 NuBus,
594 PCMCIABus,
595 CBus,
596 MPIBus,
597 MPSABus,
598 ProcessorInternal,
599 InternalPowerBus,
600 PNPISABus,
601 PNPBus,
602 MaximumInterfaceType
603 } INTERFACE_TYPE, *PINTERFACE_TYPE;
605 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
607 #define IO_RESOURCE_PREFERRED 0x01
608 #define IO_RESOURCE_DEFAULT 0x02
609 #define IO_RESOURCE_ALTERNATIVE 0x08
611 typedef struct _IO_RESOURCE_DESCRIPTOR {
612 UCHAR Option;
613 UCHAR Type;
614 UCHAR ShareDisposition;
615 UCHAR Spare1;
616 USHORT Flags;
617 USHORT Spare2;
618 union {
619 struct {
620 ULONG Length;
621 ULONG Alignment;
622 PHYSICAL_ADDRESS MinimumAddress;
623 PHYSICAL_ADDRESS MaximumAddress;
624 } Port;
625 struct {
626 ULONG Length;
627 ULONG Alignment;
628 PHYSICAL_ADDRESS MinimumAddress;
629 PHYSICAL_ADDRESS MaximumAddress;
630 } Memory;
631 struct {
632 ULONG MinimumVector;
633 ULONG MaximumVector;
634 } Interrupt;
635 struct {
636 ULONG MinimumChannel;
637 ULONG MaximumChannel;
638 } Dma;
639 struct {
640 ULONG Length;
641 ULONG Alignment;
642 PHYSICAL_ADDRESS MinimumAddress;
643 PHYSICAL_ADDRESS MaximumAddress;
644 } Generic;
645 struct {
646 ULONG Data[3];
647 } DevicePrivate;
648 struct {
649 ULONG Length;
650 ULONG MinBusNumber;
651 ULONG MaxBusNumber;
652 ULONG Reserved;
653 } BusNumber;
654 struct {
655 ULONG Priority;
656 ULONG Reserved1;
657 ULONG Reserved2;
658 } ConfigData;
659 } u;
660 } IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR;
662 typedef struct _IO_RESOURCE_LIST {
663 USHORT Version;
664 USHORT Revision;
665 ULONG Count;
666 IO_RESOURCE_DESCRIPTOR Descriptors[1];
667 } IO_RESOURCE_LIST, *PIO_RESOURCE_LIST;
669 typedef struct _IO_RESOURCE_REQUIREMENTS_LIST {
670 ULONG ListSize;
671 INTERFACE_TYPE InterfaceType;
672 ULONG BusNumber;
673 ULONG SlotNumber;
674 ULONG Reserved[3];
675 ULONG AlternativeLists;
676 IO_RESOURCE_LIST List[1];
677 } IO_RESOURCE_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST;
679 typedef enum _BUS_QUERY_ID_TYPE {
680 BusQueryDeviceID,
681 BusQueryHardwareIDs,
682 BusQueryCompatibleIDs,
683 BusQueryInstanceID,
684 BusQueryDeviceSerialNumber
685 } BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE;
687 typedef enum _DEVICE_TEXT_TYPE {
688 DeviceTextDescription,
689 DeviceTextLocationInformation
690 } DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE;
692 typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE {
693 DeviceUsageTypeUndefined,
694 DeviceUsageTypePaging,
695 DeviceUsageTypeHibernation,
696 DeviceUsageTypeDumpFile
697 } DEVICE_USAGE_NOTIFICATION_TYPE;
699 typedef struct _POWER_SEQUENCE {
700 ULONG SequenceD1;
701 ULONG SequenceD2;
702 ULONG SequenceD3;
703 } POWER_SEQUENCE, *PPOWER_SEQUENCE;
705 typedef enum _POWER_STATE_TYPE {
706 SystemPowerState,
707 DevicePowerState
708 } POWER_STATE_TYPE, *PPOWER_STATE_TYPE;
710 typedef union _POWER_STATE {
711 SYSTEM_POWER_STATE SystemState;
712 DEVICE_POWER_STATE DeviceState;
713 } POWER_STATE, *PPOWER_STATE;
715 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
716 UCHAR Type;
717 UCHAR ShareDisposition;
718 USHORT Flags;
719 union {
720 struct {
721 PHYSICAL_ADDRESS Start;
722 ULONG Length;
723 } Generic;
724 struct {
725 PHYSICAL_ADDRESS Start;
726 ULONG Length;
727 } Port;
728 struct {
729 ULONG Level;
730 ULONG Vector;
731 ULONG Affinity;
732 } Interrupt;
733 struct {
734 PHYSICAL_ADDRESS Start;
735 ULONG Length;
736 } Memory;
737 struct {
738 ULONG Channel;
739 ULONG Port;
740 ULONG Reserved1;
741 } Dma;
742 struct {
743 ULONG Data[3];
744 } DevicePrivate;
745 struct {
746 ULONG Start;
747 ULONG Length;
748 ULONG Reserved;
749 } BusNumber;
750 struct {
751 ULONG DataSize;
752 ULONG Reserved1;
753 ULONG Reserved2;
754 } DeviceSpecificData;
755 } u;
756 } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
758 typedef struct _CM_PARTIAL_RESOURCE_LIST {
759 USHORT Version;
760 USHORT Revision;
761 ULONG Count;
762 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
763 } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
765 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR {
766 INTERFACE_TYPE InterfaceType;
767 ULONG BusNumber;
768 CM_PARTIAL_RESOURCE_LIST PartialResourceList;
769 } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
771 typedef struct _CM_RESOURCE_LIST {
772 ULONG Count;
773 CM_FULL_RESOURCE_DESCRIPTOR List[1];
774 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
776 typedef NTSTATUS (WINAPI *PIO_COMPLETION_ROUTINE)(
777 IN struct _DEVICE_OBJECT *DeviceObject,
778 IN struct _IRP *Irp,
779 IN PVOID Context);
781 #define SL_PENDING_RETURNED 0x01
782 #define SL_INVOKE_ON_CANCEL 0x20
783 #define SL_INVOKE_ON_SUCCESS 0x40
784 #define SL_INVOKE_ON_ERROR 0x80
786 #include <pshpack1.h>
787 typedef struct _IO_STACK_LOCATION {
788 UCHAR MajorFunction;
789 UCHAR MinorFunction;
790 UCHAR Flags;
791 UCHAR Control;
792 union {
793 struct {
794 PIO_SECURITY_CONTEXT SecurityContext;
795 ULONG Options;
796 USHORT POINTER_ALIGNMENT FileAttributes;
797 USHORT ShareAccess;
798 ULONG POINTER_ALIGNMENT EaLength;
799 } Create;
800 struct {
801 ULONG Length;
802 ULONG POINTER_ALIGNMENT Key;
803 LARGE_INTEGER ByteOffset;
804 } Read;
805 struct {
806 ULONG Length;
807 ULONG POINTER_ALIGNMENT Key;
808 LARGE_INTEGER ByteOffset;
809 } Write;
810 struct {
811 ULONG Length;
812 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
813 } QueryFile;
814 struct {
815 ULONG Length;
816 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
817 PFILE_OBJECT FileObject;
818 union {
819 struct {
820 BOOLEAN ReplaceIfExists;
821 BOOLEAN AdvanceOnly;
822 } DUMMYSTRUCTNAME;
823 ULONG ClusterCount;
824 HANDLE DeleteHandle;
825 } DUMMYUNIONNAME;
826 } SetFile;
827 struct {
828 ULONG Length;
829 FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass;
830 } QueryVolume;
831 struct {
832 ULONG OutputBufferLength;
833 ULONG POINTER_ALIGNMENT InputBufferLength;
834 ULONG POINTER_ALIGNMENT IoControlCode;
835 PVOID Type3InputBuffer;
836 } DeviceIoControl;
837 struct {
838 SECURITY_INFORMATION SecurityInformation;
839 ULONG POINTER_ALIGNMENT Length;
840 } QuerySecurity;
841 struct {
842 SECURITY_INFORMATION SecurityInformation;
843 PSECURITY_DESCRIPTOR SecurityDescriptor;
844 } SetSecurity;
845 struct {
846 PVPB Vpb;
847 PDEVICE_OBJECT DeviceObject;
848 } MountVolume;
849 struct {
850 PVPB Vpb;
851 PDEVICE_OBJECT DeviceObject;
852 } VerifyVolume;
853 struct {
854 struct _SCSI_REQUEST_BLOCK *Srb;
855 } Scsi;
856 struct {
857 DEVICE_RELATION_TYPE Type;
858 } QueryDeviceRelations;
859 struct {
860 CONST GUID *InterfaceType;
861 USHORT Size;
862 USHORT Version;
863 PINTERFACE Interface;
864 PVOID InterfaceSpecificData;
865 } QueryInterface;
866 struct {
867 PDEVICE_CAPABILITIES Capabilities;
868 } DeviceCapabilities;
869 struct {
870 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
871 } FilterResourceRequirements;
872 struct {
873 ULONG WhichSpace;
874 PVOID Buffer;
875 ULONG Offset;
876 ULONG POINTER_ALIGNMENT Length;
877 } ReadWriteConfig;
878 struct {
879 BOOLEAN Lock;
880 } SetLock;
881 struct {
882 BUS_QUERY_ID_TYPE IdType;
883 } QueryId;
884 struct {
885 DEVICE_TEXT_TYPE DeviceTextType;
886 LCID POINTER_ALIGNMENT LocaleId;
887 } QueryDeviceText;
888 struct {
889 BOOLEAN InPath;
890 BOOLEAN Reserved[3];
891 DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type;
892 } UsageNotification;
893 struct {
894 SYSTEM_POWER_STATE PowerState;
895 } WaitWake;
896 struct {
897 PPOWER_SEQUENCE PowerSequence;
898 } PowerSequence;
899 struct {
900 ULONG SystemContext;
901 POWER_STATE_TYPE POINTER_ALIGNMENT Type;
902 POWER_STATE POINTER_ALIGNMENT State;
903 POWER_ACTION POINTER_ALIGNMENT ShutdownType;
904 } Power;
905 struct {
906 PCM_RESOURCE_LIST AllocatedResources;
907 PCM_RESOURCE_LIST AllocatedResourcesTranslated;
908 } StartDevice;
909 struct {
910 ULONG_PTR ProviderId;
911 PVOID DataPath;
912 ULONG BufferSize;
913 PVOID Buffer;
914 } WMI;
915 struct {
916 PVOID Argument1;
917 PVOID Argument2;
918 PVOID Argument3;
919 PVOID Argument4;
920 } Others;
921 } Parameters;
922 PDEVICE_OBJECT DeviceObject;
923 PFILE_OBJECT FileObject;
924 PIO_COMPLETION_ROUTINE CompletionRoutine;
925 PVOID Context;
926 } IO_STACK_LOCATION, *PIO_STACK_LOCATION;
927 #include <poppack.h>
929 typedef struct _MDL {
930 struct _MDL *Next;
931 CSHORT Size;
932 CSHORT MdlFlags;
933 struct _EPROCESS *Process;
934 PVOID MappedSystemVa;
935 PVOID StartVa;
936 ULONG ByteCount;
937 ULONG ByteOffset;
938 } MDL, *PMDL;
940 typedef struct _KTIMER {
941 DISPATCHER_HEADER Header;
942 ULARGE_INTEGER DueTime;
943 LIST_ENTRY TimerListEntry;
944 struct _KDPC *Dpc;
945 LONG Period;
946 } KTIMER, *PKTIMER;
948 typedef struct _KSYSTEM_TIME {
949 ULONG LowPart;
950 LONG High1Time;
951 LONG High2Time;
952 } KSYSTEM_TIME, *PKSYSTEM_TIME;
954 typedef enum _NT_PRODUCT_TYPE {
955 NtProductWinNt = 1,
956 NtProductLanManNt,
957 NtProductServer
958 } NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
960 #define PROCESSOR_FEATURE_MAX 64
962 typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
964 StandardDesign,
965 NEC98x86,
966 EndAlternatives
967 } ALTERNATIVE_ARCHITECTURE_TYPE;
969 typedef struct _KUSER_SHARED_DATA {
970 ULONG TickCountLowDeprecated;
971 ULONG TickCountMultiplier;
972 volatile KSYSTEM_TIME InterruptTime;
973 volatile KSYSTEM_TIME SystemTime;
974 volatile KSYSTEM_TIME TimeZoneBias;
975 USHORT ImageNumberLow;
976 USHORT ImageNumberHigh;
977 WCHAR NtSystemRoot[260];
978 ULONG MaxStckTraceDepth;
979 ULONG CryptoExponent;
980 ULONG TimeZoneId;
981 ULONG LargePageMinimum;
982 ULONG Reserverd2[7];
983 NT_PRODUCT_TYPE NtProductType;
984 BOOLEAN ProductTypeIsValid;
985 ULONG MajorNtVersion;
986 ULONG MinorNtVersion;
987 BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
988 ULONG Reserved1;
989 ULONG Reserved3;
990 volatile ULONG TimeSlip;
991 ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
992 LARGE_INTEGER SystemExpirationDate;
993 ULONG SuiteMask;
994 BOOLEAN KdDebuggerEnabled;
995 volatile ULONG ActiveConsoleId;
996 volatile ULONG DismountCount;
997 ULONG ComPlusPackage;
998 ULONG LastSystemRITEventTickCount;
999 ULONG NumberOfPhysicalPages;
1000 BOOLEAN SafeBootMode;
1001 ULONG TraceLogging;
1002 ULONGLONG Fill0;
1003 ULONGLONG SystemCall[4];
1004 union {
1005 volatile KSYSTEM_TIME TickCount;
1006 volatile ULONG64 TickCountQuad;
1007 } DUMMYUNIONNAME;
1008 } KSHARED_USER_DATA, *PKSHARED_USER_DATA;
1010 typedef enum _MM_SYSTEM_SIZE
1012 MmSmallSystem,
1013 MmMediumSystem,
1014 MmLargeSystem
1015 } MM_SYSTEMSIZE;
1017 NTSTATUS WINAPI ObCloseHandle(IN HANDLE handle);
1019 #define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.CurrentStackLocation)
1021 #define KernelMode 0
1022 #define UserMode 1
1024 /* directory object access rights */
1025 #define DIRECTORY_QUERY 0x0001
1026 #define DIRECTORY_TRAVERSE 0x0002
1027 #define DIRECTORY_CREATE_OBJECT 0x0004
1028 #define DIRECTORY_CREATE_SUBDIRECTORY 0x0008
1029 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
1031 /* symbolic link access rights */
1032 #define SYMBOLIC_LINK_QUERY 0x0001
1033 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
1035 PVOID WINAPI ExAllocatePool(POOL_TYPE,SIZE_T);
1036 PVOID WINAPI ExAllocatePoolWithQuota(POOL_TYPE,SIZE_T);
1037 PVOID WINAPI ExAllocatePoolWithTag(POOL_TYPE,SIZE_T,ULONG);
1038 PVOID WINAPI ExAllocatePoolWithQuotaTag(POOL_TYPE,SIZE_T,ULONG);
1039 void WINAPI ExFreePool(PVOID);
1040 void WINAPI ExFreePoolWithTag(PVOID,ULONG);
1042 NTSTATUS WINAPI IoAllocateDriverObjectExtension(PDRIVER_OBJECT,PVOID,ULONG,PVOID*);
1043 PVOID WINAPI IoAllocateErrorLogEntry(PVOID,UCHAR);
1044 PIRP WINAPI IoAllocateIrp(CCHAR,BOOLEAN);
1045 NTSTATUS WINAPI IoCreateDevice(DRIVER_OBJECT*,ULONG,UNICODE_STRING*,DEVICE_TYPE,ULONG,BOOLEAN,DEVICE_OBJECT**);
1046 NTSTATUS WINAPI IoCreateDriver(UNICODE_STRING*,PDRIVER_INITIALIZE);
1047 NTSTATUS WINAPI IoCreateSymbolicLink(UNICODE_STRING*,UNICODE_STRING*);
1048 void WINAPI IoDeleteDevice(DEVICE_OBJECT*);
1049 void WINAPI IoDeleteDriver(DRIVER_OBJECT*);
1050 NTSTATUS WINAPI IoDeleteSymbolicLink(UNICODE_STRING*);
1051 void WINAPI IoFreeIrp(IRP*);
1052 PEPROCESS WINAPI IoGetCurrentProcess(void);
1053 NTSTATUS WINAPI IoGetDeviceObjectPointer(UNICODE_STRING*,ACCESS_MASK,PFILE_OBJECT*,PDEVICE_OBJECT*);
1054 PVOID WINAPI IoGetDriverObjectExtension(PDRIVER_OBJECT,PVOID);
1055 PDEVICE_OBJECT WINAPI IoGetRelatedDeviceObject(PFILE_OBJECT);
1056 void WINAPI IoInitializeIrp(IRP*,USHORT,CCHAR);
1058 PKTHREAD WINAPI KeGetCurrentThread(void);
1059 void WINAPI KeQuerySystemTime(LARGE_INTEGER*);
1060 void WINAPI KeQueryTickCount(LARGE_INTEGER*);
1061 ULONG WINAPI KeQueryTimeIncrement(void);
1063 PVOID WINAPI MmAllocateContiguousMemory(SIZE_T,PHYSICAL_ADDRESS);
1064 PVOID WINAPI MmAllocateNonCachedMemory(SIZE_T);
1065 PMDL WINAPI MmAllocatePagesForMdl(PHYSICAL_ADDRESS,PHYSICAL_ADDRESS,PHYSICAL_ADDRESS,SIZE_T);
1066 void WINAPI MmFreeNonCachedMemory(PVOID,SIZE_T);
1067 MM_SYSTEMSIZE WINAPI MmQuerySystemSize(void);
1069 NTSTATUS WINAPI ObReferenceObjectByHandle(HANDLE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,PVOID*,POBJECT_HANDLE_INFORMATION);
1071 NTSTATUS WINAPI PsCreateSystemThread(PHANDLE,ULONG,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PKSTART_ROUTINE,PVOID);
1072 #define PsGetCurrentProcess() IoGetCurrentProcess()
1073 #define PsGetCurrentThread() ((PETHREAD)KeGetCurrentThread())
1074 HANDLE WINAPI PsGetCurrentProcessId(void);
1075 HANDLE WINAPI PsGetCurrentThreadId(void);
1076 BOOLEAN WINAPI PsGetVersion(ULONG*,ULONG*,ULONG*,UNICODE_STRING*);
1077 NTSTATUS WINAPI PsTerminateSystemThread(NTSTATUS);
1079 NTSTATUS WINAPI ZwAddBootEntry(PUNICODE_STRING,PUNICODE_STRING);
1080 NTSTATUS WINAPI ZwAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN);
1081 NTSTATUS WINAPI ZwAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1082 NTSTATUS WINAPI ZwAlertThread(HANDLE ThreadHandle);
1083 NTSTATUS WINAPI ZwAllocateVirtualMemory(HANDLE,PVOID*,ULONG,SIZE_T*,ULONG,ULONG);
1084 NTSTATUS WINAPI ZwCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
1085 NTSTATUS WINAPI ZwCancelTimer(HANDLE, BOOLEAN*);
1086 NTSTATUS WINAPI ZwClearEvent(HANDLE);
1087 NTSTATUS WINAPI ZwClose(HANDLE);
1088 NTSTATUS WINAPI ZwCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
1089 NTSTATUS WINAPI ZwConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
1090 NTSTATUS WINAPI ZwCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1091 NTSTATUS WINAPI ZwCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1092 NTSTATUS WINAPI ZwCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
1093 NTSTATUS WINAPI ZwCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1094 NTSTATUS WINAPI ZwCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
1095 NTSTATUS WINAPI ZwCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
1096 NTSTATUS WINAPI ZwCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
1097 NTSTATUS WINAPI ZwDeleteAtom(RTL_ATOM);
1098 NTSTATUS WINAPI ZwDeleteFile(POBJECT_ATTRIBUTES);
1099 NTSTATUS WINAPI ZwDeleteKey(HANDLE);
1100 NTSTATUS WINAPI ZwDeleteValueKey(HANDLE,const UNICODE_STRING *);
1101 NTSTATUS WINAPI ZwDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1102 NTSTATUS WINAPI ZwDisplayString(PUNICODE_STRING);
1103 NTSTATUS WINAPI ZwDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
1104 NTSTATUS WINAPI ZwDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
1105 NTSTATUS WINAPI ZwEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1106 NTSTATUS WINAPI ZwEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1107 NTSTATUS WINAPI ZwFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
1108 NTSTATUS WINAPI ZwFlushKey(HANDLE);
1109 NTSTATUS WINAPI ZwFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
1110 NTSTATUS WINAPI ZwFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1111 NTSTATUS WINAPI ZwFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1112 NTSTATUS WINAPI ZwInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
1113 NTSTATUS WINAPI ZwLoadDriver(const UNICODE_STRING *);
1114 NTSTATUS WINAPI ZwLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
1115 NTSTATUS WINAPI ZwLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1116 NTSTATUS WINAPI ZwMakeTemporaryObject(HANDLE);
1117 NTSTATUS WINAPI ZwMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
1118 NTSTATUS WINAPI ZwNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
1119 NTSTATUS WINAPI ZwOpenDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1120 NTSTATUS WINAPI ZwOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1121 NTSTATUS WINAPI ZwOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
1122 NTSTATUS WINAPI ZwOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1123 NTSTATUS WINAPI ZwOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1124 NTSTATUS WINAPI ZwOpenProcessToken(HANDLE,DWORD,HANDLE *);
1125 NTSTATUS WINAPI ZwOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1126 NTSTATUS WINAPI ZwOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1127 NTSTATUS WINAPI ZwOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1128 NTSTATUS WINAPI ZwOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
1129 NTSTATUS WINAPI ZwOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
1130 NTSTATUS WINAPI ZwPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
1131 NTSTATUS WINAPI ZwPulseEvent(HANDLE,PULONG);
1132 NTSTATUS WINAPI ZwQueryDefaultLocale(BOOLEAN,LCID*);
1133 NTSTATUS WINAPI ZwQueryDefaultUILanguage(LANGID*);
1134 NTSTATUS WINAPI ZwQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
1135 NTSTATUS WINAPI ZwQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
1136 NTSTATUS WINAPI ZwQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN);
1137 NTSTATUS WINAPI ZwQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
1138 NTSTATUS WINAPI ZwQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
1139 NTSTATUS WINAPI ZwQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1140 NTSTATUS WINAPI ZwQueryInformationToken(HANDLE,DWORD,PVOID,DWORD,LPDWORD);
1141 NTSTATUS WINAPI ZwQueryInstallUILanguage(LANGID*);
1142 NTSTATUS WINAPI ZwQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1143 NTSTATUS WINAPI ZwQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
1144 NTSTATUS WINAPI ZwQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1145 NTSTATUS WINAPI ZwQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1146 NTSTATUS WINAPI ZwQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
1147 NTSTATUS WINAPI ZwQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1148 NTSTATUS WINAPI ZwQueryTimerResolution(PULONG,PULONG,PULONG);
1149 NTSTATUS WINAPI ZwQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
1150 NTSTATUS WINAPI ZwQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1151 NTSTATUS WINAPI ZwReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
1152 NTSTATUS WINAPI ZwReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
1153 NTSTATUS WINAPI ZwRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
1154 NTSTATUS WINAPI ZwResetEvent(HANDLE,PULONG);
1155 NTSTATUS WINAPI ZwRestoreKey(HANDLE,HANDLE,ULONG);
1156 NTSTATUS WINAPI ZwSaveKey(HANDLE,HANDLE);
1157 NTSTATUS WINAPI ZwSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
1158 NTSTATUS WINAPI ZwSetDefaultLocale(BOOLEAN,LCID);
1159 NTSTATUS WINAPI ZwSetDefaultUILanguage(LANGID);
1160 NTSTATUS WINAPI ZwSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
1161 NTSTATUS WINAPI ZwSetEvent(HANDLE,PULONG);
1162 NTSTATUS WINAPI ZwSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
1163 NTSTATUS WINAPI ZwSetInformationKey(HANDLE,const int,PVOID,ULONG);
1164 NTSTATUS WINAPI ZwSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
1165 NTSTATUS WINAPI ZwSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
1166 NTSTATUS WINAPI ZwSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
1167 NTSTATUS WINAPI ZwSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG);
1168 NTSTATUS WINAPI ZwSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1169 NTSTATUS WINAPI ZwSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
1170 NTSTATUS WINAPI ZwSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
1171 NTSTATUS WINAPI ZwSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
1172 NTSTATUS WINAPI ZwSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
1173 NTSTATUS WINAPI ZwSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1174 NTSTATUS WINAPI ZwSuspendThread(HANDLE,PULONG);
1175 NTSTATUS WINAPI ZwTerminateProcess(HANDLE,LONG);
1176 NTSTATUS WINAPI ZwUnloadDriver(const UNICODE_STRING *);
1177 NTSTATUS WINAPI ZwUnloadKey(HANDLE);
1178 NTSTATUS WINAPI ZwUnmapViewOfSection(HANDLE,PVOID);
1179 NTSTATUS WINAPI ZwWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1180 NTSTATUS WINAPI ZwWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
1181 NTSTATUS WINAPI ZwWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
1182 NTSTATUS WINAPI ZwYieldExecution(void);
1184 #endif