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
26 #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
28 #define POINTER_ALIGNMENT
31 typedef LONG KPRIORITY;
33 typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
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 {
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 _KSEMAPHORE {
63 DISPATCHER_HEADER Header;
65 } KSEMAPHORE, *PKSEMAPHORE, *PRKSEMAPHORE;
67 typedef struct _KDPC {
71 LIST_ENTRY DpcListEntry;
72 PKDEFERRED_ROUTINE DeferredRoutine;
73 PVOID DeferredContext;
74 PVOID SystemArgument1;
75 PVOID SystemArgument2;
77 } KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC;
79 typedef struct _KDEVICE_QUEUE_ENTRY {
80 LIST_ENTRY DeviceListEntry;
83 } KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY,
84 *RESTRICTED_POINTER PRKDEVICE_QUEUE_ENTRY;
86 typedef struct _KDEVICE_QUEUE {
89 LIST_ENTRY DeviceListHead;
92 } KDEVICE_QUEUE, *PKDEVICE_QUEUE, *RESTRICTED_POINTER PRKDEVICE_QUEUE;
94 typedef struct _KMUTANT {
95 DISPATCHER_HEADER Header;
96 LIST_ENTRY MutantListEntry;
97 struct _KTHREAD *RESTRICTED_POINTER OwnerThread;
100 } KMUTANT, *PKMUTANT, *RESTRICTED_POINTER PRKMUTANT, KMUTEX, *PKMUTEX, *RESTRICTED_POINTER PRKMUTEX;
102 typedef enum _KWAIT_REASON
132 typedef struct _ALLOCATE_FUNCTION *PALLOCATE_FUNCTION;
133 typedef struct _IO_TIMER *PIO_TIMER;
134 typedef struct _IO_TIMER_ROUTINE *PIO_TIMER_ROUTINE;
135 typedef struct _ETHREAD *PETHREAD;
136 typedef struct _FREE_FUNCTION *PFREE_FUNCTION;
137 typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
138 typedef struct _EPROCESS *PEPROCESS;
139 typedef struct _ERESOURCE *PERESOURCE;
140 typedef struct _IO_WORKITEM *PIO_WORKITEM;
141 typedef struct _NPAGED_LOOKASIDE_LIST *PNPAGED_LOOKASIDE_LIST;
142 typedef struct _OBJECT_TYPE *POBJECT_TYPE;
143 typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION;
144 typedef struct _ZONE_HEADER *PZONE_HEADER;
146 typedef struct _FAST_MUTEX
153 } FAST_MUTEX, *PFAST_MUTEX;
155 #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR))
157 typedef struct _VPB {
161 USHORT VolumeLabelLength;
162 struct _DEVICE_OBJECT *DeviceObject;
163 struct _DEVICE_OBJECT *RealDevice;
165 ULONG ReferenceCount;
166 WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)];
169 typedef enum _POOL_TYPE {
172 NonPagedPoolMustSucceed,
174 NonPagedPoolCacheAligned,
175 PagedPoolCacheAligned,
176 NonPagedPoolCacheAlignedMustS,
180 typedef struct _WAIT_CONTEXT_BLOCK {
181 KDEVICE_QUEUE_ENTRY WaitQueueEntry;
182 struct _DRIVER_CONTROL *DeviceRoutine;
184 ULONG NumberOfMapRegisters;
187 PKDPC BufferChainingDpc;
188 } WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK;
190 #define DO_BUFFERED_IO 0x00000004
191 #define DO_EXCLUSIVE 0x00000008
192 #define DO_DIRECT_IO 0x00000010
193 #define DO_MAP_IO_BUFFER 0x00000020
194 #define DO_DEVICE_INITIALIZING 0x00000080
195 #define DO_SHUTDOWN_REGISTERED 0x00000800
196 #define DO_BUS_ENUMERATED_DEVICE 0x00001000
197 #define DO_POWER_PAGABLE 0x00002000
198 #define DO_POWER_INRUSH 0x00004000
200 #define IO_NO_INCREMENT 0
201 #define IO_CD_ROM_INCREMENT 1
202 #define IO_DISK_INCREMENT 1
203 #define IO_KEYBOARD_INCREMENT 6
204 #define IO_MAILSLOT_INCREMENT 2
205 #define IO_MOUSE_INCREMENT 6
206 #define IO_NAMED_PIPE_INCREMENT 2
207 #define IO_NETWORK_INCREMENT 2
208 #define IO_PARALLEL_INCREMENT 1
209 #define IO_SERIAL_INCREMENT 2
210 #define IO_SOUND_INCREMENT 8
211 #define IO_VIDEO_INCREMENT 1
214 #define DEVICE_TYPE ULONG
216 #define IRP_MJ_MAXIMUM_FUNCTION 0x1b
217 #define IRP_MJ_CREATE 0x00
218 #define IRP_MJ_CREATE_NAMED_PIPE 0x01
219 #define IRP_MJ_CLOSE 0x02
220 #define IRP_MJ_READ 0x03
221 #define IRP_MJ_WRITE 0x04
222 #define IRP_MJ_QUERY_INFORMATION 0x05
223 #define IRP_MJ_SET_INFORMATION 0x06
224 #define IRP_MJ_QUERY_EA 0x07
225 #define IRP_MJ_SET_EA 0x08
226 #define IRP_MJ_FLUSH_BUFFERS 0x09
227 #define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a
228 #define IRP_MJ_SET_VOLUME_INFORMATION 0x0b
229 #define IRP_MJ_DIRECTORY_CONTROL 0x0c
230 #define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d
231 #define IRP_MJ_DEVICE_CONTROL 0x0e
232 #define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f
233 #define IRP_MJ_SHUTDOWN 0x10
234 #define IRP_MJ_LOCK_CONTROL 0x11
235 #define IRP_MJ_CLEANUP 0x12
236 #define IRP_MJ_CREATE_MAILSLOT 0x13
237 #define IRP_MJ_QUERY_SECURITY 0x14
238 #define IRP_MJ_SET_SECURITY 0x15
239 #define IRP_MJ_POWER 0x16
240 #define IRP_MJ_SYSTEM_CONTROL 0x17
241 #define IRP_MJ_DEVICE_CHANGE 0x18
242 #define IRP_MJ_QUERY_QUOTA 0x19
243 #define IRP_MJ_SET_QUOTA 0x1a
244 #define IRP_MJ_PNP 0x1b
246 #define IRP_MN_START_DEVICE 0x00
247 #define IRP_MN_QUERY_REMOVE_DEVICE 0x01
248 #define IRP_MN_REMOVE_DEVICE 0x02
249 #define IRP_MN_CANCEL_REMOVE_DEVICE 0x03
250 #define IRP_MN_STOP_DEVICE 0x04
251 #define IRP_MN_QUERY_STOP_DEVICE 0x05
252 #define IRP_MN_CANCEL_STOP_DEVICE 0x06
253 #define IRP_MN_QUERY_DEVICE_RELATIONS 0x07
254 #define IRP_MN_QUERY_INTERFACE 0x08
255 #define IRP_MN_QUERY_CAPABILITIES 0x09
256 #define IRP_MN_QUERY_RESOURCES 0x0A
257 #define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B
258 #define IRP_MN_QUERY_DEVICE_TEXT 0x0C
259 #define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
260 #define IRP_MN_READ_CONFIG 0x0F
261 #define IRP_MN_WRITE_CONFIG 0x10
262 #define IRP_MN_EJECT 0x11
263 #define IRP_MN_SET_LOCK 0x12
264 #define IRP_MN_QUERY_ID 0x13
265 #define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14
266 #define IRP_MN_QUERY_BUS_INFORMATION 0x15
267 #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16
268 #define IRP_MN_SURPRISE_REMOVAL 0x17
270 #define IRP_QUOTA_CHARGED 0x01
271 #define IRP_ALLOCATED_MUST_SUCCEED 0x02
272 #define IRP_ALLOCATED_FIXED_SIZE 0x04
273 #define IRP_LOOKASIDE_ALLOCATION 0x08
275 #define IO_TYPE_ADAPTER 0x01
276 #define IO_TYPE_CONTROLLER 0x02
277 #define IO_TYPE_DEVICE 0x03
278 #define IO_TYPE_DRIVER 0x04
279 #define IO_TYPE_FILE 0x05
280 #define IO_TYPE_IRP 0x06
281 #define IO_TYPE_MASTER_ADAPTER 0x07
282 #define IO_TYPE_OPEN_PACKET 0x08
283 #define IO_TYPE_TIMER 0x09
284 #define IO_TYPE_VPB 0x0a
285 #define IO_TYPE_ERROR_LOG 0x0b
286 #define IO_TYPE_ERROR_MESSAGE 0x0c
287 #define IO_TYPE_DEVICE_OBJECT_EXTENSION 0x0d
289 typedef struct _DEVICE_OBJECT {
293 struct _DRIVER_OBJECT *DriverObject;
294 struct _DEVICE_OBJECT *NextDevice;
295 struct _DEVICE_OBJECT *AttachedDevice;
296 struct _IRP *CurrentIrp;
299 ULONG Characteristics;
301 PVOID DeviceExtension;
302 DEVICE_TYPE DeviceType;
305 LIST_ENTRY ListEntry;
306 WAIT_CONTEXT_BLOCK Wcb;
308 ULONG AlignmentRequirement;
309 KDEVICE_QUEUE DeviceQueue;
311 ULONG ActiveThreadCount;
312 PSECURITY_DESCRIPTOR SecurityDescriptor;
316 struct _DEVOBJ_EXTENSION *DeviceObjectExtension;
319 typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
321 typedef struct _DRIVER_EXTENSION {
322 struct _DRIVER_OBJECT *DriverObject;
325 UNICODE_STRING ServiceKeyName;
326 } DRIVER_EXTENSION, *PDRIVER_EXTENSION;
328 typedef struct _DRIVER_OBJECT {
331 PDEVICE_OBJECT DeviceObject;
336 PDRIVER_EXTENSION DriverExtension;
337 UNICODE_STRING DriverName;
338 PUNICODE_STRING HardwareDatabase;
339 PVOID FastIoDispatch;
340 PDRIVER_INITIALIZE DriverInit;
341 PDRIVER_STARTIO DriverStartIo;
342 PDRIVER_UNLOAD DriverUnload;
343 PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1];
345 typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
347 /* Irp definitions */
348 typedef UCHAR KIRQL, *PKIRQL;
349 typedef CCHAR KPROCESSOR_MODE;
351 typedef VOID (WINAPI *PDRIVER_CANCEL)(
352 IN struct _DEVICE_OBJECT *DeviceObject,
353 IN struct _IRP *Irp);
355 typedef VOID (WINAPI *PKNORMAL_ROUTINE)(
356 IN PVOID NormalContext,
357 IN PVOID SystemArgument1,
358 IN PVOID SystemArgument2);
360 typedef VOID (WINAPI *PKKERNEL_ROUTINE)(
361 IN struct _KAPC *Apc,
362 IN OUT PKNORMAL_ROUTINE *NormalRoutine,
363 IN OUT PVOID *NormalContext,
364 IN OUT PVOID *SystemArgument1,
365 IN OUT PVOID *SystemArgument2);
367 typedef VOID (WINAPI *PKRUNDOWN_ROUTINE)(
368 IN struct _KAPC *Apc);
370 typedef struct _KAPC {
374 struct _KTHREAD *Thread;
375 LIST_ENTRY ApcListEntry;
376 PKKERNEL_ROUTINE KernelRoutine;
377 PKRUNDOWN_ROUTINE RundownRoutine;
378 PKNORMAL_ROUTINE NormalRoutine;
380 PVOID SystemArgument1;
381 PVOID SystemArgument2;
383 KPROCESSOR_MODE ApcMode;
385 } KAPC, *PKAPC, *RESTRICTED_POINTER PRKAPC;
387 #include <pshpack1.h>
388 typedef struct _IRP {
391 struct _MDL *MdlAddress;
394 struct _IRP *MasterIrp;
398 LIST_ENTRY ThreadListEntry;
399 IO_STATUS_BLOCK IoStatus;
400 KPROCESSOR_MODE RequestorMode;
401 BOOLEAN PendingReturned;
403 CHAR CurrentLocation;
406 CCHAR ApcEnvironment;
407 UCHAR AllocationFlags;
408 PIO_STATUS_BLOCK UserIosb;
412 PIO_APC_ROUTINE UserApcRoutine;
413 PVOID UserApcContext;
414 } AsynchronousParameters;
415 LARGE_INTEGER AllocationSize;
417 PDRIVER_CANCEL CancelRoutine;
422 KDEVICE_QUEUE_ENTRY DeviceQueueEntry;
424 PVOID DriverContext[4];
428 PCHAR AuxiliaryBuffer;
430 LIST_ENTRY ListEntry;
432 struct _IO_STACK_LOCATION *CurrentStackLocation;
436 struct _FILE_OBJECT *OriginalFileObject;
442 typedef struct _IRP *PIRP;
445 /* MDL definitions */
447 typedef VOID (WINAPI *PINTERFACE_REFERENCE)(
450 typedef VOID (WINAPI *PINTERFACE_DEREFERENCE)(
453 typedef struct _INTERFACE {
457 PINTERFACE_REFERENCE InterfaceReference;
458 PINTERFACE_DEREFERENCE InterfaceDereference;
459 } INTERFACE, *PINTERFACE;
461 typedef struct _SECTION_OBJECT_POINTERS {
462 PVOID DataSectionObject;
463 PVOID SharedCacheMap;
464 PVOID ImageSectionObject;
465 } SECTION_OBJECT_POINTERS, *PSECTION_OBJECT_POINTERS;
467 typedef struct _IO_COMPLETION_CONTEXT {
470 } IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT;
472 typedef enum _DEVICE_RELATION_TYPE {
477 TargetDeviceRelation,
479 } DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE;
481 typedef struct _FILE_OBJECT {
484 PDEVICE_OBJECT DeviceObject;
488 PSECTION_OBJECT_POINTERS SectionObjectPointer;
489 PVOID PrivateCacheMap;
490 NTSTATUS FinalStatus;
491 struct _FILE_OBJECT *RelatedFileObject;
492 BOOLEAN LockOperation;
493 BOOLEAN DeletePending;
496 BOOLEAN DeleteAccess;
499 BOOLEAN SharedDelete;
501 UNICODE_STRING FileName;
502 LARGE_INTEGER CurrentByteOffset;
508 PIO_COMPLETION_CONTEXT CompletionContext;
510 typedef struct _FILE_OBJECT *PFILE_OBJECT;
512 #define INITIAL_PRIVILEGE_COUNT 3
514 typedef struct _INITIAL_PRIVILEGE_SET {
515 ULONG PrivilegeCount;
517 LUID_AND_ATTRIBUTES Privilege[INITIAL_PRIVILEGE_COUNT];
518 } INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET;
520 typedef struct _SECURITY_SUBJECT_CONTEXT {
521 PACCESS_TOKEN ClientToken;
522 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
523 PACCESS_TOKEN PrimaryToken;
524 PVOID ProcessAuditId;
525 } SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT;
527 typedef struct _ACCESS_STATE {
529 BOOLEAN SecurityEvaluated;
530 BOOLEAN GenerateAudit;
531 BOOLEAN GenerateOnClose;
532 BOOLEAN PrivilegesAllocated;
534 ACCESS_MASK RemainingDesiredAccess;
535 ACCESS_MASK PreviouslyGrantedAccess;
536 ACCESS_MASK OriginalDesiredAccess;
537 SECURITY_SUBJECT_CONTEXT SubjectSecurityContext;
538 PSECURITY_DESCRIPTOR SecurityDescriptor;
541 INITIAL_PRIVILEGE_SET InitialPrivilegeSet;
542 PRIVILEGE_SET PrivilegeSet;
545 BOOLEAN AuditPrivileges;
546 UNICODE_STRING ObjectName;
547 UNICODE_STRING ObjectTypeName;
548 } ACCESS_STATE, *PACCESS_STATE;
550 typedef struct _IO_SECURITY_CONTEXT {
551 PSECURITY_QUALITY_OF_SERVICE SecurityQos;
552 PACCESS_STATE AccessState;
553 ACCESS_MASK DesiredAccess;
554 ULONG FullCreateOptions;
555 } IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT;
557 typedef struct _DEVICE_CAPABILITIES {
562 ULONG LockSupported : 1;
563 ULONG EjectSupported : 1;
565 ULONG DockDevice : 1;
567 ULONG SilentInstall : 1;
568 ULONG RawDeviceOK : 1;
569 ULONG SurpriseRemovalOK : 1;
570 ULONG WakeFromD0 : 1;
571 ULONG WakeFromD1 : 1;
572 ULONG WakeFromD2 : 1;
573 ULONG WakeFromD3 : 1;
574 ULONG HardwareDisabled : 1;
575 ULONG NonDynamic : 1;
576 ULONG WarmEjectSupported : 1;
577 ULONG NoDisplayInUI : 1;
581 DEVICE_POWER_STATE DeviceState[PowerSystemMaximum];
582 SYSTEM_POWER_STATE SystemWake;
583 DEVICE_POWER_STATE DeviceWake;
587 } DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES;
589 typedef enum _INTERFACE_TYPE {
590 InterfaceTypeUndefined = -1,
608 } INTERFACE_TYPE, *PINTERFACE_TYPE;
610 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
612 #define IO_RESOURCE_PREFERRED 0x01
613 #define IO_RESOURCE_DEFAULT 0x02
614 #define IO_RESOURCE_ALTERNATIVE 0x08
616 typedef struct _IO_RESOURCE_DESCRIPTOR {
619 UCHAR ShareDisposition;
627 PHYSICAL_ADDRESS MinimumAddress;
628 PHYSICAL_ADDRESS MaximumAddress;
633 PHYSICAL_ADDRESS MinimumAddress;
634 PHYSICAL_ADDRESS MaximumAddress;
641 ULONG MinimumChannel;
642 ULONG MaximumChannel;
647 PHYSICAL_ADDRESS MinimumAddress;
648 PHYSICAL_ADDRESS MaximumAddress;
665 } IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR;
667 typedef struct _IO_RESOURCE_LIST {
671 IO_RESOURCE_DESCRIPTOR Descriptors[1];
672 } IO_RESOURCE_LIST, *PIO_RESOURCE_LIST;
674 typedef struct _IO_RESOURCE_REQUIREMENTS_LIST {
676 INTERFACE_TYPE InterfaceType;
680 ULONG AlternativeLists;
681 IO_RESOURCE_LIST List[1];
682 } IO_RESOURCE_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST;
684 typedef enum _BUS_QUERY_ID_TYPE {
687 BusQueryCompatibleIDs,
689 BusQueryDeviceSerialNumber
690 } BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE;
692 typedef enum _DEVICE_TEXT_TYPE {
693 DeviceTextDescription,
694 DeviceTextLocationInformation
695 } DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE;
697 typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE {
698 DeviceUsageTypeUndefined,
699 DeviceUsageTypePaging,
700 DeviceUsageTypeHibernation,
701 DeviceUsageTypeDumpFile
702 } DEVICE_USAGE_NOTIFICATION_TYPE;
704 typedef struct _POWER_SEQUENCE {
708 } POWER_SEQUENCE, *PPOWER_SEQUENCE;
710 typedef enum _POWER_STATE_TYPE {
713 } POWER_STATE_TYPE, *PPOWER_STATE_TYPE;
715 typedef union _POWER_STATE {
716 SYSTEM_POWER_STATE SystemState;
717 DEVICE_POWER_STATE DeviceState;
718 } POWER_STATE, *PPOWER_STATE;
720 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
722 UCHAR ShareDisposition;
726 PHYSICAL_ADDRESS Start;
730 PHYSICAL_ADDRESS Start;
739 PHYSICAL_ADDRESS Start;
759 } DeviceSpecificData;
761 } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
763 typedef struct _CM_PARTIAL_RESOURCE_LIST {
767 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
768 } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
770 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR {
771 INTERFACE_TYPE InterfaceType;
773 CM_PARTIAL_RESOURCE_LIST PartialResourceList;
774 } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
776 typedef struct _CM_RESOURCE_LIST {
778 CM_FULL_RESOURCE_DESCRIPTOR List[1];
779 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
781 typedef NTSTATUS (WINAPI *PIO_COMPLETION_ROUTINE)(
782 IN struct _DEVICE_OBJECT *DeviceObject,
786 #define SL_PENDING_RETURNED 0x01
787 #define SL_INVOKE_ON_CANCEL 0x20
788 #define SL_INVOKE_ON_SUCCESS 0x40
789 #define SL_INVOKE_ON_ERROR 0x80
791 #include <pshpack1.h>
792 typedef struct _IO_STACK_LOCATION {
799 PIO_SECURITY_CONTEXT SecurityContext;
801 USHORT POINTER_ALIGNMENT FileAttributes;
803 ULONG POINTER_ALIGNMENT EaLength;
807 ULONG POINTER_ALIGNMENT Key;
808 LARGE_INTEGER ByteOffset;
812 ULONG POINTER_ALIGNMENT Key;
813 LARGE_INTEGER ByteOffset;
817 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
821 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass;
822 PFILE_OBJECT FileObject;
825 BOOLEAN ReplaceIfExists;
834 FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass;
837 ULONG OutputBufferLength;
838 ULONG POINTER_ALIGNMENT InputBufferLength;
839 ULONG POINTER_ALIGNMENT IoControlCode;
840 PVOID Type3InputBuffer;
843 SECURITY_INFORMATION SecurityInformation;
844 ULONG POINTER_ALIGNMENT Length;
847 SECURITY_INFORMATION SecurityInformation;
848 PSECURITY_DESCRIPTOR SecurityDescriptor;
852 PDEVICE_OBJECT DeviceObject;
856 PDEVICE_OBJECT DeviceObject;
859 struct _SCSI_REQUEST_BLOCK *Srb;
862 DEVICE_RELATION_TYPE Type;
863 } QueryDeviceRelations;
865 CONST GUID *InterfaceType;
868 PINTERFACE Interface;
869 PVOID InterfaceSpecificData;
872 PDEVICE_CAPABILITIES Capabilities;
873 } DeviceCapabilities;
875 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList;
876 } FilterResourceRequirements;
881 ULONG POINTER_ALIGNMENT Length;
887 BUS_QUERY_ID_TYPE IdType;
890 DEVICE_TEXT_TYPE DeviceTextType;
891 LCID POINTER_ALIGNMENT LocaleId;
896 DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type;
899 SYSTEM_POWER_STATE PowerState;
902 PPOWER_SEQUENCE PowerSequence;
906 POWER_STATE_TYPE POINTER_ALIGNMENT Type;
907 POWER_STATE POINTER_ALIGNMENT State;
908 POWER_ACTION POINTER_ALIGNMENT ShutdownType;
911 PCM_RESOURCE_LIST AllocatedResources;
912 PCM_RESOURCE_LIST AllocatedResourcesTranslated;
915 ULONG_PTR ProviderId;
927 PDEVICE_OBJECT DeviceObject;
928 PFILE_OBJECT FileObject;
929 PIO_COMPLETION_ROUTINE CompletionRoutine;
931 } IO_STACK_LOCATION, *PIO_STACK_LOCATION;
934 typedef struct _MDL {
938 struct _EPROCESS *Process;
939 PVOID MappedSystemVa;
945 typedef struct _KTIMER {
946 DISPATCHER_HEADER Header;
947 ULARGE_INTEGER DueTime;
948 LIST_ENTRY TimerListEntry;
953 typedef struct _KSYSTEM_TIME {
957 } KSYSTEM_TIME, *PKSYSTEM_TIME;
959 typedef enum _NT_PRODUCT_TYPE {
963 } NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
965 #define PROCESSOR_FEATURE_MAX 64
967 typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
972 } ALTERNATIVE_ARCHITECTURE_TYPE;
974 typedef struct _KUSER_SHARED_DATA {
975 ULONG TickCountLowDeprecated;
976 ULONG TickCountMultiplier;
977 volatile KSYSTEM_TIME InterruptTime;
978 volatile KSYSTEM_TIME SystemTime;
979 volatile KSYSTEM_TIME TimeZoneBias;
980 USHORT ImageNumberLow;
981 USHORT ImageNumberHigh;
982 WCHAR NtSystemRoot[260];
983 ULONG MaxStckTraceDepth;
984 ULONG CryptoExponent;
986 ULONG LargePageMinimum;
988 NT_PRODUCT_TYPE NtProductType;
989 BOOLEAN ProductTypeIsValid;
990 ULONG MajorNtVersion;
991 ULONG MinorNtVersion;
992 BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
995 volatile ULONG TimeSlip;
996 ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
997 LARGE_INTEGER SystemExpirationDate;
999 BOOLEAN KdDebuggerEnabled;
1000 volatile ULONG ActiveConsoleId;
1001 volatile ULONG DismountCount;
1002 ULONG ComPlusPackage;
1003 ULONG LastSystemRITEventTickCount;
1004 ULONG NumberOfPhysicalPages;
1005 BOOLEAN SafeBootMode;
1008 ULONGLONG SystemCall[4];
1010 volatile KSYSTEM_TIME TickCount;
1011 volatile ULONG64 TickCountQuad;
1013 } KSHARED_USER_DATA, *PKSHARED_USER_DATA;
1015 typedef enum _MM_SYSTEM_SIZE
1022 NTSTATUS WINAPI ObCloseHandle(IN HANDLE handle);
1024 #define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.CurrentStackLocation)
1026 #define KernelMode 0
1029 /* directory object access rights */
1030 #define DIRECTORY_QUERY 0x0001
1031 #define DIRECTORY_TRAVERSE 0x0002
1032 #define DIRECTORY_CREATE_OBJECT 0x0004
1033 #define DIRECTORY_CREATE_SUBDIRECTORY 0x0008
1034 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
1036 /* symbolic link access rights */
1037 #define SYMBOLIC_LINK_QUERY 0x0001
1038 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
1040 PVOID WINAPI ExAllocatePool(POOL_TYPE,SIZE_T);
1041 PVOID WINAPI ExAllocatePoolWithQuota(POOL_TYPE,SIZE_T);
1042 PVOID WINAPI ExAllocatePoolWithTag(POOL_TYPE,SIZE_T,ULONG);
1043 PVOID WINAPI ExAllocatePoolWithQuotaTag(POOL_TYPE,SIZE_T,ULONG);
1044 void WINAPI ExFreePool(PVOID);
1045 void WINAPI ExFreePoolWithTag(PVOID,ULONG);
1047 NTSTATUS WINAPI IoAllocateDriverObjectExtension(PDRIVER_OBJECT,PVOID,ULONG,PVOID*);
1048 PVOID WINAPI IoAllocateErrorLogEntry(PVOID,UCHAR);
1049 PIRP WINAPI IoAllocateIrp(CCHAR,BOOLEAN);
1050 NTSTATUS WINAPI IoCreateDevice(DRIVER_OBJECT*,ULONG,UNICODE_STRING*,DEVICE_TYPE,ULONG,BOOLEAN,DEVICE_OBJECT**);
1051 NTSTATUS WINAPI IoCreateDriver(UNICODE_STRING*,PDRIVER_INITIALIZE);
1052 NTSTATUS WINAPI IoCreateSymbolicLink(UNICODE_STRING*,UNICODE_STRING*);
1053 void WINAPI IoDeleteDevice(DEVICE_OBJECT*);
1054 void WINAPI IoDeleteDriver(DRIVER_OBJECT*);
1055 NTSTATUS WINAPI IoDeleteSymbolicLink(UNICODE_STRING*);
1056 void WINAPI IoFreeIrp(IRP*);
1057 PEPROCESS WINAPI IoGetCurrentProcess(void);
1058 NTSTATUS WINAPI IoGetDeviceObjectPointer(UNICODE_STRING*,ACCESS_MASK,PFILE_OBJECT*,PDEVICE_OBJECT*);
1059 PVOID WINAPI IoGetDriverObjectExtension(PDRIVER_OBJECT,PVOID);
1060 PDEVICE_OBJECT WINAPI IoGetRelatedDeviceObject(PFILE_OBJECT);
1061 void WINAPI IoInitializeIrp(IRP*,USHORT,CCHAR);
1063 PKTHREAD WINAPI KeGetCurrentThread(void);
1064 void WINAPI KeQuerySystemTime(LARGE_INTEGER*);
1065 void WINAPI KeQueryTickCount(LARGE_INTEGER*);
1066 ULONG WINAPI KeQueryTimeIncrement(void);
1067 LONG WINAPI KeReleaseSemaphore(PRKSEMAPHORE,KPRIORITY,LONG,BOOLEAN);
1068 KPRIORITY WINAPI KeSetPriorityThread(PKTHREAD,KPRIORITY);
1070 PVOID WINAPI MmAllocateContiguousMemory(SIZE_T,PHYSICAL_ADDRESS);
1071 PVOID WINAPI MmAllocateNonCachedMemory(SIZE_T);
1072 PMDL WINAPI MmAllocatePagesForMdl(PHYSICAL_ADDRESS,PHYSICAL_ADDRESS,PHYSICAL_ADDRESS,SIZE_T);
1073 void WINAPI MmFreeNonCachedMemory(PVOID,SIZE_T);
1074 MM_SYSTEMSIZE WINAPI MmQuerySystemSize(void);
1076 NTSTATUS WINAPI ObReferenceObjectByHandle(HANDLE,ACCESS_MASK,POBJECT_TYPE,KPROCESSOR_MODE,PVOID*,POBJECT_HANDLE_INFORMATION);
1078 NTSTATUS WINAPI PsCreateSystemThread(PHANDLE,ULONG,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PKSTART_ROUTINE,PVOID);
1079 #define PsGetCurrentProcess() IoGetCurrentProcess()
1080 #define PsGetCurrentThread() ((PETHREAD)KeGetCurrentThread())
1081 HANDLE WINAPI PsGetCurrentProcessId(void);
1082 HANDLE WINAPI PsGetCurrentThreadId(void);
1083 BOOLEAN WINAPI PsGetVersion(ULONG*,ULONG*,ULONG*,UNICODE_STRING*);
1084 NTSTATUS WINAPI PsTerminateSystemThread(NTSTATUS);
1086 NTSTATUS WINAPI ZwAddBootEntry(PUNICODE_STRING,PUNICODE_STRING);
1087 NTSTATUS WINAPI ZwAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN);
1088 NTSTATUS WINAPI ZwAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1089 NTSTATUS WINAPI ZwAlertThread(HANDLE ThreadHandle);
1090 NTSTATUS WINAPI ZwAllocateVirtualMemory(HANDLE,PVOID*,ULONG,SIZE_T*,ULONG,ULONG);
1091 NTSTATUS WINAPI ZwCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
1092 NTSTATUS WINAPI ZwCancelTimer(HANDLE, BOOLEAN*);
1093 NTSTATUS WINAPI ZwClearEvent(HANDLE);
1094 NTSTATUS WINAPI ZwClose(HANDLE);
1095 NTSTATUS WINAPI ZwCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
1096 NTSTATUS WINAPI ZwConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
1097 NTSTATUS WINAPI ZwCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1098 NTSTATUS WINAPI ZwCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1099 NTSTATUS WINAPI ZwCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
1100 NTSTATUS WINAPI ZwCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1101 NTSTATUS WINAPI ZwCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
1102 NTSTATUS WINAPI ZwCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
1103 NTSTATUS WINAPI ZwCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
1104 NTSTATUS WINAPI ZwDeleteAtom(RTL_ATOM);
1105 NTSTATUS WINAPI ZwDeleteFile(POBJECT_ATTRIBUTES);
1106 NTSTATUS WINAPI ZwDeleteKey(HANDLE);
1107 NTSTATUS WINAPI ZwDeleteValueKey(HANDLE,const UNICODE_STRING *);
1108 NTSTATUS WINAPI ZwDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1109 NTSTATUS WINAPI ZwDisplayString(PUNICODE_STRING);
1110 NTSTATUS WINAPI ZwDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
1111 NTSTATUS WINAPI ZwDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
1112 NTSTATUS WINAPI ZwEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1113 NTSTATUS WINAPI ZwEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1114 NTSTATUS WINAPI ZwFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
1115 NTSTATUS WINAPI ZwFlushKey(HANDLE);
1116 NTSTATUS WINAPI ZwFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
1117 NTSTATUS WINAPI ZwFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1118 NTSTATUS WINAPI ZwFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1119 NTSTATUS WINAPI ZwInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
1120 NTSTATUS WINAPI ZwLoadDriver(const UNICODE_STRING *);
1121 NTSTATUS WINAPI ZwLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
1122 NTSTATUS WINAPI ZwLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1123 NTSTATUS WINAPI ZwMakeTemporaryObject(HANDLE);
1124 NTSTATUS WINAPI ZwMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
1125 NTSTATUS WINAPI ZwNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
1126 NTSTATUS WINAPI ZwOpenDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1127 NTSTATUS WINAPI ZwOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1128 NTSTATUS WINAPI ZwOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
1129 NTSTATUS WINAPI ZwOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1130 NTSTATUS WINAPI ZwOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1131 NTSTATUS WINAPI ZwOpenProcessToken(HANDLE,DWORD,HANDLE *);
1132 NTSTATUS WINAPI ZwOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1133 NTSTATUS WINAPI ZwOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1134 NTSTATUS WINAPI ZwOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1135 NTSTATUS WINAPI ZwOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
1136 NTSTATUS WINAPI ZwOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
1137 NTSTATUS WINAPI ZwPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
1138 NTSTATUS WINAPI ZwPulseEvent(HANDLE,PULONG);
1139 NTSTATUS WINAPI ZwQueryDefaultLocale(BOOLEAN,LCID*);
1140 NTSTATUS WINAPI ZwQueryDefaultUILanguage(LANGID*);
1141 NTSTATUS WINAPI ZwQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
1142 NTSTATUS WINAPI ZwQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
1143 NTSTATUS WINAPI ZwQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN);
1144 NTSTATUS WINAPI ZwQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
1145 NTSTATUS WINAPI ZwQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
1146 NTSTATUS WINAPI ZwQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1147 NTSTATUS WINAPI ZwQueryInformationToken(HANDLE,DWORD,PVOID,DWORD,LPDWORD);
1148 NTSTATUS WINAPI ZwQueryInstallUILanguage(LANGID*);
1149 NTSTATUS WINAPI ZwQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1150 NTSTATUS WINAPI ZwQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
1151 NTSTATUS WINAPI ZwQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1152 NTSTATUS WINAPI ZwQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1153 NTSTATUS WINAPI ZwQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
1154 NTSTATUS WINAPI ZwQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1155 NTSTATUS WINAPI ZwQueryTimerResolution(PULONG,PULONG,PULONG);
1156 NTSTATUS WINAPI ZwQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
1157 NTSTATUS WINAPI ZwQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1158 NTSTATUS WINAPI ZwReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
1159 NTSTATUS WINAPI ZwReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
1160 NTSTATUS WINAPI ZwRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
1161 NTSTATUS WINAPI ZwResetEvent(HANDLE,PULONG);
1162 NTSTATUS WINAPI ZwRestoreKey(HANDLE,HANDLE,ULONG);
1163 NTSTATUS WINAPI ZwSaveKey(HANDLE,HANDLE);
1164 NTSTATUS WINAPI ZwSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
1165 NTSTATUS WINAPI ZwSetDefaultLocale(BOOLEAN,LCID);
1166 NTSTATUS WINAPI ZwSetDefaultUILanguage(LANGID);
1167 NTSTATUS WINAPI ZwSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
1168 NTSTATUS WINAPI ZwSetEvent(HANDLE,PULONG);
1169 NTSTATUS WINAPI ZwSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
1170 NTSTATUS WINAPI ZwSetInformationKey(HANDLE,const int,PVOID,ULONG);
1171 NTSTATUS WINAPI ZwSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
1172 NTSTATUS WINAPI ZwSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
1173 NTSTATUS WINAPI ZwSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
1174 NTSTATUS WINAPI ZwSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG);
1175 NTSTATUS WINAPI ZwSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1176 NTSTATUS WINAPI ZwSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
1177 NTSTATUS WINAPI ZwSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
1178 NTSTATUS WINAPI ZwSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
1179 NTSTATUS WINAPI ZwSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
1180 NTSTATUS WINAPI ZwSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1181 NTSTATUS WINAPI ZwSuspendThread(HANDLE,PULONG);
1182 NTSTATUS WINAPI ZwTerminateProcess(HANDLE,LONG);
1183 NTSTATUS WINAPI ZwUnloadDriver(const UNICODE_STRING *);
1184 NTSTATUS WINAPI ZwUnloadKey(HANDLE);
1185 NTSTATUS WINAPI ZwUnmapViewOfSection(HANDLE,PVOID);
1186 NTSTATUS WINAPI ZwWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1187 NTSTATUS WINAPI ZwWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
1188 NTSTATUS WINAPI ZwWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
1189 NTSTATUS WINAPI ZwYieldExecution(void);