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