NtWriteFile - NtDoc

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

NTSYSCALLAPI
NTSTATUS
NTAPI
NtWriteFile(
    _In_ HANDLE FileHandle,
    _In_opt_ HANDLE Event,
    _In_opt_ PIO_APC_ROUTINE ApcRoutine,
    _In_opt_ PVOID ApcContext,
    _Out_ PIO_STATUS_BLOCK IoStatusBlock,
    _In_reads_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
ZwWriteFile(
    _In_ HANDLE FileHandle,
    _In_opt_ HANDLE Event,
    _In_opt_ PIO_APC_ROUTINE ApcRoutine,
    _In_opt_ PVOID ApcContext,
    _Out_ PIO_STATUS_BLOCK IoStatusBlock,
    _In_reads_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 Win 2000 DDK)

FileHandle

HANDLE to File Object opened with FILE_WRITE_DATA access.

Event

HANDLE to Event Object signaled when write finished.

ApcRoutine

User APC routine executed after writing is complete.

ApcContext

Parameter to ApcRoutine.

IoStatusBlock

IO result of call.

Buffer

Buffer with data to write.

Length

Length of Buffer, in bytes.

ByteOffset

Offset from beginning of file, where write starts.

Key

??? (See NtReadFile).

Related Win32 API

Documented by

See also