1 /*++ NDK Version: 0098 2 3 Copyright (c) Alex Ionescu. All rights reserved. 4 5 Header Name: 6 7 iofuncs.h 8 9 Abstract: 10 11 Function definitions for the I/O Manager. 12 13 Author: 14 15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006 16 17 --*/ 18 19 #ifndef _IOFUNCS_H 20 #define _IOFUNCS_H 21 22 // 23 // Dependencies 24 // 25 #include <umtypes.h> 26 #include <iotypes.h> 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 // 33 // I/O Functions 34 // 35 #ifndef NTOS_MODE_USER 36 VOID 37 FASTCALL 38 IoAssignDriveLetters( 39 _In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock, 40 _In_ PSTRING NtDeviceName, 41 _Out_ PUCHAR NtSystemPath, 42 _Out_ PSTRING NtSystemPathString 43 ); 44 45 NTSTATUS 46 NTAPI 47 IoSynchronousInvalidateDeviceRelations( 48 _In_ PDEVICE_OBJECT DeviceObject, 49 _In_ DEVICE_RELATION_TYPE Type 50 ); 51 52 NTSTATUS 53 NTAPI 54 IoCreateDriver( 55 _In_opt_ PUNICODE_STRING DriverName, 56 _In_ PDRIVER_INITIALIZE InitializationFunction 57 ); 58 59 VOID 60 NTAPI 61 IoDeleteDriver( 62 _In_ PDRIVER_OBJECT DriverObject 63 ); 64 65 NTSTATUS 66 NTAPI 67 IoReportHalResourceUsage( 68 _In_ PUNICODE_STRING HalName, 69 _In_ PCM_RESOURCE_LIST RawResourceList, 70 _In_ PCM_RESOURCE_LIST TranslatedResourceList, 71 _In_ ULONG ResourceListSize 72 ); 73 #endif 74 75 // 76 // Native calls 77 // 78 NTSYSCALLAPI 79 NTSTATUS 80 NTAPI 81 NtAddBootEntry( 82 _In_ PBOOT_ENTRY BootEntry, 83 _In_ ULONG Id 84 ); 85 86 NTSYSCALLAPI 87 NTSTATUS 88 NTAPI 89 NtAddDriverEntry( 90 _In_ PEFI_DRIVER_ENTRY BootEntry, 91 _In_ ULONG Id 92 ); 93 94 NTSYSCALLAPI 95 NTSTATUS 96 NTAPI 97 NtCancelIoFile( 98 _In_ HANDLE FileHandle, 99 _Out_ PIO_STATUS_BLOCK IoStatusBlock 100 ); 101 102 __kernel_entry 103 NTSYSCALLAPI 104 NTSTATUS 105 NTAPI 106 NtCreateFile( 107 _Out_ PHANDLE FileHandle, 108 _In_ ACCESS_MASK DesiredAccess, 109 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 110 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 111 _In_opt_ PLARGE_INTEGER AllocationSize, 112 _In_ ULONG FileAttributes, 113 _In_ ULONG ShareAccess, 114 _In_ ULONG CreateDisposition, 115 _In_ ULONG CreateOptions, 116 _In_reads_bytes_opt_(EaLength) PVOID EaBuffer, 117 _In_ ULONG EaLength 118 ); 119 120 NTSYSCALLAPI 121 NTSTATUS 122 NTAPI 123 NtCreateIoCompletion( 124 _Out_ PHANDLE IoCompletionHandle, 125 _In_ ACCESS_MASK DesiredAccess, 126 _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes, 127 _In_ ULONG NumberOfConcurrentThreads 128 ); 129 130 NTSYSCALLAPI 131 NTSTATUS 132 NTAPI 133 NtCreateMailslotFile( 134 _Out_ PHANDLE MailSlotFileHandle, 135 _In_ ACCESS_MASK DesiredAccess, 136 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 137 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 138 _In_ ULONG FileAttributes, 139 _In_ ULONG ShareAccess, 140 _In_ ULONG MaxMessageSize, 141 _In_ PLARGE_INTEGER TimeOut 142 ); 143 144 NTSYSCALLAPI 145 NTSTATUS 146 NTAPI 147 NtCreateNamedPipeFile( 148 _Out_ PHANDLE NamedPipeFileHandle, 149 _In_ ACCESS_MASK DesiredAccess, 150 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 151 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 152 _In_ ULONG ShareAccess, 153 _In_ ULONG CreateDisposition, 154 _In_ ULONG CreateOptions, 155 _In_ ULONG WriteModeMessage, 156 _In_ ULONG ReadModeMessage, 157 _In_ ULONG NonBlocking, 158 _In_ ULONG MaxInstances, 159 _In_ ULONG InBufferSize, 160 _In_ ULONG OutBufferSize, 161 _In_ PLARGE_INTEGER DefaultTimeOut 162 ); 163 164 165 NTSYSCALLAPI 166 NTSTATUS 167 NTAPI 168 NtDeleteDriverEntry( 169 _In_ ULONG Id 170 ); 171 172 NTSYSCALLAPI 173 NTSTATUS 174 NTAPI 175 NtDeleteBootEntry( 176 _In_ ULONG Id 177 ); 178 179 NTSYSCALLAPI 180 NTSTATUS 181 NTAPI 182 NtDeleteFile( 183 _In_ POBJECT_ATTRIBUTES ObjectAttributes 184 ); 185 186 __kernel_entry 187 NTSYSCALLAPI 188 NTSTATUS 189 NTAPI 190 NtDeviceIoControlFile( 191 _In_ HANDLE FileHandle, 192 _In_opt_ HANDLE Event, 193 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 194 _In_opt_ PVOID ApcContext, 195 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 196 _In_ ULONG IoControlCode, 197 _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer, 198 _In_ ULONG InputBufferLength, 199 _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer, 200 _In_ ULONG OutputBufferLength 201 ); 202 203 NTSYSCALLAPI 204 NTSTATUS 205 NTAPI 206 NtEnumerateBootEntries( 207 _In_ PVOID Buffer, 208 _In_ PULONG BufferLength 209 ); 210 211 NTSYSCALLAPI 212 NTSTATUS 213 NTAPI 214 NtEnumerateDriverEntries( 215 _In_ PVOID Buffer, 216 _In_ PULONG BufferLength 217 ); 218 219 NTSYSCALLAPI 220 NTSTATUS 221 NTAPI 222 NtFlushBuffersFile( 223 _In_ HANDLE FileHandle, 224 _Out_ PIO_STATUS_BLOCK IoStatusBlock 225 ); 226 227 NTSYSCALLAPI 228 NTSTATUS 229 NTAPI 230 NtFlushWriteBuffer(VOID); 231 232 __kernel_entry 233 NTSYSCALLAPI 234 NTSTATUS 235 NTAPI 236 NtFsControlFile( 237 _In_ HANDLE FileHandle, 238 _In_opt_ HANDLE Event, 239 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 240 _In_opt_ PVOID ApcContext, 241 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 242 _In_ ULONG FsControlCode, 243 _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer, 244 _In_ ULONG InputBufferLength, 245 _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer, 246 _In_ ULONG OutputBufferLength 247 ); 248 249 NTSYSCALLAPI 250 NTSTATUS 251 NTAPI 252 NtLoadDriver( 253 _In_ PUNICODE_STRING DriverServiceName 254 ); 255 256 NTSYSCALLAPI 257 NTSTATUS 258 NTAPI 259 NtLockFile( 260 _In_ HANDLE FileHandle, 261 _In_opt_ HANDLE Event, 262 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 263 _In_opt_ PVOID ApcContext, 264 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 265 _In_ PLARGE_INTEGER ByteOffset, 266 _In_ PLARGE_INTEGER Length, 267 _In_ ULONG Key, 268 _In_ BOOLEAN FailImmediatedly, 269 _In_ BOOLEAN ExclusiveLock 270 ); 271 272 NTSYSCALLAPI 273 NTSTATUS 274 NTAPI 275 NtModifyBootEntry( 276 _In_ PBOOT_ENTRY BootEntry 277 ); 278 279 NTSYSCALLAPI 280 NTSTATUS 281 NTAPI 282 NtModifyDriverEntry( 283 _In_ PEFI_DRIVER_ENTRY DriverEntry 284 ); 285 286 NTSYSCALLAPI 287 NTSTATUS 288 NTAPI 289 NtNotifyChangeDirectoryFile( 290 _In_ HANDLE FileHandle, 291 _In_opt_ HANDLE Event, 292 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 293 _In_opt_ PVOID ApcContext, 294 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 295 _Out_ PVOID Buffer, 296 _In_ ULONG BufferSize, 297 _In_ ULONG CompletionFilter, 298 _In_ BOOLEAN WatchTree 299 ); 300 301 NTSYSCALLAPI 302 NTSTATUS 303 NTAPI 304 NtOpenFile( 305 _Out_ PHANDLE FileHandle, 306 _In_ ACCESS_MASK DesiredAccess, 307 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 308 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 309 _In_ ULONG ShareAccess, 310 _In_ ULONG OpenOptions 311 ); 312 313 NTSYSCALLAPI 314 NTSTATUS 315 NTAPI 316 NtOpenIoCompletion( 317 _Out_ PHANDLE CompetionPort, 318 _In_ ACCESS_MASK DesiredAccess, 319 _In_ POBJECT_ATTRIBUTES ObjectAttributes 320 ); 321 322 NTSYSCALLAPI 323 NTSTATUS 324 NTAPI 325 NtQueryAttributesFile( 326 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 327 _Out_ PFILE_BASIC_INFORMATION FileInformation 328 ); 329 330 NTSTATUS 331 NTAPI 332 NtQueryDriverEntryOrder( 333 _In_ PULONG Ids, 334 _In_ PULONG Count 335 ); 336 337 NTSYSCALLAPI 338 NTSTATUS 339 NTAPI 340 NtQueryBootEntryOrder( 341 _In_ PULONG Ids, 342 _In_ PULONG Count 343 ); 344 345 NTSYSCALLAPI 346 NTSTATUS 347 NTAPI 348 NtQueryBootOptions( 349 _In_ PBOOT_OPTIONS BootOptions, 350 _In_ PULONG BootOptionsLength 351 ); 352 353 __kernel_entry 354 NTSYSCALLAPI 355 NTSTATUS 356 NTAPI 357 NtQueryDirectoryFile( 358 _In_ HANDLE FileHandle, 359 _In_opt_ HANDLE Event, 360 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 361 _In_opt_ PVOID ApcContext, 362 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 363 _Out_writes_bytes_(Length) PVOID FileInformation, 364 _In_ ULONG Length, 365 _In_ FILE_INFORMATION_CLASS FileInformationClass, 366 _In_ BOOLEAN ReturnSingleEntry, 367 _In_opt_ PUNICODE_STRING FileName, 368 _In_ BOOLEAN RestartScan 369 ); 370 371 NTSYSCALLAPI 372 NTSTATUS 373 NTAPI 374 NtQueryEaFile( 375 _In_ HANDLE FileHandle, 376 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 377 _Out_ PVOID Buffer, 378 _In_ ULONG Length, 379 _In_ BOOLEAN ReturnSingleEntry, 380 _In_opt_ PVOID EaList, 381 _In_ ULONG EaListLength, 382 _In_opt_ PULONG EaIndex, 383 _In_ BOOLEAN RestartScan 384 ); 385 386 NTSYSCALLAPI 387 NTSTATUS 388 NTAPI 389 NtQueryFullAttributesFile( 390 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 391 _Out_ PFILE_NETWORK_OPEN_INFORMATION FileInformation 392 ); 393 394 __kernel_entry 395 NTSYSCALLAPI 396 NTSTATUS 397 NTAPI 398 NtQueryInformationFile( 399 _In_ HANDLE FileHandle, 400 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 401 _Out_writes_bytes_(Length) PVOID FileInformation, 402 _In_ ULONG Length, 403 _In_ FILE_INFORMATION_CLASS FileInformationClass 404 ); 405 406 NTSYSCALLAPI 407 NTSTATUS 408 NTAPI 409 NtQueryIoCompletion( 410 _In_ HANDLE IoCompletionHandle, 411 _In_ IO_COMPLETION_INFORMATION_CLASS IoCompletionInformationClass, 412 _Out_ PVOID IoCompletionInformation, 413 _In_ ULONG IoCompletionInformationLength, 414 _Out_opt_ PULONG ResultLength 415 ); 416 417 __kernel_entry 418 NTSYSCALLAPI 419 NTSTATUS 420 NTAPI 421 NtQueryQuotaInformationFile( 422 _In_ HANDLE FileHandle, 423 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 424 _Out_writes_bytes_(Length) PVOID Buffer, 425 _In_ ULONG Length, 426 _In_ BOOLEAN ReturnSingleEntry, 427 _In_reads_bytes_opt_(SidListLength) PVOID SidList, 428 _In_ ULONG SidListLength, 429 _In_reads_bytes_opt_((8 + (4 * ((SID *)StartSid)->SubAuthorityCount))) // SeLengthSid() 430 PSID StartSid, 431 _In_ BOOLEAN RestartScan 432 ); 433 434 __kernel_entry 435 NTSYSCALLAPI 436 NTSTATUS 437 NTAPI 438 NtQueryVolumeInformationFile( 439 _In_ HANDLE FileHandle, 440 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 441 _Out_writes_bytes_(Length) PVOID FsInformation, 442 _In_ ULONG Length, 443 _In_ FS_INFORMATION_CLASS FsInformationClass 444 ); 445 446 __kernel_entry 447 NTSYSCALLAPI 448 NTSTATUS 449 NTAPI 450 NtReadFile( 451 _In_ HANDLE FileHandle, 452 _In_opt_ HANDLE Event, 453 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 454 _In_opt_ PVOID ApcContext, 455 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 456 _Out_writes_bytes_(Length) PVOID Buffer, 457 _In_ ULONG Length, 458 _In_opt_ PLARGE_INTEGER ByteOffset, 459 _In_opt_ PULONG Key 460 ); 461 462 NTSYSCALLAPI 463 NTSTATUS 464 NTAPI 465 NtReadFileScatter( 466 _In_ HANDLE FileHandle, 467 _In_opt_ HANDLE Event, 468 _In_opt_ PIO_APC_ROUTINE UserApcRoutine, 469 _In_opt_ PVOID UserApcContext, 470 _Out_ PIO_STATUS_BLOCK UserIoStatusBlock, 471 _In_ FILE_SEGMENT_ELEMENT BufferDescription[], 472 _In_ ULONG BufferLength, 473 _In_ PLARGE_INTEGER ByteOffset, 474 _In_opt_ PULONG Key 475 ); 476 477 NTSYSCALLAPI 478 NTSTATUS 479 NTAPI 480 NtRemoveIoCompletion( 481 _In_ HANDLE IoCompletionHandle, 482 _Out_ PVOID *CompletionKey, 483 _Out_ PVOID *CompletionContext, 484 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 485 _In_opt_ PLARGE_INTEGER Timeout 486 ); 487 488 NTSYSCALLAPI 489 NTSTATUS 490 NTAPI 491 NtSetBootEntryOrder( 492 _In_ PULONG Ids, 493 _In_ PULONG Count 494 ); 495 496 NTSYSCALLAPI 497 NTSTATUS 498 NTAPI 499 NtSetBootOptions( 500 _In_ PBOOT_OPTIONS BootOptions, 501 _In_ ULONG FieldsToChange 502 ); 503 504 NTSTATUS 505 NTAPI 506 NtSetDriverEntryOrder( 507 _In_ PULONG Ids, 508 _In_ PULONG Count 509 ); 510 511 NTSYSCALLAPI 512 NTSTATUS 513 NTAPI 514 NtSetEaFile( 515 _In_ HANDLE FileHandle, 516 _In_ PIO_STATUS_BLOCK IoStatusBlock, 517 PVOID EaBuffer, 518 ULONG EaBufferSize 519 ); 520 521 __kernel_entry 522 NTSYSCALLAPI 523 NTSTATUS 524 NTAPI 525 NtSetInformationFile( 526 _In_ HANDLE FileHandle, 527 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 528 _In_reads_bytes_(Length) PVOID FileInformation, 529 _In_ ULONG Length, 530 _In_ FILE_INFORMATION_CLASS FileInformationClass 531 ); 532 533 NTSYSCALLAPI 534 NTSTATUS 535 NTAPI 536 NtSetIoCompletion( 537 _In_ HANDLE IoCompletionPortHandle, 538 _In_ PVOID CompletionKey, 539 _In_ PVOID CompletionContext, 540 _In_ NTSTATUS CompletionStatus, 541 _In_ ULONG CompletionInformation 542 ); 543 544 NTSYSCALLAPI 545 NTSTATUS 546 NTAPI 547 NtSetQuotaInformationFile( 548 HANDLE FileHandle, 549 PIO_STATUS_BLOCK IoStatusBlock, 550 PVOID Buffer, 551 ULONG BufferLength 552 ); 553 554 __kernel_entry 555 NTSYSCALLAPI 556 NTSTATUS 557 NTAPI 558 NtSetVolumeInformationFile( 559 _In_ HANDLE FileHandle, 560 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 561 _In_reads_bytes_(Length) PVOID FsInformation, 562 _In_ ULONG Length, 563 _In_ FS_INFORMATION_CLASS FsInformationClass 564 ); 565 566 NTSYSCALLAPI 567 NTSTATUS 568 NTAPI 569 NtTranslateFilePath( 570 PFILE_PATH InputFilePath, 571 ULONG OutputType, 572 PFILE_PATH OutputFilePath, 573 ULONG OutputFilePathLength 574 ); 575 576 NTSYSCALLAPI 577 NTSTATUS 578 NTAPI 579 NtUnloadDriver( 580 _In_ PUNICODE_STRING DriverServiceName 581 ); 582 583 __kernel_entry 584 NTSYSCALLAPI 585 NTSTATUS 586 NTAPI 587 NtUnlockFile( 588 _In_ HANDLE FileHandle, 589 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 590 _In_ PLARGE_INTEGER ByteOffset, 591 _In_ PLARGE_INTEGER Length, 592 _In_ ULONG Key 593 ); 594 595 __kernel_entry 596 NTSYSCALLAPI 597 NTSTATUS 598 NTAPI 599 NtWriteFile( 600 _In_ HANDLE FileHandle, 601 _In_opt_ HANDLE Event, 602 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 603 _In_opt_ PVOID ApcContext, 604 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 605 _In_reads_bytes_(Length) PVOID Buffer, 606 _In_ ULONG Length, 607 _In_opt_ PLARGE_INTEGER ByteOffset, 608 _In_opt_ PULONG Key 609 ); 610 611 NTSYSCALLAPI 612 NTSTATUS 613 NTAPI 614 NtWriteFileGather( 615 _In_ HANDLE FileHandle, 616 _In_opt_ HANDLE Event, 617 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 618 _In_opt_ PVOID ApcContext, 619 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 620 _In_ FILE_SEGMENT_ELEMENT BufferDescription[], 621 _In_ ULONG BufferLength, 622 _In_ PLARGE_INTEGER ByteOffset, 623 _In_opt_ PULONG Key 624 ); 625 626 NTSYSAPI 627 NTSTATUS 628 NTAPI 629 ZwAddBootEntry( 630 _In_ PUNICODE_STRING EntryName, 631 _In_ PUNICODE_STRING EntryValue 632 ); 633 634 NTSYSAPI 635 NTSTATUS 636 NTAPI 637 ZwCancelIoFile( 638 _In_ HANDLE FileHandle, 639 _Out_ PIO_STATUS_BLOCK IoStatusBlock 640 ); 641 642 _IRQL_requires_max_(PASSIVE_LEVEL) 643 NTSYSAPI 644 NTSTATUS 645 NTAPI 646 ZwCreateFile( 647 _Out_ PHANDLE FileHandle, 648 _In_ ACCESS_MASK DesiredAccess, 649 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 650 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 651 _In_opt_ PLARGE_INTEGER AllocationSize, 652 _In_ ULONG FileAttributes, 653 _In_ ULONG ShareAccess, 654 _In_ ULONG CreateDisposition, 655 _In_ ULONG CreateOptions, 656 _In_reads_bytes_opt_(EaLength) PVOID EaBuffer, 657 _In_ ULONG EaLength 658 ); 659 660 NTSYSAPI 661 NTSTATUS 662 NTAPI 663 ZwCreateIoCompletion( 664 _Out_ PHANDLE IoCompletionHandle, 665 _In_ ACCESS_MASK DesiredAccess, 666 _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes, 667 _In_ ULONG NumberOfConcurrentThreads 668 ); 669 670 NTSYSAPI 671 NTSTATUS 672 NTAPI 673 ZwCreateMailslotFile( 674 _Out_ PHANDLE MailSlotFileHandle, 675 _In_ ACCESS_MASK DesiredAccess, 676 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 677 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 678 _In_ ULONG FileAttributes, 679 _In_ ULONG ShareAccess, 680 _In_ ULONG MaxMessageSize, 681 _In_ PLARGE_INTEGER TimeOut 682 ); 683 684 NTSYSAPI 685 NTSTATUS 686 NTAPI 687 ZwCreateNamedPipeFile( 688 _Out_ PHANDLE NamedPipeFileHandle, 689 _In_ ACCESS_MASK DesiredAccess, 690 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 691 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 692 _In_ ULONG ShareAccess, 693 _In_ ULONG CreateDisposition, 694 _In_ ULONG CreateOptions, 695 _In_ ULONG WriteModeMessage, 696 _In_ ULONG ReadModeMessage, 697 _In_ ULONG NonBlocking, 698 _In_ ULONG MaxInstances, 699 _In_ ULONG InBufferSize, 700 _In_ ULONG OutBufferSize, 701 _In_ PLARGE_INTEGER DefaultTimeOut 702 ); 703 704 NTSYSAPI 705 NTSTATUS 706 NTAPI 707 ZwDeleteBootEntry( 708 _In_ PUNICODE_STRING EntryName, 709 _In_ PUNICODE_STRING EntryValue 710 ); 711 712 NTSYSAPI 713 NTSTATUS 714 NTAPI 715 ZwDeleteFile( 716 _In_ POBJECT_ATTRIBUTES ObjectAttributes 717 ); 718 719 _IRQL_requires_max_(PASSIVE_LEVEL) 720 NTSYSAPI 721 NTSTATUS 722 NTAPI 723 ZwDeviceIoControlFile( 724 _In_ HANDLE FileHandle, 725 _In_opt_ HANDLE Event, 726 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 727 _In_opt_ PVOID ApcContext, 728 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 729 _In_ ULONG IoControlCode, 730 _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer, 731 _In_ ULONG InputBufferLength, 732 _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer, 733 _In_ ULONG OutputBufferLength 734 ); 735 736 _IRQL_requires_max_(PASSIVE_LEVEL) 737 NTSYSAPI 738 NTSTATUS 739 NTAPI 740 ZwFlushBuffersFile( 741 _In_ HANDLE FileHandle, 742 _Out_ PIO_STATUS_BLOCK IoStatusBlock 743 ); 744 745 NTSYSAPI 746 NTSTATUS 747 NTAPI 748 ZwFlushWriteBuffer(VOID); 749 750 _IRQL_requires_max_(PASSIVE_LEVEL) 751 NTSYSAPI 752 NTSTATUS 753 NTAPI 754 ZwFsControlFile( 755 _In_ HANDLE FileHandle, 756 _In_opt_ HANDLE Event, 757 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 758 _In_opt_ PVOID ApcContext, 759 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 760 _In_ ULONG FsControlCode, 761 _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer, 762 _In_ ULONG InputBufferLength, 763 _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer, 764 _In_ ULONG OutputBufferLength 765 ); 766 767 #ifdef NTOS_MODE_USER 768 NTSYSAPI 769 NTSTATUS 770 NTAPI 771 ZwLoadDriver( 772 _In_ PUNICODE_STRING DriverServiceName 773 ); 774 #endif 775 776 NTSYSAPI 777 NTSTATUS 778 NTAPI 779 ZwLockFile( 780 _In_ HANDLE FileHandle, 781 _In_opt_ HANDLE Event, 782 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 783 _In_opt_ PVOID ApcContext, 784 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 785 _In_ PLARGE_INTEGER ByteOffset, 786 _In_ PLARGE_INTEGER Length, 787 _In_ ULONG Key, 788 _In_ BOOLEAN FailImmediatedly, 789 _In_ BOOLEAN ExclusiveLock 790 ); 791 792 NTSYSAPI 793 NTSTATUS 794 NTAPI 795 ZwNotifyChangeDirectoryFile( 796 _In_ HANDLE FileHandle, 797 _In_opt_ HANDLE Event, 798 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 799 _In_opt_ PVOID ApcContext, 800 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 801 _Out_ PVOID Buffer, 802 _In_ ULONG BufferSize, 803 _In_ ULONG CompletionFilter, 804 _In_ BOOLEAN WatchTree 805 ); 806 807 NTSYSAPI 808 NTSTATUS 809 NTAPI 810 ZwOpenFile( 811 _Out_ PHANDLE FileHandle, 812 _In_ ACCESS_MASK DesiredAccess, 813 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 814 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 815 _In_ ULONG ShareAccess, 816 _In_ ULONG OpenOptions 817 ); 818 819 NTSYSAPI 820 NTSTATUS 821 NTAPI 822 ZwOpenIoCompletion( 823 _Out_ PHANDLE CompetionPort, 824 _In_ ACCESS_MASK DesiredAccess, 825 _In_ POBJECT_ATTRIBUTES ObjectAttributes 826 ); 827 828 NTSYSAPI 829 NTSTATUS 830 NTAPI 831 ZwQueryAttributesFile( 832 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 833 _Out_ PFILE_BASIC_INFORMATION FileInformation 834 ); 835 836 _IRQL_requires_max_(PASSIVE_LEVEL) 837 NTSYSAPI 838 NTSTATUS 839 NTAPI 840 ZwQueryDirectoryFile( 841 _In_ HANDLE FileHandle, 842 _In_opt_ HANDLE Event, 843 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 844 _In_opt_ PVOID ApcContext, 845 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 846 _Out_writes_bytes_(Length) PVOID FileInformation, 847 _In_ ULONG Length, 848 _In_ FILE_INFORMATION_CLASS FileInformationClass, 849 _In_ BOOLEAN ReturnSingleEntry, 850 _In_opt_ PUNICODE_STRING FileName, 851 _In_ BOOLEAN RestartScan 852 ); 853 854 #ifdef NTOS_MODE_USER 855 NTSYSAPI 856 NTSTATUS 857 NTAPI 858 ZwQueryEaFile( 859 _In_ HANDLE FileHandle, 860 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 861 _Out_ PVOID Buffer, 862 _In_ ULONG Length, 863 _In_ BOOLEAN ReturnSingleEntry, 864 _In_opt_ PVOID EaList, 865 _In_ ULONG EaListLength, 866 _In_opt_ PULONG EaIndex, 867 _In_ BOOLEAN RestartScan 868 ); 869 #endif 870 871 NTSYSAPI 872 NTSTATUS 873 NTAPI 874 ZwQueryFullAttributesFile( 875 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 876 _Out_ PFILE_NETWORK_OPEN_INFORMATION FileInformation 877 ); 878 879 _IRQL_requires_max_(PASSIVE_LEVEL) 880 NTSYSAPI 881 NTSTATUS 882 NTAPI 883 ZwQueryInformationFile( 884 _In_ HANDLE FileHandle, 885 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 886 _Out_writes_bytes_(Length) PVOID FileInformation, 887 _In_ ULONG Length, 888 _In_ FILE_INFORMATION_CLASS FileInformationClass 889 ); 890 891 NTSYSAPI 892 NTSTATUS 893 NTAPI 894 ZwQueryIoCompletion( 895 _In_ HANDLE IoCompletionHandle, 896 _In_ IO_COMPLETION_INFORMATION_CLASS IoCompletionInformationClass, 897 _Out_ PVOID IoCompletionInformation, 898 _In_ ULONG IoCompletionInformationLength, 899 _Out_opt_ PULONG ResultLength 900 ); 901 902 NTSYSAPI 903 NTSTATUS 904 NTAPI 905 ZwQueryQuotaInformationFile( 906 _In_ HANDLE FileHandle, 907 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 908 _Out_ PVOID Buffer, 909 _In_ ULONG Length, 910 _In_ BOOLEAN ReturnSingleEntry, 911 _In_opt_ PVOID SidList, 912 _In_ ULONG SidListLength, 913 _In_opt_ PSID StartSid, 914 _In_ BOOLEAN RestartScan 915 ); 916 917 _IRQL_requires_max_(PASSIVE_LEVEL) 918 NTSYSAPI 919 NTSTATUS 920 NTAPI 921 ZwQueryVolumeInformationFile( 922 _In_ HANDLE FileHandle, 923 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 924 _Out_writes_bytes_(Length) PVOID FsInformation, 925 _In_ ULONG Length, 926 _In_ FS_INFORMATION_CLASS FsInformationClass 927 ); 928 929 _IRQL_requires_max_(PASSIVE_LEVEL) 930 NTSYSAPI 931 NTSTATUS 932 NTAPI 933 ZwReadFile( 934 _In_ HANDLE FileHandle, 935 _In_opt_ HANDLE Event, 936 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 937 _In_opt_ PVOID ApcContext, 938 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 939 _Out_writes_bytes_(Length) PVOID Buffer, 940 _In_ ULONG Length, 941 _In_opt_ PLARGE_INTEGER ByteOffset, 942 _In_opt_ PULONG Key 943 ); 944 945 NTSYSAPI 946 NTSTATUS 947 NTAPI 948 ZwReadFileScatter( 949 _In_ HANDLE FileHandle, 950 _In_opt_ HANDLE Event, 951 _In_opt_ PIO_APC_ROUTINE UserApcRoutine, 952 _In_opt_ PVOID UserApcContext, 953 _Out_ PIO_STATUS_BLOCK UserIoStatusBlock, 954 _In_ FILE_SEGMENT_ELEMENT BufferDescription[], 955 _In_ ULONG BufferLength, 956 _In_ PLARGE_INTEGER ByteOffset, 957 _In_opt_ PULONG Key 958 ); 959 960 NTSYSAPI 961 NTSTATUS 962 NTAPI 963 ZwRemoveIoCompletion( 964 _In_ HANDLE IoCompletionHandle, 965 _Out_ PVOID *CompletionKey, 966 _Out_ PVOID *CompletionContext, 967 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 968 _In_opt_ PLARGE_INTEGER Timeout 969 ); 970 971 #ifdef NTOS_MODE_USER 972 NTSYSAPI 973 NTSTATUS 974 NTAPI 975 ZwSetEaFile( 976 _In_ HANDLE FileHandle, 977 _In_ PIO_STATUS_BLOCK IoStatusBlock, 978 PVOID EaBuffer, 979 ULONG EaBufferSize 980 ); 981 #endif 982 983 _IRQL_requires_max_(PASSIVE_LEVEL) 984 NTSYSAPI 985 NTSTATUS 986 NTAPI 987 ZwSetInformationFile( 988 _In_ HANDLE FileHandle, 989 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 990 _In_reads_bytes_(Length) PVOID FileInformation, 991 _In_ ULONG Length, 992 _In_ FILE_INFORMATION_CLASS FileInformationClass 993 ); 994 995 NTSYSAPI 996 NTSTATUS 997 NTAPI 998 ZwSetIoCompletion( 999 _In_ HANDLE IoCompletionPortHandle, 1000 _In_ PVOID CompletionKey, 1001 _In_ PVOID CompletionContext, 1002 _In_ NTSTATUS CompletionStatus, 1003 _In_ ULONG CompletionInformation 1004 ); 1005 1006 NTSYSAPI 1007 NTSTATUS 1008 NTAPI 1009 ZwSetQuotaInformationFile( 1010 _In_ HANDLE FileHandle, 1011 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 1012 _In_ PVOID Buffer, 1013 _In_ ULONG BufferLength 1014 ); 1015 1016 _IRQL_requires_max_(PASSIVE_LEVEL) 1017 NTSYSAPI 1018 NTSTATUS 1019 NTAPI 1020 ZwSetVolumeInformationFile( 1021 _In_ HANDLE FileHandle, 1022 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 1023 _In_reads_bytes_(Length) PVOID FsInformation, 1024 _In_ ULONG Length, 1025 _In_ FS_INFORMATION_CLASS FsInformationClass 1026 ); 1027 1028 NTSYSAPI 1029 NTSTATUS 1030 NTAPI 1031 ZwUnloadDriver( 1032 _In_ PUNICODE_STRING DriverServiceName 1033 ); 1034 1035 NTSYSAPI 1036 NTSTATUS 1037 NTAPI 1038 ZwUnlockFile( 1039 _In_ HANDLE FileHandle, 1040 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 1041 _In_ PLARGE_INTEGER ByteOffset, 1042 _In_ PLARGE_INTEGER Length, 1043 _In_opt_ ULONG Key 1044 ); 1045 1046 _IRQL_requires_max_(PASSIVE_LEVEL) 1047 NTSYSAPI 1048 NTSTATUS 1049 NTAPI 1050 ZwWriteFile( 1051 _In_ HANDLE FileHandle, 1052 _In_opt_ HANDLE Event, 1053 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 1054 _In_opt_ PVOID ApcContext, 1055 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 1056 _In_reads_bytes_(Length) PVOID Buffer, 1057 _In_ ULONG Length, 1058 _In_opt_ PLARGE_INTEGER ByteOffset, 1059 _In_opt_ PULONG Key 1060 ); 1061 1062 NTSYSAPI 1063 NTSTATUS 1064 NTAPI 1065 ZwWriteFileGather( 1066 _In_ HANDLE FileHandle, 1067 _In_opt_ HANDLE Event, 1068 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 1069 _In_opt_ PVOID ApcContext, 1070 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 1071 _In_ FILE_SEGMENT_ELEMENT BufferDescription[], 1072 _In_ ULONG BufferLength, 1073 _In_ PLARGE_INTEGER ByteOffset, 1074 _In_opt_ PULONG Key 1075 ); 1076 1077 #ifdef __cplusplus 1078 } 1079 #endif 1080 1081 #endif 1082 1083 1084