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 _PAGED_LOOKASIDE_LIST
*PPAGED_LOOKASIDE_LIST
;
143 typedef struct _OBJECT_TYPE
*POBJECT_TYPE
;
144 typedef struct _OBJECT_HANDLE_INFORMATION
*POBJECT_HANDLE_INFORMATION
;
145 typedef struct _ZONE_HEADER
*PZONE_HEADER
;
147 typedef struct _FAST_MUTEX
154 } FAST_MUTEX
, *PFAST_MUTEX
;
156 #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR))
158 typedef struct _VPB
{
162 USHORT VolumeLabelLength
;
163 struct _DEVICE_OBJECT
*DeviceObject
;
164 struct _DEVICE_OBJECT
*RealDevice
;
166 ULONG ReferenceCount
;
167 WCHAR VolumeLabel
[MAXIMUM_VOLUME_LABEL_LENGTH
/ sizeof(WCHAR
)];
170 typedef enum _POOL_TYPE
{
173 NonPagedPoolMustSucceed
,
175 NonPagedPoolCacheAligned
,
176 PagedPoolCacheAligned
,
177 NonPagedPoolCacheAlignedMustS
,
181 typedef struct _WAIT_CONTEXT_BLOCK
{
182 KDEVICE_QUEUE_ENTRY WaitQueueEntry
;
183 struct _DRIVER_CONTROL
*DeviceRoutine
;
185 ULONG NumberOfMapRegisters
;
188 PKDPC BufferChainingDpc
;
189 } WAIT_CONTEXT_BLOCK
, *PWAIT_CONTEXT_BLOCK
;
191 #define DO_BUFFERED_IO 0x00000004
192 #define DO_EXCLUSIVE 0x00000008
193 #define DO_DIRECT_IO 0x00000010
194 #define DO_MAP_IO_BUFFER 0x00000020
195 #define DO_DEVICE_INITIALIZING 0x00000080
196 #define DO_SHUTDOWN_REGISTERED 0x00000800
197 #define DO_BUS_ENUMERATED_DEVICE 0x00001000
198 #define DO_POWER_PAGABLE 0x00002000
199 #define DO_POWER_INRUSH 0x00004000
201 #define IO_NO_INCREMENT 0
202 #define IO_CD_ROM_INCREMENT 1
203 #define IO_DISK_INCREMENT 1
204 #define IO_KEYBOARD_INCREMENT 6
205 #define IO_MAILSLOT_INCREMENT 2
206 #define IO_MOUSE_INCREMENT 6
207 #define IO_NAMED_PIPE_INCREMENT 2
208 #define IO_NETWORK_INCREMENT 2
209 #define IO_PARALLEL_INCREMENT 1
210 #define IO_SERIAL_INCREMENT 2
211 #define IO_SOUND_INCREMENT 8
212 #define IO_VIDEO_INCREMENT 1
215 #define DEVICE_TYPE ULONG
217 #define IRP_MJ_MAXIMUM_FUNCTION 0x1b
218 #define IRP_MJ_CREATE 0x00
219 #define IRP_MJ_CREATE_NAMED_PIPE 0x01
220 #define IRP_MJ_CLOSE 0x02
221 #define IRP_MJ_READ 0x03
222 #define IRP_MJ_WRITE 0x04
223 #define IRP_MJ_QUERY_INFORMATION 0x05
224 #define IRP_MJ_SET_INFORMATION 0x06
225 #define IRP_MJ_QUERY_EA 0x07
226 #define IRP_MJ_SET_EA 0x08
227 #define IRP_MJ_FLUSH_BUFFERS 0x09
228 #define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a
229 #define IRP_MJ_SET_VOLUME_INFORMATION 0x0b
230 #define IRP_MJ_DIRECTORY_CONTROL 0x0c
231 #define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d
232 #define IRP_MJ_DEVICE_CONTROL 0x0e
233 #define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f
234 #define IRP_MJ_SHUTDOWN 0x10
235 #define IRP_MJ_LOCK_CONTROL 0x11
236 #define IRP_MJ_CLEANUP 0x12
237 #define IRP_MJ_CREATE_MAILSLOT 0x13
238 #define IRP_MJ_QUERY_SECURITY 0x14
239 #define IRP_MJ_SET_SECURITY 0x15
240 #define IRP_MJ_POWER 0x16
241 #define IRP_MJ_SYSTEM_CONTROL 0x17
242 #define IRP_MJ_DEVICE_CHANGE 0x18
243 #define IRP_MJ_QUERY_QUOTA 0x19
244 #define IRP_MJ_SET_QUOTA 0x1a
245 #define IRP_MJ_PNP 0x1b
247 #define IRP_MN_START_DEVICE 0x00
248 #define IRP_MN_QUERY_REMOVE_DEVICE 0x01
249 #define IRP_MN_REMOVE_DEVICE 0x02
250 #define IRP_MN_CANCEL_REMOVE_DEVICE 0x03
251 #define IRP_MN_STOP_DEVICE 0x04
252 #define IRP_MN_QUERY_STOP_DEVICE 0x05
253 #define IRP_MN_CANCEL_STOP_DEVICE 0x06
254 #define IRP_MN_QUERY_DEVICE_RELATIONS 0x07
255 #define IRP_MN_QUERY_INTERFACE 0x08
256 #define IRP_MN_QUERY_CAPABILITIES 0x09
257 #define IRP_MN_QUERY_RESOURCES 0x0A
258 #define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B
259 #define IRP_MN_QUERY_DEVICE_TEXT 0x0C
260 #define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
261 #define IRP_MN_READ_CONFIG 0x0F
262 #define IRP_MN_WRITE_CONFIG 0x10
263 #define IRP_MN_EJECT 0x11
264 #define IRP_MN_SET_LOCK 0x12
265 #define IRP_MN_QUERY_ID 0x13
266 #define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14
267 #define IRP_MN_QUERY_BUS_INFORMATION 0x15
268 #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16
269 #define IRP_MN_SURPRISE_REMOVAL 0x17
270 #define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
272 #define IRP_QUOTA_CHARGED 0x01
273 #define IRP_ALLOCATED_MUST_SUCCEED 0x02
274 #define IRP_ALLOCATED_FIXED_SIZE 0x04
275 #define IRP_LOOKASIDE_ALLOCATION 0x08
277 #define IO_TYPE_ADAPTER 0x01
278 #define IO_TYPE_CONTROLLER 0x02
279 #define IO_TYPE_DEVICE 0x03
280 #define IO_TYPE_DRIVER 0x04
281 #define IO_TYPE_FILE 0x05
282 #define IO_TYPE_IRP 0x06
283 #define IO_TYPE_MASTER_ADAPTER 0x07
284 #define IO_TYPE_OPEN_PACKET 0x08
285 #define IO_TYPE_TIMER 0x09
286 #define IO_TYPE_VPB 0x0a
287 #define IO_TYPE_ERROR_LOG 0x0b
288 #define IO_TYPE_ERROR_MESSAGE 0x0c
289 #define IO_TYPE_DEVICE_OBJECT_EXTENSION 0x0d
291 typedef struct _DEVICE_OBJECT
{
295 struct _DRIVER_OBJECT
*DriverObject
;
296 struct _DEVICE_OBJECT
*NextDevice
;
297 struct _DEVICE_OBJECT
*AttachedDevice
;
298 struct _IRP
*CurrentIrp
;
301 ULONG Characteristics
;
303 PVOID DeviceExtension
;
304 DEVICE_TYPE DeviceType
;
307 LIST_ENTRY ListEntry
;
308 WAIT_CONTEXT_BLOCK Wcb
;
310 ULONG AlignmentRequirement
;
311 KDEVICE_QUEUE DeviceQueue
;
313 ULONG ActiveThreadCount
;
314 PSECURITY_DESCRIPTOR SecurityDescriptor
;
318 struct _DEVOBJ_EXTENSION
*DeviceObjectExtension
;
321 typedef struct _DEVICE_OBJECT
*PDEVICE_OBJECT
;
323 typedef struct _DEVICE_RELATIONS
{
325 PDEVICE_OBJECT Objects
[1];
327 typedef struct _DEVICE_RELATIONS
*PDEVICE_RELATIONS
;
329 typedef struct _DRIVER_EXTENSION
{
330 struct _DRIVER_OBJECT
*DriverObject
;
333 UNICODE_STRING ServiceKeyName
;
334 } DRIVER_EXTENSION
, *PDRIVER_EXTENSION
;
336 typedef struct _DRIVER_OBJECT
{
339 PDEVICE_OBJECT DeviceObject
;
344 PDRIVER_EXTENSION DriverExtension
;
345 UNICODE_STRING DriverName
;
346 PUNICODE_STRING HardwareDatabase
;
347 PVOID FastIoDispatch
;
348 PDRIVER_INITIALIZE DriverInit
;
349 PDRIVER_STARTIO DriverStartIo
;
350 PDRIVER_UNLOAD DriverUnload
;
351 PDRIVER_DISPATCH MajorFunction
[IRP_MJ_MAXIMUM_FUNCTION
+ 1];
353 typedef struct _DRIVER_OBJECT
*PDRIVER_OBJECT
;
355 /* Irp definitions */
356 typedef UCHAR KIRQL
, *PKIRQL
;
357 typedef CCHAR KPROCESSOR_MODE
;
359 typedef VOID (WINAPI
*PDRIVER_CANCEL
)(
360 IN
struct _DEVICE_OBJECT
*DeviceObject
,
361 IN
struct _IRP
*Irp
);
363 typedef VOID (WINAPI
*PKNORMAL_ROUTINE
)(
364 IN PVOID NormalContext
,
365 IN PVOID SystemArgument1
,
366 IN PVOID SystemArgument2
);
368 typedef VOID (WINAPI
*PKKERNEL_ROUTINE
)(
369 IN
struct _KAPC
*Apc
,
370 IN OUT PKNORMAL_ROUTINE
*NormalRoutine
,
371 IN OUT PVOID
*NormalContext
,
372 IN OUT PVOID
*SystemArgument1
,
373 IN OUT PVOID
*SystemArgument2
);
375 typedef VOID (WINAPI
*PKRUNDOWN_ROUTINE
)(
376 IN
struct _KAPC
*Apc
);
378 typedef struct _KAPC
{
382 struct _KTHREAD
*Thread
;
383 LIST_ENTRY ApcListEntry
;
384 PKKERNEL_ROUTINE KernelRoutine
;
385 PKRUNDOWN_ROUTINE RundownRoutine
;
386 PKNORMAL_ROUTINE NormalRoutine
;
388 PVOID SystemArgument1
;
389 PVOID SystemArgument2
;
391 KPROCESSOR_MODE ApcMode
;
393 } KAPC
, *PKAPC
, *RESTRICTED_POINTER PRKAPC
;
395 #include <pshpack1.h>
396 typedef struct _IRP
{
399 struct _MDL
*MdlAddress
;
402 struct _IRP
*MasterIrp
;
406 LIST_ENTRY ThreadListEntry
;
407 IO_STATUS_BLOCK IoStatus
;
408 KPROCESSOR_MODE RequestorMode
;
409 BOOLEAN PendingReturned
;
411 CHAR CurrentLocation
;
414 CCHAR ApcEnvironment
;
415 UCHAR AllocationFlags
;
416 PIO_STATUS_BLOCK UserIosb
;
420 PIO_APC_ROUTINE UserApcRoutine
;
421 PVOID UserApcContext
;
422 } AsynchronousParameters
;
423 LARGE_INTEGER AllocationSize
;
425 PDRIVER_CANCEL CancelRoutine
;
430 KDEVICE_QUEUE_ENTRY DeviceQueueEntry
;
432 PVOID DriverContext
[4];
436 PCHAR AuxiliaryBuffer
;
438 LIST_ENTRY ListEntry
;
440 struct _IO_STACK_LOCATION
*CurrentStackLocation
;
444 struct _FILE_OBJECT
*OriginalFileObject
;
450 typedef struct _IRP
*PIRP
;
453 typedef VOID (WINAPI
*PINTERFACE_REFERENCE
)(
456 typedef VOID (WINAPI
*PINTERFACE_DEREFERENCE
)(
459 typedef struct _INTERFACE
{
463 PINTERFACE_REFERENCE InterfaceReference
;
464 PINTERFACE_DEREFERENCE InterfaceDereference
;
465 } INTERFACE
, *PINTERFACE
;
467 typedef struct _SECTION_OBJECT_POINTERS
{
468 PVOID DataSectionObject
;
469 PVOID SharedCacheMap
;
470 PVOID ImageSectionObject
;
471 } SECTION_OBJECT_POINTERS
, *PSECTION_OBJECT_POINTERS
;
473 typedef struct _IO_COMPLETION_CONTEXT
{
476 } IO_COMPLETION_CONTEXT
, *PIO_COMPLETION_CONTEXT
;
478 typedef enum _DEVICE_RELATION_TYPE
{
483 TargetDeviceRelation
,
485 } DEVICE_RELATION_TYPE
, *PDEVICE_RELATION_TYPE
;
487 typedef struct _FILE_OBJECT
{
490 PDEVICE_OBJECT DeviceObject
;
494 PSECTION_OBJECT_POINTERS SectionObjectPointer
;
495 PVOID PrivateCacheMap
;
496 NTSTATUS FinalStatus
;
497 struct _FILE_OBJECT
*RelatedFileObject
;
498 BOOLEAN LockOperation
;
499 BOOLEAN DeletePending
;
502 BOOLEAN DeleteAccess
;
505 BOOLEAN SharedDelete
;
507 UNICODE_STRING FileName
;
508 LARGE_INTEGER CurrentByteOffset
;
514 PIO_COMPLETION_CONTEXT CompletionContext
;
516 typedef struct _FILE_OBJECT
*PFILE_OBJECT
;
518 #define INITIAL_PRIVILEGE_COUNT 3
520 typedef struct _INITIAL_PRIVILEGE_SET
{
521 ULONG PrivilegeCount
;
523 LUID_AND_ATTRIBUTES Privilege
[INITIAL_PRIVILEGE_COUNT
];
524 } INITIAL_PRIVILEGE_SET
, * PINITIAL_PRIVILEGE_SET
;
526 typedef struct _SECURITY_SUBJECT_CONTEXT
{
527 PACCESS_TOKEN ClientToken
;
528 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
529 PACCESS_TOKEN PrimaryToken
;
530 PVOID ProcessAuditId
;
531 } SECURITY_SUBJECT_CONTEXT
, *PSECURITY_SUBJECT_CONTEXT
;
533 typedef struct _ACCESS_STATE
{
535 BOOLEAN SecurityEvaluated
;
536 BOOLEAN GenerateAudit
;
537 BOOLEAN GenerateOnClose
;
538 BOOLEAN PrivilegesAllocated
;
540 ACCESS_MASK RemainingDesiredAccess
;
541 ACCESS_MASK PreviouslyGrantedAccess
;
542 ACCESS_MASK OriginalDesiredAccess
;
543 SECURITY_SUBJECT_CONTEXT SubjectSecurityContext
;
544 PSECURITY_DESCRIPTOR SecurityDescriptor
;
547 INITIAL_PRIVILEGE_SET InitialPrivilegeSet
;
548 PRIVILEGE_SET PrivilegeSet
;
551 BOOLEAN AuditPrivileges
;
552 UNICODE_STRING ObjectName
;
553 UNICODE_STRING ObjectTypeName
;
554 } ACCESS_STATE
, *PACCESS_STATE
;
556 typedef struct _IO_SECURITY_CONTEXT
{
557 PSECURITY_QUALITY_OF_SERVICE SecurityQos
;
558 PACCESS_STATE AccessState
;
559 ACCESS_MASK DesiredAccess
;
560 ULONG FullCreateOptions
;
561 } IO_SECURITY_CONTEXT
, *PIO_SECURITY_CONTEXT
;
563 typedef struct _DEVICE_CAPABILITIES
{
568 ULONG LockSupported
: 1;
569 ULONG EjectSupported
: 1;
571 ULONG DockDevice
: 1;
573 ULONG SilentInstall
: 1;
574 ULONG RawDeviceOK
: 1;
575 ULONG SurpriseRemovalOK
: 1;
576 ULONG WakeFromD0
: 1;
577 ULONG WakeFromD1
: 1;
578 ULONG WakeFromD2
: 1;
579 ULONG WakeFromD3
: 1;
580 ULONG HardwareDisabled
: 1;
581 ULONG NonDynamic
: 1;
582 ULONG WarmEjectSupported
: 1;
583 ULONG NoDisplayInUI
: 1;
587 DEVICE_POWER_STATE DeviceState
[PowerSystemMaximum
];
588 SYSTEM_POWER_STATE SystemWake
;
589 DEVICE_POWER_STATE DeviceWake
;
593 } DEVICE_CAPABILITIES
, *PDEVICE_CAPABILITIES
;
595 typedef struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION
{
599 GUID InterfaceClassGuid
;
600 PUNICODE_STRING SymbolicLinkName
;
601 } DEVICE_INTERFACE_CHANGE_NOTIFICATION
, *PDEVICE_INTERFACE_CHANGE_NOTIFICATION
;
603 typedef enum _INTERFACE_TYPE
{
604 InterfaceTypeUndefined
= -1,
622 } INTERFACE_TYPE
, *PINTERFACE_TYPE
;
624 typedef LARGE_INTEGER PHYSICAL_ADDRESS
, *PPHYSICAL_ADDRESS
;
626 #define IO_RESOURCE_PREFERRED 0x01
627 #define IO_RESOURCE_DEFAULT 0x02
628 #define IO_RESOURCE_ALTERNATIVE 0x08
630 typedef struct _IO_RESOURCE_DESCRIPTOR
{
633 UCHAR ShareDisposition
;
641 PHYSICAL_ADDRESS MinimumAddress
;
642 PHYSICAL_ADDRESS MaximumAddress
;
647 PHYSICAL_ADDRESS MinimumAddress
;
648 PHYSICAL_ADDRESS MaximumAddress
;
655 ULONG MinimumChannel
;
656 ULONG MaximumChannel
;
661 PHYSICAL_ADDRESS MinimumAddress
;
662 PHYSICAL_ADDRESS MaximumAddress
;
679 } IO_RESOURCE_DESCRIPTOR
, *PIO_RESOURCE_DESCRIPTOR
;
681 typedef struct _IO_RESOURCE_LIST
{
685 IO_RESOURCE_DESCRIPTOR Descriptors
[1];
686 } IO_RESOURCE_LIST
, *PIO_RESOURCE_LIST
;
688 typedef struct _IO_RESOURCE_REQUIREMENTS_LIST
{
690 INTERFACE_TYPE InterfaceType
;
694 ULONG AlternativeLists
;
695 IO_RESOURCE_LIST List
[1];
696 } IO_RESOURCE_REQUIREMENTS_LIST
, *PIO_RESOURCE_REQUIREMENTS_LIST
;
698 typedef enum _BUS_QUERY_ID_TYPE
{
701 BusQueryCompatibleIDs
,
703 BusQueryDeviceSerialNumber
704 } BUS_QUERY_ID_TYPE
, *PBUS_QUERY_ID_TYPE
;
707 DevicePropertyDeviceDescription
,
708 DevicePropertyHardwareID
,
709 DevicePropertyCompatibleIDs
,
710 DevicePropertyBootConfiguration
,
711 DevicePropertyBootConfigurationTranslated
,
712 DevicePropertyClassName
,
713 DevicePropertyClassGuid
,
714 DevicePropertyDriverKeyName
,
715 DevicePropertyManufacturer
,
716 DevicePropertyFriendlyName
,
717 DevicePropertyLocationInformation
,
718 DevicePropertyPhysicalDeviceObjectName
,
719 DevicePropertyBusTypeGuid
,
720 DevicePropertyLegacyBusType
,
721 DevicePropertyBusNumber
,
722 DevicePropertyEnumeratorName
,
723 DevicePropertyAddress
,
724 DevicePropertyUINumber
,
725 DevicePropertyInstallState
,
726 DevicePropertyRemovalPolicy
727 } DEVICE_REGISTRY_PROPERTY
;
729 typedef enum _DEVICE_TEXT_TYPE
{
730 DeviceTextDescription
,
731 DeviceTextLocationInformation
732 } DEVICE_TEXT_TYPE
, *PDEVICE_TEXT_TYPE
;
734 typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE
{
735 DeviceUsageTypeUndefined
,
736 DeviceUsageTypePaging
,
737 DeviceUsageTypeHibernation
,
738 DeviceUsageTypeDumpFile
739 } DEVICE_USAGE_NOTIFICATION_TYPE
;
741 typedef struct _POWER_SEQUENCE
{
745 } POWER_SEQUENCE
, *PPOWER_SEQUENCE
;
747 typedef enum _POWER_STATE_TYPE
{
750 } POWER_STATE_TYPE
, *PPOWER_STATE_TYPE
;
752 typedef union _POWER_STATE
{
753 SYSTEM_POWER_STATE SystemState
;
754 DEVICE_POWER_STATE DeviceState
;
755 } POWER_STATE
, *PPOWER_STATE
;
757 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
{
759 UCHAR ShareDisposition
;
763 PHYSICAL_ADDRESS Start
;
767 PHYSICAL_ADDRESS Start
;
776 PHYSICAL_ADDRESS Start
;
796 } DeviceSpecificData
;
798 } CM_PARTIAL_RESOURCE_DESCRIPTOR
, *PCM_PARTIAL_RESOURCE_DESCRIPTOR
;
800 typedef struct _CM_PARTIAL_RESOURCE_LIST
{
804 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors
[1];
805 } CM_PARTIAL_RESOURCE_LIST
, *PCM_PARTIAL_RESOURCE_LIST
;
807 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
{
808 INTERFACE_TYPE InterfaceType
;
810 CM_PARTIAL_RESOURCE_LIST PartialResourceList
;
811 } CM_FULL_RESOURCE_DESCRIPTOR
, *PCM_FULL_RESOURCE_DESCRIPTOR
;
813 typedef struct _CM_RESOURCE_LIST
{
815 CM_FULL_RESOURCE_DESCRIPTOR List
[1];
816 } CM_RESOURCE_LIST
, *PCM_RESOURCE_LIST
;
818 typedef NTSTATUS (WINAPI
*PIO_COMPLETION_ROUTINE
)(
819 IN
struct _DEVICE_OBJECT
*DeviceObject
,
823 #define SL_PENDING_RETURNED 0x01
824 #define SL_INVOKE_ON_CANCEL 0x20
825 #define SL_INVOKE_ON_SUCCESS 0x40
826 #define SL_INVOKE_ON_ERROR 0x80
828 #include <pshpack1.h>
829 typedef struct _IO_STACK_LOCATION
{
836 PIO_SECURITY_CONTEXT SecurityContext
;
838 USHORT POINTER_ALIGNMENT FileAttributes
;
840 ULONG POINTER_ALIGNMENT EaLength
;
844 ULONG POINTER_ALIGNMENT Key
;
845 LARGE_INTEGER ByteOffset
;
849 ULONG POINTER_ALIGNMENT Key
;
850 LARGE_INTEGER ByteOffset
;
854 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass
;
858 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass
;
859 PFILE_OBJECT FileObject
;
862 BOOLEAN ReplaceIfExists
;
871 FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass
;
874 ULONG OutputBufferLength
;
875 ULONG POINTER_ALIGNMENT InputBufferLength
;
876 ULONG POINTER_ALIGNMENT IoControlCode
;
877 PVOID Type3InputBuffer
;
880 SECURITY_INFORMATION SecurityInformation
;
881 ULONG POINTER_ALIGNMENT Length
;
884 SECURITY_INFORMATION SecurityInformation
;
885 PSECURITY_DESCRIPTOR SecurityDescriptor
;
889 PDEVICE_OBJECT DeviceObject
;
893 PDEVICE_OBJECT DeviceObject
;
896 struct _SCSI_REQUEST_BLOCK
*Srb
;
899 DEVICE_RELATION_TYPE Type
;
900 } QueryDeviceRelations
;
902 const GUID
*InterfaceType
;
905 PINTERFACE Interface
;
906 PVOID InterfaceSpecificData
;
909 PDEVICE_CAPABILITIES Capabilities
;
910 } DeviceCapabilities
;
912 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList
;
913 } FilterResourceRequirements
;
918 ULONG POINTER_ALIGNMENT Length
;
924 BUS_QUERY_ID_TYPE IdType
;
927 DEVICE_TEXT_TYPE DeviceTextType
;
928 LCID POINTER_ALIGNMENT LocaleId
;
933 DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type
;
936 SYSTEM_POWER_STATE PowerState
;
939 PPOWER_SEQUENCE PowerSequence
;
943 POWER_STATE_TYPE POINTER_ALIGNMENT Type
;
944 POWER_STATE POINTER_ALIGNMENT State
;
945 POWER_ACTION POINTER_ALIGNMENT ShutdownType
;
948 PCM_RESOURCE_LIST AllocatedResources
;
949 PCM_RESOURCE_LIST AllocatedResourcesTranslated
;
952 ULONG_PTR ProviderId
;
964 PDEVICE_OBJECT DeviceObject
;
965 PFILE_OBJECT FileObject
;
966 PIO_COMPLETION_ROUTINE CompletionRoutine
;
968 } IO_STACK_LOCATION
, *PIO_STACK_LOCATION
;
971 /* MDL definitions */
973 #define MDL_MAPPED_TO_SYSTEM_VA 0x0001
974 #define MDL_PAGES_LOCKED 0x0002
975 #define MDL_SOURCE_IS_NONPAGED_POOL 0x0004
976 #define MDL_ALLOCATED_FIXED_SIZE 0x0008
977 #define MDL_PARTIAL 0x0010
978 #define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020
979 #define MDL_IO_PAGE_READ 0x0040
980 #define MDL_WRITE_OPERATION 0x0080
981 #define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100
982 #define MDL_FREE_EXTRA_PTES 0x0200
983 #define MDL_DESCRIBES_AWE 0x0400
984 #define MDL_IO_SPACE 0x0800
985 #define MDL_NETWORK_HEADER 0x1000
986 #define MDL_MAPPING_CAN_FAIL 0x2000
987 #define MDL_ALLOCATED_MUST_SUCCEED 0x4000
988 #define MDL_INTERNAL 0x8000
990 #define MDL_MAPPING_FLAGS (MDL_MAPPED_TO_SYSTEM_VA | \
992 MDL_SOURCE_IS_NONPAGED_POOL | \
993 MDL_PARTIAL_HAS_BEEN_MAPPED | \
994 MDL_PARENT_MAPPED_SYSTEM_VA | \
998 typedef struct _MDL
{
1002 struct _EPROCESS
*Process
;
1003 PVOID MappedSystemVa
;
1011 typedef struct _KTIMER
{
1012 DISPATCHER_HEADER Header
;
1013 ULARGE_INTEGER DueTime
;
1014 LIST_ENTRY TimerListEntry
;
1019 typedef struct _KSYSTEM_TIME
{
1023 } KSYSTEM_TIME
, *PKSYSTEM_TIME
;
1025 typedef enum _NT_PRODUCT_TYPE
{
1029 } NT_PRODUCT_TYPE
, *PNT_PRODUCT_TYPE
;
1031 #define PROCESSOR_FEATURE_MAX 64
1033 typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
1038 } ALTERNATIVE_ARCHITECTURE_TYPE
;
1040 #define NX_SUPPORT_POLICY_ALWAYSOFF 0
1041 #define NX_SUPPORT_POLICY_ALWAYSON 1
1042 #define NX_SUPPORT_POLICY_OPTIN 2
1043 #define NX_SUPPORT_POLICY_OPTOUT 3
1045 #define MAX_WOW64_SHARED_ENTRIES 16
1047 typedef struct _KUSER_SHARED_DATA
{
1048 ULONG TickCountLowDeprecated
;
1049 ULONG TickCountMultiplier
;
1050 volatile KSYSTEM_TIME InterruptTime
;
1051 volatile KSYSTEM_TIME SystemTime
;
1052 volatile KSYSTEM_TIME TimeZoneBias
;
1053 USHORT ImageNumberLow
;
1054 USHORT ImageNumberHigh
;
1055 WCHAR NtSystemRoot
[260];
1056 ULONG MaxStackTraceDepth
;
1057 ULONG CryptoExponent
;
1059 ULONG LargePageMinimum
;
1061 NT_PRODUCT_TYPE NtProductType
;
1062 BOOLEAN ProductTypeIsValid
;
1063 ULONG NtMajorVersion
;
1064 ULONG NtMinorVersion
;
1065 BOOLEAN ProcessorFeatures
[PROCESSOR_FEATURE_MAX
];
1068 volatile ULONG TimeSlip
;
1069 ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture
;
1070 LARGE_INTEGER SystemExpirationDate
;
1072 BOOLEAN KdDebuggerEnabled
;
1073 UCHAR NXSupportPolicy
;
1074 volatile ULONG ActiveConsoleId
;
1075 volatile ULONG DismountCount
;
1076 ULONG ComPlusPackage
;
1077 ULONG LastSystemRITEventTickCount
;
1078 ULONG NumberOfPhysicalPages
;
1079 BOOLEAN SafeBootMode
;
1081 ULONGLONG TestRetInstruction
;
1083 ULONG SystemCallReturn
;
1084 ULONGLONG SystemCallPad
[3];
1086 volatile KSYSTEM_TIME TickCount
;
1087 volatile ULONG64 TickCountQuad
;
1090 ULONG Wow64SharedInformation
[MAX_WOW64_SHARED_ENTRIES
];
1091 } KSHARED_USER_DATA
, *PKSHARED_USER_DATA
;
1093 typedef enum _MEMORY_CACHING_TYPE
{
1096 MmWriteCombined
= 2,
1097 MmHardwareCoherentCached
= 3,
1098 MmNonCachedUnordered
= 4,
1100 MmMaximumCacheType
= 6
1101 } MEMORY_CACHING_TYPE
;
1103 typedef enum _MM_PAGE_PRIORITY
{
1105 NormalPagePriority
= 16,
1106 HighPagePriority
= 32
1109 typedef enum _MM_SYSTEM_SIZE
1116 typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK
{
1118 BOOLEAN Reserved
[3];
1121 } IO_REMOVE_LOCK_COMMON_BLOCK
;
1123 typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK
*PIO_REMOVE_LOCK_TRACKING_BLOCK
;
1125 typedef struct _IO_REMOVE_LOCK_DBG_BLOCK
{
1128 LONGLONG MaxLockedTicks
;
1130 LIST_ENTRY LockList
;
1132 LONG LowMemoryCount
;
1135 PIO_REMOVE_LOCK_TRACKING_BLOCK Blocks
;
1136 } IO_REMOVE_LOCK_DBG_BLOCK
;
1138 typedef struct _IO_REMOVE_LOCK
{
1139 IO_REMOVE_LOCK_COMMON_BLOCK Common
;
1140 IO_REMOVE_LOCK_DBG_BLOCK Dbg
;
1141 } IO_REMOVE_LOCK
, *PIO_REMOVE_LOCK
;
1149 typedef struct _CALLBACK_OBJECT
1153 LIST_ENTRY RegisteredCallbacks
;
1154 BOOLEAN AllowMultipleCallbacks
;
1156 } CALLBACK_OBJECT
, *PCALLBACK_OBJECT
;
1158 NTSTATUS WINAPI
ObCloseHandle(IN HANDLE handle
);
1160 #ifdef NONAMELESSUNION
1161 # ifdef NONAMELESSSTRUCT
1162 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.u2.CurrentStackLocation)
1163 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.u2.CurrentStackLocation - 1)
1165 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.u2.CurrentStackLocation)
1166 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.u2.CurrentStackLocation - 1)
1169 # ifdef NONAMELESSSTRUCT
1170 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.CurrentStackLocation)
1171 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.CurrentStackLocation - 1)
1173 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.CurrentStackLocation)
1174 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.CurrentStackLocation - 1)
1178 #define KernelMode 0
1181 /* directory object access rights */
1182 #define DIRECTORY_QUERY 0x0001
1183 #define DIRECTORY_TRAVERSE 0x0002
1184 #define DIRECTORY_CREATE_OBJECT 0x0004
1185 #define DIRECTORY_CREATE_SUBDIRECTORY 0x0008
1186 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
1188 /* symbolic link access rights */
1189 #define SYMBOLIC_LINK_QUERY 0x0001
1190 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
1192 PVOID WINAPI
ExAllocatePool(POOL_TYPE
,SIZE_T
);
1193 PVOID WINAPI
ExAllocatePoolWithQuota(POOL_TYPE
,SIZE_T
);
1194 PVOID WINAPI
ExAllocatePoolWithTag(POOL_TYPE
,SIZE_T
,ULONG
);
1195 PVOID WINAPI
ExAllocatePoolWithQuotaTag(POOL_TYPE
,SIZE_T
,ULONG
);
1196 void WINAPI
ExFreePool(PVOID
);
1197 void WINAPI
ExFreePoolWithTag(PVOID
,ULONG
);
1199 NTSTATUS WINAPI
IoAllocateDriverObjectExtension(PDRIVER_OBJECT
,PVOID
,ULONG
,PVOID
*);
1200 PVOID WINAPI
IoAllocateErrorLogEntry(PVOID
,UCHAR
);
1201 PIRP WINAPI
IoAllocateIrp(CCHAR
,BOOLEAN
);
1202 NTSTATUS WINAPI
IoCallDriver(DEVICE_OBJECT
*,IRP
*);
1203 VOID WINAPI
IoCompleteRequest(IRP
*,UCHAR
);
1204 NTSTATUS WINAPI
IoCreateDevice(DRIVER_OBJECT
*,ULONG
,UNICODE_STRING
*,DEVICE_TYPE
,ULONG
,BOOLEAN
,DEVICE_OBJECT
**);
1205 NTSTATUS WINAPI
IoCreateDriver(UNICODE_STRING
*,PDRIVER_INITIALIZE
);
1206 NTSTATUS WINAPI
IoCreateSymbolicLink(UNICODE_STRING
*,UNICODE_STRING
*);
1207 void WINAPI
IoDeleteDevice(DEVICE_OBJECT
*);
1208 void WINAPI
IoDeleteDriver(DRIVER_OBJECT
*);
1209 NTSTATUS WINAPI
IoDeleteSymbolicLink(UNICODE_STRING
*);
1210 void WINAPI
IoFreeIrp(IRP
*);
1211 PEPROCESS WINAPI
IoGetCurrentProcess(void);
1212 NTSTATUS WINAPI
IoGetDeviceInterfaces(const GUID
*,PDEVICE_OBJECT
,ULONG
,PWSTR
*);
1213 NTSTATUS WINAPI
IoGetDeviceObjectPointer(UNICODE_STRING
*,ACCESS_MASK
,PFILE_OBJECT
*,PDEVICE_OBJECT
*);
1214 NTSTATUS WINAPI
IoGetDeviceProperty(PDEVICE_OBJECT
,DEVICE_REGISTRY_PROPERTY
,ULONG
,PVOID
,PULONG
);
1215 PVOID WINAPI
IoGetDriverObjectExtension(PDRIVER_OBJECT
,PVOID
);
1216 PDEVICE_OBJECT WINAPI
IoGetRelatedDeviceObject(PFILE_OBJECT
);
1217 void WINAPI
IoInitializeIrp(IRP
*,USHORT
,CCHAR
);
1218 VOID WINAPI
IoInitializeRemoveLockEx(PIO_REMOVE_LOCK
,ULONG
,ULONG
,ULONG
,ULONG
);
1219 NTSTATUS WINAPI
IoWMIRegistrationControl(PDEVICE_OBJECT
,ULONG
);
1221 PKTHREAD WINAPI
KeGetCurrentThread(void);
1222 void WINAPI
KeQuerySystemTime(LARGE_INTEGER
*);
1223 void WINAPI
KeQueryTickCount(LARGE_INTEGER
*);
1224 ULONG WINAPI
KeQueryTimeIncrement(void);
1225 LONG WINAPI
KeReleaseSemaphore(PRKSEMAPHORE
,KPRIORITY
,LONG
,BOOLEAN
);
1226 LONG WINAPI
KeResetEvent(PRKEVENT
);
1227 LONG WINAPI
KeSetEvent(PRKEVENT
,KPRIORITY
,BOOLEAN
);
1228 KPRIORITY WINAPI
KeSetPriorityThread(PKTHREAD
,KPRIORITY
);
1230 PVOID WINAPI
MmAllocateContiguousMemory(SIZE_T
,PHYSICAL_ADDRESS
);
1231 PVOID WINAPI
MmAllocateNonCachedMemory(SIZE_T
);
1232 PMDL WINAPI
MmAllocatePagesForMdl(PHYSICAL_ADDRESS
,PHYSICAL_ADDRESS
,PHYSICAL_ADDRESS
,SIZE_T
);
1233 void WINAPI
MmFreeNonCachedMemory(PVOID
,SIZE_T
);
1234 MM_SYSTEMSIZE WINAPI
MmQuerySystemSize(void);
1236 NTSTATUS WINAPI
ObReferenceObjectByHandle(HANDLE
,ACCESS_MASK
,POBJECT_TYPE
,KPROCESSOR_MODE
,PVOID
*,POBJECT_HANDLE_INFORMATION
);
1238 POWER_STATE WINAPI
PoSetPowerState(PDEVICE_OBJECT
,POWER_STATE_TYPE
,POWER_STATE
);
1239 NTSTATUS WINAPI
PsCreateSystemThread(PHANDLE
,ULONG
,POBJECT_ATTRIBUTES
,HANDLE
,PCLIENT_ID
,PKSTART_ROUTINE
,PVOID
);
1240 #define PsGetCurrentProcess() IoGetCurrentProcess()
1241 #define PsGetCurrentThread() ((PETHREAD)KeGetCurrentThread())
1242 HANDLE WINAPI
PsGetCurrentProcessId(void);
1243 HANDLE WINAPI
PsGetCurrentThreadId(void);
1244 BOOLEAN WINAPI
PsGetVersion(ULONG
*,ULONG
*,ULONG
*,UNICODE_STRING
*);
1245 NTSTATUS WINAPI
PsTerminateSystemThread(NTSTATUS
);
1247 NTSTATUS WINAPI
ZwAddBootEntry(PUNICODE_STRING
,PUNICODE_STRING
);
1248 NTSTATUS WINAPI
ZwAccessCheckAndAuditAlarm(PUNICODE_STRING
,HANDLE
,PUNICODE_STRING
,PUNICODE_STRING
,PSECURITY_DESCRIPTOR
,ACCESS_MASK
,PGENERIC_MAPPING
,BOOLEAN
,PACCESS_MASK
,PBOOLEAN
,PBOOLEAN
);
1249 NTSTATUS WINAPI
ZwAdjustPrivilegesToken(HANDLE
,BOOLEAN
,PTOKEN_PRIVILEGES
,DWORD
,PTOKEN_PRIVILEGES
,PDWORD
);
1250 NTSTATUS WINAPI
ZwAlertThread(HANDLE ThreadHandle
);
1251 NTSTATUS WINAPI
ZwAllocateVirtualMemory(HANDLE
,PVOID
*,ULONG
,SIZE_T
*,ULONG
,ULONG
);
1252 NTSTATUS WINAPI
ZwCancelIoFile(HANDLE
,PIO_STATUS_BLOCK
);
1253 NTSTATUS WINAPI
ZwCancelTimer(HANDLE
, BOOLEAN
*);
1254 NTSTATUS WINAPI
ZwClearEvent(HANDLE
);
1255 NTSTATUS WINAPI
ZwClose(HANDLE
);
1256 NTSTATUS WINAPI
ZwCloseObjectAuditAlarm(PUNICODE_STRING
,HANDLE
,BOOLEAN
);
1257 NTSTATUS WINAPI
ZwConnectPort(PHANDLE
,PUNICODE_STRING
,PSECURITY_QUALITY_OF_SERVICE
,PLPC_SECTION_WRITE
,PLPC_SECTION_READ
,PULONG
,PVOID
,PULONG
);
1258 NTSTATUS WINAPI
ZwCreateDirectoryObject(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
);
1259 NTSTATUS WINAPI
ZwCreateEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,BOOLEAN
,BOOLEAN
);
1260 NTSTATUS WINAPI
ZwCreateFile(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PIO_STATUS_BLOCK
,PLARGE_INTEGER
,ULONG
,ULONG
,ULONG
,ULONG
,PVOID
,ULONG
);
1261 NTSTATUS WINAPI
ZwCreateKey(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,ULONG
,const UNICODE_STRING
*,ULONG
,PULONG
);
1262 NTSTATUS WINAPI
ZwCreateSection(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const LARGE_INTEGER
*,ULONG
,ULONG
,HANDLE
);
1263 NTSTATUS WINAPI
ZwCreateSymbolicLinkObject(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PUNICODE_STRING
);
1264 NTSTATUS WINAPI
ZwCreateTimer(HANDLE
*, ACCESS_MASK
, const OBJECT_ATTRIBUTES
*, TIMER_TYPE
);
1265 NTSTATUS WINAPI
ZwDeleteAtom(RTL_ATOM
);
1266 NTSTATUS WINAPI
ZwDeleteFile(POBJECT_ATTRIBUTES
);
1267 NTSTATUS WINAPI
ZwDeleteKey(HANDLE
);
1268 NTSTATUS WINAPI
ZwDeleteValueKey(HANDLE
,const UNICODE_STRING
*);
1269 NTSTATUS WINAPI
ZwDeviceIoControlFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,PVOID
,ULONG
,PVOID
,ULONG
);
1270 NTSTATUS WINAPI
ZwDisplayString(PUNICODE_STRING
);
1271 NTSTATUS WINAPI
ZwDuplicateObject(HANDLE
,HANDLE
,HANDLE
,PHANDLE
,ACCESS_MASK
,ULONG
,ULONG
);
1272 NTSTATUS WINAPI
ZwDuplicateToken(HANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,SECURITY_IMPERSONATION_LEVEL
,TOKEN_TYPE
,PHANDLE
);
1273 NTSTATUS WINAPI
ZwEnumerateKey(HANDLE
,ULONG
,KEY_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
1274 NTSTATUS WINAPI
ZwEnumerateValueKey(HANDLE
,ULONG
,KEY_VALUE_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
1275 NTSTATUS WINAPI
ZwFlushInstructionCache(HANDLE
,LPCVOID
,SIZE_T
);
1276 NTSTATUS WINAPI
ZwFlushKey(HANDLE
);
1277 NTSTATUS WINAPI
ZwFlushVirtualMemory(HANDLE
,LPCVOID
*,SIZE_T
*,ULONG
);
1278 NTSTATUS WINAPI
ZwFreeVirtualMemory(HANDLE
,PVOID
*,SIZE_T
*,ULONG
);
1279 NTSTATUS WINAPI
ZwFsControlFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,PVOID
,ULONG
,PVOID
,ULONG
);
1280 NTSTATUS WINAPI
ZwInitiatePowerAction(POWER_ACTION
,SYSTEM_POWER_STATE
,ULONG
,BOOLEAN
);
1281 NTSTATUS WINAPI
ZwLoadDriver(const UNICODE_STRING
*);
1282 NTSTATUS WINAPI
ZwLoadKey(const OBJECT_ATTRIBUTES
*,OBJECT_ATTRIBUTES
*);
1283 NTSTATUS WINAPI
ZwLockVirtualMemory(HANDLE
,PVOID
*,SIZE_T
*,ULONG
);
1284 NTSTATUS WINAPI
ZwMakeTemporaryObject(HANDLE
);
1285 NTSTATUS WINAPI
ZwMapViewOfSection(HANDLE
,HANDLE
,PVOID
*,ULONG
,SIZE_T
,const LARGE_INTEGER
*,SIZE_T
*,SECTION_INHERIT
,ULONG
,ULONG
);
1286 NTSTATUS WINAPI
ZwNotifyChangeKey(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,BOOLEAN
,PVOID
,ULONG
,BOOLEAN
);
1287 NTSTATUS WINAPI
ZwOpenDirectoryObject(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
);
1288 NTSTATUS WINAPI
ZwOpenEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
1289 NTSTATUS WINAPI
ZwOpenFile(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PIO_STATUS_BLOCK
,ULONG
,ULONG
);
1290 NTSTATUS WINAPI
ZwOpenKey(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
1291 NTSTATUS WINAPI
ZwOpenProcess(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const CLIENT_ID
*);
1292 NTSTATUS WINAPI
ZwOpenProcessToken(HANDLE
,DWORD
,HANDLE
*);
1293 NTSTATUS WINAPI
ZwOpenSection(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
1294 NTSTATUS WINAPI
ZwOpenSymbolicLinkObject(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
);
1295 NTSTATUS WINAPI
ZwOpenThread(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const CLIENT_ID
*);
1296 NTSTATUS WINAPI
ZwOpenThreadToken(HANDLE
,DWORD
,BOOLEAN
,HANDLE
*);
1297 NTSTATUS WINAPI
ZwOpenTimer(HANDLE
*, ACCESS_MASK
, const OBJECT_ATTRIBUTES
*);
1298 NTSTATUS WINAPI
ZwPowerInformation(POWER_INFORMATION_LEVEL
,PVOID
,ULONG
,PVOID
,ULONG
);
1299 NTSTATUS WINAPI
ZwPulseEvent(HANDLE
,PULONG
);
1300 NTSTATUS WINAPI
ZwQueryDefaultLocale(BOOLEAN
,LCID
*);
1301 NTSTATUS WINAPI
ZwQueryDefaultUILanguage(LANGID
*);
1302 NTSTATUS WINAPI
ZwQueryDirectoryFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,FILE_INFORMATION_CLASS
,BOOLEAN
,PUNICODE_STRING
,BOOLEAN
);
1303 NTSTATUS WINAPI
ZwQueryDirectoryObject(HANDLE
,PDIRECTORY_BASIC_INFORMATION
,ULONG
,BOOLEAN
,BOOLEAN
,PULONG
,PULONG
);
1304 NTSTATUS WINAPI
ZwQueryEaFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,BOOLEAN
,PVOID
,ULONG
,PVOID
,BOOLEAN
);
1305 NTSTATUS WINAPI
ZwQueryFullAttributesFile(const OBJECT_ATTRIBUTES
*,FILE_NETWORK_OPEN_INFORMATION
*);
1306 NTSTATUS WINAPI
ZwQueryInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,LONG
,FILE_INFORMATION_CLASS
);
1307 NTSTATUS WINAPI
ZwQueryInformationThread(HANDLE
,THREADINFOCLASS
,PVOID
,ULONG
,PULONG
);
1308 NTSTATUS WINAPI
ZwQueryInformationToken(HANDLE
,DWORD
,PVOID
,DWORD
,LPDWORD
);
1309 NTSTATUS WINAPI
ZwQueryInstallUILanguage(LANGID
*);
1310 NTSTATUS WINAPI
ZwQueryKey(HANDLE
,KEY_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
1311 NTSTATUS WINAPI
ZwQueryObject(HANDLE
, OBJECT_INFORMATION_CLASS
, PVOID
, ULONG
, PULONG
);
1312 NTSTATUS WINAPI
ZwQuerySecurityObject(HANDLE
,SECURITY_INFORMATION
,PSECURITY_DESCRIPTOR
,ULONG
,PULONG
);
1313 NTSTATUS WINAPI
ZwQuerySection(HANDLE
,SECTION_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
1314 NTSTATUS WINAPI
ZwQuerySymbolicLinkObject(HANDLE
,PUNICODE_STRING
,PULONG
);
1315 NTSTATUS WINAPI
ZwQuerySystemInformation(SYSTEM_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
1316 NTSTATUS WINAPI
ZwQueryTimerResolution(PULONG
,PULONG
,PULONG
);
1317 NTSTATUS WINAPI
ZwQueryValueKey(HANDLE
,const UNICODE_STRING
*,KEY_VALUE_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
1318 NTSTATUS WINAPI
ZwQueryVolumeInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,FS_INFORMATION_CLASS
);
1319 NTSTATUS WINAPI
ZwReadFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,PLARGE_INTEGER
,PULONG
);
1320 NTSTATUS WINAPI
ZwReplaceKey(POBJECT_ATTRIBUTES
,HANDLE
,POBJECT_ATTRIBUTES
);
1321 NTSTATUS WINAPI
ZwRequestWaitReplyPort(HANDLE
,PLPC_MESSAGE
,PLPC_MESSAGE
);
1322 NTSTATUS WINAPI
ZwResetEvent(HANDLE
,PULONG
);
1323 NTSTATUS WINAPI
ZwRestoreKey(HANDLE
,HANDLE
,ULONG
);
1324 NTSTATUS WINAPI
ZwSaveKey(HANDLE
,HANDLE
);
1325 NTSTATUS WINAPI
ZwSecureConnectPort(PHANDLE
,PUNICODE_STRING
,PSECURITY_QUALITY_OF_SERVICE
,PLPC_SECTION_WRITE
,PSID
,PLPC_SECTION_READ
,PULONG
,PVOID
,PULONG
);
1326 NTSTATUS WINAPI
ZwSetDefaultLocale(BOOLEAN
,LCID
);
1327 NTSTATUS WINAPI
ZwSetDefaultUILanguage(LANGID
);
1328 NTSTATUS WINAPI
ZwSetEaFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
);
1329 NTSTATUS WINAPI
ZwSetEvent(HANDLE
,PULONG
);
1330 NTSTATUS WINAPI
ZwSetInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,FILE_INFORMATION_CLASS
);
1331 NTSTATUS WINAPI
ZwSetInformationKey(HANDLE
,const int,PVOID
,ULONG
);
1332 NTSTATUS WINAPI
ZwSetInformationObject(HANDLE
, OBJECT_INFORMATION_CLASS
, PVOID
, ULONG
);
1333 NTSTATUS WINAPI
ZwSetInformationProcess(HANDLE
,PROCESS_INFORMATION_CLASS
,PVOID
,ULONG
);
1334 NTSTATUS WINAPI
ZwSetInformationThread(HANDLE
,THREADINFOCLASS
,LPCVOID
,ULONG
);
1335 NTSTATUS WINAPI
ZwSetIoCompletion(HANDLE
,ULONG
,ULONG
,NTSTATUS
,ULONG
);
1336 NTSTATUS WINAPI
ZwSetSecurityObject(HANDLE
,SECURITY_INFORMATION
,PSECURITY_DESCRIPTOR
);
1337 NTSTATUS WINAPI
ZwSetSystemInformation(SYSTEM_INFORMATION_CLASS
,PVOID
,ULONG
);
1338 NTSTATUS WINAPI
ZwSetSystemTime(const LARGE_INTEGER
*,LARGE_INTEGER
*);
1339 NTSTATUS WINAPI
ZwSetTimer(HANDLE
, const LARGE_INTEGER
*, PTIMER_APC_ROUTINE
, PVOID
, BOOLEAN
, ULONG
, BOOLEAN
*);
1340 NTSTATUS WINAPI
ZwSetValueKey(HANDLE
,const UNICODE_STRING
*,ULONG
,ULONG
,const void *,ULONG
);
1341 NTSTATUS WINAPI
ZwSetVolumeInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,FS_INFORMATION_CLASS
);
1342 NTSTATUS WINAPI
ZwSuspendThread(HANDLE
,PULONG
);
1343 NTSTATUS WINAPI
ZwTerminateProcess(HANDLE
,LONG
);
1344 NTSTATUS WINAPI
ZwUnloadDriver(const UNICODE_STRING
*);
1345 NTSTATUS WINAPI
ZwUnloadKey(HANDLE
);
1346 NTSTATUS WINAPI
ZwUnmapViewOfSection(HANDLE
,PVOID
);
1347 NTSTATUS WINAPI
ZwWaitForSingleObject(HANDLE
,BOOLEAN
,const LARGE_INTEGER
*);
1348 NTSTATUS WINAPI
ZwWaitForMultipleObjects(ULONG
,const HANDLE
*,BOOLEAN
,BOOLEAN
,const LARGE_INTEGER
*);
1349 NTSTATUS WINAPI
ZwWriteFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,const void*,ULONG
,PLARGE_INTEGER
,PULONG
);
1350 NTSTATUS WINAPI
ZwYieldExecution(void);