NtReadFile - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTIOAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
NtReadFile(
    _In_ HANDLE FileHandle,
    _In_opt_ HANDLE Event,
    _In_opt_ PIO_APC_ROUTINE ApcRoutine,
    _In_opt_ PVOID ApcContext,
    _Out_ PIO_STATUS_BLOCK IoStatusBlock,
    _Out_writes_bytes_(Length) PVOID Buffer,
    _In_ ULONG Length,
    _In_opt_ PLARGE_INTEGER ByteOffset,
    _In_opt_ PULONG Key
    );

#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwReadFile(
    _In_ HANDLE FileHandle,
    _In_opt_ HANDLE Event,
    _In_opt_ PIO_APC_ROUTINE ApcRoutine,
    _In_opt_ PVOID ApcContext,
    _Out_ PIO_STATUS_BLOCK IoStatusBlock,
    _Out_writes_bytes_(Length) PVOID Buffer,
    _In_ ULONG Length,
    _In_opt_ PLARGE_INTEGER ByteOffset,
    _In_opt_ PULONG Key
    );

#endif

View code on GitHub

This function is documented in Windows Driver Kit here and here.


(Also described in Win2000 DDK)

FileHandle

HANDLE to File Object opened with FILE_READ_DATA access.

Event

Optional HANDLE to Event Object signaled when reading is done.

ApcRoutine

User defined APC routine queued for execute after reading is done.

ApcContext

User parameter to ApcRoutine.

IoStatusBlock

Pointer to IO_STATUS structure received IO status of file reading.

Buffer

User-allocated buffer for read data.

Length

Length of Buffer, in bytes.

ByteOffset

Offset from beginning of file, in bytes.

Key

??? (In my opinion: use this, if you previously lock file, and now you want read it, but without unlocking).

Related Win32 API

Documented by

See also