Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2004-2005 Ivan Leo Puoti |
| 3 | * |
| 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. |
| 8 | * |
| 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. |
| 13 | * |
| 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 |
Jonathan Ernst | 360a3f9 | 2006-05-18 14:49:52 +0200 | [diff] [blame] | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 17 | */ |
| 18 | |
| 19 | #ifndef _WDMDDK_ |
| 20 | #define _WDMDDK_ |
| 21 | #define _NTDDK_ |
| 22 | |
| 23 | #include <ntstatus.h> |
| 24 | |
| 25 | #ifdef _WIN64 |
| 26 | #define POINTER_ALIGNMENT DECLSPEC_ALIGN(8) |
| 27 | #else |
| 28 | #define POINTER_ALIGNMENT |
| 29 | #endif |
| 30 | |
| 31 | typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK; |
| 32 | |
| 33 | struct _KDPC; |
| 34 | struct _KAPC; |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 35 | struct _IRP; |
| 36 | struct _DEVICE_OBJECT; |
| 37 | struct _DRIVER_OBJECT; |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 38 | |
| 39 | typedef VOID (WINAPI *PKDEFERRED_ROUTINE)(struct _KDPC *, PVOID, PVOID, PVOID); |
Francois Gouget | 17c5773 | 2007-09-27 18:53:23 +0200 | [diff] [blame] | 40 | typedef VOID (WINAPI *PKSTART_ROUTINE)(PVOID); |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 41 | |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 42 | typedef NTSTATUS (WINAPI *PDRIVER_INITIALIZE)(struct _DRIVER_OBJECT *, PUNICODE_STRING); |
| 43 | typedef NTSTATUS (WINAPI *PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *, struct _IRP *); |
| 44 | typedef void (WINAPI *PDRIVER_STARTIO)(struct _DEVICE_OBJECT *, struct _IRP *); |
| 45 | typedef void (WINAPI *PDRIVER_UNLOAD)(struct _DRIVER_OBJECT *); |
| 46 | |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 47 | typedef struct _DISPATCHER_HEADER { |
| 48 | UCHAR Type; |
| 49 | UCHAR Absolute; |
| 50 | UCHAR Size; |
| 51 | UCHAR Inserted; |
| 52 | LONG SignalState; |
| 53 | LIST_ENTRY WaitListHead; |
| 54 | } DISPATCHER_HEADER, *PDISPATCHER_HEADER; |
| 55 | |
| 56 | typedef struct _KEVENT { |
| 57 | DISPATCHER_HEADER Header; |
| 58 | } KEVENT, *PKEVENT, *RESTRICTED_POINTER PRKEVENT; |
| 59 | |
| 60 | typedef struct _KDPC { |
| 61 | CSHORT Type; |
| 62 | UCHAR Number; |
| 63 | UCHAR Importance; |
| 64 | LIST_ENTRY DpcListEntry; |
| 65 | PKDEFERRED_ROUTINE DeferredRoutine; |
| 66 | PVOID DeferredContext; |
| 67 | PVOID SystemArgument1; |
| 68 | PVOID SystemArgument2; |
| 69 | PULONG_PTR Lock; |
| 70 | } KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC; |
| 71 | |
| 72 | typedef struct _KDEVICE_QUEUE_ENTRY { |
| 73 | LIST_ENTRY DeviceListEntry; |
| 74 | ULONG SortKey; |
| 75 | BOOLEAN Inserted; |
| 76 | } KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY, |
| 77 | *RESTRICTED_POINTER PRKDEVICE_QUEUE_ENTRY; |
| 78 | |
| 79 | typedef struct _KDEVICE_QUEUE { |
| 80 | CSHORT Type; |
| 81 | CSHORT Size; |
| 82 | LIST_ENTRY DeviceListHead; |
| 83 | KSPIN_LOCK Lock; |
| 84 | BOOLEAN Busy; |
| 85 | } KDEVICE_QUEUE, *PKDEVICE_QUEUE, *RESTRICTED_POINTER PRKDEVICE_QUEUE; |
| 86 | |
| 87 | typedef struct _IO_TIMER *PIO_TIMER; |
| 88 | typedef struct _ETHREAD *PETHREAD; |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 89 | typedef struct _KTHREAD *PKTHREAD; |
| 90 | typedef struct _EPROCESS *PEPROCESS; |
EA Durbin | eb6a1fc | 2007-11-08 15:09:08 -0600 | [diff] [blame] | 91 | typedef struct _IO_WORKITEM *PIO_WORKITEM; |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 92 | |
| 93 | #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR)) |
| 94 | |
| 95 | typedef struct _VPB { |
| 96 | CSHORT Type; |
| 97 | CSHORT Size; |
| 98 | USHORT Flags; |
| 99 | USHORT VolumeLabelLength; |
| 100 | struct _DEVICE_OBJECT *DeviceObject; |
| 101 | struct _DEVICE_OBJECT *RealDevice; |
| 102 | ULONG SerialNumber; |
| 103 | ULONG ReferenceCount; |
| 104 | WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)]; |
| 105 | } VPB, *PVPB; |
| 106 | |
Ivan Leo Puoti | 4c53092 | 2005-12-16 12:37:24 +0100 | [diff] [blame] | 107 | typedef enum _POOL_TYPE { |
| 108 | NonPagedPool, |
| 109 | PagedPool, |
| 110 | NonPagedPoolMustSucceed, |
| 111 | UnkownType, |
| 112 | NonPagedPoolCacheAligned, |
| 113 | PagedPoolCacheAligned, |
| 114 | NonPagedPoolCacheAlignedMustS, |
| 115 | MaxPoolType |
| 116 | } POOL_TYPE; |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 117 | |
| 118 | typedef struct _WAIT_CONTEXT_BLOCK { |
| 119 | KDEVICE_QUEUE_ENTRY WaitQueueEntry; |
| 120 | struct _DRIVER_CONTROL *DeviceRoutine; |
| 121 | PVOID DeviceContext; |
| 122 | ULONG NumberOfMapRegisters; |
| 123 | PVOID DeviceObject; |
| 124 | PVOID CurrentIrp; |
| 125 | PKDPC BufferChainingDpc; |
| 126 | } WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK; |
| 127 | |
| 128 | #ifndef DEVICE_TYPE |
| 129 | #define DEVICE_TYPE ULONG |
| 130 | #endif |
| 131 | #define IRP_MJ_MAXIMUM_FUNCTION 0x1b |
| 132 | #define IRP_MJ_DEVICE_CONTROL 0x0e |
| 133 | |
| 134 | typedef struct _DEVICE_OBJECT { |
| 135 | CSHORT Type; |
| 136 | USHORT Size; |
| 137 | LONG ReferenceCount; |
| 138 | struct _DRIVER_OBJECT *DriverObject; |
| 139 | struct _DEVICE_OBJECT *NextDevice; |
| 140 | struct _DEVICE_OBJECT *AttachedDevice; |
| 141 | struct _IRP *CurrentIrp; |
| 142 | PIO_TIMER Timer; |
| 143 | ULONG Flags; |
| 144 | ULONG Characteristics; |
| 145 | PVPB Vpb; |
| 146 | PVOID DeviceExtension; |
| 147 | DEVICE_TYPE DeviceType; |
| 148 | CCHAR StackSize; |
| 149 | union { |
| 150 | LIST_ENTRY ListEntry; |
| 151 | WAIT_CONTEXT_BLOCK Wcb; |
| 152 | } Queue; |
| 153 | ULONG AlignmentRequirement; |
| 154 | KDEVICE_QUEUE DeviceQueue; |
| 155 | KDPC Dpc; |
| 156 | ULONG ActiveThreadCount; |
| 157 | PSECURITY_DESCRIPTOR SecurityDescriptor; |
| 158 | KEVENT DeviceLock; |
| 159 | USHORT SectorSize; |
| 160 | USHORT Spare1; |
| 161 | struct _DEVOBJ_EXTENSION *DeviceObjectExtension; |
| 162 | PVOID Reserved; |
| 163 | } DEVICE_OBJECT; |
| 164 | typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; |
| 165 | |
| 166 | typedef struct _DRIVER_EXTENSION { |
| 167 | struct _DRIVER_OBJECT *DriverObject; |
| 168 | PVOID AddDevice; |
| 169 | ULONG Count; |
| 170 | UNICODE_STRING ServiceKeyName; |
| 171 | } DRIVER_EXTENSION, *PDRIVER_EXTENSION; |
| 172 | |
| 173 | typedef struct _DRIVER_OBJECT { |
| 174 | CSHORT Type; |
| 175 | CSHORT Size; |
| 176 | PDEVICE_OBJECT DeviceObject; |
| 177 | ULONG Flags; |
| 178 | PVOID DriverStart; |
| 179 | ULONG DriverSize; |
| 180 | PVOID DriverSection; |
| 181 | PDRIVER_EXTENSION DriverExtension; |
| 182 | UNICODE_STRING DriverName; |
| 183 | PUNICODE_STRING HardwareDatabase; |
| 184 | PVOID FastIoDispatch; |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 185 | PDRIVER_INITIALIZE DriverInit; |
| 186 | PDRIVER_STARTIO DriverStartIo; |
| 187 | PDRIVER_UNLOAD DriverUnload; |
| 188 | PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1]; |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 189 | } DRIVER_OBJECT; |
| 190 | typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; |
| 191 | |
| 192 | /* Irp definitions */ |
| 193 | typedef UCHAR KIRQL, *PKIRQL; |
| 194 | typedef CCHAR KPROCESSOR_MODE; |
| 195 | |
| 196 | typedef VOID (WINAPI *PDRIVER_CANCEL)( |
| 197 | IN struct _DEVICE_OBJECT *DeviceObject, |
| 198 | IN struct _IRP *Irp); |
| 199 | |
| 200 | typedef VOID (WINAPI *PKNORMAL_ROUTINE)( |
| 201 | IN PVOID NormalContext, |
| 202 | IN PVOID SystemArgument1, |
| 203 | IN PVOID SystemArgument2); |
| 204 | |
| 205 | typedef VOID (WINAPI *PKKERNEL_ROUTINE)( |
| 206 | IN struct _KAPC *Apc, |
| 207 | IN OUT PKNORMAL_ROUTINE *NormalRoutine, |
| 208 | IN OUT PVOID *NormalContext, |
| 209 | IN OUT PVOID *SystemArgument1, |
| 210 | IN OUT PVOID *SystemArgument2); |
| 211 | |
| 212 | typedef VOID (WINAPI *PKRUNDOWN_ROUTINE)( |
| 213 | IN struct _KAPC *Apc); |
| 214 | |
| 215 | typedef struct _KAPC { |
| 216 | CSHORT Type; |
| 217 | CSHORT Size; |
| 218 | ULONG Spare0; |
| 219 | struct _KTHREAD *Thread; |
| 220 | LIST_ENTRY ApcListEntry; |
| 221 | PKKERNEL_ROUTINE KernelRoutine; |
| 222 | PKRUNDOWN_ROUTINE RundownRoutine; |
| 223 | PKNORMAL_ROUTINE NormalRoutine; |
| 224 | PVOID NormalContext; |
| 225 | PVOID SystemArgument1; |
| 226 | PVOID SystemArgument2; |
| 227 | CCHAR ApcStateIndex; |
| 228 | KPROCESSOR_MODE ApcMode; |
| 229 | BOOLEAN Inserted; |
| 230 | } KAPC, *PKAPC, *RESTRICTED_POINTER PRKAPC; |
| 231 | |
| 232 | #include <pshpack1.h> |
| 233 | typedef struct _IRP { |
| 234 | CSHORT Type; |
| 235 | USHORT Size; |
| 236 | struct _MDL *MdlAddress; |
| 237 | ULONG Flags; |
| 238 | union { |
| 239 | struct _IRP *MasterIrp; |
| 240 | LONG IrpCount; |
| 241 | PVOID SystemBuffer; |
| 242 | } AssociatedIrp; |
| 243 | LIST_ENTRY ThreadListEntry; |
| 244 | IO_STATUS_BLOCK IoStatus; |
| 245 | KPROCESSOR_MODE RequestorMode; |
| 246 | BOOLEAN PendingReturned; |
| 247 | CHAR StackCount; |
| 248 | CHAR CurrentLocation; |
| 249 | BOOLEAN Cancel; |
| 250 | KIRQL CancelIrql; |
| 251 | CCHAR ApcEnvironment; |
| 252 | UCHAR AllocationFlags; |
| 253 | PIO_STATUS_BLOCK UserIosb; |
| 254 | PKEVENT UserEvent; |
| 255 | union { |
| 256 | struct { |
| 257 | PIO_APC_ROUTINE UserApcRoutine; |
| 258 | PVOID UserApcContext; |
| 259 | } AsynchronousParameters; |
| 260 | LARGE_INTEGER AllocationSize; |
| 261 | } Overlay; |
| 262 | PDRIVER_CANCEL CancelRoutine; |
| 263 | PVOID UserBuffer; |
| 264 | union { |
| 265 | struct { |
| 266 | union { |
| 267 | KDEVICE_QUEUE_ENTRY DeviceQueueEntry; |
| 268 | struct { |
| 269 | PVOID DriverContext[4]; |
| 270 | } DUMMYSTRUCTNAME; |
| 271 | } DUMMYUNIONNAME; |
| 272 | PETHREAD Thread; |
| 273 | PCHAR AuxiliaryBuffer; |
| 274 | struct { |
| 275 | LIST_ENTRY ListEntry; |
| 276 | union { |
| 277 | struct _IO_STACK_LOCATION *CurrentStackLocation; |
| 278 | ULONG PacketType; |
| 279 | } DUMMYUNIONNAME; |
| 280 | } DUMMYSTRUCTNAME; |
| 281 | struct _FILE_OBJECT *OriginalFileObject; |
| 282 | } Overlay; |
| 283 | KAPC Apc; |
| 284 | PVOID CompletionKey; |
| 285 | } Tail; |
| 286 | } IRP; |
| 287 | typedef struct _IRP *PIRP; |
| 288 | #include <poppack.h> |
| 289 | |
| 290 | /* MDL definitions */ |
| 291 | |
| 292 | typedef VOID (WINAPI *PINTERFACE_REFERENCE)( |
| 293 | PVOID Context); |
| 294 | |
| 295 | typedef VOID (WINAPI *PINTERFACE_DEREFERENCE)( |
| 296 | PVOID Context); |
| 297 | |
| 298 | typedef struct _INTERFACE { |
| 299 | USHORT Size; |
| 300 | USHORT Version; |
| 301 | PVOID Context; |
| 302 | PINTERFACE_REFERENCE InterfaceReference; |
| 303 | PINTERFACE_DEREFERENCE InterfaceDereference; |
| 304 | } INTERFACE, *PINTERFACE; |
| 305 | |
| 306 | typedef struct _SECTION_OBJECT_POINTERS { |
| 307 | PVOID DataSectionObject; |
| 308 | PVOID SharedCacheMap; |
| 309 | PVOID ImageSectionObject; |
| 310 | } SECTION_OBJECT_POINTERS, *PSECTION_OBJECT_POINTERS; |
| 311 | |
| 312 | typedef struct _IO_COMPLETION_CONTEXT { |
| 313 | PVOID Port; |
| 314 | PVOID Key; |
| 315 | } IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT; |
| 316 | |
| 317 | typedef enum _DEVICE_RELATION_TYPE { |
| 318 | BusRelations, |
| 319 | EjectionRelations, |
| 320 | PowerRelations, |
| 321 | RemovalRelations, |
| 322 | TargetDeviceRelation, |
| 323 | SingleBusRelations |
| 324 | } DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE; |
| 325 | |
| 326 | typedef struct _FILE_OBJECT { |
| 327 | CSHORT Type; |
| 328 | CSHORT Size; |
| 329 | PDEVICE_OBJECT DeviceObject; |
| 330 | PVPB Vpb; |
| 331 | PVOID FsContext; |
| 332 | PVOID FsContext2; |
| 333 | PSECTION_OBJECT_POINTERS SectionObjectPointer; |
| 334 | PVOID PrivateCacheMap; |
| 335 | NTSTATUS FinalStatus; |
| 336 | struct _FILE_OBJECT *RelatedFileObject; |
| 337 | BOOLEAN LockOperation; |
| 338 | BOOLEAN DeletePending; |
| 339 | BOOLEAN ReadAccess; |
| 340 | BOOLEAN WriteAccess; |
| 341 | BOOLEAN DeleteAccess; |
| 342 | BOOLEAN SharedRead; |
| 343 | BOOLEAN SharedWrite; |
| 344 | BOOLEAN SharedDelete; |
| 345 | ULONG Flags; |
| 346 | UNICODE_STRING FileName; |
| 347 | LARGE_INTEGER CurrentByteOffset; |
| 348 | ULONG Waiters; |
| 349 | ULONG Busy; |
| 350 | PVOID LastLock; |
| 351 | KEVENT Lock; |
| 352 | KEVENT Event; |
| 353 | PIO_COMPLETION_CONTEXT CompletionContext; |
| 354 | } FILE_OBJECT; |
| 355 | typedef struct _FILE_OBJECT *PFILE_OBJECT; |
| 356 | |
| 357 | #define INITIAL_PRIVILEGE_COUNT 3 |
| 358 | |
| 359 | typedef struct _INITIAL_PRIVILEGE_SET { |
| 360 | ULONG PrivilegeCount; |
| 361 | ULONG Control; |
| 362 | LUID_AND_ATTRIBUTES Privilege[INITIAL_PRIVILEGE_COUNT]; |
| 363 | } INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET; |
| 364 | |
| 365 | typedef struct _SECURITY_SUBJECT_CONTEXT { |
| 366 | PACCESS_TOKEN ClientToken; |
| 367 | SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; |
| 368 | PACCESS_TOKEN PrimaryToken; |
| 369 | PVOID ProcessAuditId; |
| 370 | } SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT; |
| 371 | |
| 372 | typedef struct _ACCESS_STATE { |
| 373 | LUID OperationID; |
| 374 | BOOLEAN SecurityEvaluated; |
| 375 | BOOLEAN GenerateAudit; |
| 376 | BOOLEAN GenerateOnClose; |
| 377 | BOOLEAN PrivilegesAllocated; |
| 378 | ULONG Flags; |
| 379 | ACCESS_MASK RemainingDesiredAccess; |
| 380 | ACCESS_MASK PreviouslyGrantedAccess; |
| 381 | ACCESS_MASK OriginalDesiredAccess; |
| 382 | SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; |
| 383 | PSECURITY_DESCRIPTOR SecurityDescriptor; |
| 384 | PVOID AuxData; |
| 385 | union { |
| 386 | INITIAL_PRIVILEGE_SET InitialPrivilegeSet; |
| 387 | PRIVILEGE_SET PrivilegeSet; |
| 388 | } Privileges; |
| 389 | |
| 390 | BOOLEAN AuditPrivileges; |
| 391 | UNICODE_STRING ObjectName; |
| 392 | UNICODE_STRING ObjectTypeName; |
| 393 | } ACCESS_STATE, *PACCESS_STATE; |
| 394 | |
| 395 | typedef struct _IO_SECURITY_CONTEXT { |
| 396 | PSECURITY_QUALITY_OF_SERVICE SecurityQos; |
| 397 | PACCESS_STATE AccessState; |
| 398 | ACCESS_MASK DesiredAccess; |
| 399 | ULONG FullCreateOptions; |
| 400 | } IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT; |
| 401 | |
| 402 | typedef struct _DEVICE_CAPABILITIES { |
| 403 | USHORT Size; |
| 404 | USHORT Version; |
| 405 | ULONG DeviceD1 : 1; |
| 406 | ULONG DeviceD2 : 1; |
| 407 | ULONG LockSupported : 1; |
| 408 | ULONG EjectSupported : 1; |
| 409 | ULONG Removable : 1; |
| 410 | ULONG DockDevice : 1; |
| 411 | ULONG UniqueID : 1; |
| 412 | ULONG SilentInstall : 1; |
| 413 | ULONG RawDeviceOK : 1; |
| 414 | ULONG SurpriseRemovalOK : 1; |
| 415 | ULONG WakeFromD0 : 1; |
| 416 | ULONG WakeFromD1 : 1; |
| 417 | ULONG WakeFromD2 : 1; |
| 418 | ULONG WakeFromD3 : 1; |
| 419 | ULONG HardwareDisabled : 1; |
| 420 | ULONG NonDynamic : 1; |
| 421 | ULONG WarmEjectSupported : 1; |
| 422 | ULONG NoDisplayInUI : 1; |
| 423 | ULONG Reserved : 14; |
| 424 | ULONG Address; |
| 425 | ULONG UINumber; |
| 426 | DEVICE_POWER_STATE DeviceState[PowerSystemMaximum]; |
| 427 | SYSTEM_POWER_STATE SystemWake; |
| 428 | DEVICE_POWER_STATE DeviceWake; |
| 429 | ULONG D1Latency; |
| 430 | ULONG D2Latency; |
| 431 | ULONG D3Latency; |
| 432 | } DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES; |
| 433 | |
| 434 | typedef enum _INTERFACE_TYPE { |
| 435 | InterfaceTypeUndefined = -1, |
| 436 | Internal, |
| 437 | Isa, |
| 438 | Eisa, |
| 439 | MicroChannel, |
| 440 | TurboChannel, |
| 441 | PCIBus, |
| 442 | VMEBus, |
| 443 | NuBus, |
| 444 | PCMCIABus, |
| 445 | CBus, |
| 446 | MPIBus, |
| 447 | MPSABus, |
| 448 | ProcessorInternal, |
| 449 | InternalPowerBus, |
| 450 | PNPISABus, |
| 451 | PNPBus, |
| 452 | MaximumInterfaceType |
| 453 | } INTERFACE_TYPE, *PINTERFACE_TYPE; |
| 454 | |
| 455 | typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS; |
| 456 | |
| 457 | #define IO_RESOURCE_PREFERRED 0x01 |
| 458 | #define IO_RESOURCE_DEFAULT 0x02 |
| 459 | #define IO_RESOURCE_ALTERNATIVE 0x08 |
| 460 | |
| 461 | typedef struct _IO_RESOURCE_DESCRIPTOR { |
| 462 | UCHAR Option; |
| 463 | UCHAR Type; |
| 464 | UCHAR ShareDisposition; |
| 465 | UCHAR Spare1; |
| 466 | USHORT Flags; |
| 467 | USHORT Spare2; |
| 468 | union { |
| 469 | struct { |
| 470 | ULONG Length; |
| 471 | ULONG Alignment; |
| 472 | PHYSICAL_ADDRESS MinimumAddress; |
| 473 | PHYSICAL_ADDRESS MaximumAddress; |
| 474 | } Port; |
| 475 | struct { |
| 476 | ULONG Length; |
| 477 | ULONG Alignment; |
| 478 | PHYSICAL_ADDRESS MinimumAddress; |
| 479 | PHYSICAL_ADDRESS MaximumAddress; |
| 480 | } Memory; |
| 481 | struct { |
| 482 | ULONG MinimumVector; |
| 483 | ULONG MaximumVector; |
| 484 | } Interrupt; |
| 485 | struct { |
| 486 | ULONG MinimumChannel; |
| 487 | ULONG MaximumChannel; |
| 488 | } Dma; |
| 489 | struct { |
| 490 | ULONG Length; |
| 491 | ULONG Alignment; |
| 492 | PHYSICAL_ADDRESS MinimumAddress; |
| 493 | PHYSICAL_ADDRESS MaximumAddress; |
| 494 | } Generic; |
| 495 | struct { |
| 496 | ULONG Data[3]; |
| 497 | } DevicePrivate; |
| 498 | struct { |
| 499 | ULONG Length; |
| 500 | ULONG MinBusNumber; |
| 501 | ULONG MaxBusNumber; |
| 502 | ULONG Reserved; |
| 503 | } BusNumber; |
| 504 | struct { |
| 505 | ULONG Priority; |
| 506 | ULONG Reserved1; |
| 507 | ULONG Reserved2; |
| 508 | } ConfigData; |
| 509 | } u; |
| 510 | } IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR; |
| 511 | |
| 512 | typedef struct _IO_RESOURCE_LIST { |
| 513 | USHORT Version; |
| 514 | USHORT Revision; |
| 515 | ULONG Count; |
| 516 | IO_RESOURCE_DESCRIPTOR Descriptors[1]; |
| 517 | } IO_RESOURCE_LIST, *PIO_RESOURCE_LIST; |
| 518 | |
| 519 | typedef struct _IO_RESOURCE_REQUIREMENTS_LIST { |
| 520 | ULONG ListSize; |
| 521 | INTERFACE_TYPE InterfaceType; |
| 522 | ULONG BusNumber; |
| 523 | ULONG SlotNumber; |
| 524 | ULONG Reserved[3]; |
| 525 | ULONG AlternativeLists; |
| 526 | IO_RESOURCE_LIST List[1]; |
| 527 | } IO_RESOURCE_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST; |
| 528 | |
| 529 | typedef enum _BUS_QUERY_ID_TYPE { |
| 530 | BusQueryDeviceID, |
| 531 | BusQueryHardwareIDs, |
| 532 | BusQueryCompatibleIDs, |
| 533 | BusQueryInstanceID, |
| 534 | BusQueryDeviceSerialNumber |
| 535 | } BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE; |
| 536 | |
| 537 | typedef enum _DEVICE_TEXT_TYPE { |
| 538 | DeviceTextDescription, |
| 539 | DeviceTextLocationInformation |
| 540 | } DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE; |
| 541 | |
| 542 | typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE { |
| 543 | DeviceUsageTypeUndefined, |
| 544 | DeviceUsageTypePaging, |
| 545 | DeviceUsageTypeHibernation, |
| 546 | DeviceUsageTypeDumpFile |
| 547 | } DEVICE_USAGE_NOTIFICATION_TYPE; |
| 548 | |
| 549 | typedef struct _POWER_SEQUENCE { |
| 550 | ULONG SequenceD1; |
| 551 | ULONG SequenceD2; |
| 552 | ULONG SequenceD3; |
| 553 | } POWER_SEQUENCE, *PPOWER_SEQUENCE; |
| 554 | |
| 555 | typedef enum _POWER_STATE_TYPE { |
| 556 | SystemPowerState, |
| 557 | DevicePowerState |
| 558 | } POWER_STATE_TYPE, *PPOWER_STATE_TYPE; |
| 559 | |
| 560 | typedef union _POWER_STATE { |
| 561 | SYSTEM_POWER_STATE SystemState; |
| 562 | DEVICE_POWER_STATE DeviceState; |
| 563 | } POWER_STATE, *PPOWER_STATE; |
| 564 | |
| 565 | typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { |
| 566 | UCHAR Type; |
| 567 | UCHAR ShareDisposition; |
| 568 | USHORT Flags; |
| 569 | union { |
| 570 | struct { |
| 571 | PHYSICAL_ADDRESS Start; |
| 572 | ULONG Length; |
| 573 | } Generic; |
| 574 | struct { |
| 575 | PHYSICAL_ADDRESS Start; |
| 576 | ULONG Length; |
| 577 | } Port; |
| 578 | struct { |
| 579 | ULONG Level; |
| 580 | ULONG Vector; |
| 581 | ULONG Affinity; |
| 582 | } Interrupt; |
| 583 | struct { |
| 584 | PHYSICAL_ADDRESS Start; |
| 585 | ULONG Length; |
| 586 | } Memory; |
| 587 | struct { |
| 588 | ULONG Channel; |
| 589 | ULONG Port; |
| 590 | ULONG Reserved1; |
| 591 | } Dma; |
| 592 | struct { |
| 593 | ULONG Data[3]; |
| 594 | } DevicePrivate; |
| 595 | struct { |
| 596 | ULONG Start; |
| 597 | ULONG Length; |
| 598 | ULONG Reserved; |
| 599 | } BusNumber; |
| 600 | struct { |
| 601 | ULONG DataSize; |
| 602 | ULONG Reserved1; |
| 603 | ULONG Reserved2; |
| 604 | } DeviceSpecificData; |
| 605 | } u; |
| 606 | } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR; |
| 607 | |
| 608 | typedef struct _CM_PARTIAL_RESOURCE_LIST { |
| 609 | USHORT Version; |
| 610 | USHORT Revision; |
| 611 | ULONG Count; |
| 612 | CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; |
| 613 | } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST; |
| 614 | |
| 615 | typedef struct _CM_FULL_RESOURCE_DESCRIPTOR { |
| 616 | INTERFACE_TYPE InterfaceType; |
| 617 | ULONG BusNumber; |
| 618 | CM_PARTIAL_RESOURCE_LIST PartialResourceList; |
| 619 | } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR; |
| 620 | |
| 621 | typedef struct _CM_RESOURCE_LIST { |
| 622 | ULONG Count; |
| 623 | CM_FULL_RESOURCE_DESCRIPTOR List[1]; |
| 624 | } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST; |
| 625 | |
| 626 | typedef NTSTATUS (WINAPI *PIO_COMPLETION_ROUTINE)( |
| 627 | IN struct _DEVICE_OBJECT *DeviceObject, |
| 628 | IN struct _IRP *Irp, |
| 629 | IN PVOID Context); |
| 630 | |
| 631 | #include <pshpack1.h> |
| 632 | typedef struct _IO_STACK_LOCATION { |
| 633 | UCHAR MajorFunction; |
| 634 | UCHAR MinorFunction; |
| 635 | UCHAR Flags; |
| 636 | UCHAR Control; |
| 637 | union { |
| 638 | struct { |
| 639 | PIO_SECURITY_CONTEXT SecurityContext; |
| 640 | ULONG Options; |
| 641 | USHORT POINTER_ALIGNMENT FileAttributes; |
| 642 | USHORT ShareAccess; |
| 643 | ULONG POINTER_ALIGNMENT EaLength; |
| 644 | } Create; |
| 645 | struct { |
| 646 | ULONG Length; |
| 647 | ULONG POINTER_ALIGNMENT Key; |
| 648 | LARGE_INTEGER ByteOffset; |
| 649 | } Read; |
| 650 | struct { |
| 651 | ULONG Length; |
| 652 | ULONG POINTER_ALIGNMENT Key; |
| 653 | LARGE_INTEGER ByteOffset; |
| 654 | } Write; |
| 655 | struct { |
| 656 | ULONG Length; |
| 657 | FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; |
| 658 | } QueryFile; |
| 659 | struct { |
| 660 | ULONG Length; |
| 661 | FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; |
| 662 | PFILE_OBJECT FileObject; |
| 663 | union { |
| 664 | struct { |
| 665 | BOOLEAN ReplaceIfExists; |
| 666 | BOOLEAN AdvanceOnly; |
| 667 | } DUMMYSTRUCTNAME; |
| 668 | ULONG ClusterCount; |
| 669 | HANDLE DeleteHandle; |
| 670 | } DUMMYUNIONNAME; |
| 671 | } SetFile; |
| 672 | struct { |
| 673 | ULONG Length; |
| 674 | FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass; |
| 675 | } QueryVolume; |
| 676 | struct { |
| 677 | ULONG OutputBufferLength; |
| 678 | ULONG POINTER_ALIGNMENT InputBufferLength; |
| 679 | ULONG POINTER_ALIGNMENT IoControlCode; |
| 680 | PVOID Type3InputBuffer; |
| 681 | } DeviceIoControl; |
| 682 | struct { |
| 683 | SECURITY_INFORMATION SecurityInformation; |
| 684 | ULONG POINTER_ALIGNMENT Length; |
| 685 | } QuerySecurity; |
| 686 | struct { |
| 687 | SECURITY_INFORMATION SecurityInformation; |
| 688 | PSECURITY_DESCRIPTOR SecurityDescriptor; |
| 689 | } SetSecurity; |
| 690 | struct { |
| 691 | PVPB Vpb; |
| 692 | PDEVICE_OBJECT DeviceObject; |
| 693 | } MountVolume; |
| 694 | struct { |
| 695 | PVPB Vpb; |
| 696 | PDEVICE_OBJECT DeviceObject; |
| 697 | } VerifyVolume; |
| 698 | struct { |
| 699 | struct _SCSI_REQUEST_BLOCK *Srb; |
| 700 | } Scsi; |
| 701 | struct { |
| 702 | DEVICE_RELATION_TYPE Type; |
| 703 | } QueryDeviceRelations; |
| 704 | struct { |
| 705 | CONST GUID *InterfaceType; |
| 706 | USHORT Size; |
| 707 | USHORT Version; |
| 708 | PINTERFACE Interface; |
| 709 | PVOID InterfaceSpecificData; |
| 710 | } QueryInterface; |
| 711 | struct { |
| 712 | PDEVICE_CAPABILITIES Capabilities; |
| 713 | } DeviceCapabilities; |
| 714 | struct { |
| 715 | PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; |
| 716 | } FilterResourceRequirements; |
| 717 | struct { |
| 718 | ULONG WhichSpace; |
| 719 | PVOID Buffer; |
| 720 | ULONG Offset; |
| 721 | ULONG POINTER_ALIGNMENT Length; |
| 722 | } ReadWriteConfig; |
| 723 | struct { |
| 724 | BOOLEAN Lock; |
| 725 | } SetLock; |
| 726 | struct { |
| 727 | BUS_QUERY_ID_TYPE IdType; |
| 728 | } QueryId; |
| 729 | struct { |
| 730 | DEVICE_TEXT_TYPE DeviceTextType; |
| 731 | LCID POINTER_ALIGNMENT LocaleId; |
| 732 | } QueryDeviceText; |
| 733 | struct { |
| 734 | BOOLEAN InPath; |
| 735 | BOOLEAN Reserved[3]; |
| 736 | DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type; |
| 737 | } UsageNotification; |
| 738 | struct { |
| 739 | SYSTEM_POWER_STATE PowerState; |
| 740 | } WaitWake; |
| 741 | struct { |
| 742 | PPOWER_SEQUENCE PowerSequence; |
| 743 | } PowerSequence; |
| 744 | struct { |
| 745 | ULONG SystemContext; |
| 746 | POWER_STATE_TYPE POINTER_ALIGNMENT Type; |
| 747 | POWER_STATE POINTER_ALIGNMENT State; |
| 748 | POWER_ACTION POINTER_ALIGNMENT ShutdownType; |
| 749 | } Power; |
| 750 | struct { |
| 751 | PCM_RESOURCE_LIST AllocatedResources; |
| 752 | PCM_RESOURCE_LIST AllocatedResourcesTranslated; |
| 753 | } StartDevice; |
| 754 | struct { |
| 755 | ULONG_PTR ProviderId; |
| 756 | PVOID DataPath; |
| 757 | ULONG BufferSize; |
| 758 | PVOID Buffer; |
| 759 | } WMI; |
| 760 | struct { |
| 761 | PVOID Argument1; |
| 762 | PVOID Argument2; |
| 763 | PVOID Argument3; |
| 764 | PVOID Argument4; |
| 765 | } Others; |
| 766 | } Parameters; |
| 767 | PDEVICE_OBJECT DeviceObject; |
| 768 | PFILE_OBJECT FileObject; |
| 769 | PIO_COMPLETION_ROUTINE CompletionRoutine; |
| 770 | PVOID Context; |
| 771 | } IO_STACK_LOCATION, *PIO_STACK_LOCATION; |
| 772 | #include <poppack.h> |
| 773 | |
| 774 | typedef struct _MDL { |
| 775 | struct _MDL *Next; |
| 776 | CSHORT Size; |
| 777 | CSHORT MdlFlags; |
| 778 | struct _EPROCESS *Process; |
| 779 | PVOID MappedSystemVa; |
| 780 | PVOID StartVa; |
| 781 | ULONG ByteCount; |
| 782 | ULONG ByteOffset; |
| 783 | } MDL, *PMDL; |
| 784 | |
James Hawkins | fbbd915 | 2007-06-18 14:19:09 -0700 | [diff] [blame] | 785 | typedef struct _KTIMER { |
| 786 | DISPATCHER_HEADER Header; |
| 787 | ULARGE_INTEGER DueTime; |
| 788 | LIST_ENTRY TimerListEntry; |
| 789 | struct _KDPC *Dpc; |
| 790 | LONG Period; |
| 791 | } KTIMER, *PKTIMER; |
| 792 | |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 793 | typedef struct _KSYSTEM_TIME { |
| 794 | ULONG LowPart; |
| 795 | LONG High1Time; |
| 796 | LONG High2Time; |
| 797 | } KSYSTEM_TIME, *PKSYSTEM_TIME; |
| 798 | |
| 799 | typedef enum _NT_PRODUCT_TYPE { |
| 800 | NtProductWinNt = 1, |
| 801 | NtProductLanManNt, |
| 802 | NtProductServer |
| 803 | } NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE; |
| 804 | |
| 805 | #define PROCESSOR_FEATURE_MAX 64 |
| 806 | |
| 807 | typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE |
| 808 | { |
| 809 | StandardDesign, |
| 810 | NEC98x86, |
| 811 | EndAlternatives |
| 812 | } ALTERNATIVE_ARCHITECTURE_TYPE; |
| 813 | |
| 814 | typedef struct _KUSER_SHARED_DATA { |
| 815 | ULONG TickCountLowDeprecated; |
| 816 | ULONG TickCountMultiplier; |
| 817 | volatile KSYSTEM_TIME InterruptTime; |
| 818 | volatile KSYSTEM_TIME SystemTime; |
| 819 | volatile KSYSTEM_TIME TimeZoneBias; |
| 820 | USHORT ImageNumberLow; |
| 821 | USHORT ImageNumberHigh; |
| 822 | WCHAR NtSystemRoot[260]; |
| 823 | ULONG MaxStckTraceDepth; |
| 824 | ULONG CryptoExponent; |
| 825 | ULONG TimeZoneId; |
| 826 | ULONG LargePageMinimum; |
| 827 | ULONG Reserverd2[7]; |
| 828 | NT_PRODUCT_TYPE NtProductType; |
| 829 | BOOLEAN ProductTypeIsValid; |
| 830 | ULONG MajorNtVersion; |
| 831 | ULONG MinorNtVersion; |
| 832 | BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX]; |
| 833 | ULONG Reserved1; |
| 834 | ULONG Reserved3; |
| 835 | volatile ULONG TimeSlip; |
| 836 | ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture; |
| 837 | LARGE_INTEGER SystemExpirationDate; |
| 838 | ULONG SuiteMask; |
| 839 | BOOLEAN KdDebuggerEnabled; |
| 840 | volatile ULONG ActiveConsoleId; |
| 841 | volatile ULONG DismountCount; |
| 842 | ULONG ComPlusPackage; |
| 843 | ULONG LastSystemRITEventTickCount; |
| 844 | ULONG NumberOfPhysicalPages; |
| 845 | BOOLEAN SafeBootMode; |
| 846 | ULONG TraceLogging; |
| 847 | ULONGLONG Fill0; |
| 848 | ULONGLONG SystemCall[4]; |
| 849 | union { |
| 850 | volatile KSYSTEM_TIME TickCount; |
| 851 | volatile ULONG64 TickCountQuad; |
Alexandre Julliard | c9cc7e3 | 2006-03-02 18:03:32 +0100 | [diff] [blame] | 852 | } DUMMYUNIONNAME; |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 853 | } KSHARED_USER_DATA, *PKSHARED_USER_DATA; |
| 854 | |
Ivan Leo Puoti | 4c53092 | 2005-12-16 12:37:24 +0100 | [diff] [blame] | 855 | NTSTATUS WINAPI ObCloseHandle(IN HANDLE handle); |
| 856 | |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 857 | #define IoGetCurrentIrpStackLocation(_Irp) ((_Irp)->Tail.Overlay.CurrentStackLocation) |
| 858 | |
| 859 | #define KernelMode 0 |
| 860 | #define UserMode 1 |
| 861 | |
Vitaliy Margolen | 0b12525 | 2005-11-28 17:29:25 +0100 | [diff] [blame] | 862 | /* directory object access rights */ |
| 863 | #define DIRECTORY_QUERY 0x0001 |
| 864 | #define DIRECTORY_TRAVERSE 0x0002 |
| 865 | #define DIRECTORY_CREATE_OBJECT 0x0004 |
| 866 | #define DIRECTORY_CREATE_SUBDIRECTORY 0x0008 |
| 867 | #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF) |
| 868 | |
| 869 | /* symbolic link access rights */ |
| 870 | #define SYMBOLIC_LINK_QUERY 0x0001 |
| 871 | #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1) |
| 872 | |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 873 | PVOID WINAPI ExAllocatePool(POOL_TYPE,SIZE_T); |
| 874 | PVOID WINAPI ExAllocatePoolWithQuota(POOL_TYPE,SIZE_T); |
| 875 | PVOID WINAPI ExAllocatePoolWithTag(POOL_TYPE,SIZE_T,ULONG); |
| 876 | PVOID WINAPI ExAllocatePoolWithQuotaTag(POOL_TYPE,SIZE_T,ULONG); |
| 877 | void WINAPI ExFreePool(PVOID); |
Alexandre Julliard | 982d6cc | 2007-05-16 17:39:32 +0200 | [diff] [blame] | 878 | void WINAPI ExFreePoolWithTag(PVOID,ULONG); |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 879 | |
| 880 | NTSTATUS WINAPI IoCreateDevice(DRIVER_OBJECT*,ULONG,UNICODE_STRING*,DEVICE_TYPE,ULONG,BOOLEAN,DEVICE_OBJECT**); |
Alexandre Julliard | 7ac931a | 2007-12-18 19:46:06 +0100 | [diff] [blame] | 881 | NTSTATUS WINAPI IoCreateDriver(UNICODE_STRING*,PDRIVER_INITIALIZE); |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 882 | NTSTATUS WINAPI IoCreateSymbolicLink(UNICODE_STRING*,UNICODE_STRING*); |
| 883 | void WINAPI IoDeleteDevice(DEVICE_OBJECT*); |
Alexandre Julliard | 7ac931a | 2007-12-18 19:46:06 +0100 | [diff] [blame] | 884 | void WINAPI IoDeleteDriver(DRIVER_OBJECT*); |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 885 | NTSTATUS WINAPI IoDeleteSymbolicLink(UNICODE_STRING*); |
| 886 | PEPROCESS WINAPI IoGetCurrentProcess(void); |
| 887 | |
| 888 | PKTHREAD WINAPI KeGetCurrentThread(void); |
Alexandre Julliard | bd3a08b | 2007-05-18 16:48:54 +0200 | [diff] [blame] | 889 | void WINAPI KeQuerySystemTime(LARGE_INTEGER*); |
| 890 | void WINAPI KeQueryTickCount(LARGE_INTEGER*); |
| 891 | ULONG WINAPI KeQueryTimeIncrement(void); |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 892 | |
Francois Gouget | f20cd49 | 2007-08-15 14:52:23 +0200 | [diff] [blame] | 893 | PVOID WINAPI MmAllocateNonCachedMemory(SIZE_T); |
Alexandre Julliard | 982d6cc | 2007-05-16 17:39:32 +0200 | [diff] [blame] | 894 | void WINAPI MmFreeNonCachedMemory(PVOID,SIZE_T); |
| 895 | |
Francois Gouget | 17c5773 | 2007-09-27 18:53:23 +0200 | [diff] [blame] | 896 | NTSTATUS WINAPI PsCreateSystemThread(PHANDLE,ULONG,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PKSTART_ROUTINE,PVOID); |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 897 | #define PsGetCurrentProcess() IoGetCurrentProcess() |
| 898 | #define PsGetCurrentThread() ((PETHREAD)KeGetCurrentThread()) |
| 899 | HANDLE WINAPI PsGetCurrentProcessId(void); |
| 900 | HANDLE WINAPI PsGetCurrentThreadId(void); |
| 901 | BOOLEAN WINAPI PsGetVersion(ULONG*,ULONG*,ULONG*,UNICODE_STRING*); |
Francois Gouget | 17c5773 | 2007-09-27 18:53:23 +0200 | [diff] [blame] | 902 | NTSTATUS WINAPI PsTerminateSystemThread(NTSTATUS); |
Alexandre Julliard | dff6cdf | 2007-05-15 21:41:21 +0200 | [diff] [blame] | 903 | |
Ivan Leo Puoti | 4c53092 | 2005-12-16 12:37:24 +0100 | [diff] [blame] | 904 | NTSTATUS WINAPI ZwAddBootEntry(PUNICODE_STRING,PUNICODE_STRING); |
| 905 | NTSTATUS WINAPI ZwAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN); |
| 906 | NTSTATUS WINAPI ZwAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD); |
| 907 | NTSTATUS WINAPI ZwAlertThread(HANDLE ThreadHandle); |
| 908 | NTSTATUS WINAPI ZwAllocateVirtualMemory(HANDLE,PVOID*,ULONG,SIZE_T*,ULONG,ULONG); |
| 909 | NTSTATUS WINAPI ZwCancelIoFile(HANDLE,PIO_STATUS_BLOCK); |
| 910 | NTSTATUS WINAPI ZwCancelTimer(HANDLE, BOOLEAN*); |
| 911 | NTSTATUS WINAPI ZwClearEvent(HANDLE); |
| 912 | NTSTATUS WINAPI ZwClose(HANDLE); |
| 913 | NTSTATUS WINAPI ZwCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN); |
| 914 | NTSTATUS WINAPI ZwConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG); |
| 915 | NTSTATUS WINAPI ZwCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); |
| 916 | NTSTATUS WINAPI ZwCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN); |
| 917 | NTSTATUS WINAPI ZwCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG); |
| 918 | NTSTATUS WINAPI ZwCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG); |
| 919 | NTSTATUS WINAPI ZwCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE); |
| 920 | NTSTATUS WINAPI ZwCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING); |
| 921 | NTSTATUS WINAPI ZwCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE); |
| 922 | NTSTATUS WINAPI ZwDeleteAtom(RTL_ATOM); |
| 923 | NTSTATUS WINAPI ZwDeleteFile(POBJECT_ATTRIBUTES); |
| 924 | NTSTATUS WINAPI ZwDeleteKey(HANDLE); |
| 925 | NTSTATUS WINAPI ZwDeleteValueKey(HANDLE,const UNICODE_STRING *); |
| 926 | NTSTATUS WINAPI ZwDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG); |
| 927 | NTSTATUS WINAPI ZwDisplayString(PUNICODE_STRING); |
| 928 | NTSTATUS WINAPI ZwDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG); |
| 929 | NTSTATUS WINAPI ZwDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE); |
| 930 | NTSTATUS WINAPI ZwEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *); |
| 931 | NTSTATUS WINAPI ZwEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG); |
| 932 | NTSTATUS WINAPI ZwFlushInstructionCache(HANDLE,LPCVOID,SIZE_T); |
| 933 | NTSTATUS WINAPI ZwFlushKey(HANDLE); |
| 934 | NTSTATUS WINAPI ZwFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG); |
| 935 | NTSTATUS WINAPI ZwFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG); |
| 936 | NTSTATUS WINAPI ZwFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG); |
| 937 | NTSTATUS WINAPI ZwInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN); |
| 938 | NTSTATUS WINAPI ZwLoadDriver(const UNICODE_STRING *); |
| 939 | NTSTATUS WINAPI ZwLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *); |
| 940 | NTSTATUS WINAPI ZwLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG); |
| 941 | NTSTATUS WINAPI ZwMakeTemporaryObject(HANDLE); |
| 942 | NTSTATUS WINAPI ZwMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG); |
| 943 | NTSTATUS WINAPI ZwNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN); |
| 944 | NTSTATUS WINAPI ZwOpenDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); |
| 945 | NTSTATUS WINAPI ZwOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *); |
| 946 | NTSTATUS WINAPI ZwOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG); |
| 947 | NTSTATUS WINAPI ZwOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *); |
| 948 | NTSTATUS WINAPI ZwOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*); |
| 949 | NTSTATUS WINAPI ZwOpenProcessToken(HANDLE,DWORD,HANDLE *); |
| 950 | NTSTATUS WINAPI ZwOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*); |
| 951 | NTSTATUS WINAPI ZwOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); |
| 952 | NTSTATUS WINAPI ZwOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*); |
| 953 | NTSTATUS WINAPI ZwOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *); |
| 954 | NTSTATUS WINAPI ZwOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*); |
| 955 | NTSTATUS WINAPI ZwPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG); |
| 956 | NTSTATUS WINAPI ZwPulseEvent(HANDLE,PULONG); |
| 957 | NTSTATUS WINAPI ZwQueryDefaultLocale(BOOLEAN,LCID*); |
| 958 | NTSTATUS WINAPI ZwQueryDefaultUILanguage(LANGID*); |
| 959 | NTSTATUS WINAPI ZwQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN); |
| 960 | NTSTATUS WINAPI ZwQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG); |
| 961 | NTSTATUS WINAPI ZwQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN); |
| 962 | NTSTATUS WINAPI ZwQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*); |
| 963 | NTSTATUS WINAPI ZwQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS); |
| 964 | NTSTATUS WINAPI ZwQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG); |
Francois Gouget | f20cd49 | 2007-08-15 14:52:23 +0200 | [diff] [blame] | 965 | NTSTATUS WINAPI ZwQueryInformationToken(HANDLE,DWORD,PVOID,DWORD,LPDWORD); |
Ivan Leo Puoti | 4c53092 | 2005-12-16 12:37:24 +0100 | [diff] [blame] | 966 | NTSTATUS WINAPI ZwQueryInstallUILanguage(LANGID*); |
| 967 | NTSTATUS WINAPI ZwQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *); |
| 968 | NTSTATUS WINAPI ZwQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG); |
| 969 | NTSTATUS WINAPI ZwQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG); |
| 970 | NTSTATUS WINAPI ZwQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG); |
| 971 | NTSTATUS WINAPI ZwQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG); |
| 972 | NTSTATUS WINAPI ZwQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG); |
| 973 | NTSTATUS WINAPI ZwQueryTimerResolution(PULONG,PULONG,PULONG); |
| 974 | NTSTATUS WINAPI ZwQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *); |
| 975 | NTSTATUS WINAPI ZwQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS); |
| 976 | NTSTATUS WINAPI ZwReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG); |
| 977 | NTSTATUS WINAPI ZwReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES); |
| 978 | NTSTATUS WINAPI ZwRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE); |
| 979 | NTSTATUS WINAPI ZwResetEvent(HANDLE,PULONG); |
| 980 | NTSTATUS WINAPI ZwRestoreKey(HANDLE,HANDLE,ULONG); |
| 981 | NTSTATUS WINAPI ZwSaveKey(HANDLE,HANDLE); |
| 982 | NTSTATUS WINAPI ZwSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG); |
| 983 | NTSTATUS WINAPI ZwSetDefaultLocale(BOOLEAN,LCID); |
| 984 | NTSTATUS WINAPI ZwSetDefaultUILanguage(LANGID); |
| 985 | NTSTATUS WINAPI ZwSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG); |
| 986 | NTSTATUS WINAPI ZwSetEvent(HANDLE,PULONG); |
| 987 | NTSTATUS WINAPI ZwSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS); |
| 988 | NTSTATUS WINAPI ZwSetInformationKey(HANDLE,const int,PVOID,ULONG); |
| 989 | NTSTATUS WINAPI ZwSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG); |
| 990 | NTSTATUS WINAPI ZwSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG); |
| 991 | NTSTATUS WINAPI ZwSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG); |
| 992 | NTSTATUS WINAPI ZwSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG); |
| 993 | NTSTATUS WINAPI ZwSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); |
| 994 | NTSTATUS WINAPI ZwSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG); |
| 995 | NTSTATUS WINAPI ZwSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*); |
| 996 | NTSTATUS WINAPI ZwSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*); |
| 997 | NTSTATUS WINAPI ZwSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG); |
| 998 | NTSTATUS WINAPI ZwSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS); |
| 999 | NTSTATUS WINAPI ZwSuspendThread(HANDLE,PULONG); |
| 1000 | NTSTATUS WINAPI ZwTerminateProcess(HANDLE,LONG); |
| 1001 | NTSTATUS WINAPI ZwUnloadDriver(const UNICODE_STRING *); |
| 1002 | NTSTATUS WINAPI ZwUnloadKey(HANDLE); |
| 1003 | NTSTATUS WINAPI ZwUnmapViewOfSection(HANDLE,PVOID); |
| 1004 | NTSTATUS WINAPI ZwWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*); |
| 1005 | NTSTATUS WINAPI ZwWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*); |
| 1006 | NTSTATUS WINAPI ZwWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG); |
| 1007 | NTSTATUS WINAPI ZwYieldExecution(void); |
| 1008 | |
Ivan Leo Puoti | 1bf99ec | 2005-09-23 17:22:12 +0000 | [diff] [blame] | 1009 | #endif |