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 _KDPC
{
66 LIST_ENTRY DpcListEntry
;
67 PKDEFERRED_ROUTINE DeferredRoutine
;
68 PVOID DeferredContext
;
69 PVOID SystemArgument1
;
70 PVOID SystemArgument2
;
72 } KDPC
, *PKDPC
, *RESTRICTED_POINTER PRKDPC
;
74 typedef struct _KDEVICE_QUEUE_ENTRY
{
75 LIST_ENTRY DeviceListEntry
;
78 } KDEVICE_QUEUE_ENTRY
, *PKDEVICE_QUEUE_ENTRY
,
79 *RESTRICTED_POINTER PRKDEVICE_QUEUE_ENTRY
;
81 typedef struct _KDEVICE_QUEUE
{
84 LIST_ENTRY DeviceListHead
;
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
;
95 } KMUTANT
, *PKMUTANT
, *RESTRICTED_POINTER PRKMUTANT
, KMUTEX
, *PKMUTEX
, *RESTRICTED_POINTER PRKMUTEX
;
97 typedef enum _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
148 } FAST_MUTEX
, *PFAST_MUTEX
;
150 #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR))
152 typedef struct _VPB
{
156 USHORT VolumeLabelLength
;
157 struct _DEVICE_OBJECT
*DeviceObject
;
158 struct _DEVICE_OBJECT
*RealDevice
;
160 ULONG ReferenceCount
;
161 WCHAR VolumeLabel
[MAXIMUM_VOLUME_LABEL_LENGTH
/ sizeof(WCHAR
)];
164 typedef enum _POOL_TYPE
{
167 NonPagedPoolMustSucceed
,
169 NonPagedPoolCacheAligned
,
170 PagedPoolCacheAligned
,
171 NonPagedPoolCacheAlignedMustS
,
175 typedef struct _WAIT_CONTEXT_BLOCK
{
176 KDEVICE_QUEUE_ENTRY WaitQueueEntry
;
177 struct _DRIVER_CONTROL
*DeviceRoutine
;
179 ULONG NumberOfMapRegisters
;
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
209 #define DEVICE_TYPE ULONG
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
{
288 struct _DRIVER_OBJECT
*DriverObject
;
289 struct _DEVICE_OBJECT
*NextDevice
;
290 struct _DEVICE_OBJECT
*AttachedDevice
;
291 struct _IRP
*CurrentIrp
;
294 ULONG Characteristics
;
296 PVOID DeviceExtension
;
297 DEVICE_TYPE DeviceType
;
300 LIST_ENTRY ListEntry
;
301 WAIT_CONTEXT_BLOCK Wcb
;
303 ULONG AlignmentRequirement
;
304 KDEVICE_QUEUE DeviceQueue
;
306 ULONG ActiveThreadCount
;
307 PSECURITY_DESCRIPTOR SecurityDescriptor
;
311 struct _DEVOBJ_EXTENSION
*DeviceObjectExtension
;
314 typedef struct _DEVICE_OBJECT
*PDEVICE_OBJECT
;
316 typedef struct _DRIVER_EXTENSION
{
317 struct _DRIVER_OBJECT
*DriverObject
;
320 UNICODE_STRING ServiceKeyName
;
321 } DRIVER_EXTENSION
, *PDRIVER_EXTENSION
;
323 typedef struct _DRIVER_OBJECT
{
326 PDEVICE_OBJECT DeviceObject
;
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];
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
{
369 struct _KTHREAD
*Thread
;
370 LIST_ENTRY ApcListEntry
;
371 PKKERNEL_ROUTINE KernelRoutine
;
372 PKRUNDOWN_ROUTINE RundownRoutine
;
373 PKNORMAL_ROUTINE NormalRoutine
;
375 PVOID SystemArgument1
;
376 PVOID SystemArgument2
;
378 KPROCESSOR_MODE ApcMode
;
380 } KAPC
, *PKAPC
, *RESTRICTED_POINTER PRKAPC
;
382 #include <pshpack1.h>
383 typedef struct _IRP
{
386 struct _MDL
*MdlAddress
;
389 struct _IRP
*MasterIrp
;
393 LIST_ENTRY ThreadListEntry
;
394 IO_STATUS_BLOCK IoStatus
;
395 KPROCESSOR_MODE RequestorMode
;
396 BOOLEAN PendingReturned
;
398 CHAR CurrentLocation
;
401 CCHAR ApcEnvironment
;
402 UCHAR AllocationFlags
;
403 PIO_STATUS_BLOCK UserIosb
;
407 PIO_APC_ROUTINE UserApcRoutine
;
408 PVOID UserApcContext
;
409 } AsynchronousParameters
;
410 LARGE_INTEGER AllocationSize
;
412 PDRIVER_CANCEL CancelRoutine
;
417 KDEVICE_QUEUE_ENTRY DeviceQueueEntry
;
419 PVOID DriverContext
[4];
423 PCHAR AuxiliaryBuffer
;
425 LIST_ENTRY ListEntry
;
427 struct _IO_STACK_LOCATION
*CurrentStackLocation
;
431 struct _FILE_OBJECT
*OriginalFileObject
;
437 typedef struct _IRP
*PIRP
;
440 /* MDL definitions */
442 typedef VOID (WINAPI
*PINTERFACE_REFERENCE
)(
445 typedef VOID (WINAPI
*PINTERFACE_DEREFERENCE
)(
448 typedef struct _INTERFACE
{
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
{
465 } IO_COMPLETION_CONTEXT
, *PIO_COMPLETION_CONTEXT
;
467 typedef enum _DEVICE_RELATION_TYPE
{
472 TargetDeviceRelation
,
474 } DEVICE_RELATION_TYPE
, *PDEVICE_RELATION_TYPE
;
476 typedef struct _FILE_OBJECT
{
479 PDEVICE_OBJECT DeviceObject
;
483 PSECTION_OBJECT_POINTERS SectionObjectPointer
;
484 PVOID PrivateCacheMap
;
485 NTSTATUS FinalStatus
;
486 struct _FILE_OBJECT
*RelatedFileObject
;
487 BOOLEAN LockOperation
;
488 BOOLEAN DeletePending
;
491 BOOLEAN DeleteAccess
;
494 BOOLEAN SharedDelete
;
496 UNICODE_STRING FileName
;
497 LARGE_INTEGER CurrentByteOffset
;
503 PIO_COMPLETION_CONTEXT CompletionContext
;
505 typedef struct _FILE_OBJECT
*PFILE_OBJECT
;
507 #define INITIAL_PRIVILEGE_COUNT 3
509 typedef struct _INITIAL_PRIVILEGE_SET
{
510 ULONG PrivilegeCount
;
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
{
524 BOOLEAN SecurityEvaluated
;
525 BOOLEAN GenerateAudit
;
526 BOOLEAN GenerateOnClose
;
527 BOOLEAN PrivilegesAllocated
;
529 ACCESS_MASK RemainingDesiredAccess
;
530 ACCESS_MASK PreviouslyGrantedAccess
;
531 ACCESS_MASK OriginalDesiredAccess
;
532 SECURITY_SUBJECT_CONTEXT SubjectSecurityContext
;
533 PSECURITY_DESCRIPTOR SecurityDescriptor
;
536 INITIAL_PRIVILEGE_SET InitialPrivilegeSet
;
537 PRIVILEGE_SET PrivilegeSet
;
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
{
557 ULONG LockSupported
: 1;
558 ULONG EjectSupported
: 1;
560 ULONG DockDevice
: 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;
576 DEVICE_POWER_STATE DeviceState
[PowerSystemMaximum
];
577 SYSTEM_POWER_STATE SystemWake
;
578 DEVICE_POWER_STATE DeviceWake
;
582 } DEVICE_CAPABILITIES
, *PDEVICE_CAPABILITIES
;
584 typedef enum _INTERFACE_TYPE
{
585 InterfaceTypeUndefined
= -1,
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
{
614 UCHAR ShareDisposition
;
622 PHYSICAL_ADDRESS MinimumAddress
;
623 PHYSICAL_ADDRESS MaximumAddress
;
628 PHYSICAL_ADDRESS MinimumAddress
;
629 PHYSICAL_ADDRESS MaximumAddress
;
636 ULONG MinimumChannel
;
637 ULONG MaximumChannel
;
642 PHYSICAL_ADDRESS MinimumAddress
;
643 PHYSICAL_ADDRESS MaximumAddress
;
660 } IO_RESOURCE_DESCRIPTOR
, *PIO_RESOURCE_DESCRIPTOR
;
662 typedef struct _IO_RESOURCE_LIST
{
666 IO_RESOURCE_DESCRIPTOR Descriptors
[1];
667 } IO_RESOURCE_LIST
, *PIO_RESOURCE_LIST
;
669 typedef struct _IO_RESOURCE_REQUIREMENTS_LIST
{
671 INTERFACE_TYPE InterfaceType
;
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
{
682 BusQueryCompatibleIDs
,
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
{
703 } POWER_SEQUENCE
, *PPOWER_SEQUENCE
;
705 typedef enum _POWER_STATE_TYPE
{
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
{
717 UCHAR ShareDisposition
;
721 PHYSICAL_ADDRESS Start
;
725 PHYSICAL_ADDRESS Start
;
734 PHYSICAL_ADDRESS Start
;
754 } DeviceSpecificData
;
756 } CM_PARTIAL_RESOURCE_DESCRIPTOR
, *PCM_PARTIAL_RESOURCE_DESCRIPTOR
;
758 typedef struct _CM_PARTIAL_RESOURCE_LIST
{
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
;
768 CM_PARTIAL_RESOURCE_LIST PartialResourceList
;
769 } CM_FULL_RESOURCE_DESCRIPTOR
, *PCM_FULL_RESOURCE_DESCRIPTOR
;
771 typedef struct _CM_RESOURCE_LIST
{
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
,
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
{
794 PIO_SECURITY_CONTEXT SecurityContext
;
796 USHORT POINTER_ALIGNMENT FileAttributes
;
798 ULONG POINTER_ALIGNMENT EaLength
;
802 ULONG POINTER_ALIGNMENT Key
;
803 LARGE_INTEGER ByteOffset
;
807 ULONG POINTER_ALIGNMENT Key
;
808 LARGE_INTEGER ByteOffset
;
812 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass
;
816 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass
;
817 PFILE_OBJECT FileObject
;
820 BOOLEAN ReplaceIfExists
;
829 FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass
;
832 ULONG OutputBufferLength
;
833 ULONG POINTER_ALIGNMENT InputBufferLength
;
834 ULONG POINTER_ALIGNMENT IoControlCode
;
835 PVOID Type3InputBuffer
;
838 SECURITY_INFORMATION SecurityInformation
;
839 ULONG POINTER_ALIGNMENT Length
;
842 SECURITY_INFORMATION SecurityInformation
;
843 PSECURITY_DESCRIPTOR SecurityDescriptor
;
847 PDEVICE_OBJECT DeviceObject
;
851 PDEVICE_OBJECT DeviceObject
;
854 struct _SCSI_REQUEST_BLOCK
*Srb
;
857 DEVICE_RELATION_TYPE Type
;
858 } QueryDeviceRelations
;
860 CONST GUID
*InterfaceType
;
863 PINTERFACE Interface
;
864 PVOID InterfaceSpecificData
;
867 PDEVICE_CAPABILITIES Capabilities
;
868 } DeviceCapabilities
;
870 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList
;
871 } FilterResourceRequirements
;
876 ULONG POINTER_ALIGNMENT Length
;
882 BUS_QUERY_ID_TYPE IdType
;
885 DEVICE_TEXT_TYPE DeviceTextType
;
886 LCID POINTER_ALIGNMENT LocaleId
;
891 DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type
;
894 SYSTEM_POWER_STATE PowerState
;
897 PPOWER_SEQUENCE PowerSequence
;
901 POWER_STATE_TYPE POINTER_ALIGNMENT Type
;
902 POWER_STATE POINTER_ALIGNMENT State
;
903 POWER_ACTION POINTER_ALIGNMENT ShutdownType
;
906 PCM_RESOURCE_LIST AllocatedResources
;
907 PCM_RESOURCE_LIST AllocatedResourcesTranslated
;
910 ULONG_PTR ProviderId
;
922 PDEVICE_OBJECT DeviceObject
;
923 PFILE_OBJECT FileObject
;
924 PIO_COMPLETION_ROUTINE CompletionRoutine
;
926 } IO_STACK_LOCATION
, *PIO_STACK_LOCATION
;
929 typedef struct _MDL
{
933 struct _EPROCESS
*Process
;
934 PVOID MappedSystemVa
;
940 typedef struct _KTIMER
{
941 DISPATCHER_HEADER Header
;
942 ULARGE_INTEGER DueTime
;
943 LIST_ENTRY TimerListEntry
;
948 typedef struct _KSYSTEM_TIME
{
952 } KSYSTEM_TIME
, *PKSYSTEM_TIME
;
954 typedef enum _NT_PRODUCT_TYPE
{
958 } NT_PRODUCT_TYPE
, *PNT_PRODUCT_TYPE
;
960 #define PROCESSOR_FEATURE_MAX 64
962 typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
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
;
981 ULONG LargePageMinimum
;
983 NT_PRODUCT_TYPE NtProductType
;
984 BOOLEAN ProductTypeIsValid
;
985 ULONG MajorNtVersion
;
986 ULONG MinorNtVersion
;
987 BOOLEAN ProcessorFeatures
[PROCESSOR_FEATURE_MAX
];
990 volatile ULONG TimeSlip
;
991 ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture
;
992 LARGE_INTEGER SystemExpirationDate
;
994 BOOLEAN KdDebuggerEnabled
;
995 volatile ULONG ActiveConsoleId
;
996 volatile ULONG DismountCount
;
997 ULONG ComPlusPackage
;
998 ULONG LastSystemRITEventTickCount
;
999 ULONG NumberOfPhysicalPages
;
1000 BOOLEAN SafeBootMode
;
1003 ULONGLONG SystemCall
[4];
1005 volatile KSYSTEM_TIME TickCount
;
1006 volatile ULONG64 TickCountQuad
;
1008 } KSHARED_USER_DATA
, *PKSHARED_USER_DATA
;
1010 typedef enum _MM_SYSTEM_SIZE
1017 NTSTATUS WINAPI
ObCloseHandle(IN HANDLE handle
);
1019 #define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.CurrentStackLocation)
1021 #define KernelMode 0
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);