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