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
24 #include <devpropdef.h>
27 #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
29 #define POINTER_ALIGNMENT
32 /* FIXME: We suppose that page size is 4096 */
35 #define PAGE_SIZE 0x1000
38 #define BYTE_OFFSET(va) ((ULONG)((ULONG_PTR)(va) & (PAGE_SIZE - 1)))
39 #define PAGE_ALIGN(va) ((PVOID)((ULONG_PTR)(va) & ~(PAGE_SIZE - 1)))
40 #define ADDRESS_AND_SIZE_TO_SPAN_PAGES(va, length) \
41 ((BYTE_OFFSET(va) + ((SIZE_T)(length)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT)
43 typedef LONG KPRIORITY
;
45 typedef ULONG_PTR KSPIN_LOCK
, *PKSPIN_LOCK
;
47 typedef ULONG_PTR ERESOURCE_THREAD
;
48 typedef ERESOURCE_THREAD
*PERESOURCE_THREAD
;
49 typedef struct _FILE_GET_QUOTA_INFORMATION
*PFILE_GET_QUOTA_INFORMATION
;
54 struct _DEVICE_OBJECT
;
55 struct _DRIVER_OBJECT
;
58 typedef VOID (WINAPI
*PKDEFERRED_ROUTINE
)(struct _KDPC
*, PVOID
, PVOID
, PVOID
);
59 typedef VOID (WINAPI
*PKSTART_ROUTINE
)(PVOID
);
61 typedef NTSTATUS (WINAPI
*PDRIVER_INITIALIZE
)(struct _DRIVER_OBJECT
*, PUNICODE_STRING
);
62 typedef NTSTATUS (WINAPI
*PDRIVER_DISPATCH
)(struct _DEVICE_OBJECT
*, struct _IRP
*);
63 typedef void (WINAPI
*PDRIVER_STARTIO
)(struct _DEVICE_OBJECT
*, struct _IRP
*);
64 typedef void (WINAPI
*PDRIVER_UNLOAD
)(struct _DRIVER_OBJECT
*);
65 typedef NTSTATUS (WINAPI
*PDRIVER_ADD_DEVICE
)(struct _DRIVER_OBJECT
*, struct _DEVICE_OBJECT
*);
67 typedef struct _DISPATCHER_HEADER
{
73 LIST_ENTRY WaitListHead
;
74 } DISPATCHER_HEADER
, *PDISPATCHER_HEADER
;
76 typedef struct _KEVENT
{
77 DISPATCHER_HEADER Header
;
78 } KEVENT
, *PKEVENT
, *RESTRICTED_POINTER PRKEVENT
;
80 typedef struct _KSEMAPHORE
{
81 DISPATCHER_HEADER Header
;
83 } KSEMAPHORE
, *PKSEMAPHORE
, *PRKSEMAPHORE
;
85 typedef struct _KDPC
{
87 ULONG TargetInfoAsUlong
;
91 volatile USHORT Number
;
94 SINGLE_LIST_ENTRY DpcListEntry
;
95 KAFFINITY ProcessorHistory
;
96 PKDEFERRED_ROUTINE DeferredRoutine
;
97 PVOID DeferredContext
;
98 PVOID SystemArgument1
;
99 PVOID SystemArgument2
;
101 } KDPC
, *PKDPC
, *RESTRICTED_POINTER PRKDPC
;
103 typedef enum _KDPC_IMPORTANCE
{
110 typedef struct _KDEVICE_QUEUE_ENTRY
{
111 LIST_ENTRY DeviceListEntry
;
114 } KDEVICE_QUEUE_ENTRY
, *PKDEVICE_QUEUE_ENTRY
,
115 *RESTRICTED_POINTER PRKDEVICE_QUEUE_ENTRY
;
117 typedef struct _KDEVICE_QUEUE
{
120 LIST_ENTRY DeviceListHead
;
123 } KDEVICE_QUEUE
, *PKDEVICE_QUEUE
, *RESTRICTED_POINTER PRKDEVICE_QUEUE
;
125 typedef struct _KMUTANT
{
126 DISPATCHER_HEADER Header
;
127 LIST_ENTRY MutantListEntry
;
128 struct _KTHREAD
*RESTRICTED_POINTER OwnerThread
;
131 } KMUTANT
, *PKMUTANT
, *RESTRICTED_POINTER PRKMUTANT
, KMUTEX
, *PKMUTEX
, *RESTRICTED_POINTER PRKMUTEX
;
133 typedef struct _DEFERRED_REVERSE_BARRIER
136 ULONG TotalProcessors
;
137 } DEFERRED_REVERSE_BARRIER
;
139 typedef enum _KWAIT_REASON
169 typedef struct _KWAIT_BLOCK
{
170 LIST_ENTRY WaitListEntry
;
171 struct _KTHREAD
*RESTRICTED_POINTER Thread
;
173 struct _KWAIT_BLOCK
*RESTRICTED_POINTER NextWaitBlock
;
176 } KWAIT_BLOCK
, *PKWAIT_BLOCK
, *RESTRICTED_POINTER PRKWAIT_BLOCK
;
178 typedef struct _OWNER_ENTRY
180 ERESOURCE_THREAD OwnerThread
;
185 ULONG IoPriorityBoosted
: 1;
186 ULONG OwnerReferenced
: 1;
187 ULONG IoQoSPriorityBoosted
: 1;
188 ULONG OwnerCount
: 29;
192 } OWNER_ENTRY
, *POWNER_ENTRY
;
194 #define ResourceNeverExclusive 0x0010
195 #define ResourceReleaseByOtherThread 0x0020
196 #define ResourceOwnedExclusive 0x0080
198 typedef struct _ERESOURCE
200 LIST_ENTRY SystemResourcesList
;
201 OWNER_ENTRY
*OwnerTable
;
208 UCHAR ReservedLowFlags
;
209 UCHAR WaiterPriority
;
212 KSEMAPHORE
*SharedWaiters
;
213 KEVENT
*ExclusiveWaiters
;
214 OWNER_ENTRY OwnerEntry
;
216 ULONG ContentionCount
;
217 ULONG NumberOfSharedWaiters
;
218 ULONG NumberOfExclusiveWaiters
;
225 ULONG_PTR CreatorBackTraceIndex
;
228 } ERESOURCE
, *PERESOURCE
;
230 typedef struct _IO_TIMER
*PIO_TIMER
;
231 typedef struct _IO_TIMER_ROUTINE
*PIO_TIMER_ROUTINE
;
232 typedef struct _ETHREAD
*PETHREAD
;
233 typedef struct _KTHREAD
*PKTHREAD
, *PRKTHREAD
;
234 typedef struct _EPROCESS
*PEPROCESS
;
235 typedef struct _KPROCESS KPROCESS
, *PKPROCESS
, *PRKPROCESS
;
236 typedef struct _IO_WORKITEM
*PIO_WORKITEM
;
237 typedef struct _OBJECT_TYPE
*POBJECT_TYPE
;
238 typedef struct _OBJECT_HANDLE_INFORMATION
*POBJECT_HANDLE_INFORMATION
;
239 typedef struct _ZONE_HEADER
*PZONE_HEADER
;
240 typedef struct _LOOKASIDE_LIST_EX
*PLOOKASIDE_LIST_EX
;
242 typedef struct _KAPC_STATE
244 LIST_ENTRY ApcListHead
[2];
246 UCHAR KernelApcInProgress
;
247 UCHAR KernelApcPending
;
248 UCHAR UserApcPending
;
249 } KAPC_STATE
, *PKAPC_STATE
;
251 #define FM_LOCK_BIT 0x1
253 typedef struct _FAST_MUTEX
260 } FAST_MUTEX
, *PFAST_MUTEX
;
262 typedef struct _KGUARDED_MUTEX
272 SHORT KernelApcDisable
;
273 SHORT SpecialApcDisable
;
275 ULONG CombinedApcDisable
;
277 } KGUARDED_MUTEX
, *PKGUARDED_MUTEX
;
279 #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR))
281 typedef struct _VPB
{
285 USHORT VolumeLabelLength
;
286 struct _DEVICE_OBJECT
*DeviceObject
;
287 struct _DEVICE_OBJECT
*RealDevice
;
289 ULONG ReferenceCount
;
290 WCHAR VolumeLabel
[MAXIMUM_VOLUME_LABEL_LENGTH
/ sizeof(WCHAR
)];
293 #define POOL_QUOTA_FAIL_INSTEAD_OF_RAISE 0x0008
294 #define POOL_RAISE_IF_ALLOCATION_FAILURE 0x0010
295 #define POOL_COLD_ALLOCATION 0x0100
296 #define POOL_NX_ALLOCATION 0x0200
298 typedef enum _POOL_TYPE
{
301 NonPagedPoolMustSucceed
,
303 NonPagedPoolCacheAligned
,
304 PagedPoolCacheAligned
,
305 NonPagedPoolCacheAlignedMustS
,
309 typedef struct _WAIT_CONTEXT_BLOCK
{
310 KDEVICE_QUEUE_ENTRY WaitQueueEntry
;
311 struct _DRIVER_CONTROL
*DeviceRoutine
;
313 ULONG NumberOfMapRegisters
;
316 PKDPC BufferChainingDpc
;
317 } WAIT_CONTEXT_BLOCK
, *PWAIT_CONTEXT_BLOCK
;
319 #define DO_BUFFERED_IO 0x00000004
320 #define DO_EXCLUSIVE 0x00000008
321 #define DO_DIRECT_IO 0x00000010
322 #define DO_MAP_IO_BUFFER 0x00000020
323 #define DO_DEVICE_INITIALIZING 0x00000080
324 #define DO_SHUTDOWN_REGISTERED 0x00000800
325 #define DO_BUS_ENUMERATED_DEVICE 0x00001000
326 #define DO_POWER_PAGABLE 0x00002000
327 #define DO_POWER_INRUSH 0x00004000
329 #define IO_NO_INCREMENT 0
330 #define IO_CD_ROM_INCREMENT 1
331 #define IO_DISK_INCREMENT 1
332 #define IO_KEYBOARD_INCREMENT 6
333 #define IO_MAILSLOT_INCREMENT 2
334 #define IO_MOUSE_INCREMENT 6
335 #define IO_NAMED_PIPE_INCREMENT 2
336 #define IO_NETWORK_INCREMENT 2
337 #define IO_PARALLEL_INCREMENT 1
338 #define IO_SERIAL_INCREMENT 2
339 #define IO_SOUND_INCREMENT 8
340 #define IO_VIDEO_INCREMENT 1
343 #define DEVICE_TYPE ULONG
345 #define IRP_MJ_MAXIMUM_FUNCTION 0x1b
346 #define IRP_MJ_CREATE 0x00
347 #define IRP_MJ_CREATE_NAMED_PIPE 0x01
348 #define IRP_MJ_CLOSE 0x02
349 #define IRP_MJ_READ 0x03
350 #define IRP_MJ_WRITE 0x04
351 #define IRP_MJ_QUERY_INFORMATION 0x05
352 #define IRP_MJ_SET_INFORMATION 0x06
353 #define IRP_MJ_QUERY_EA 0x07
354 #define IRP_MJ_SET_EA 0x08
355 #define IRP_MJ_FLUSH_BUFFERS 0x09
356 #define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a
357 #define IRP_MJ_SET_VOLUME_INFORMATION 0x0b
358 #define IRP_MJ_DIRECTORY_CONTROL 0x0c
359 #define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d
360 #define IRP_MJ_DEVICE_CONTROL 0x0e
361 #define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f
362 #define IRP_MJ_SHUTDOWN 0x10
363 #define IRP_MJ_LOCK_CONTROL 0x11
364 #define IRP_MJ_CLEANUP 0x12
365 #define IRP_MJ_CREATE_MAILSLOT 0x13
366 #define IRP_MJ_QUERY_SECURITY 0x14
367 #define IRP_MJ_SET_SECURITY 0x15
368 #define IRP_MJ_POWER 0x16
369 #define IRP_MJ_SYSTEM_CONTROL 0x17
370 #define IRP_MJ_DEVICE_CHANGE 0x18
371 #define IRP_MJ_QUERY_QUOTA 0x19
372 #define IRP_MJ_SET_QUOTA 0x1a
373 #define IRP_MJ_PNP 0x1b
375 #define IRP_MN_START_DEVICE 0x00
376 #define IRP_MN_QUERY_REMOVE_DEVICE 0x01
377 #define IRP_MN_REMOVE_DEVICE 0x02
378 #define IRP_MN_CANCEL_REMOVE_DEVICE 0x03
379 #define IRP_MN_STOP_DEVICE 0x04
380 #define IRP_MN_QUERY_STOP_DEVICE 0x05
381 #define IRP_MN_CANCEL_STOP_DEVICE 0x06
382 #define IRP_MN_QUERY_DEVICE_RELATIONS 0x07
383 #define IRP_MN_QUERY_INTERFACE 0x08
384 #define IRP_MN_QUERY_CAPABILITIES 0x09
385 #define IRP_MN_QUERY_RESOURCES 0x0A
386 #define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B
387 #define IRP_MN_QUERY_DEVICE_TEXT 0x0C
388 #define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
389 #define IRP_MN_READ_CONFIG 0x0F
390 #define IRP_MN_WRITE_CONFIG 0x10
391 #define IRP_MN_EJECT 0x11
392 #define IRP_MN_SET_LOCK 0x12
393 #define IRP_MN_QUERY_ID 0x13
394 #define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14
395 #define IRP_MN_QUERY_BUS_INFORMATION 0x15
396 #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16
397 #define IRP_MN_SURPRISE_REMOVAL 0x17
398 #define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
400 #define IRP_MN_WAIT_WAKE 0x00
401 #define IRP_MN_POWER_SEQUENCE 0x01
402 #define IRP_MN_SET_POWER 0x02
403 #define IRP_MN_QUERY_POWER 0x03
405 #define IRP_QUOTA_CHARGED 0x01
406 #define IRP_ALLOCATED_MUST_SUCCEED 0x02
407 #define IRP_ALLOCATED_FIXED_SIZE 0x04
408 #define IRP_LOOKASIDE_ALLOCATION 0x08
410 #define IO_TYPE_ADAPTER 0x01
411 #define IO_TYPE_CONTROLLER 0x02
412 #define IO_TYPE_DEVICE 0x03
413 #define IO_TYPE_DRIVER 0x04
414 #define IO_TYPE_FILE 0x05
415 #define IO_TYPE_IRP 0x06
416 #define IO_TYPE_MASTER_ADAPTER 0x07
417 #define IO_TYPE_OPEN_PACKET 0x08
418 #define IO_TYPE_TIMER 0x09
419 #define IO_TYPE_VPB 0x0a
420 #define IO_TYPE_ERROR_LOG 0x0b
421 #define IO_TYPE_ERROR_MESSAGE 0x0c
422 #define IO_TYPE_DEVICE_OBJECT_EXTENSION 0x0d
423 #define IO_TYPE_DEVICE_QUEUE 0x14
425 typedef struct _DEVICE_OBJECT
{
429 struct _DRIVER_OBJECT
*DriverObject
;
430 struct _DEVICE_OBJECT
*NextDevice
;
431 struct _DEVICE_OBJECT
*AttachedDevice
;
432 struct _IRP
*CurrentIrp
;
435 ULONG Characteristics
;
437 PVOID DeviceExtension
;
438 DEVICE_TYPE DeviceType
;
441 LIST_ENTRY ListEntry
;
442 WAIT_CONTEXT_BLOCK Wcb
;
444 ULONG AlignmentRequirement
;
445 KDEVICE_QUEUE DeviceQueue
;
447 ULONG ActiveThreadCount
;
448 PSECURITY_DESCRIPTOR SecurityDescriptor
;
452 struct _DEVOBJ_EXTENSION
*DeviceObjectExtension
;
455 typedef struct _DEVICE_OBJECT
*PDEVICE_OBJECT
;
457 typedef struct _DEVICE_RELATIONS
{
459 PDEVICE_OBJECT Objects
[1];
461 typedef struct _DEVICE_RELATIONS
*PDEVICE_RELATIONS
;
463 typedef struct _DRIVER_EXTENSION
{
464 struct _DRIVER_OBJECT
*DriverObject
;
465 PDRIVER_ADD_DEVICE AddDevice
;
467 UNICODE_STRING ServiceKeyName
;
468 } DRIVER_EXTENSION
, *PDRIVER_EXTENSION
;
470 typedef struct _DRIVER_OBJECT
{
473 PDEVICE_OBJECT DeviceObject
;
478 PDRIVER_EXTENSION DriverExtension
;
479 UNICODE_STRING DriverName
;
480 PUNICODE_STRING HardwareDatabase
;
481 PVOID FastIoDispatch
;
482 PDRIVER_INITIALIZE DriverInit
;
483 PDRIVER_STARTIO DriverStartIo
;
484 PDRIVER_UNLOAD DriverUnload
;
485 PDRIVER_DISPATCH MajorFunction
[IRP_MJ_MAXIMUM_FUNCTION
+ 1];
487 typedef struct _DRIVER_OBJECT
*PDRIVER_OBJECT
;
489 /* Irp definitions */
490 typedef UCHAR KIRQL
, *PKIRQL
;
491 typedef CCHAR KPROCESSOR_MODE
;
492 typedef enum _KAPC_ENVIRONMENT
494 OriginalApcEnvironment
,
495 AttachedApcEnvironment
,
496 CurrentApcEnvironment
,
498 } KAPC_ENVIRONMENT
, *PKAPC_ENVIRONMENT
;
500 typedef VOID (WINAPI
*PDRIVER_CANCEL
)(
501 IN
struct _DEVICE_OBJECT
*DeviceObject
,
502 IN
struct _IRP
*Irp
);
504 typedef VOID (WINAPI
*PKNORMAL_ROUTINE
)(
505 IN PVOID NormalContext
,
506 IN PVOID SystemArgument1
,
507 IN PVOID SystemArgument2
);
509 typedef VOID (WINAPI
*PKKERNEL_ROUTINE
)(
510 IN
struct _KAPC
*Apc
,
511 IN OUT PKNORMAL_ROUTINE
*NormalRoutine
,
512 IN OUT PVOID
*NormalContext
,
513 IN OUT PVOID
*SystemArgument1
,
514 IN OUT PVOID
*SystemArgument2
);
516 typedef VOID (WINAPI
*PKRUNDOWN_ROUTINE
)(
517 IN
struct _KAPC
*Apc
);
519 typedef struct _KAPC
{
523 struct _KTHREAD
*Thread
;
524 LIST_ENTRY ApcListEntry
;
525 PKKERNEL_ROUTINE KernelRoutine
;
526 PKRUNDOWN_ROUTINE RundownRoutine
;
527 PKNORMAL_ROUTINE NormalRoutine
;
529 PVOID SystemArgument1
;
530 PVOID SystemArgument2
;
532 KPROCESSOR_MODE ApcMode
;
534 } KAPC
, *PKAPC
, *RESTRICTED_POINTER PRKAPC
;
536 typedef struct _IRP
{
539 struct _MDL
*MdlAddress
;
542 struct _IRP
*MasterIrp
;
546 LIST_ENTRY ThreadListEntry
;
547 IO_STATUS_BLOCK IoStatus
;
548 KPROCESSOR_MODE RequestorMode
;
549 BOOLEAN PendingReturned
;
551 CHAR CurrentLocation
;
554 CCHAR ApcEnvironment
;
555 UCHAR AllocationFlags
;
556 PIO_STATUS_BLOCK UserIosb
;
560 PIO_APC_ROUTINE UserApcRoutine
;
561 PVOID UserApcContext
;
562 } AsynchronousParameters
;
563 LARGE_INTEGER AllocationSize
;
565 PDRIVER_CANCEL CancelRoutine
;
570 KDEVICE_QUEUE_ENTRY DeviceQueueEntry
;
572 PVOID DriverContext
[4];
576 PCHAR AuxiliaryBuffer
;
578 LIST_ENTRY ListEntry
;
580 struct _IO_STACK_LOCATION
*CurrentStackLocation
;
584 struct _FILE_OBJECT
*OriginalFileObject
;
590 typedef struct _IRP
*PIRP
;
592 #define IRP_NOCACHE 0x0001
593 #define IRP_PAGING_IO 0x0002
594 #define IRP_MOUNT_COMPLETION 0x0002
595 #define IRP_SYNCHRONOUS_API 0x0004
596 #define IRP_ASSOCIATED_IRP 0x0008
597 #define IRP_BUFFERED_IO 0x0010
598 #define IRP_DEALLOCATE_BUFFER 0x0020
599 #define IRP_INPUT_OPERATION 0x0040
600 #define IRP_SYNCHRONOUS_PAGING_IO 0x0040
601 #define IRP_CREATE_OPERATION 0x0080
602 #define IRP_READ_OPERATION 0x0100
603 #define IRP_WRITE_OPERATION 0x0200
604 #define IRP_CLOSE_OPERATION 0x0400
605 #define IRP_DEFER_IO_COMPLETION 0x0800
606 #define IRP_OB_QUERY_NAME 0x1000
607 #define IRP_HOLD_DEVICE_QUEUE 0x2000
609 typedef VOID (WINAPI
*PINTERFACE_REFERENCE
)(
612 typedef VOID (WINAPI
*PINTERFACE_DEREFERENCE
)(
615 typedef struct _INTERFACE
{
619 PINTERFACE_REFERENCE InterfaceReference
;
620 PINTERFACE_DEREFERENCE InterfaceDereference
;
621 } INTERFACE
, *PINTERFACE
;
623 typedef struct _SECTION_OBJECT_POINTERS
{
624 PVOID DataSectionObject
;
625 PVOID SharedCacheMap
;
626 PVOID ImageSectionObject
;
627 } SECTION_OBJECT_POINTERS
, *PSECTION_OBJECT_POINTERS
;
629 typedef struct _IO_COMPLETION_CONTEXT
{
632 } IO_COMPLETION_CONTEXT
, *PIO_COMPLETION_CONTEXT
;
634 typedef enum _DEVICE_RELATION_TYPE
{
639 TargetDeviceRelation
,
641 } DEVICE_RELATION_TYPE
, *PDEVICE_RELATION_TYPE
;
643 typedef struct _FILE_OBJECT
{
646 PDEVICE_OBJECT DeviceObject
;
650 PSECTION_OBJECT_POINTERS SectionObjectPointer
;
651 PVOID PrivateCacheMap
;
652 NTSTATUS FinalStatus
;
653 struct _FILE_OBJECT
*RelatedFileObject
;
654 BOOLEAN LockOperation
;
655 BOOLEAN DeletePending
;
658 BOOLEAN DeleteAccess
;
661 BOOLEAN SharedDelete
;
663 UNICODE_STRING FileName
;
664 LARGE_INTEGER CurrentByteOffset
;
670 PIO_COMPLETION_CONTEXT CompletionContext
;
672 typedef struct _FILE_OBJECT
*PFILE_OBJECT
;
674 #define INITIAL_PRIVILEGE_COUNT 3
676 typedef struct _INITIAL_PRIVILEGE_SET
{
677 ULONG PrivilegeCount
;
679 LUID_AND_ATTRIBUTES Privilege
[INITIAL_PRIVILEGE_COUNT
];
680 } INITIAL_PRIVILEGE_SET
, * PINITIAL_PRIVILEGE_SET
;
682 typedef struct _SECURITY_SUBJECT_CONTEXT
{
683 PACCESS_TOKEN ClientToken
;
684 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
685 PACCESS_TOKEN PrimaryToken
;
686 PVOID ProcessAuditId
;
687 } SECURITY_SUBJECT_CONTEXT
, *PSECURITY_SUBJECT_CONTEXT
;
689 typedef struct _ACCESS_STATE
{
691 BOOLEAN SecurityEvaluated
;
692 BOOLEAN GenerateAudit
;
693 BOOLEAN GenerateOnClose
;
694 BOOLEAN PrivilegesAllocated
;
696 ACCESS_MASK RemainingDesiredAccess
;
697 ACCESS_MASK PreviouslyGrantedAccess
;
698 ACCESS_MASK OriginalDesiredAccess
;
699 SECURITY_SUBJECT_CONTEXT SubjectSecurityContext
;
700 PSECURITY_DESCRIPTOR SecurityDescriptor
;
703 INITIAL_PRIVILEGE_SET InitialPrivilegeSet
;
704 PRIVILEGE_SET PrivilegeSet
;
707 BOOLEAN AuditPrivileges
;
708 UNICODE_STRING ObjectName
;
709 UNICODE_STRING ObjectTypeName
;
710 } ACCESS_STATE
, *PACCESS_STATE
;
712 typedef struct _IO_SECURITY_CONTEXT
{
713 PSECURITY_QUALITY_OF_SERVICE SecurityQos
;
714 PACCESS_STATE AccessState
;
715 ACCESS_MASK DesiredAccess
;
716 ULONG FullCreateOptions
;
717 } IO_SECURITY_CONTEXT
, *PIO_SECURITY_CONTEXT
;
719 typedef struct _DEVICE_CAPABILITIES
{
724 ULONG LockSupported
: 1;
725 ULONG EjectSupported
: 1;
727 ULONG DockDevice
: 1;
729 ULONG SilentInstall
: 1;
730 ULONG RawDeviceOK
: 1;
731 ULONG SurpriseRemovalOK
: 1;
732 ULONG WakeFromD0
: 1;
733 ULONG WakeFromD1
: 1;
734 ULONG WakeFromD2
: 1;
735 ULONG WakeFromD3
: 1;
736 ULONG HardwareDisabled
: 1;
737 ULONG NonDynamic
: 1;
738 ULONG WarmEjectSupported
: 1;
739 ULONG NoDisplayInUI
: 1;
743 DEVICE_POWER_STATE DeviceState
[PowerSystemMaximum
];
744 SYSTEM_POWER_STATE SystemWake
;
745 DEVICE_POWER_STATE DeviceWake
;
749 } DEVICE_CAPABILITIES
, *PDEVICE_CAPABILITIES
;
751 typedef struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION
{
755 GUID InterfaceClassGuid
;
756 PUNICODE_STRING SymbolicLinkName
;
757 } DEVICE_INTERFACE_CHANGE_NOTIFICATION
, *PDEVICE_INTERFACE_CHANGE_NOTIFICATION
;
759 typedef enum _INTERFACE_TYPE
{
760 InterfaceTypeUndefined
= -1,
778 } INTERFACE_TYPE
, *PINTERFACE_TYPE
;
780 typedef LARGE_INTEGER PHYSICAL_ADDRESS
, *PPHYSICAL_ADDRESS
;
782 #define IO_RESOURCE_PREFERRED 0x01
783 #define IO_RESOURCE_DEFAULT 0x02
784 #define IO_RESOURCE_ALTERNATIVE 0x08
786 typedef struct _IO_RESOURCE_DESCRIPTOR
{
789 UCHAR ShareDisposition
;
797 PHYSICAL_ADDRESS MinimumAddress
;
798 PHYSICAL_ADDRESS MaximumAddress
;
803 PHYSICAL_ADDRESS MinimumAddress
;
804 PHYSICAL_ADDRESS MaximumAddress
;
811 ULONG MinimumChannel
;
812 ULONG MaximumChannel
;
817 PHYSICAL_ADDRESS MinimumAddress
;
818 PHYSICAL_ADDRESS MaximumAddress
;
835 } IO_RESOURCE_DESCRIPTOR
, *PIO_RESOURCE_DESCRIPTOR
;
837 typedef struct _IO_RESOURCE_LIST
{
841 IO_RESOURCE_DESCRIPTOR Descriptors
[1];
842 } IO_RESOURCE_LIST
, *PIO_RESOURCE_LIST
;
844 typedef struct _IO_RESOURCE_REQUIREMENTS_LIST
{
846 INTERFACE_TYPE InterfaceType
;
850 ULONG AlternativeLists
;
851 IO_RESOURCE_LIST List
[1];
852 } IO_RESOURCE_REQUIREMENTS_LIST
, *PIO_RESOURCE_REQUIREMENTS_LIST
;
854 typedef enum _BUS_QUERY_ID_TYPE
{
857 BusQueryCompatibleIDs
,
859 BusQueryDeviceSerialNumber
,
861 } BUS_QUERY_ID_TYPE
, *PBUS_QUERY_ID_TYPE
;
863 typedef enum _CREATE_FILE_TYPE
{
865 CreateFileTypeNamedPipe
,
866 CreateFileTypeMailslot
870 DevicePropertyDeviceDescription
,
871 DevicePropertyHardwareID
,
872 DevicePropertyCompatibleIDs
,
873 DevicePropertyBootConfiguration
,
874 DevicePropertyBootConfigurationTranslated
,
875 DevicePropertyClassName
,
876 DevicePropertyClassGuid
,
877 DevicePropertyDriverKeyName
,
878 DevicePropertyManufacturer
,
879 DevicePropertyFriendlyName
,
880 DevicePropertyLocationInformation
,
881 DevicePropertyPhysicalDeviceObjectName
,
882 DevicePropertyBusTypeGuid
,
883 DevicePropertyLegacyBusType
,
884 DevicePropertyBusNumber
,
885 DevicePropertyEnumeratorName
,
886 DevicePropertyAddress
,
887 DevicePropertyUINumber
,
888 DevicePropertyInstallState
,
889 DevicePropertyRemovalPolicy
890 } DEVICE_REGISTRY_PROPERTY
;
892 typedef enum _DEVICE_TEXT_TYPE
{
893 DeviceTextDescription
,
894 DeviceTextLocationInformation
895 } DEVICE_TEXT_TYPE
, *PDEVICE_TEXT_TYPE
;
897 typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE
{
898 DeviceUsageTypeUndefined
,
899 DeviceUsageTypePaging
,
900 DeviceUsageTypeHibernation
,
901 DeviceUsageTypeDumpFile
902 } DEVICE_USAGE_NOTIFICATION_TYPE
;
904 typedef struct _POWER_SEQUENCE
{
908 } POWER_SEQUENCE
, *PPOWER_SEQUENCE
;
910 typedef enum _POWER_STATE_TYPE
{
913 } POWER_STATE_TYPE
, *PPOWER_STATE_TYPE
;
915 typedef union _POWER_STATE
{
916 SYSTEM_POWER_STATE SystemState
;
917 DEVICE_POWER_STATE DeviceState
;
918 } POWER_STATE
, *PPOWER_STATE
;
920 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
{
922 UCHAR ShareDisposition
;
926 PHYSICAL_ADDRESS Start
;
930 PHYSICAL_ADDRESS Start
;
939 PHYSICAL_ADDRESS Start
;
959 } DeviceSpecificData
;
961 } CM_PARTIAL_RESOURCE_DESCRIPTOR
, *PCM_PARTIAL_RESOURCE_DESCRIPTOR
;
963 typedef struct _CM_PARTIAL_RESOURCE_LIST
{
967 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors
[1];
968 } CM_PARTIAL_RESOURCE_LIST
, *PCM_PARTIAL_RESOURCE_LIST
;
970 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
{
971 INTERFACE_TYPE InterfaceType
;
973 CM_PARTIAL_RESOURCE_LIST PartialResourceList
;
974 } CM_FULL_RESOURCE_DESCRIPTOR
, *PCM_FULL_RESOURCE_DESCRIPTOR
;
976 typedef struct _CM_RESOURCE_LIST
{
978 CM_FULL_RESOURCE_DESCRIPTOR List
[1];
979 } CM_RESOURCE_LIST
, *PCM_RESOURCE_LIST
;
981 typedef NTSTATUS (WINAPI
*PIO_COMPLETION_ROUTINE
)(
982 IN
struct _DEVICE_OBJECT
*DeviceObject
,
986 #define SL_PENDING_RETURNED 0x01
987 #define SL_INVOKE_ON_CANCEL 0x20
988 #define SL_INVOKE_ON_SUCCESS 0x40
989 #define SL_INVOKE_ON_ERROR 0x80
992 #include <pshpack4.h>
994 typedef struct _IO_STACK_LOCATION
{
1001 PIO_SECURITY_CONTEXT SecurityContext
;
1003 USHORT POINTER_ALIGNMENT FileAttributes
;
1005 ULONG POINTER_ALIGNMENT EaLength
;
1009 ULONG POINTER_ALIGNMENT Key
;
1010 LARGE_INTEGER ByteOffset
;
1014 ULONG POINTER_ALIGNMENT Key
;
1015 LARGE_INTEGER ByteOffset
;
1019 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass
;
1023 FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass
;
1024 PFILE_OBJECT FileObject
;
1027 BOOLEAN ReplaceIfExists
;
1028 BOOLEAN AdvanceOnly
;
1031 HANDLE DeleteHandle
;
1036 FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass
;
1039 ULONG OutputBufferLength
;
1040 ULONG POINTER_ALIGNMENT InputBufferLength
;
1041 ULONG POINTER_ALIGNMENT IoControlCode
;
1042 PVOID Type3InputBuffer
;
1045 SECURITY_INFORMATION SecurityInformation
;
1046 ULONG POINTER_ALIGNMENT Length
;
1049 SECURITY_INFORMATION SecurityInformation
;
1050 PSECURITY_DESCRIPTOR SecurityDescriptor
;
1054 PDEVICE_OBJECT DeviceObject
;
1058 PDEVICE_OBJECT DeviceObject
;
1061 struct _SCSI_REQUEST_BLOCK
*Srb
;
1064 DEVICE_RELATION_TYPE Type
;
1065 } QueryDeviceRelations
;
1067 const GUID
*InterfaceType
;
1070 PINTERFACE Interface
;
1071 PVOID InterfaceSpecificData
;
1074 PDEVICE_CAPABILITIES Capabilities
;
1075 } DeviceCapabilities
;
1077 PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList
;
1078 } FilterResourceRequirements
;
1083 ULONG POINTER_ALIGNMENT Length
;
1089 BUS_QUERY_ID_TYPE IdType
;
1092 DEVICE_TEXT_TYPE DeviceTextType
;
1093 LCID POINTER_ALIGNMENT LocaleId
;
1097 BOOLEAN Reserved
[3];
1098 DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type
;
1099 } UsageNotification
;
1101 SYSTEM_POWER_STATE PowerState
;
1104 PPOWER_SEQUENCE PowerSequence
;
1107 ULONG SystemContext
;
1108 POWER_STATE_TYPE POINTER_ALIGNMENT Type
;
1109 POWER_STATE POINTER_ALIGNMENT State
;
1110 POWER_ACTION POINTER_ALIGNMENT ShutdownType
;
1113 PCM_RESOURCE_LIST AllocatedResources
;
1114 PCM_RESOURCE_LIST AllocatedResourcesTranslated
;
1117 ULONG_PTR ProviderId
;
1129 PDEVICE_OBJECT DeviceObject
;
1130 PFILE_OBJECT FileObject
;
1131 PIO_COMPLETION_ROUTINE CompletionRoutine
;
1133 } IO_STACK_LOCATION
, *PIO_STACK_LOCATION
;
1134 #if !defined(_WIN64)
1135 #include <poppack.h>
1138 /* MDL definitions */
1140 #define MDL_MAPPED_TO_SYSTEM_VA 0x0001
1141 #define MDL_PAGES_LOCKED 0x0002
1142 #define MDL_SOURCE_IS_NONPAGED_POOL 0x0004
1143 #define MDL_ALLOCATED_FIXED_SIZE 0x0008
1144 #define MDL_PARTIAL 0x0010
1145 #define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020
1146 #define MDL_IO_PAGE_READ 0x0040
1147 #define MDL_WRITE_OPERATION 0x0080
1148 #define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100
1149 #define MDL_FREE_EXTRA_PTES 0x0200
1150 #define MDL_DESCRIBES_AWE 0x0400
1151 #define MDL_IO_SPACE 0x0800
1152 #define MDL_NETWORK_HEADER 0x1000
1153 #define MDL_MAPPING_CAN_FAIL 0x2000
1154 #define MDL_ALLOCATED_MUST_SUCCEED 0x4000
1155 #define MDL_INTERNAL 0x8000
1157 #define MDL_MAPPING_FLAGS (MDL_MAPPED_TO_SYSTEM_VA | \
1158 MDL_PAGES_LOCKED | \
1159 MDL_SOURCE_IS_NONPAGED_POOL | \
1160 MDL_PARTIAL_HAS_BEEN_MAPPED | \
1161 MDL_PARENT_MAPPED_SYSTEM_VA | \
1165 typedef struct _MDL
{
1169 struct _EPROCESS
*Process
;
1170 PVOID MappedSystemVa
;
1177 typedef ULONG PFN_NUMBER
, *PPFN_NUMBER
;
1179 static inline void MmInitializeMdl(MDL
*mdl
, void *va
, SIZE_T length
)
1182 mdl
->Size
= sizeof(MDL
) + sizeof(PFN_NUMBER
) * ADDRESS_AND_SIZE_TO_SPAN_PAGES(va
, length
);
1184 mdl
->StartVa
= (void *)PAGE_ALIGN(va
);
1185 mdl
->ByteOffset
= BYTE_OFFSET(va
);
1186 mdl
->ByteCount
= length
;
1189 typedef struct _KTIMER
{
1190 DISPATCHER_HEADER Header
;
1191 ULARGE_INTEGER DueTime
;
1192 LIST_ENTRY TimerListEntry
;
1197 typedef struct _KSYSTEM_TIME
{
1201 } KSYSTEM_TIME
, *PKSYSTEM_TIME
;
1203 typedef enum _NT_PRODUCT_TYPE
{
1207 } NT_PRODUCT_TYPE
, *PNT_PRODUCT_TYPE
;
1209 #define PROCESSOR_FEATURE_MAX 64
1211 typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
1216 } ALTERNATIVE_ARCHITECTURE_TYPE
;
1218 #define NX_SUPPORT_POLICY_ALWAYSOFF 0
1219 #define NX_SUPPORT_POLICY_ALWAYSON 1
1220 #define NX_SUPPORT_POLICY_OPTIN 2
1221 #define NX_SUPPORT_POLICY_OPTOUT 3
1223 typedef struct _KUSER_SHARED_DATA
{
1224 ULONG TickCountLowDeprecated
; /* 0x000 */
1225 ULONG TickCountMultiplier
; /* 0x004 */
1226 volatile KSYSTEM_TIME InterruptTime
; /* 0x008 */
1227 volatile KSYSTEM_TIME SystemTime
; /* 0x014 */
1228 volatile KSYSTEM_TIME TimeZoneBias
; /* 0x020 */
1229 USHORT ImageNumberLow
; /* 0x02c */
1230 USHORT ImageNumberHigh
; /* 0x02e */
1231 WCHAR NtSystemRoot
[260]; /* 0x030 */
1232 ULONG MaxStackTraceDepth
; /* 0x238 */
1233 ULONG CryptoExponent
; /* 0x23c */
1234 ULONG TimeZoneId
; /* 0x240 */
1235 ULONG LargePageMinimum
; /* 0x244 */
1236 ULONG AitSamplingValue
; /* 0x248 */
1237 ULONG AppCompatFlag
; /* 0x24c */
1238 ULONGLONG RNGSeedVersion
; /* 0x250 */
1239 ULONG GlobalValidationRunLevel
; /* 0x258 */
1240 volatile ULONG TimeZoneBiasStamp
; /* 0x25c */
1241 ULONG NtBuildNumber
; /* 0x260 */
1242 NT_PRODUCT_TYPE NtProductType
; /* 0x264 */
1243 BOOLEAN ProductTypeIsValid
; /* 0x268 */
1244 USHORT NativeProcessorArchitecture
; /* 0x26a */
1245 ULONG NtMajorVersion
; /* 0x26c */
1246 ULONG NtMinorVersion
; /* 0x270 */
1247 BOOLEAN ProcessorFeatures
[PROCESSOR_FEATURE_MAX
]; /* 0x274 */
1248 ULONG Reserved1
; /* 0x2b4 */
1249 ULONG Reserved3
; /* 0x2b8 */
1250 volatile ULONG TimeSlip
; /* 0x2bc */
1251 ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture
; /* 0x2c0 */
1252 ULONG BootId
; /* 0x2c4 */
1253 LARGE_INTEGER SystemExpirationDate
; /* 0x2c8 */
1254 ULONG SuiteMask
; /* 0x2d0 */
1255 BOOLEAN KdDebuggerEnabled
; /* 0x2d4 */
1256 UCHAR NXSupportPolicy
; /* 0x2d5 */
1257 USHORT CyclesPerYield
; /* 0x2d6 */
1258 volatile ULONG ActiveConsoleId
; /* 0x2d8 */
1259 volatile ULONG DismountCount
; /* 0x2dc */
1260 ULONG ComPlusPackage
; /* 0x2e0 */
1261 ULONG LastSystemRITEventTickCount
; /* 0x2e4 */
1262 ULONG NumberOfPhysicalPages
; /* 0x2e8 */
1263 BOOLEAN SafeBootMode
; /* 0x2ec */
1264 UCHAR VirtualizationFlags
; /* 0x2ed */
1266 ULONG SharedDataFlags
; /* 0x2f0 */
1268 ULONG DbgErrorPortPresent
: 1;
1269 ULONG DbgElevationEnabed
: 1;
1270 ULONG DbgVirtEnabled
: 1;
1271 ULONG DbgInstallerDetectEnabled
: 1;
1272 ULONG DbgLkgEnabled
: 1;
1273 ULONG DbgDynProcessorEnabled
: 1;
1274 ULONG DbgConsoleBrokerEnabled
: 1;
1275 ULONG DbgSecureBootEnabled
: 1;
1276 ULONG DbgMultiSessionSku
: 1;
1277 ULONG DbgMultiUsersInSessionSku
: 1;
1278 ULONG DbgStateSeparationEnabled
: 1;
1279 ULONG SpareBits
: 21;
1282 ULONG DataFlagsPad
[1]; /* 0x2f4 */
1283 ULONGLONG TestRetInstruction
; /* 0x2f8 */
1284 LONGLONG QpcFrequency
; /* 0x300 */
1285 ULONG SystemCall
; /* 0x308 */
1287 ULONG AllFlags
; /* 0x30c */
1289 ULONG Win32Process
: 1;
1290 ULONG Sgx2Enclave
: 1;
1291 ULONG VbsBasicEnclave
: 1;
1292 ULONG SpareBits
: 29;
1294 } UserCetAvailableEnvironments
;
1295 ULONGLONG SystemCallPad
[2]; /* 0x310 */
1297 volatile KSYSTEM_TIME TickCount
; /* 0x320 */
1298 volatile ULONG64 TickCountQuad
;
1300 ULONG Cookie
; /* 0x330 */
1301 ULONG CookiePad
[1]; /* 0x334 */
1302 LONGLONG ConsoleSessionForegroundProcessId
; /* 0x338 */
1303 ULONGLONG TimeUpdateLock
; /* 0x340 */
1304 ULONGLONG BaselineSystemTimeQpc
; /* 0x348 */
1305 ULONGLONG BaselineInterruptTimeQpc
; /* 0x350 */
1306 ULONGLONG QpcSystemTimeIncrement
; /* 0x358 */
1307 ULONGLONG QpcInterruptTimeIncrement
; /* 0x360 */
1308 UCHAR QpcSystemTimeIncrementShift
; /* 0x368 */
1309 UCHAR QpcInterruptTimeIncrementShift
; /* 0x369 */
1310 USHORT UnparkedProcessorCount
; /* 0x36a */
1311 ULONG EnclaveFeatureMask
[4]; /* 0x36c */
1312 ULONG TelemetryCoverageRound
; /* 0x37c */
1313 USHORT UserModeGlobalLogger
[16]; /* 0x380 */
1314 ULONG ImageFileExecutionOptions
; /* 0x3a0 */
1315 ULONG LangGenerationCount
; /* 0x3a4 */
1316 ULONG ActiveProcessorAffinity
; /* 0x3a8 */
1317 volatile ULONGLONG InterruptTimeBias
; /* 0x3b0 */
1318 volatile ULONGLONG QpcBias
; /* 0x3b8 */
1319 ULONG ActiveProcessorCount
; /* 0x3c0 */
1320 volatile UCHAR ActiveGroupCount
; /* 0x3c4 */
1322 USHORT QpcData
; /* 0x3c6 */
1324 UCHAR
volatile QpcBypassEnabled
;
1328 LARGE_INTEGER TimeZoneBiasEffectiveStart
; /* 0x3c8 */
1329 LARGE_INTEGER TimeZoneBiasEffectiveEnd
; /* 0x3d0 */
1330 XSTATE_CONFIGURATION XState
; /* 0x3d8 */
1331 } KSHARED_USER_DATA
, *PKSHARED_USER_DATA
;
1333 #define SHARED_GLOBAL_FLAGS_QPC_BYPASS_ENABLED 0x01
1334 #define SHARED_GLOBAL_FLAGS_QPC_BYPASS_USE_HV_PAGE 0x02
1335 #define SHARED_GLOBAL_FLAGS_QPC_BYPASS_DISABLE_32BIT 0x04
1336 #define SHARED_GLOBAL_FLAGS_QPC_BYPASS_USE_MFENCE 0x10
1337 #define SHARED_GLOBAL_FLAGS_QPC_BYPASS_USE_LFENCE 0x20
1338 #define SHARED_GLOBAL_FLAGS_QPC_BYPASS_A73_ERRATA 0x40
1339 #define SHARED_GLOBAL_FLAGS_QPC_BYPASS_USE_RDTSCP 0x80
1341 typedef enum _MEMORY_CACHING_TYPE
{
1344 MmWriteCombined
= 2,
1345 MmHardwareCoherentCached
= 3,
1346 MmNonCachedUnordered
= 4,
1348 MmMaximumCacheType
= 6
1349 } MEMORY_CACHING_TYPE
;
1351 typedef enum _MM_PAGE_PRIORITY
{
1353 NormalPagePriority
= 16,
1354 HighPagePriority
= 32
1357 typedef enum _MM_SYSTEM_SIZE
1364 typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK
{
1366 BOOLEAN Reserved
[3];
1369 } IO_REMOVE_LOCK_COMMON_BLOCK
;
1371 typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK
*PIO_REMOVE_LOCK_TRACKING_BLOCK
;
1373 typedef struct _IO_REMOVE_LOCK_DBG_BLOCK
{
1376 LONGLONG MaxLockedTicks
;
1378 LIST_ENTRY LockList
;
1380 LONG LowMemoryCount
;
1383 PIO_REMOVE_LOCK_TRACKING_BLOCK Blocks
;
1384 } IO_REMOVE_LOCK_DBG_BLOCK
;
1386 typedef struct _IO_REMOVE_LOCK
{
1387 IO_REMOVE_LOCK_COMMON_BLOCK Common
;
1388 IO_REMOVE_LOCK_DBG_BLOCK Dbg
;
1389 } IO_REMOVE_LOCK
, *PIO_REMOVE_LOCK
;
1397 typedef struct _CALLBACK_OBJECT
1401 LIST_ENTRY RegisteredCallbacks
;
1402 BOOLEAN AllowMultipleCallbacks
;
1404 } CALLBACK_OBJECT
, *PCALLBACK_OBJECT
;
1406 typedef struct _KSPIN_LOCK_QUEUE
{
1407 struct _KSPIN_LOCK_QUEUE
* volatile Next
;
1408 volatile PKSPIN_LOCK Lock
;
1409 } KSPIN_LOCK_QUEUE
, *PKSPIN_LOCK_QUEUE
;
1411 typedef struct _KLOCK_QUEUE_HANDLE
{
1412 KSPIN_LOCK_QUEUE LockQueue
;
1414 } KLOCK_QUEUE_HANDLE
, *PKLOCK_QUEUE_HANDLE
;
1416 typedef void * (__WINE_ALLOC_SIZE(2) NTAPI
*PALLOCATE_FUNCTION
)(POOL_TYPE
, SIZE_T
, ULONG
);
1417 typedef void * (__WINE_ALLOC_SIZE(2) NTAPI
*PALLOCATE_FUNCTION_EX
)(POOL_TYPE
, SIZE_T
, ULONG
, PLOOKASIDE_LIST_EX
);
1418 typedef void (NTAPI
*PFREE_FUNCTION
)(void *);
1419 typedef void (NTAPI
*PFREE_FUNCTION_EX
)(void *, PLOOKASIDE_LIST_EX
);
1420 typedef void (NTAPI
*PCALLBACK_FUNCTION
)(void *, void *, void *);
1423 #define LOOKASIDE_ALIGN DECLSPEC_CACHEALIGN
1425 #define LOOKASIDE_ALIGN
1428 #define LOOKASIDE_MINIMUM_BLOCK_SIZE (RTL_SIZEOF_THROUGH_FIELD(SLIST_ENTRY, Next))
1430 #define GENERAL_LOOKASIDE_LAYOUT \
1433 SLIST_HEADER ListHead; \
1434 SINGLE_LIST_ENTRY SingleListHead; \
1437 USHORT MaximumDepth; \
1438 ULONG TotalAllocates; \
1441 ULONG AllocateMisses; \
1442 ULONG AllocateHits; \
1443 } DUMMYUNIONNAME2; \
1449 } DUMMYUNIONNAME3; \
1455 PALLOCATE_FUNCTION_EX AllocateEx; \
1456 PALLOCATE_FUNCTION Allocate; \
1457 } DUMMYUNIONNAME4; \
1460 PFREE_FUNCTION_EX FreeEx; \
1461 PFREE_FUNCTION Free; \
1462 } DUMMYUNIONNAME5; \
1463 LIST_ENTRY ListEntry; \
1464 ULONG LastTotalAllocates; \
1467 ULONG LastAllocateMisses; \
1468 ULONG LastAllocateHits; \
1469 } DUMMYUNIONNAME6; \
1472 typedef struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE
1474 GENERAL_LOOKASIDE_LAYOUT
1475 } GENERAL_LOOKASIDE
;
1477 typedef struct _GENERAL_LOOKASIDE_POOL
1479 GENERAL_LOOKASIDE_LAYOUT
1480 } GENERAL_LOOKASIDE_POOL
, *PGENERAL_LOOKASIDE_POOL
;
1482 typedef struct _LOOKASIDE_LIST_EX
1484 GENERAL_LOOKASIDE_POOL L
;
1485 } LOOKASIDE_LIST_EX
;
1487 typedef struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST
1489 GENERAL_LOOKASIDE L
;
1490 #if defined(__i386__)
1491 KSPIN_LOCK Lock__ObsoleteButDoNotDelete
;
1493 } NPAGED_LOOKASIDE_LIST
, *PNPAGED_LOOKASIDE_LIST
;
1495 typedef struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST
1497 GENERAL_LOOKASIDE L
;
1498 #if defined(__i386__)
1499 FAST_MUTEX Lock__ObsoleteButDoNotDelete
;
1501 } PAGED_LOOKASIDE_LIST
, *PPAGED_LOOKASIDE_LIST
;
1503 typedef NTSTATUS (NTAPI EX_CALLBACK_FUNCTION
)(void *CallbackContext
, void *Argument1
, void *Argument2
);
1504 typedef EX_CALLBACK_FUNCTION
*PEX_CALLBACK_FUNCTION
;
1506 typedef ULONG OB_OPERATION
;
1508 typedef struct _OB_PRE_CREATE_HANDLE_INFORMATION
{
1509 ACCESS_MASK DesiredAccess
;
1510 ACCESS_MASK OriginalDesiredAccess
;
1511 } OB_PRE_CREATE_HANDLE_INFORMATION
, *POB_PRE_CREATE_HANDLE_INFORMATION
;
1513 typedef struct _OB_PRE_DUPLICATE_HANDLE_INFORMATION
{
1514 ACCESS_MASK DesiredAccess
;
1515 ACCESS_MASK OriginalDesiredAccess
;
1516 PVOID SourceProcess
;
1517 PVOID TargetProcess
;
1518 } OB_PRE_DUPLICATE_HANDLE_INFORMATION
, *POB_PRE_DUPLICATE_HANDLE_INFORMATION
;
1520 typedef union _OB_PRE_OPERATION_PARAMETERS
{
1521 OB_PRE_CREATE_HANDLE_INFORMATION CreateHandleInformation
;
1522 OB_PRE_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation
;
1523 } OB_PRE_OPERATION_PARAMETERS
, *POB_PRE_OPERATION_PARAMETERS
;
1525 typedef struct _OB_PRE_OPERATION_INFORMATION
{
1526 OB_OPERATION Operation
;
1530 ULONG KernelHandle
:1;
1535 POBJECT_TYPE ObjectType
;
1537 POB_PRE_OPERATION_PARAMETERS Parameters
;
1538 } OB_PRE_OPERATION_INFORMATION
, *POB_PRE_OPERATION_INFORMATION
;
1540 typedef struct _OB_POST_CREATE_HANDLE_INFORMATION
{
1541 ACCESS_MASK GrantedAccess
;
1542 } OB_POST_CREATE_HANDLE_INFORMATION
, *POB_POST_CREATE_HANDLE_INFORMATION
;
1544 typedef struct _OB_POST_DUPLICATE_HANDLE_INFORMATION
{
1545 ACCESS_MASK GrantedAccess
;
1546 } OB_POST_DUPLICATE_HANDLE_INFORMATION
, *POB_POST_DUPLICATE_HANDLE_INFORMATION
;
1548 typedef union _OB_POST_OPERATION_PARAMETERS
{
1549 OB_POST_CREATE_HANDLE_INFORMATION CreateHandleInformation
;
1550 OB_POST_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation
;
1551 } OB_POST_OPERATION_PARAMETERS
, *POB_POST_OPERATION_PARAMETERS
;
1553 typedef struct _OB_POST_OPERATION_INFORMATION
{
1554 OB_OPERATION Operation
;
1558 ULONG KernelHandle
:1;
1563 POBJECT_TYPE ObjectType
;
1565 NTSTATUS ReturnStatus
;
1566 POB_POST_OPERATION_PARAMETERS Parameters
;
1567 } OB_POST_OPERATION_INFORMATION
,*POB_POST_OPERATION_INFORMATION
;
1569 typedef enum _OB_PREOP_CALLBACK_STATUS
{
1571 } OB_PREOP_CALLBACK_STATUS
, *POB_PREOP_CALLBACK_STATUS
;
1573 typedef OB_PREOP_CALLBACK_STATUS (WINAPI
*POB_PRE_OPERATION_CALLBACK
)(void *context
, POB_PRE_OPERATION_INFORMATION information
);
1574 typedef void (WINAPI
*POB_POST_OPERATION_CALLBACK
)(void *context
, POB_POST_OPERATION_INFORMATION information
);
1576 typedef struct _OB_OPERATION_REGISTRATION
{
1577 POBJECT_TYPE
*ObjectType
;
1578 OB_OPERATION Operations
;
1579 POB_PRE_OPERATION_CALLBACK PreOperation
;
1580 POB_POST_OPERATION_CALLBACK PostOperation
;
1581 } OB_OPERATION_REGISTRATION
, *POB_OPERATION_REGISTRATION
;
1583 typedef struct _OB_CALLBACK_REGISTRATION
{
1585 USHORT OperationRegistrationCount
;
1586 UNICODE_STRING Altitude
;
1587 PVOID RegistrationContext
;
1588 OB_OPERATION_REGISTRATION
*OperationRegistration
;
1589 } OB_CALLBACK_REGISTRATION
, *POB_CALLBACK_REGISTRATION
;
1591 #define OB_FLT_REGISTRATION_VERSION_0100 0x0100
1592 #define OB_FLT_REGISTRATION_VERSION OB_FLT_REGISTRATION_VERSION_0100
1594 typedef enum _DIRECTORY_NOTIFY_INFORMATION_CLASS
{
1595 DirectoryNotifyInformation
= 1,
1596 DirectoryNotifyExtendedInformation
1597 } DIRECTORY_NOTIFY_INFORMATION_CLASS
, *PDIRECTORY_NOTIFY_INFORMATION_CLASS
;
1599 typedef enum _WORK_QUEUE_TYPE
{
1602 HyperCriticalWorkQueue
,
1606 typedef void (WINAPI
*PIO_WORKITEM_ROUTINE
)(PDEVICE_OBJECT
,void*);
1608 NTSTATUS WINAPI
ObCloseHandle(IN HANDLE handle
);
1610 #ifdef NONAMELESSUNION
1611 # ifdef NONAMELESSSTRUCT
1612 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.u2.CurrentStackLocation)
1613 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.u2.CurrentStackLocation - 1)
1614 static inline void IoSkipCurrentIrpStackLocation(IRP
*irp
) {irp
->Tail
.Overlay
.s
.u2
.CurrentStackLocation
++; irp
->CurrentLocation
++;}
1616 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.u2.CurrentStackLocation)
1617 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.u2.CurrentStackLocation - 1)
1618 static inline void IoSkipCurrentIrpStackLocation(IRP
*irp
) {irp
->Tail
.Overlay
.u2
.CurrentStackLocation
++; irp
->CurrentLocation
++;}
1621 # ifdef NONAMELESSSTRUCT
1622 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.CurrentStackLocation)
1623 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.s.CurrentStackLocation - 1)
1624 static inline void IoSkipCurrentIrpStackLocation(IRP
*irp
) {irp
->Tail
.Overlay
.s
.CurrentStackLocation
++; irp
->CurrentLocation
++;}
1626 # define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.CurrentStackLocation)
1627 # define IoGetNextIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.CurrentStackLocation - 1)
1628 static inline void IoSkipCurrentIrpStackLocation(IRP
*irp
) {irp
->Tail
.Overlay
.CurrentStackLocation
++; irp
->CurrentLocation
++;}
1632 #define IoSetCancelRoutine(irp, routine) \
1633 ((PDRIVER_CANCEL)InterlockedExchangePointer((void **)&(irp)->CancelRoutine, routine))
1635 static inline void IoSetCompletionRoutine(IRP
*irp
, PIO_COMPLETION_ROUTINE routine
, void *context
,
1636 BOOLEAN on_success
, BOOLEAN on_error
, BOOLEAN on_cancel
)
1638 IO_STACK_LOCATION
*irpsp
= IoGetNextIrpStackLocation(irp
);
1639 irpsp
->CompletionRoutine
= routine
;
1640 irpsp
->Context
= context
;
1642 if (on_success
) irpsp
->Control
|= SL_INVOKE_ON_SUCCESS
;
1643 if (on_error
) irpsp
->Control
|= SL_INVOKE_ON_ERROR
;
1644 if (on_cancel
) irpsp
->Control
|= SL_INVOKE_ON_CANCEL
;
1647 static inline void IoMarkIrpPending(IRP
*irp
)
1649 IoGetCurrentIrpStackLocation(irp
)->Control
|= SL_PENDING_RETURNED
;
1652 static inline void IoCopyCurrentIrpStackLocationToNext(IRP
*irp
)
1654 IO_STACK_LOCATION
*current
= IoGetCurrentIrpStackLocation(irp
);
1655 IO_STACK_LOCATION
*next
= IoGetNextIrpStackLocation(irp
);
1656 memcpy(next
, current
, FIELD_OFFSET(IO_STACK_LOCATION
, CompletionRoutine
));
1660 #define KernelMode 0
1663 /* directory object access rights */
1664 #define DIRECTORY_QUERY 0x0001
1665 #define DIRECTORY_TRAVERSE 0x0002
1666 #define DIRECTORY_CREATE_OBJECT 0x0004
1667 #define DIRECTORY_CREATE_SUBDIRECTORY 0x0008
1668 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
1670 /* symbolic link access rights */
1671 #define SYMBOLIC_LINK_QUERY 0x0001
1672 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
1674 #ifndef WINE_UNIX_LIB
1676 NTSTATUS WINAPI
DbgQueryDebugFilterState(ULONG
, ULONG
);
1678 void FASTCALL
ExAcquireFastMutex(FAST_MUTEX
*);
1679 void FASTCALL
ExAcquireFastMutexUnsafe(PFAST_MUTEX
);
1680 BOOLEAN WINAPI
ExAcquireResourceExclusiveLite(ERESOURCE
*,BOOLEAN
);
1681 BOOLEAN WINAPI
ExAcquireResourceSharedLite(ERESOURCE
*,BOOLEAN
);
1682 BOOLEAN WINAPI
ExAcquireSharedStarveExclusive(ERESOURCE
*,BOOLEAN
);
1683 BOOLEAN WINAPI
ExAcquireSharedWaitForExclusive(ERESOURCE
*,BOOLEAN
);
1684 void WINAPI
ExFreePool(PVOID
);
1685 PVOID WINAPI
ExAllocatePool(POOL_TYPE
,SIZE_T
) __WINE_ALLOC_SIZE(2) __WINE_DEALLOC(ExFreePool
) __WINE_MALLOC
;
1686 PVOID WINAPI
ExAllocatePoolWithQuota(POOL_TYPE
,SIZE_T
) __WINE_ALLOC_SIZE(2) __WINE_DEALLOC(ExFreePool
) __WINE_MALLOC
;
1687 void WINAPI
ExFreePoolWithTag(PVOID
,ULONG
);
1688 PVOID WINAPI
ExAllocatePoolWithTag(POOL_TYPE
,SIZE_T
,ULONG
) __WINE_ALLOC_SIZE(2) __WINE_DEALLOC(ExFreePoolWithTag
) __WINE_MALLOC
;
1689 PVOID WINAPI
ExAllocatePoolWithQuotaTag(POOL_TYPE
,SIZE_T
,ULONG
) __WINE_ALLOC_SIZE(2) __WINE_DEALLOC(ExFreePoolWithTag
) __WINE_MALLOC
;
1690 void WINAPI
ExDeleteNPagedLookasideList(PNPAGED_LOOKASIDE_LIST
);
1691 void WINAPI
ExDeletePagedLookasideList(PPAGED_LOOKASIDE_LIST
);
1692 NTSTATUS WINAPI
ExDeleteResourceLite(ERESOURCE
*);
1693 ULONG WINAPI
ExGetExclusiveWaiterCount(ERESOURCE
*);
1694 KPROCESSOR_MODE WINAPI
ExGetPreviousMode(void);
1695 ULONG WINAPI
ExGetSharedWaiterCount(ERESOURCE
*);
1696 void WINAPI
ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST
,PALLOCATE_FUNCTION
,PFREE_FUNCTION
,ULONG
,SIZE_T
,ULONG
,USHORT
);
1697 void WINAPI
ExInitializePagedLookasideList(PPAGED_LOOKASIDE_LIST
,PALLOCATE_FUNCTION
,PFREE_FUNCTION
,ULONG
,SIZE_T
,ULONG
,USHORT
);
1698 NTSTATUS WINAPI
ExInitializeResourceLite(ERESOURCE
*);
1699 PSLIST_ENTRY WINAPI
ExInterlockedFlushSList(PSLIST_HEADER
);
1700 PSLIST_ENTRY WINAPI
ExInterlockedPopEntrySList(PSLIST_HEADER
,PKSPIN_LOCK
);
1701 PSLIST_ENTRY WINAPI
ExInterlockedPushEntrySList(PSLIST_HEADER
,PSLIST_ENTRY
,PKSPIN_LOCK
);
1702 LIST_ENTRY
* WINAPI
ExInterlockedRemoveHeadList(LIST_ENTRY
*,KSPIN_LOCK
*);
1703 BOOLEAN WINAPI
ExIsResourceAcquiredExclusiveLite(ERESOURCE
*);
1704 ULONG WINAPI
ExIsResourceAcquiredSharedLite(ERESOURCE
*);
1705 void * WINAPI
ExRegisterCallback(PCALLBACK_OBJECT
,PCALLBACK_FUNCTION
,void*);
1706 void FASTCALL
ExReleaseFastMutex(FAST_MUTEX
*);
1707 void FASTCALL
ExReleaseFastMutexUnsafe(PFAST_MUTEX
);
1708 void WINAPI
ExReleaseResourceForThreadLite(ERESOURCE
*,ERESOURCE_THREAD
);
1709 ULONG WINAPI
ExSetTimerResolution(ULONG
,BOOLEAN
);
1710 void WINAPI
ExUnregisterCallback(void*);
1712 #define PLUGPLAY_PROPERTY_PERSISTENT 0x0001
1714 void WINAPI
IoFreeErrorLogEntry(void*);
1715 void WINAPI
IoFreeIrp(IRP
*);
1716 void WINAPI
IoFreeMdl(MDL
*);
1717 void WINAPI
IoFreeWorkItem(PIO_WORKITEM
);
1718 void WINAPI
IoAcquireCancelSpinLock(KIRQL
*);
1719 NTSTATUS WINAPI
IoAcquireRemoveLockEx(IO_REMOVE_LOCK
*,void*,const char*,ULONG
, ULONG
);
1720 NTSTATUS WINAPI
IoAllocateDriverObjectExtension(PDRIVER_OBJECT
,PVOID
,ULONG
,PVOID
*);
1721 void* WINAPI
IoAllocateErrorLogEntry(void*,unsigned char) __WINE_ALLOC_SIZE(2) __WINE_DEALLOC(IoFreeErrorLogEntry
) __WINE_MALLOC
;
1722 IRP
* WINAPI
IoAllocateIrp(char,BOOLEAN
) __WINE_DEALLOC(IoFreeIrp
);
1723 MDL
* WINAPI
IoAllocateMdl(void*,ULONG
,BOOLEAN
,BOOLEAN
,IRP
*) __WINE_DEALLOC(IoFreeMdl
);
1724 PIO_WORKITEM WINAPI
IoAllocateWorkItem(DEVICE_OBJECT
*) __WINE_DEALLOC(IoFreeWorkItem
);
1725 void WINAPI
IoDetachDevice(PDEVICE_OBJECT
);
1726 PDEVICE_OBJECT WINAPI
IoAttachDeviceToDeviceStack(PDEVICE_OBJECT
,PDEVICE_OBJECT
);
1727 PIRP WINAPI
IoBuildAsynchronousFsdRequest(ULONG
,DEVICE_OBJECT
*,void*,ULONG
,LARGE_INTEGER
*,IO_STATUS_BLOCK
*);
1728 PIRP WINAPI
IoBuildDeviceIoControlRequest(ULONG
,DEVICE_OBJECT
*,PVOID
,ULONG
,PVOID
,ULONG
,BOOLEAN
,PKEVENT
,IO_STATUS_BLOCK
*);
1729 PIRP WINAPI
IoBuildSynchronousFsdRequest(ULONG
,DEVICE_OBJECT
*,PVOID
,ULONG
,PLARGE_INTEGER
,PKEVENT
,IO_STATUS_BLOCK
*);
1730 NTSTATUS WINAPI
IoCallDriver(DEVICE_OBJECT
*,IRP
*);
1731 BOOLEAN WINAPI
IoCancelIrp(IRP
*);
1732 VOID WINAPI
IoCompleteRequest(IRP
*,UCHAR
);
1733 NTSTATUS WINAPI
IoCreateDevice(DRIVER_OBJECT
*,ULONG
,UNICODE_STRING
*,DEVICE_TYPE
,ULONG
,BOOLEAN
,DEVICE_OBJECT
**);
1734 NTSTATUS WINAPI
IoCreateDeviceSecure(DRIVER_OBJECT
*,ULONG
,UNICODE_STRING
*,DEVICE_TYPE
,ULONG
,BOOLEAN
,PCUNICODE_STRING
,LPCGUID
,DEVICE_OBJECT
**);
1735 NTSTATUS WINAPI
IoCreateDriver(UNICODE_STRING
*,PDRIVER_INITIALIZE
);
1736 NTSTATUS WINAPI
IoCreateSymbolicLink(UNICODE_STRING
*,UNICODE_STRING
*);
1737 PKEVENT WINAPI
IoCreateSynchronizationEvent(UNICODE_STRING
*,HANDLE
*);
1738 void WINAPI
IoDeleteDevice(DEVICE_OBJECT
*);
1739 void WINAPI
IoDeleteDriver(DRIVER_OBJECT
*);
1740 NTSTATUS WINAPI
IoDeleteSymbolicLink(UNICODE_STRING
*);
1741 DEVICE_OBJECT
* WINAPI
IoGetAttachedDeviceReference(DEVICE_OBJECT
*);
1742 PEPROCESS WINAPI
IoGetCurrentProcess(void);
1743 NTSTATUS WINAPI
IoGetDeviceInterfaces(const GUID
*,PDEVICE_OBJECT
,ULONG
,PWSTR
*);
1744 NTSTATUS WINAPI
IoGetDeviceObjectPointer(UNICODE_STRING
*,ACCESS_MASK
,PFILE_OBJECT
*,PDEVICE_OBJECT
*);
1745 NTSTATUS WINAPI
IoGetDeviceProperty(PDEVICE_OBJECT
,DEVICE_REGISTRY_PROPERTY
,ULONG
,PVOID
,PULONG
);
1746 PVOID WINAPI
IoGetDriverObjectExtension(PDRIVER_OBJECT
,PVOID
);
1747 PDEVICE_OBJECT WINAPI
IoGetRelatedDeviceObject(PFILE_OBJECT
);
1748 void WINAPI
IoGetStackLimits(ULONG_PTR
*,ULONG_PTR
*);
1749 void WINAPI
IoInitializeIrp(IRP
*,USHORT
,CCHAR
);
1750 VOID WINAPI
IoInitializeRemoveLockEx(PIO_REMOVE_LOCK
,ULONG
,ULONG
,ULONG
,ULONG
);
1751 void WINAPI
IoInvalidateDeviceRelations(PDEVICE_OBJECT
,DEVICE_RELATION_TYPE
);
1753 BOOLEAN WINAPI
IoIs32bitProcess(IRP
*);
1755 NTSTATUS WINAPI
IoOpenDeviceRegistryKey(DEVICE_OBJECT
*,ULONG
,ACCESS_MASK
,HANDLE
*);
1756 void WINAPI
IoQueueWorkItem(PIO_WORKITEM
,PIO_WORKITEM_ROUTINE
,WORK_QUEUE_TYPE
,void*);
1757 NTSTATUS WINAPI
IoRegisterDeviceInterface(PDEVICE_OBJECT
,const GUID
*,PUNICODE_STRING
,PUNICODE_STRING
);
1758 void WINAPI
IoReleaseCancelSpinLock(KIRQL
);
1759 void WINAPI
IoReleaseRemoveLockAndWaitEx(IO_REMOVE_LOCK
*,void*,ULONG
);
1760 void WINAPI
IoReleaseRemoveLockEx(IO_REMOVE_LOCK
*,void*,ULONG
);
1761 void WINAPI
IoReuseIrp(IRP
*,NTSTATUS
);
1762 NTSTATUS WINAPI
IoSetDeviceInterfaceState(UNICODE_STRING
*,BOOLEAN
);
1763 NTSTATUS WINAPI
IoSetDevicePropertyData(DEVICE_OBJECT
*,const DEVPROPKEY
*,LCID
,ULONG
,DEVPROPTYPE
,ULONG
,void*);
1764 NTSTATUS WINAPI
IoWMIRegistrationControl(PDEVICE_OBJECT
,ULONG
);
1766 void FASTCALL
KeAcquireInStackQueuedSpinLockAtDpcLevel(KSPIN_LOCK
*,KLOCK_QUEUE_HANDLE
*);
1768 void WINAPI
KeAcquireSpinLock(KSPIN_LOCK
*,KIRQL
*);
1770 #define KeAcquireSpinLock( lock, irql ) *(irql) = KeAcquireSpinLockRaiseToDpc( lock )
1771 KIRQL WINAPI
KeAcquireSpinLockRaiseToDpc(KSPIN_LOCK
*);
1773 void WINAPI
KeAcquireSpinLockAtDpcLevel(KSPIN_LOCK
*);
1774 void WINAPI DECLSPEC_NORETURN
KeBugCheckEx(ULONG
,ULONG_PTR
,ULONG_PTR
,ULONG_PTR
,ULONG_PTR
);
1775 BOOLEAN WINAPI
KeCancelTimer(KTIMER
*);
1776 void WINAPI
KeClearEvent(PRKEVENT
);
1777 NTSTATUS WINAPI
KeDelayExecutionThread(KPROCESSOR_MODE
,BOOLEAN
,LARGE_INTEGER
*);
1778 void WINAPI
KeEnterCriticalRegion(void);
1779 void WINAPI
KeGenericCallDpc(PKDEFERRED_ROUTINE
,PVOID
);
1780 ULONG WINAPI
KeGetCurrentProcessorNumber(void);
1781 PKTHREAD WINAPI
KeGetCurrentThread(void);
1782 void WINAPI
KeInitializeDeviceQueue(KDEVICE_QUEUE
*);
1783 void WINAPI
KeInitializeDpc(KDPC
*,PKDEFERRED_ROUTINE
,void*);
1784 void WINAPI
KeInitializeEvent(PRKEVENT
,EVENT_TYPE
,BOOLEAN
);
1785 void WINAPI
KeInitializeMutex(PRKMUTEX
,ULONG
);
1786 void WINAPI
KeInitializeSemaphore(PRKSEMAPHORE
,LONG
,LONG
);
1787 void WINAPI
KeInitializeTimerEx(PKTIMER
,TIMER_TYPE
);
1788 void WINAPI
KeInitializeTimer(KTIMER
*);
1789 BOOLEAN WINAPI
KeInsertDeviceQueue(KDEVICE_QUEUE
*,KDEVICE_QUEUE_ENTRY
*);
1790 void WINAPI
KeLeaveCriticalRegion(void);
1791 ULONG WINAPI
KeQueryActiveProcessorCountEx(USHORT
);
1792 KAFFINITY WINAPI
KeQueryActiveProcessors(void);
1793 void WINAPI
KeQuerySystemTime(LARGE_INTEGER
*);
1794 void WINAPI
KeQueryTickCount(LARGE_INTEGER
*);
1795 ULONG WINAPI
KeQueryTimeIncrement(void);
1796 LONG WINAPI
KeReadStateEvent(PRKEVENT
);
1797 void FASTCALL
KeReleaseInStackQueuedSpinLockFromDpcLevel(KLOCK_QUEUE_HANDLE
*);
1798 LONG WINAPI
KeReleaseMutex(PRKMUTEX
,BOOLEAN
);
1799 LONG WINAPI
KeReleaseSemaphore(PRKSEMAPHORE
,KPRIORITY
,LONG
,BOOLEAN
);
1800 void WINAPI
KeReleaseSpinLock(KSPIN_LOCK
*,KIRQL
);
1801 void WINAPI
KeReleaseSpinLockFromDpcLevel(KSPIN_LOCK
*);
1802 KDEVICE_QUEUE_ENTRY
* WINAPI
KeRemoveDeviceQueue(KDEVICE_QUEUE
*);
1803 LONG WINAPI
KeResetEvent(PRKEVENT
);
1804 void WINAPI
KeRevertToUserAffinityThread(void);
1805 void WINAPI
KeRevertToUserAffinityThreadEx(KAFFINITY affinity
);
1806 LONG WINAPI
KeSetEvent(PRKEVENT
,KPRIORITY
,BOOLEAN
);
1807 KPRIORITY WINAPI
KeSetPriorityThread(PKTHREAD
,KPRIORITY
);
1808 void WINAPI
KeSetSystemAffinityThread(KAFFINITY
);
1809 KAFFINITY WINAPI
KeSetSystemAffinityThreadEx(KAFFINITY affinity
);
1810 BOOLEAN WINAPI
KeSetTimer(KTIMER
*,LARGE_INTEGER
,KDPC
*);
1811 BOOLEAN WINAPI
KeSetTimerEx(KTIMER
*,LARGE_INTEGER
,LONG
,KDPC
*);
1812 void WINAPI
KeSignalCallDpcDone(void*);
1813 BOOLEAN WINAPI
KeSignalCallDpcSynchronize(void*);
1814 NTSTATUS WINAPI
KeWaitForMultipleObjects(ULONG
,void*[],WAIT_TYPE
,KWAIT_REASON
,KPROCESSOR_MODE
,BOOLEAN
,LARGE_INTEGER
*,KWAIT_BLOCK
*);
1815 NTSTATUS WINAPI
KeWaitForSingleObject(void*,KWAIT_REASON
,KPROCESSOR_MODE
,BOOLEAN
,LARGE_INTEGER
*);
1817 PVOID WINAPI
MmAllocateContiguousMemory(SIZE_T
,PHYSICAL_ADDRESS
) __WINE_ALLOC_SIZE(1) __WINE_MALLOC
;
1818 void WINAPI
MmFreeNonCachedMemory(PVOID
,SIZE_T
);
1819 PVOID WINAPI
MmAllocateNonCachedMemory(SIZE_T
) __WINE_ALLOC_SIZE(1) __WINE_DEALLOC(MmFreeNonCachedMemory
) __WINE_MALLOC
;
1820 PMDL WINAPI
MmAllocatePagesForMdl(PHYSICAL_ADDRESS
,PHYSICAL_ADDRESS
,PHYSICAL_ADDRESS
,SIZE_T
);
1821 void WINAPI
MmBuildMdlForNonPagedPool(MDL
*);
1822 NTSTATUS WINAPI
MmCopyVirtualMemory(PEPROCESS
,void*,PEPROCESS
,void*,SIZE_T
,KPROCESSOR_MODE
,SIZE_T
*);
1823 void * WINAPI
MmGetSystemRoutineAddress(UNICODE_STRING
*);
1824 PVOID WINAPI
MmMapLockedPagesSpecifyCache(PMDLX
,KPROCESSOR_MODE
,MEMORY_CACHING_TYPE
,PVOID
,ULONG
,MM_PAGE_PRIORITY
);
1825 MM_SYSTEMSIZE WINAPI
MmQuerySystemSize(void);
1826 void WINAPI
MmProbeAndLockPages(PMDLX
, KPROCESSOR_MODE
, LOCK_OPERATION
);
1827 void WINAPI
MmUnmapLockedPages(void*, PMDL
);
1829 void FASTCALL
ObfReferenceObject(void*);
1830 void WINAPI
ObDereferenceObject(void*);
1831 USHORT WINAPI
ObGetFilterVersion(void);
1832 NTSTATUS WINAPI
ObRegisterCallbacks(POB_CALLBACK_REGISTRATION
, void**);
1833 NTSTATUS WINAPI
ObReferenceObjectByHandle(HANDLE
,ACCESS_MASK
,POBJECT_TYPE
,KPROCESSOR_MODE
,PVOID
*,POBJECT_HANDLE_INFORMATION
);
1834 NTSTATUS WINAPI
ObReferenceObjectByName(UNICODE_STRING
*,ULONG
,ACCESS_STATE
*,ACCESS_MASK
,POBJECT_TYPE
,KPROCESSOR_MODE
,void*,void**);
1835 NTSTATUS WINAPI
ObReferenceObjectByPointer(void*,ACCESS_MASK
,POBJECT_TYPE
,KPROCESSOR_MODE
);
1836 void WINAPI
ObUnRegisterCallbacks(void*);
1838 NTSTATUS WINAPI
PoCallDriver(DEVICE_OBJECT
*,IRP
*);
1839 POWER_STATE WINAPI
PoSetPowerState(PDEVICE_OBJECT
,POWER_STATE_TYPE
,POWER_STATE
);
1840 void WINAPI
PoStartNextPowerIrp(IRP
*);
1842 NTSTATUS WINAPI
PsCreateSystemThread(PHANDLE
,ULONG
,POBJECT_ATTRIBUTES
,HANDLE
,PCLIENT_ID
,PKSTART_ROUTINE
,PVOID
);
1843 #define PsGetCurrentProcess() IoGetCurrentProcess()
1844 #define PsGetCurrentThread() ((PETHREAD)KeGetCurrentThread())
1845 HANDLE WINAPI
PsGetCurrentProcessId(void);
1846 HANDLE WINAPI
PsGetCurrentThreadId(void);
1847 HANDLE WINAPI
PsGetProcessInheritedFromUniqueProcessId(PEPROCESS
);
1848 BOOLEAN WINAPI
PsGetVersion(ULONG
*,ULONG
*,ULONG
*,UNICODE_STRING
*);
1849 NTSTATUS WINAPI
PsTerminateSystemThread(NTSTATUS
);
1852 NTSYSAPI
void WINAPI
RtlCopyMemoryNonTemporal(void*,const void*,SIZE_T
);
1854 #define RtlCopyMemoryNonTemporal RtlCopyMemory
1856 BOOLEAN WINAPI
RtlIsNtDdiVersionAvailable(ULONG
);
1858 NTSTATUS WINAPI
ZwAddBootEntry(PUNICODE_STRING
,PUNICODE_STRING
);
1859 NTSTATUS WINAPI
ZwAccessCheckAndAuditAlarm(PUNICODE_STRING
,HANDLE
,PUNICODE_STRING
,PUNICODE_STRING
,PSECURITY_DESCRIPTOR
,ACCESS_MASK
,PGENERIC_MAPPING
,BOOLEAN
,PACCESS_MASK
,PBOOLEAN
,PBOOLEAN
);
1860 NTSTATUS WINAPI
ZwAdjustPrivilegesToken(HANDLE
,BOOLEAN
,PTOKEN_PRIVILEGES
,DWORD
,PTOKEN_PRIVILEGES
,PDWORD
);
1861 NTSTATUS WINAPI
ZwAlertThread(HANDLE ThreadHandle
);
1862 NTSTATUS WINAPI
ZwAllocateVirtualMemory(HANDLE
,PVOID
*,ULONG
,SIZE_T
*,ULONG
,ULONG
);
1863 NTSTATUS WINAPI
ZwCancelIoFile(HANDLE
,PIO_STATUS_BLOCK
);
1864 NTSTATUS WINAPI
ZwCancelTimer(HANDLE
, BOOLEAN
*);
1865 NTSTATUS WINAPI
ZwClearEvent(HANDLE
);
1866 NTSTATUS WINAPI
ZwClose(HANDLE
);
1867 NTSTATUS WINAPI
ZwCloseObjectAuditAlarm(PUNICODE_STRING
,HANDLE
,BOOLEAN
);
1868 NTSTATUS WINAPI
ZwConnectPort(PHANDLE
,PUNICODE_STRING
,PSECURITY_QUALITY_OF_SERVICE
,PLPC_SECTION_WRITE
,PLPC_SECTION_READ
,PULONG
,PVOID
,PULONG
);
1869 NTSTATUS WINAPI
ZwCreateDirectoryObject(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
);
1870 NTSTATUS WINAPI
ZwCreateEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,BOOLEAN
,BOOLEAN
);
1871 NTSTATUS WINAPI
ZwCreateFile(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PIO_STATUS_BLOCK
,PLARGE_INTEGER
,ULONG
,ULONG
,ULONG
,ULONG
,PVOID
,ULONG
);
1872 NTSTATUS WINAPI
ZwCreateKey(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,ULONG
,const UNICODE_STRING
*,ULONG
,PULONG
);
1873 NTSTATUS WINAPI
ZwCreateSection(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const LARGE_INTEGER
*,ULONG
,ULONG
,HANDLE
);
1874 NTSTATUS WINAPI
ZwCreateSymbolicLinkObject(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PUNICODE_STRING
);
1875 NTSTATUS WINAPI
ZwCreateTimer(HANDLE
*, ACCESS_MASK
, const OBJECT_ATTRIBUTES
*, TIMER_TYPE
);
1876 NTSTATUS WINAPI
ZwDeleteAtom(RTL_ATOM
);
1877 NTSTATUS WINAPI
ZwDeleteFile(POBJECT_ATTRIBUTES
);
1878 NTSTATUS WINAPI
ZwDeleteKey(HANDLE
);
1879 NTSTATUS WINAPI
ZwDeleteValueKey(HANDLE
,const UNICODE_STRING
*);
1880 NTSTATUS WINAPI
ZwDeviceIoControlFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,PVOID
,ULONG
,PVOID
,ULONG
);
1881 NTSTATUS WINAPI
ZwDisplayString(PUNICODE_STRING
);
1882 NTSTATUS WINAPI
ZwDuplicateObject(HANDLE
,HANDLE
,HANDLE
,PHANDLE
,ACCESS_MASK
,ULONG
,ULONG
);
1883 NTSTATUS WINAPI
ZwDuplicateToken(HANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,SECURITY_IMPERSONATION_LEVEL
,TOKEN_TYPE
,PHANDLE
);
1884 NTSTATUS WINAPI
ZwEnumerateKey(HANDLE
,ULONG
,KEY_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
1885 NTSTATUS WINAPI
ZwEnumerateValueKey(HANDLE
,ULONG
,KEY_VALUE_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
1886 NTSTATUS WINAPI
ZwFlushInstructionCache(HANDLE
,LPCVOID
,SIZE_T
);
1887 NTSTATUS WINAPI
ZwFlushKey(HANDLE
);
1888 NTSTATUS WINAPI
ZwFlushVirtualMemory(HANDLE
,LPCVOID
*,SIZE_T
*,ULONG
);
1889 NTSTATUS WINAPI
ZwFreeVirtualMemory(HANDLE
,PVOID
*,SIZE_T
*,ULONG
);
1890 NTSTATUS WINAPI
ZwFsControlFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,PVOID
,ULONG
,PVOID
,ULONG
);
1891 NTSTATUS WINAPI
ZwInitiatePowerAction(POWER_ACTION
,SYSTEM_POWER_STATE
,ULONG
,BOOLEAN
);
1892 NTSTATUS WINAPI
ZwLoadDriver(const UNICODE_STRING
*);
1893 NTSTATUS WINAPI
ZwLoadKey(const OBJECT_ATTRIBUTES
*,OBJECT_ATTRIBUTES
*);
1894 NTSTATUS WINAPI
ZwLockVirtualMemory(HANDLE
,PVOID
*,SIZE_T
*,ULONG
);
1895 NTSTATUS WINAPI
ZwMakeTemporaryObject(HANDLE
);
1896 NTSTATUS WINAPI
ZwMapViewOfSection(HANDLE
,HANDLE
,PVOID
*,ULONG
,SIZE_T
,const LARGE_INTEGER
*,SIZE_T
*,SECTION_INHERIT
,ULONG
,ULONG
);
1897 NTSTATUS WINAPI
ZwNotifyChangeKey(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,ULONG
,BOOLEAN
,PVOID
,ULONG
,BOOLEAN
);
1898 NTSTATUS WINAPI
ZwOpenDirectoryObject(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
);
1899 NTSTATUS WINAPI
ZwOpenEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
1900 NTSTATUS WINAPI
ZwOpenFile(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
,PIO_STATUS_BLOCK
,ULONG
,ULONG
);
1901 NTSTATUS WINAPI
ZwOpenKey(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
1902 NTSTATUS WINAPI
ZwOpenProcess(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const CLIENT_ID
*);
1903 NTSTATUS WINAPI
ZwOpenProcessToken(HANDLE
,DWORD
,HANDLE
*);
1904 NTSTATUS WINAPI
ZwOpenSection(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
1905 NTSTATUS WINAPI
ZwOpenSymbolicLinkObject(PHANDLE
,ACCESS_MASK
,POBJECT_ATTRIBUTES
);
1906 NTSTATUS WINAPI
ZwOpenThread(HANDLE
*,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,const CLIENT_ID
*);
1907 NTSTATUS WINAPI
ZwOpenThreadToken(HANDLE
,DWORD
,BOOLEAN
,HANDLE
*);
1908 NTSTATUS WINAPI
ZwOpenTimer(HANDLE
*, ACCESS_MASK
, const OBJECT_ATTRIBUTES
*);
1909 NTSTATUS WINAPI
ZwPowerInformation(POWER_INFORMATION_LEVEL
,PVOID
,ULONG
,PVOID
,ULONG
);
1910 NTSTATUS WINAPI
ZwPulseEvent(HANDLE
,PULONG
);
1911 NTSTATUS WINAPI
ZwQueryDefaultLocale(BOOLEAN
,LCID
*);
1912 NTSTATUS WINAPI
ZwQueryDefaultUILanguage(LANGID
*);
1913 NTSTATUS WINAPI
ZwQueryDirectoryFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,FILE_INFORMATION_CLASS
,BOOLEAN
,PUNICODE_STRING
,BOOLEAN
);
1914 NTSTATUS WINAPI
ZwQueryDirectoryObject(HANDLE
,PDIRECTORY_BASIC_INFORMATION
,ULONG
,BOOLEAN
,BOOLEAN
,PULONG
,PULONG
);
1915 NTSTATUS WINAPI
ZwQueryEaFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,BOOLEAN
,PVOID
,ULONG
,PVOID
,BOOLEAN
);
1916 NTSTATUS WINAPI
ZwQueryFullAttributesFile(const OBJECT_ATTRIBUTES
*,FILE_NETWORK_OPEN_INFORMATION
*);
1917 NTSTATUS WINAPI
ZwQueryInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,LONG
,FILE_INFORMATION_CLASS
);
1918 NTSTATUS WINAPI
ZwQueryInformationThread(HANDLE
,THREADINFOCLASS
,PVOID
,ULONG
,PULONG
);
1919 NTSTATUS WINAPI
ZwQueryInformationToken(HANDLE
,DWORD
,PVOID
,DWORD
,LPDWORD
);
1920 NTSTATUS WINAPI
ZwQueryInstallUILanguage(LANGID
*);
1921 NTSTATUS WINAPI
ZwQueryKey(HANDLE
,KEY_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
1922 NTSTATUS WINAPI
ZwQueryObject(HANDLE
, OBJECT_INFORMATION_CLASS
, PVOID
, ULONG
, PULONG
);
1923 NTSTATUS WINAPI
ZwQuerySecurityObject(HANDLE
,SECURITY_INFORMATION
,PSECURITY_DESCRIPTOR
,ULONG
,PULONG
);
1924 NTSTATUS WINAPI
ZwQuerySection(HANDLE
,SECTION_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
1925 NTSTATUS WINAPI
ZwQuerySymbolicLinkObject(HANDLE
,PUNICODE_STRING
,PULONG
);
1926 NTSTATUS WINAPI
ZwQuerySystemInformation(SYSTEM_INFORMATION_CLASS
,PVOID
,ULONG
,PULONG
);
1927 NTSTATUS WINAPI
ZwQueryTimerResolution(PULONG
,PULONG
,PULONG
);
1928 NTSTATUS WINAPI
ZwQueryValueKey(HANDLE
,const UNICODE_STRING
*,KEY_VALUE_INFORMATION_CLASS
,void *,DWORD
,DWORD
*);
1929 NTSTATUS WINAPI
ZwQueryVolumeInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,FS_INFORMATION_CLASS
);
1930 NTSTATUS WINAPI
ZwReadFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,PLARGE_INTEGER
,PULONG
);
1931 NTSTATUS WINAPI
ZwReplaceKey(POBJECT_ATTRIBUTES
,HANDLE
,POBJECT_ATTRIBUTES
);
1932 NTSTATUS WINAPI
ZwRequestWaitReplyPort(HANDLE
,PLPC_MESSAGE
,PLPC_MESSAGE
);
1933 NTSTATUS WINAPI
ZwResetEvent(HANDLE
,PULONG
);
1934 NTSTATUS WINAPI
ZwRestoreKey(HANDLE
,HANDLE
,ULONG
);
1935 NTSTATUS WINAPI
ZwSaveKey(HANDLE
,HANDLE
);
1936 NTSTATUS WINAPI
ZwSecureConnectPort(PHANDLE
,PUNICODE_STRING
,PSECURITY_QUALITY_OF_SERVICE
,PLPC_SECTION_WRITE
,PSID
,PLPC_SECTION_READ
,PULONG
,PVOID
,PULONG
);
1937 NTSTATUS WINAPI
ZwSetDefaultLocale(BOOLEAN
,LCID
);
1938 NTSTATUS WINAPI
ZwSetDefaultUILanguage(LANGID
);
1939 NTSTATUS WINAPI
ZwSetEaFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
);
1940 NTSTATUS WINAPI
ZwSetEvent(HANDLE
,PULONG
);
1941 NTSTATUS WINAPI
ZwSetInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,FILE_INFORMATION_CLASS
);
1942 NTSTATUS WINAPI
ZwSetInformationKey(HANDLE
,const int,PVOID
,ULONG
);
1943 NTSTATUS WINAPI
ZwSetInformationObject(HANDLE
, OBJECT_INFORMATION_CLASS
, PVOID
, ULONG
);
1944 NTSTATUS WINAPI
ZwSetInformationProcess(HANDLE
,PROCESSINFOCLASS
,PVOID
,ULONG
);
1945 NTSTATUS WINAPI
ZwSetInformationThread(HANDLE
,THREADINFOCLASS
,LPCVOID
,ULONG
);
1946 NTSTATUS WINAPI
ZwSetIoCompletion(HANDLE
,ULONG
,ULONG
,NTSTATUS
,ULONG
);
1947 NTSTATUS WINAPI
ZwSetLdtEntries(ULONG
,ULONG
,ULONG
,ULONG
,ULONG
,ULONG
);
1948 NTSTATUS WINAPI
ZwSetSecurityObject(HANDLE
,SECURITY_INFORMATION
,PSECURITY_DESCRIPTOR
);
1949 NTSTATUS WINAPI
ZwSetSystemInformation(SYSTEM_INFORMATION_CLASS
,PVOID
,ULONG
);
1950 NTSTATUS WINAPI
ZwSetSystemTime(const LARGE_INTEGER
*,LARGE_INTEGER
*);
1951 NTSTATUS WINAPI
ZwSetTimer(HANDLE
, const LARGE_INTEGER
*, PTIMER_APC_ROUTINE
, PVOID
, BOOLEAN
, ULONG
, BOOLEAN
*);
1952 NTSTATUS WINAPI
ZwSetValueKey(HANDLE
,const UNICODE_STRING
*,ULONG
,ULONG
,const void *,ULONG
);
1953 NTSTATUS WINAPI
ZwSetVolumeInformationFile(HANDLE
,PIO_STATUS_BLOCK
,PVOID
,ULONG
,FS_INFORMATION_CLASS
);
1954 NTSTATUS WINAPI
ZwSuspendThread(HANDLE
,PULONG
);
1955 NTSTATUS WINAPI
ZwTerminateProcess(HANDLE
,LONG
);
1956 NTSTATUS WINAPI
ZwUnloadDriver(const UNICODE_STRING
*);
1957 NTSTATUS WINAPI
ZwUnloadKey(HANDLE
);
1958 NTSTATUS WINAPI
ZwUnmapViewOfSection(HANDLE
,PVOID
);
1959 NTSTATUS WINAPI
ZwWaitForSingleObject(HANDLE
,BOOLEAN
,const LARGE_INTEGER
*);
1960 NTSTATUS WINAPI
ZwWaitForMultipleObjects(ULONG
,const HANDLE
*,BOOLEAN
,BOOLEAN
,const LARGE_INTEGER
*);
1961 NTSTATUS WINAPI
ZwWriteFile(HANDLE
,HANDLE
,PIO_APC_ROUTINE
,PVOID
,PIO_STATUS_BLOCK
,const void*,ULONG
,PLARGE_INTEGER
,PULONG
);
1962 NTSTATUS WINAPI
ZwYieldExecution(void);
1964 static inline void ExInitializeFastMutex( FAST_MUTEX
*mutex
)
1966 mutex
->Count
= FM_LOCK_BIT
;
1967 mutex
->Owner
= NULL
;
1968 mutex
->Contention
= 0;
1969 KeInitializeEvent( &mutex
->Event
, SynchronizationEvent
, FALSE
);
1972 static FORCEINLINE
void WINAPI
KeInitializeSpinLock( KSPIN_LOCK
*lock
)
1977 static inline void *MmGetSystemAddressForMdlSafe(MDL
*mdl
, ULONG priority
)
1979 if (mdl
->MdlFlags
& (MDL_MAPPED_TO_SYSTEM_VA
| MDL_SOURCE_IS_NONPAGED_POOL
))
1980 return mdl
->MappedSystemVa
;
1982 return MmMapLockedPagesSpecifyCache(mdl
, KernelMode
, MmCached
, NULL
, FALSE
, priority
);
1985 #endif /* WINE_UNIX_LIB */